PDA

View Full Version : Tiberium as template for token-based modding?


vampiremouse
29th Dec 2010, 05:26 PM
Posting from the phone-please excuse any technical issues this may cause.

Tiberium appears to be unique in the Sims game. Specifically,how it interacts with our Sims and its given me an idea that may be unique. Its up to you folks to tell me whether its worth attempting, where I would start, and how difficult this would be. I've been looking through the game files but haven't actually found Tiberium itself...yet. Therefore this is all based on educated guess-work. Okay?

Tiberium is an object that is picked up and sits in inventory. While there it appears to detect a broadcasted event (going on vacation) and responds by maturing into a new form that calls a "buff/moodlet"

The buff is on a two-hour reapeating timer which ends with a hex/automatic action/animation. The cycle ceases once the Tiberium is no longer in inventory (conversion to spire form and much money)

Now imagine that we cloned tiberium and tweaked it into a new object which detected a different event in the world, time of day, a party, going to work, etc.

Imagine the new object gave a different "buff" any possible moodlet in the entire game by simple virtue of being in your inventory (possibly with a trigger event)

Remove the object and whatever it does goes away, put it on and the effect is there.

Any Hex is also probably chainable as well.

If my theory is correct world builders could create custom objects, and players could make nearly any TEMPORARY change to a sim by placing and removing an object.

Thoughts?

Vampiremouse

ashillion
12th Mar 2011, 04:56 PM
This is an old thread but I have just come to the same idea in my quest to make a object i have in mind... anyone have any idea if this concept is sound?

Buzzler
12th Mar 2011, 05:31 PM
It's perfectly possible and simple to make an object that calls certain methods when being added to or removed from an inventory. Tiberium is nothing special actually. You can look at its code to see how it's done of course.

Token-based modding isn't necessary in TS3, though.

vampiremouse
28th Jul 2011, 08:12 PM
I'm glad to finally see a responce to this thread :).

I was proposing "token-based" as an alternative to mods that effect all sims and as the best way to handle "lucky" or "cursed" items.

i.e. a world builder wants to put an object with actual properties in a tomb. This could be a "lucky coin" that helps the sim and then is passed to an heir. A "cursed" item that must be returned to the tomb (technically can just be dropped - but good for role-players). Or a an item with a "price" for helping the sim. For instance "steroids" that improve athletic skill but make the sim "hot-tempered".

Other uses of a "token" might be to simulate radiation or water poisoning, zombie status or whatever in townies (provided the token will stay in inventory/continue to function when not playing a toon..

Provide "virtual traits" for sims (beyond the five trait plus hidden limit or traits which do not yet exist in game - without using other mods) This would allow more complex sims with a mix of problems and advantages.

Simulate chronic or acute illness in a sim, they experiance "symptoms" under certain conditions and at certain intervals - as long as they hold the object, it is up to the player when/if the object is removed.

This is just touching the surface of what might be accomplished with "object" modding.

I did notice you used the word "methods" in your reply Buzzler?

When I was looking through the code I found the term "hex" many times as what appears to be moodlet/animation calls.

Is "methods" one of the terms sims 3 uses in the programing...if so how does it differ from what I thought hexes were?

Would you use "tokens" for the sorts of things I'm proposing, or do you feel a different approach is better?

How would you approach these sorts of ideas?

I'm trying to create something versitile yet simple, that the average player/world creator could manage and add or subtract as they wanted between one game or another. And which a relatively new modder has a chance of mastering in a reasonable time span :)

Open to any and all constructive thoughts.

Vampiremouse

Buzzler
28th Jul 2011, 08:57 PM
When I was looking through the code I found the term "hex" many times as what appears to be moodlet/animation calls.Then you were probably only looking at XMLs. In e.g. the skills and buffs XMLs, the hex element defines an enum element. The Athletic skill has the corresponding SkillNames enum element Athletic for example.

Is "methods" one of the terms sims 3 uses in the programing...if so how does it differ from what I thought hexes were?No, "method" is the C# term for what's called function in C.

Would you use "tokens" for the sorts of things I'm proposing, or do you feel a different approach is better?What is a good way and what isn't, really depends on what exactly you want to do. In general, I'd say put the "brains" to where the actual action happens. If you want to make an object that emits radiation, then of course the object itself should have the actual functionality (TS3 has a class for stuff like that: ReactionBroadcaster). I don't think a token would be the right thing to add traits. Traits are difficult anyway, because the actual functionality is spread all over the place. Same for a zombie occult or (water) poisoning: an object, i.e. an interaction on the object, may very well be the cause, but the actual functionality happens "on" the related sim. Sims aren't suddenly not poisened anymore or stop being zombies, just because you remove a token from their inventory, right?

If I'm right that you only looked at XMLs before, you should take baby steps anyway. What you want to do, requires script modding and script modding should be started slowly and with small projects. I've seen a lot of people start script modding and taking up big projects right away. None of them pulled through. Kinda sad, really.

vampiremouse
29th Jul 2011, 01:26 AM
I was only looking at XML so far I believe, I'm more familiar with C then C# and basic and html more then C, but can follow code resonably well once I actually figure out what its conventions are ;). Its all the extra steps to compile/de-compile aka translate to readable format stuff that I find most annoying. If I didn't have to do all that just to look at the data I'd be a lot further. The game I used to mod you could view (though not actually modify most of the code) using file decompression software so I did a lot more random "hunting" until I found what I needed to mod, and trial and error was easier as well.

re: "method" = "Function" there is now a lightbulb going off in my brain :)

