[Task 5] Create an Object entirely from scratch

Discussion in 'Evaluation' started by RHY3756547, Mar 13, 2016.

  1. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    In this task, you have to bring it all together! Make your own object from scratch, set up a base graphic, give it an init and main function, and make at least one interaction for it. The object can be as simple as possible apart from these requirements.

    I don't expect participation for this task to be high, but I'm interested to see what you can come up with if you're up to it! The object does not have to be complicated, it just has to be made from scratch and have at least one simple interaction.

    Firstly, you probably want to think of something to make. I've decided to make a decorative object depicting the SECC in Glasgow, because I see it like every morning. I've prebaked some sprites for these using the 3ds max sprite exporter plugin for 32-bit 3DS Max 9 (you do not have to do this):

    We want to create a new iff for the object. In the Main Window (or a button in the object browser), select New > Object. Choose a unique name for your iff, then name your object. Just click "random GUID" to generate a GUID for your new object.

    upload_2016-3-12_21-28-19.png upload_2016-3-12_21-28-36.png
    Immediately the object editor window will appear, depicting a very clearly empty object. Switch to the appearance tab - you'll see that there are no graphics.
    First thing we want to do is create a new drawgroup to use as our base graphic. Click the "+", then set up the graphic from all directions. This has been covered in Task 2:

    For my SECC example, I've made multiple graphics with the intention of animating them. These are made out of two sprites, one of which being the SECC itself, and the other being a helicopter. I made these in blender, exported the sprites using 3DS Max and imported them using the "Import TGA Sheet" option.

    Select the graphic you made, and set it as the First and Last graphic of your object using the buttons. For my object, I've created multiple animation frames - I used the "copy" feature to copy the first graphic multiple times, and for each group I adjusted the helicopter's Z physical offset to make it float up and down.


    Next up, we need to set up the basic BHAV trees for the object. All objects need both an "init" and "main" tree. Init trees are run when the object is first created, and set up attributes like where the object is allowed to be placed and initialize any Attributes for that object. Main trees are run constantly, and should contain a "Global: Idle" subroutine inside an infinite loop - within which you should perform periodic operations for that object, such as changing the graphic.

    To create a BHAV tree, go to Trees and Resources, select "Trees" in the combobox and click "New". Your tree should have an ID between 4097 and 8191 - this is the allowed range for trees "Private" to an object. (above 8191 is Semi-Global, and below 4096 is Global) Open it up and it will be totally empty! You should probably start with the subroutine "Global - Init Object". Add whatever else you need, sequentially link them to each other, and end on a "Return True", which you can place by pressing "Ctrl-T" (Ctrl-F places a Return False)

    Here's one I made:
    This just runs the standard Init function for objects, and sets a flag to allow the object to be placed on the tables as well as the floor. (floor is set by the global function!)

    Here's the main function I made:
    This simple main function actually animates the object when it is placed in the world. The object repeatedly idles for 2 frames (Argument 1 of the Idle function), increments the graphic and mods it against the total number of graphics, to get it to cycle back to 0 when it hits 16. Each time this is done, the graphic is refreshed.

    To place an object in the world, use the "Create New Object Instance" button in the Object Browser! It does not currently appear in the catalog!

    If we didn't want the object to do anything, we'd just make the idle subroutine point back to itself, and have its Argument 1 be a rather high number, eg. 3000 ticks.

    Now that we've set up these functions, we should set them to be our new object's "init" and "main" entry points (you'll notice that these are highlighted in red, as they are required). To do this, go back to the object window, and on the Entry Points tab, set the "Action" tree for both the init and main functions to the ones you just created.

    The "Check" tree, when it exists, is run before the action tree to determine whether it should be considered for running depending on the true/false value returned. For idle and main, this is not important - they ignore the check tree as they should always run.

    Here it is with our functions set. Now, we can place the object in a lot, and it will work correctly:

    But... This isn't good enough! We need an interaction! Lets make a simple one, where we simply walk up to the object and clap at it. First make another tree, call it something like "Interaction - Appreciate". There are no rules for this type of tree, they just run from start to finish on the sim, with the target object in the "Stack Object. Here's one I made:


    We just walk the sim up to the object and run the clap animation. No funny business! The Animate Sim primitive's false branch is how it deals with events, so we just loop that back to itself. After that, the interaction just ends.

    Now that the tree exists, we need to add it to a "Tree Table" - a grouping which gives pie menu names to trees, allows them to be queued as interactions and provides a "check" functionality to optionally hide interactions that should not be available. Go to the Trees and Resources tab and go to "Tree Tables" and you'll be shocked that we don't have any! Create a new one the same way we created a tree, and give it a reasonable id (eg 100).


    Set add an interaction and name it appropriately. Set its action tree to the one we just created, then click "Select as My Tree Table" to make it the main tree table for the object you've created. Now place your object in the lot again, and click on it. Your interaction will be there - give it a shot!

    (Don't worry about the flags yet - most of them do not work and will default to allow everyone anyways.)


    Wow - check this out! All these resources we made, entirely from scratch. Click save and your object will be saved for future generations to enjoy.

    ...And you're done! You've made your first object. Good for you! This is the most powerful thing you can do with the editor - you can make literally anything. The only limit is yourself! If you can make something really cool, I might even include it in the live beta when the global server is working. ;)

    Submitting Feedback:
    After translating your object, go open up the main window, go to the Resources tab, and click "Save All".
    If your object is an original game object, this will save your changes to "Content/Objects/objectname.iff" relative to the FreeSO folder, where objectname is name of the object file you modified.
    If your object is completely custom, it will be saved back to the .iff file in the "Content/Objects" folder. It will be permanently modified, so watch out!

    Upload all files like these to the internet somehow, and create a post like below showing screenshots of it in action and linking to the files. You should also include some feedback on how it went - this is the most important part!!!
    Last edited: Mar 13, 2016
    AquilaSim likes this.
  2. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Example Feedback:

    I made an object depicting the SECC in Glasgow, with a helicopter hovering above it. There is a single interaction where the sim walks up to the object and claps. Here's the object:


    • When making all the animation frames, I had to modify the physical offset for each animation frame separately, which got pretty tedious for my 15 frame . It would help if there were an option to sync these up, at least partially.
    • The tree range for Private trees should be enforced, so people don't break the game.
    • We need documentation for SimAntics. Lots of this stuff needs to be explained!
    • The editor messed up as I had it open for a few hours in the background.
    Things I liked:
    • Wow, I made my own object! Hi mom, I'm on TV!
    • This would have taken a very long time to do, make and test with Codex, Transmogrifier and Iff Pencil. Having everything in one place, and being able to test it immediately meant I performed this in about 5 minutes. (obviously, I know a lot about simantics anyways)
    • Copy button was a great addition to DGRP to make it easier to animate my object using delta positions.
    • Everything good I said in all the other tasks.
    Last edited: Mar 13, 2016
  3. TheMarshmallowBear

    TheMarshmallowBear Active Member

    I have two questions regarding this.

    1. Does completing Task 5 automatically complete Task 4 as said previously somewhere?

    2. Does the object have to have completely brand new graphisc or could we go with the more "recolor but give it a completely different behavior" as long as the object is seperate from the "original color"?
  4. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    1. Yes, I was a bit stretched last night so forgot to mention.

    2. You can use any graphic you want - the main idea is that you set up the object from scratch.
    LetsRaceBwoi likes this.
  5. Simhrique0990

    Simhrique0990 Active Member

    For this task .. I already had decided,make some objects related to "SimCity 2000" I selected This "Arch" (I do not know the right name but ignore ..) This Arch, has a simple interaction, Your sim, will try to repair the object.. but, will die,electrocuted. :(


    001.png 002.png 003.png

    Things I Liked:

    Make a object, is very Fun :p
    - Set the height and distance, is not difficult (Thanks to DGRP Editor)
    - Edit Trees, Put Sprites .. all in one tool .. is good
    - Well .. this task was fun, compared to the others.


    As already said, Above .. much to be explained about Simantics.
    - The Tree Editor .. I think that the first interaction, set automatically,for the primary. Since it sometimes, it can be forgotten (Resulting in crash)


    Images The Object:

    [​IMG] [​IMG]

    (Even, was wrong, some tasks .. is fun, evaluate the IDE,Thank you for making this tool and restore the entire game itself) :D


    RHY3756547 likes this.
  6. TheMarshmallowBear

    TheMarshmallowBear Active Member

    Is there a way to "loop an animation"? I want to use one of the idle animations for my object.. also how do I make it so I can change the motives an object does (i.e how do I grant it the power to increase your mood)
  7. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Loop its true branch back to itself through some sequence of primitives. Usually, people do this with the "Wait for Notify" Global subroutine, which returns true when the interaction has been cancelled and false otherwise.

    If you want to make it loop a set number of times, set up a local variable in the resource browser, reopen the BHAV editor, and use expressions to increment the local every loop, and exit when it is above a certain value.

    You could probably use "set motive change" and "clear motive change" at the end to do the motive changes for you automatically right now, but they're a wee bit unstable right now. You can also do it with expressions, eg. My Motives Fun += literal 1 every animation loop.

    I'll be making some documentation for all this some time in the future.
  8. TheMarshmallowBear

    TheMarshmallowBear Active Member

    How do I get my object "into" the game?
    Simhrique0990 likes this.
  9. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    @TheMarshmallowBear "Create new Object Instance" in the object browser. Nothing currently appears in the catalog unfortunately.
    Last edited: Mar 13, 2016
  10. TheMarshmallowBear

    TheMarshmallowBear Active Member

    For this task, I decided to do a simple yet functional object. A meditation rug!

    In hindisght it really should've been a lava lamp, that at least had animation. Hindsight 20/20 or whatever. I'll do that some day!

    The purpose of the object's functionality is a relaxation method which will fill a sims needs to the full. The behind the scenes method is that the game will increase the motives by 10 every time the sim will complete the floating meditation loop animation (as demonstrated by my Meditate action tree)



    For whatever reason the exact method of creating a new object's sprites wasn't clear. As the preview didn't display the actual object. It might've been conflicting Content ID (both the sprites and the drawgroups used the same ID). I eventually did figure it out

    Another problem was me not know that rugs have some sort of flag that allows sims to be on "top" of them. As a result, my sim intiailly route failed because it called for the sim to be "on top" of the object. I instead decided not to waste time and just switch where the sim would go. Hence why I think it should've been a lava lamp.

    In general, I can't really "complain". All of my issues stemed from lack of documentation th at, with time, will be available to future players and creators. There isn't many issues with the software itself, it's literally drag and pull, and voila, something works.


    I've always wondered why I've never gotten around to doing objects for Sims. Answer is. it's complicated.

    Yet, this is extermely simple, and within pretty much 10 minutes I can make a functional object that does something. I can't wait to see what else we come up with and what wonders TSO can hold. We finally have Custom Content we've always dreamed off in the game!

    The user interface is extremely simple, easy to understand, and easy to use. Given it's early stages sure there's few missing things (how do I know if I set my strings correctly?) but with documentation almost none of these issues will exist so the program already is pretty much perfect.

    Here's some pictures I took of the process


    I didn't keep a track of task list since this thing took a course of two days. But the process was simple.

    I followed the instructions provided and there were little to no issues.

    Most of my problems/stalemates came from me not knowing certain things that Rhy was more than happy to provide. Thanks Rhy!
    RHY3756547 likes this.
  11. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    To make it possible for avatars to walk on an object, you need to set the "Allow Person Intersection" flag in My Object Data flags (in init tree)... But right now flags are unnamed! (you need to know the literal flag number) That's another thing I need to do - make the editor display dynamic names for complex things like flags and constants. Right now I think some of the flags are documented on simantics.wikidot.com, though I might have missed em.

    Thanks for going all out with participation in all this. Your feedback had been stellar!
  12. TheMarshmallowBear

    TheMarshmallowBear Active Member

    Glad to help, you help me by bringing wonderful memories and give me hope for all that is to come.
  13. LetsRaceBwoi

    LetsRaceBwoi Well-Known Member

    The depth is a bit screwed up but whatever
    the gravestone kinda foreshadows what this does

    There is one interaction, "Buy Cola". When your Sim activates this interaction, they will walk over to the front of the vending machine, try to put money in the machine and get electrocuted. I recolored one of the original vending machine sprites - I forgot which one though - because I don't have 3DS Max and every sprite I try making myself ends up looking like shit :) I really liked doing this one though, I felt a real sense of satisfaction as if my body was telling me, "yay, you did it!"
    Download: https://mega.nz/#!gcpniKCK!GFdwjyxDacgXDDPsW5mYYqyILTthojGQdOUuyC2GCLE (72KB)
    • I made my own object
    • It was easier than I thought it would be
    • Good layout of each screen, made sure that what I needed was where I needed it
    • Took me three tries, kept screwing easy stuff up (sprites, depth)
    • Everything's in different places making it a little more confusing than it really should be.
    • Sprites should, like, automatically get their own drawgroup set up or something, just to make things easier.
    • Took me a couple of tries to get the rotation - small marker to show the front of the object would be nice
    Time for me to go do the survey!
    RHY3756547 and JWofles like this.
  14. tsomatt

    tsomatt New Member

    For this task I decided to make a mega sized TSO version of everyone's favorite building toy. The functionality of this object lets you place it on the ground or a table, change the color to one of the five available, and create a new instance of the object in the color of your choice to place anywhere available on the lot using the global "Put Here" function. In hindsight I would have liked to create a "bucket" object where the Sim could take out the pieces from that, but the deadline was coming up fast.
    task5-1.jpg [​IMG]
    The Create Block function is called by the individual Create Block (Color) interactions which pass the sprite ID for the color in temp 1.

    Download the object here: http://www.tsomania.net/special/brick.iff
    - This was my own fault, but I created the sprites in the wrong size to start and had trouble getting the brick to sit on the ground. Rhys was able to provide some direction on how to get it sit on the ground.
    - Setting up each rotation for every draw group was a bit tedious, especially when creating five different brick colors. It seems like this could be automated by copying the rotations in the sprite itself.
    - A copy function for the trees/interactions would be nice to have for the same reason above.
    - When clicking the + in the tree table action view, it would be good if the focus is put on the new line so you don't accidently edit the previously selected line.
    Things I Liked:
    - I liked how creating and saving the object resources was very easy, nothing to worry about.
    - I liked that the entry point functions that are required and missing are highlighted red until you add them. It gives a visual cue something is wrong.
    - The BHAV editor is very easy to use and after some practice with the previous tasks creating new functions and interactions isn't too difficult.
    - Overall the IDE is an extremely well put together set of powerful tools to create an object from start to finish.
    JWofles and RHY3756547 like this.
  15. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Ah, I see why you wanted to stack them. Too bad it's not possible yet. :(

    One technique that certain TSO objects use to get this colour selection is use a little known feature where they "Add Action Strings" in the Interaction Check Tree. So they have one interaction, and in the test tree add multiple entries for that same interaction, with a different stack object selected. They kind of abuse the stack object to carry numbers instead, so colour white would be object ID 2 for example... It's all a little complicated and I wouldn't recommend trying it out without some proper documentation.


    Also... the primitive doesn't have an editor yet. :I
  16. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    I hacked your brick to use a SLOT I hex-edited into submission. Here it is:

    They're stackable, but it highlights a few bugs with our Buy Mode placement and stacking things more than 1 high. You can now also use interactions to stack them:

    @tsomatt It was pleasantly surprising to see that you figured out sim carry in slot 0 and check trees by yourself, bravo! I understand some of these things arent exactly obvious since there is no documentation, but learning by example is a great feat that shows that the IDE is working as intended. ;)
  17. Tirea

    Tirea Active Member

    Since my original plan backfired and the evaluation is soon over, I made a quick and simple "Cheat" Statue.
    I extracted the original fortune teller machine from Magin' Magic, loaded it in the IDE, extracted the sprites and used them for my statue. Creating the object was really fun, though I made a few mistakes and crashed the game quite a bit... :p

    When you click on the statue you can ask for certain things like food or a new TV.
    Here's what happens when you ask for money:
    CheatStatue4.png [​IMG]

    The "Ask for food" function checks how much hunger your Sim has and if he really needs food...
    If the Sim has a lot of hunger he gets a whole pizza, if he has medium hunger, he gets a turkey plate and if he has not much hunger the statue spawns a fire on top of him :D

    Things I Liked
    • Making your own objects is considerably easy, extremely so if you compare them to TS1 programs like iff pencil...
    • The dynamic updating of the function made testing a LOT easier, you don't have to save the changes or rebuy the objects, changes inside the function update the object on the fly
    • A lot of the animations just didn't want to work, which makes for a lot of testing to see which animations don't randomly "crash" and are usable in a custom object
    • Sometimes when I changed a function, tested it to make sure it worked like I wanted to, the IDE crashed while saving the .iff file, which became corrupted and I had to start all over again...
    • I'd have loved to create some dialogs but I guess that is either just not possible right now or it was to hard for me to find...
    Last edited: Mar 18, 2016
    Tori Sim and JWofles like this.
  18. JWofles

    JWofles Active Member

    I made a potion seller (inspired by TS1 makin magic) that can either make all your motives go up full, make you pee yourself, give yourself lots of money or lose all your clothes.


    My main and init is just like everybody else's.

    DL - https://mega.nz/#!vxsnQbjY!mJ3UzwCX5ba3c_fVGE92BovbRLzc6mei3vBRO7MpsJQ

    I think the random primitive failed on my object because you only seem to pee yourself or go naked...
    -There are little odd things you have to remember to doing an object from scratch from memory could mess up because you need to know what chunk numbers to do etc.
    -It'd be nice to have the main and init auto-generated so it doesn't crash and potentially make you lose your object (if you forgot to save) because you didn't put the primitives in.
    -I didn't know how to do a randomiser thing (but then rhy helped me<3)

    Things I liked:
    Tree editor made it very easy to quickly test something (take it off the main branch and into a little test branch so I don't have to go through trial and error to get it).
    -It's handy to have the object update live in the game.
    -Extremely easy to create complex objects, people shouldn't be scared of this.
    -I am really excited to use this in the future when I have more time than 1-2 hours to create decent objects.

    Amazing work rhy :d

    -Thanks TheMarshmallowBear, I looked at your tree to see how to change motives<3
    -Thanks inet2inet.com for the cool sprite (even though it turned out odd-looking ingame)! DL
    Last edited: Mar 17, 2016
    RHY3756547 and Tirea like this.
  19. xXJDrocks450Xx

    xXJDrocks450Xx Well-Known Member

    Mine may not be as fancy as others were, but hey its an object I made from scratch none the less.
    The object I made was a "Sad" painting that any sim just can't seem to admire without bawling their eyes out. What's even worse, is that they won't stop crying until you cancel the interaction (Wait for Notify)
    Download linked up here: My favorite EA Sports title is competitive Sims upload_2016-3-16_21-28-17.png

    Problems I Found:

    • For some reason, when I exported sprites for my object like usual, I would edit it, then when I went to import the edited sprites, they would never show up. The screen would look as if I had never pushed a button. This happened with all objects I tried to create, except for this one object I've explained to you in this post. This object was the very first object I created it that info helps at all.
    • My object really liked to freeze my game with the main entry point being the source of these freezes. Of course that problem is fixed now thanks to some help from @RHY3756547 . For anyone who has this same problem, you must have the arguments in "Global: Idle" greater than their default value of 0. For mine I chose a simple, random number, 999. Creative choice right?
    • With the "Create new object instance" it would be a very nice touch if say, you were already in build/buy mode, and you created the new object instance, if the object could spawn in your hand, that would be very handy for wall objects and such, instead of spawning at center screen. Though I feel as if I'm just nit-picking now :p
    Things I enjoyed:
    • The sprite import/export feature, when it worked for me, it was a breeze. I really liked how automated it felt, just selecting a folder and letting the IDE pick the right sprite was very easy. I like that much more then individually picking sprites.
    • The tree editor is very visual. I like how Common Sense driven it is. Me, having no prior experiences with Sim-Antics, I felt like I could make any object do anything I wanted. I think a great tag-line would be, "So long as you have a brain, and are older than 6, you can figure your way, around Sim-Antix" the "X" was to make it rhyme with "six" lol.
    • I like how you can create object groups. For example I named my Object IFF "JDrocks' Objects" and I was able to keep all my objects organized in one spot, and they were also easy to find. All I had to do was search "JD" and any objects I had created would show up there.
  20. RHY3756547

    RHY3756547 FreeSO Developer Staff Member Moderator

    Yikes - isn't that a bit heavy to hold with one hand? :p Nice to see an object utilizing existing animations to suggest something other than what it was intended to!

    Cool, the Wait for Notify loop is a nice addition. The sprite problem is weird - either you aren't saving the files back out to bmp in the same folder or something's going wrong during import and it's giving up.

    Your animation false branches should go back to themselves. The false branch is called whenever the animation signals an event - if you branch from false to something that doesn't eventually loop back to the animation it won't finish the animation.

    The use of the worship animation is a nice touch. I've also always had a soft spot for the Makin Magic sprites. Dialog primitive currently doesn't have an operand editor.

    What are the cases for the iff crash? That shouldn't happen, especially with standalone iffs.
    Last edited: Mar 17, 2016
    JWofles likes this.

Share This Page