Replies: 53 (Who?), Viewed: 57399 times.
Page 1 of 3
Lab Assistant
Original Poster
#1 Old 3rd Apr 2006 at 1:29 PM Last edited by Numenor : 10th Feb 2007 at 10:44 PM. Reason: Fixed images
Default Adding an "Effect" to an object

EDIT (by Numenor): Atavera has retired from modding; all his creations and tutorials are therefore NO LONGER SUPPORTED by the author. We'll do our best to answer to the questions, if possible; but the entire production of objects/hacks/tutorials by Atavera is nevertheless to be considered DISCONTINUED.

--------------------------------------------------------------------------

Adding an "Effect" to a custom object

I suggest reading the following tutorials before trying this:
Modding InfoCenter - An Introduction to Slots
Modding InfoCenter - The Resource Node(CRES)
and be familiar with adding and changing behaviour functions.

Overview:
Effects are started and stopped via BHAV. The effects are called by name defined in text lists, and are started in slots. Lots of effects will stop on their own once the animation is finished, but others are looped and must be manually stopped by the BHAVs again. There seems to be no limit on how many effects can be on one slot at a time, and they can be created in any type of slot(usually target slots though). In this tutorial, I add the zZz sleeping effects to a re-meshed garden gnome that I made. I have the gnome(before I added the FX) for you to use so you don't have to clone your own and make a mesh.

Finding Effects:
Well there seems to be some kind of list in Effects.package, but the filetype isn't yet recognised by any package editors. What I do, is open an object from the game in Objects.package, and read it's text list 0x8F to get names of effects. For my object I will use the "sleeping" effect.

The Resource Node:
First thing to do is to go to my object's Resource Node, and add a node for the slot. Add a transform node, and attach as a child node of 0x9(the Shape reference node). Now name the node "slot_fx_0". Now we need to edit the position of the node. Load the mesh in your 3d editor, and set the units so that 1 unit is equal to 1 sims tile(the shadow mesh is 1 tile). Now create a small cube, and position it right above the gnomes head and record the position from the origin. The coordinates that I use for this object are (0.016,0.118,0.177), enter these into the Translation part of your new block.


The Text Lists:
This object does not come with an effect text list, so clone another text list and change the instance to 0x8F. Delete any un-needed strings, and add to the first string, your effect name. The effect that I'm using is called "sleeping".

Now go to list 0x90 and add your the name of the effect slot node that you added to the resource node. Note that it is index 0x3 that we will need in the next part.


The Slot:
Now open the Slot file and add an entry. Set the type to Target, and set S2 to 2(to tell the game to get the position from the CRES). Because the index in text list 0x90 was 0x3, put 3 into I9. I10 seems to just be the entry number in the slot but doesn't seem to effect anything, anyway set it to 4 since it is the fourth slot entry.


The Behaviours:
Now the object needs instructions to use the effect. Depending upon the object, you may want to put this in different places, but in this object I want the effect to start when I buy the gnome and stay forever. First thoughts may be to add this to the init, but that will not work for effects. The effects can only be started in Live Mode, so we need to put it in the Main function right before the main idle loop.

From looking at how the fountain handles its effects, there is a 3 tick Idle before starting the effect, I believe this is necessary for similar reasons that it won't start in Buy Mode. So add a 3 tick Idle, followed by the primitive Start/Stop Effect(0x70). For the 0x70, the first operand leave 00 because we are starting an effect(you would put 01 to stop this effect). The next 3 are the data owner that of the object we start it on, since this is the main, it will be the My ObjectID(03 0B 00). The fourth operand is the index of string 0x8F to use, which will remain 00 because the "sleeping" effect is in 0x0 index. The seventh operand is the slot number which we will change to 01. There was already an existing Target slot in the slot file(0x0), so the one we added was 0x1. The tenth operand will remain zero because it is a target slot. The eleventh operand will also remain zero because it uses the private string 0x8F rather than Global or SemiGlobal. Now link the effect line to go to the main loop, and you are done.


End Result:


Feel free to ask questions if you have any, and I'll try to help.
Screenshots
Download - please read all instructions before downloading any files!
File Type: rar atavera_FX-Tutorial-Gnome.rar (53.5 KB, 512 downloads)
Advertisement
Forum Resident
#2 Old 3rd Apr 2006 at 1:59 PM
Just as I suspected. Thanks!
Mad Poster
#3 Old 7th Apr 2006 at 12:54 PM
For probably more infos on FX effects, may check out the material.package at the material folder right at the "res" folder, not the one in the catalogue folder. I don't really know much, so it's just a suggestion...

Thanks for showing how to add the FX efects... Now, I've realised it takes really more things to set to have them work...
Shaken, Not Stirred
#4 Old 12th Apr 2006 at 10:17 PM
yea... I'm afraid we havent come up with a way to read the .fx files in effects.package...

I was designing an editor for them, but I got stalled and had to stop because of real life stuff.

They're listed on the wiki though for whoever wants to try and decode more of them.
Lab Assistant
Original Poster
#5 Old 15th Apr 2006 at 8:53 AM
Thanks Kary, I'll check the Wiki for that
Lab Assistant
#6 Old 19th Apr 2006 at 3:54 PM Last edited by Edootjuh : 19th Apr 2006 at 3:57 PM. Reason: spelling mistake
Pdf???
could you make it PDF, it kinda hard to read in my resolution