Where is the "ReactionBroadcaster" located btw? I will definately take a look at that this weekend

I definately am trying to start with baby steps but I don't really want global mods if that makes sense. Each scenario I play is different and I switch between them a lot so I want to use emitters, tokens, or *something* that would change only that save game or that sim.

For example lets say I create an object called "ring of sunlight immunity" and place it at the end of a complex tomb, create a sim, turn them into a vampire and have them go on an elaborate quest to find said ring. Ideally I could also provide this map and/or tomb to others who could also get this special object and give it to a sim. Other "objects" could have different properties.

So the question is would creating objects with properties and/or new emitters be within the perview of baby steps? And if so where are the resources I am looking for?

As for "traits" I wasn't looking for actual traits so much as getting the game to provide the appropriate moodlet and animation for whatever trait/situation I am "faking" with a "token"

I get what you are saying about putting the action where it actually occurs :) but wouldn't anything like that require global modding or a VERY high skill level? I want to provide something for myself and others that allows sim by sim and/or scenario specific customization. Does that make sense?

Should I scale this back (if so to what?) or can you guide me in the right direction,

Thank you for your time,

Vampiremouse

Then you were probably only looking at XMLs. In e.g. the skills and buffs XMLs, the hex element defines an enum element. The Athletic skill has the corresponding SkillNames enum element Athletic for example.

No, "method" is the C# term for what's called function in C.

What is a good way and what isn't, really depends on what exactly you want to do. In general, I'd say put the "brains" to where the actual action happens. If you want to make an object that emits radiation, then of course the object itself should have the actual functionality (TS3 has a class for stuff like that: ReactionBroadcaster). I don't think a token would be the right thing to add traits. Traits are difficult anyway, because the actual functionality is spread all over the place. Same for a zombie occult or (water) poisoning: an object, i.e. an interaction on the object, may very well be the cause, but the actual functionality happens "on" the related sim. Sims aren't suddenly not poisened anymore or stop being zombies, just because you remove a token from their inventory, right?

If I'm right that you only looked at XMLs before, you should take baby steps anyway. What you want to do, requires script modding and script modding should be started slowly and with small projects. I've seen a lot of people start script modding and taking up big projects right away. None of them pulled through. Kinda sad, really.

Buzzler
30th Jul 2011, 12:05 PM
In the case of TS3, XMLs can only tell you *what* happens (sometimes, not even close to always), but only the actual code will tell you *how* it happens. So, first thing to do should be to rip the libraries out of the core packages and load them into an assembly browser/decompiler. That doesn't take much longer than a minute and there's really no point pondering about what you could mold if you didn't look at the clay yet. ;) Look up the ReactionBroadcaster for example.

Also, having experience with C will help, but OOP will probably still be hard to swallow.

"Global mod" isn't really applicable to TS3 mods. That's just a matter of focus and you control the focus. If you don't want a mod to affect every savegame, give it a switch.

For example lets say I create an object called "ring of sunlight immunity" and place it at the end of a complex tomb, create a sim, turn them into a vampire and have them go on an elaborate quest to find said ring.In that particular case, a ring object would make sense, yes. Still, there are different ways to implement something like that. The easiest way would probably be to to use the ring as beacon, have one global EventListener listen for kGotBuff events, check for BuffTooMuchSun and BuffHeatingUp buffs, and remove them if the/a ring is in the related sim's inventory.

You may try to do that. Make the object first (including custom script) and figure out what's needed to add an object to an inventory. :)

BTW: How is your frustration tolerance? ;)

dlane2155
8th Dec 2011, 09:22 PM
vampiremouse - This is almost exactly what I am trying to do myself. Did you figure this out? My wife and I have been watching the Vampire Diaries and I would like for the game to be more like that. In that show some of the vampires have a ring that allows them to go in the sun and I did some research and the rings actually contain a Lapis Lazuli gem which turns out to be in the game if you have the World Adventures expansion pack. So what I am trying to do is when that Lapis Lazuli gem (possibly a specific cut) is in a vampires inventory it will block the heating up buff. I figured using something thats already in the game is easier than making a custom object.

I have looked through almost everything in the xml files and found nothing about triggering or blocking buffs and I assumed that it would have to be a more advanced mod which Buzzler confirmed in this thread.

I did manage to look at the sims3gameplaysystems.dll and found how Flame Fruit in the inventory triggers the "cozy fire" buff but the coding is way over my head and I wouldn't know how to apply that to another object. I looked for how tiberium triggers the "tiberiumnausea" buff but I could not find it. I'm assuming I just need to know what category tiberium is under, but either way I don't know how to replicate it on a custom object or an object already in the game.