Posts Tagged ‘hex’

Changing an object’s placement flags

Some weeks ago someone named Lynn Drescher asked me by mail how to enable an object to be placed on water. After receiving a link to the website of Simophor I downloaded some objects that can be placed on water and started experimenting. As I didn’t remember to have seen something like water-placement in the Object Definition (OBJD) resource, I started the search using Script Station.

It turned out that the “init tree” subroutine is the most important piece in the puzzle. Whenever someone wants to use a certain object, this subroutine is called. It initialises some variables in the object, including some flag fields and placement flags. I compared several of these subroutines and came to some conclusions.

Using primitive 2, the “expression” primitive, the subroutine alters these things. The first parameter equals 42 decimal, the second is the flag index number, the third 2304 decimal (set flag or 0900 hex) or 2560 decimal (clear flag or 0A00 hex) and the fourth equals 1795 decimal. By setting or clearing this flags the properties of the objects are set. It seems that by default all flags are cleared.

For Placement, flag 1 indicates that an object can be placed on the floor and flag 2 that it can be placed on terrain (grass and such). When flag 3 is set the object can be placed on water. Then there are some unknowns. When flag 12 is set that means the object can be placed on a pool and flag 13 means it can only be placed on a pool tile. Of course, only setting flag 13 doesn’t mean you can place it on a pool tile: you need a combination of flags for that.

Unfortunately, I haven’t been able to determine the meaning of the other flags at this moment. It is possible that I find it later, but you’ll notice when I do. Of course any help from your side to determine these flags or the flags from flag fields 1 and 2 are appreciated very much.

Of course you’d like to know how to add these things to your favourite home-made object… what you need is Script Station, to which you can find a download link on the forums of Fusion Creations. You should then locate the “init tree” subroutine. Usually this is also the name of that subroutine. Alternative names are “init common” and such for multi-object IFF files. It goes beyond this document to find the exact subroutine, but usually it isn’t that tough to localize it. When you’ve opened the subroutine in Script Station you need to optimize the code (by pressing “Optimize”) and find the last line where it says “return TRUE” and “return FALSE” or “return ERROR“. Note the line number. Click “add line”. Double-click the new line. Click “Expert Edit”. Change “Function” to 2. Change “parameter 1” to 42 (decimal) in the SECOND edit box (which was “0” before changing). Change “parameter 2” to the flag number. Change “parameter 3” to 0900 (hexadecimal) for setting or 0A00 (hexadecimal) for clearing in the FIRST edit box (which was “0000” before changing). Change “parameter 4” to 1795 (decimal) in the second box. Finally, set “true” to the line number you noted and “false” to “FE”. Click OK to continue. When you press the optimisation button again you should see the new line just above the last line. If all goes right the translation will be something like “My placement Set Flag XX” or “My placement Clear Flags XX” with “XX” being the flag number. Well done, your object’s placement flags are now changed. Don’t forget to press OK some times and save the files manually (Script Station won’t warn you if you forget that).

Tom.

  • Share/Bookmark

Hi guys. If you haven’t checked out Simposium from the news post yesterday, I suggest you give it a looksee if you’re into creating stuff for The Sims. Clive has done a great job on the program and people are starting to create new animations. Of course one of the problems is that you can’t use them in the game because objects have the name of the animation hard-wired. Well, I’m working on correcting that shortly (I feel the need to fill a gap quickly). So I’m putting together a quick app that will let you pick any object, select an animation from it and change that to whatever one you want. No, this will not let you add animations, only replace the existing ones. Much like the way some people are doing it now by hex editing the objects only this is a little safer and more user friendly. Anyways, I’ll post more info on it tommorow.

There’s also a lot of questions flying my way about a book project I was working on. Unfortunately I can’t discuss any details with you about it so please be patient. I will keep you as informed as I can about things, but some subjects are a little taboo. In any case, there’s plenty of gossip and trash to talk about around here with all the junky programs I write anyways right? See you in the forums!

  • Share/Bookmark
My Flickr Photos
Vista IntenseIT with Scooby DSC_0007.JPG Shadows Hanging out with Xander DSC_0106 DSC_0041 Chasing Trooper DSC_0065
What I'm Doing...

Powered by Twitter Tools