The best Sims2 fansite! (Yes, it's even better that MTS2 :-D)
Lab Assistant
Original Poster
#7 Old 19th Apr 2006 at 8:04 PM
:skull: Probably the problem was my resolution I was on 1280x800 when I made this. Sorry, but I don't have any utility to create PDF files though.
Test Subject
#8 Old 12th Jul 2006 at 8:41 PM
I would love to see a tutorial on how you make the neon lettering. I want to do a sign for a strip club called "The Foxy Flamingo." I want to do the sign before posting it on MTS2.
Field Researcher
#9 Old 22nd Jul 2006 at 12:24 PM Last edited by Max3D : 22nd Jul 2006 at 12:42 PM.
if u need to apply the effect to the object without control the starting point of the effect you can use Object in Stack Objects's ... on this way independently by the cres the effect will be applied to the object in the stack.
I'm not shure if it's important but on the Sloth i've assigned #i9 = 0
Effect Stop/Start (Hard start effect on object in Target slot 0x00 of object in Stack Object's 0x000B (object id),
"coolglassesafterglow"
01040B00030000C40B0000000A000000


this note is for me too ^^
Test Subject
#10 Old 18th Oct 2006 at 2:59 AM
Umm, can I offer some help? (I hope)
Quote:
Originally Posted by atavera
:skull: Probably the problem was my resolution I was on 1280x800 when I made this. Sorry, but I don't have any utility to create PDF files though.


Umm, what if someone had copied the article to an RTF file for their own use? Could you use that (nothing edited, just copied & pasted) with pages set to landscape to minimise image degradation from shrinking

If it's okay, I'm sure I could email it to you for proof reading. Or something? Still learning this site but loving what I find.
Lab Assistant
Original Poster
#11 Old 13th Nov 2006 at 9:15 AM
databanks: Sorry for the late response, I haven't checked this thread in some time now. I have no problem with anyone re-organising this information, re-posting it, re-wording it, or anything really.
The ModFather
retired moderator
#12 Old 10th Feb 2007 at 10:47 PM
10 Feb 2007 - The tutorial has been restored (after having been deleted by Atavera). Please remember that Atavera has retired from modding; all his creations and tutorials are therefore NO LONGER SUPPORTED by the author. We'll do our best to answer to the questions, if possible; but the entire production of objects/hacks/tutorials by Atavera is nevertheless to be considered DISCONTINUED.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Instructor
#13 Old 12th Feb 2007 at 9:40 AM
Default Is it possible to use only part of an effect?
I would like to use only part of the waterSpoutupFX, ie take away the big spouts but keep the water falling.

Karybdis wrote in April 2006:

"I'm afraid we havent come up with a way to read the .fx files in effects.package"

Am I to understand by this that there is no way to edit the actual effect?
Retired Duck
retired moderator
#14 Old 12th Feb 2007 at 9:57 AM
buggybooz - Yes, that is correct.
Field Researcher
DELETED POST
12th Feb 2007 at 9:11 PM
This message has been deleted by MizzesSimmer. Reason: changing my mind again, ty anyways!
Test Subject
#15 Old 7th Apr 2007 at 10:12 PM
I don't understand any of that... lol
Forum Resident
#16 Old 18th Apr 2007 at 2:46 PM
I'm having a little problem with the behaviours:

If I try to link to the FX via 0x0070 the effect is not taken from the text list 0x008f (Effects) but from 0x0100 (attrribute labels).

Why?

Any help appreciated, see attached image.

Screenshots

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
The ModFather
retired moderator
#17 Old 18th Apr 2007 at 4:33 PM
Xan, I think that it's only a "visual" problem, i.e. the BHAV wrapper displays the name from the wrong text list, but then the game acts correctly.
Are you experiencing problems in game, with this effect?

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Forum Resident
#18 Old 18th Apr 2007 at 7:13 PM
I have not yet tried it ingame, since this my first try at SFX and I wanted to make sure I made no error.

Thanks, I will experiment and then come back with my findings.

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
Forum Resident
#19 Old 18th Apr 2007 at 7:54 PM
The game crashes, but that could be due to other errors I've made. Does the Main BHAV really loop to itself?

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
Forum Resident
#20 Old 19th Apr 2007 at 11:31 AM
this is so cool!love it!thanx
Retired Duck
retired moderator
#21 Old 19th Apr 2007 at 1:16 PM
xanathon - At what point does the game crash though? When it's booting, or when you're using the object? It's pretty much impossible for a bad BHAV to fully crash the game as long as you play with testing cheats. If you're actually crashing the game, it's more likely a problem in the way you've set up the CRES.

(And yes, the main function must loop. As long as it has a decent idle or a sleep somewhere in there then it's working fine.)
Forum Resident
#22 Old 19th Apr 2007 at 6:42 PM
It crashes at the moment I click on the one lamp category, where my new object resides. I hear some regular ticks for a second or two and then the game crashes.

It is abolutely possible that I made errors in the process before writing the new BHAVs, since I'm trying this for the first time. I guess I will start over from scratch.

Hm. Just had the idea to have a look at the games log, mybe in there is something helpful.

For now: Thanks folks!

I'll report back if I manage to make an ever greater mess... ;o)

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
The ModFather
retired moderator
#23 Old 19th Apr 2007 at 10:54 PM
Then it might be something in the scenegraph chain; most probable causes are an improperly added block to the CRES (I had a lot of problems with CRES having "IK" blocks at the end; but IK blocks exist only in animated objects); or something in the GMND: the "DataList Extension Reference" might have an exceeding line, compared to the actual number of DataList Extension blocks in the GMND.

I've finally started my Journal. Information only, no questions.

My latest activity: CEP 9.2.0! - AnyGameStarter 2.1.1 (UPD) - Scriptorium v.2.2f - Photo & Plaques hide with walls - Magazine Rack (UPD) - Animated Windows Hack (UPD) - Custom Instrument Hack (UPD) - Drivable Cars Without Nightlife (UPD) - Courtesy Lights (FIX) - Custom Fence-Arches - Painting-TV - Smarter Lights (UPD)


I *DON'T* accept requests, sorry.
Retired Duck
retired moderator
#24 Old 20th Apr 2007 at 12:18 PM
You can always post the object here, see if anyone here can spot what's not right.
Forum Resident
#25 Old 20th Apr 2007 at 1:33 PM Last edited by xanathon : 21st Apr 2007 at 5:19 PM.
I gladly do this, thanks for the offer, Echo.

Be warned: This is a highly experimental object, expect everything...

Edit: Object removed

happy simming,
Xanathon


Xanathon's Laboratory :: WishList

.: Do not harass me with requests via PM, you will only get ignored :.
.: Don't post my objects or objects derived from them on paysites or the exchange! :.
Page 1 of 3
Back to top