Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Test Subject
Original Poster
#1 Old 5th Aug 2023 at 6:06 AM
Default Creating and editing Sims2 Effects in the original scripting language
Sims 2 Effects Editing

Sims2 has a pretty versatile effects system, these are used for some things you might expect, such as the smoke and sparks coming out of the UFOs in strangetown:



However, they are also used for things you might not expect such as the plumbobs floating over buildings in the neighborhood view and even the fly throughs that play when you load into a neighborhood.

The compiled versions of these effects live in the Res/Effects/effects.package. While we have done some work to decode the overall structure and some fields of that format here , there is now a much easier way to edit these effects.

LazyDuchess and I found that the game still looks for and compiles these effects from their developer friendly textual representations. This means that you can now edit and make new effects using the same scripting format that the original Sims 2 artists did.


The File

Sims2 looks for a file under TSBin\Plugins called main.fx. So for example if you have all the expansions you would create a text file The Sims 2 Ultimate Collection\Fun with Pets\SP9\TSBin\Plugins\main.fx.

This file should contain the effects you want to add/override. So for example, we can override the afformentioned smoke coming from the strangetown UFOs to be giant orbs that turn from green to red:

Code:
particles test
  life 5
  rate 30
  source -point
  emit -dir (0, 0, 1) 1 -speed 5
  texture "effects-puff"

  color (0.0, 1.0, 0.0) (1.0, 0.0, 0.0)
end

effect neighborhood_house_smoking
   particleEffect test
end


and we get:



Some more details on my github gist here: https://gist.github.com/ammaraskar/...11be62999854194

Would definitely recommend going through the presentation slides by the Sims 2 developer behind the effects system here: https://www.andrewwillmott.com/talk...cedural-content
Advertisement
Lab Assistant
#2 Old 5th Aug 2023 at 8:54 PM
Very cool! Thank you for sharing.

Is it known what other source shapes can be used beside 'point' ?

I'm http://crispsandkerosene.tumblr.com/ on tumblr, admittedly not very active on MTS.
Test Subject
Original Poster
#3 Old 5th Aug 2023 at 9:31 PM
I'm not entirely sure what the syntax is but I know the game supports at least rects, cuboids, ellipsoids and toruses.

Internally they're represented as the corners but I'm guessing the game lets you pass radii to make it more convenient.
Test Subject
Original Poster
#4 Old 22nd Aug 2023 at 12:31 AM
Just wanted to shout out @Meduza who posted their experiments with this on tumblr: https://www.tumblr.com/jellymeduza/...flies-effect-or

They've got a randomly moving firefly and a fading treble cleff with the following code:

Code:
particles bluefireflies
  life 4
  rate 3
  source -point
  emit -dir (0, 0, 0.5) 0.5 -speed 0.25
  randomWalk -strength 1.5 -turn 0.5
  texture "ep5_fireflieson_blue"
  size 0.05
end

effect ep5_fireflies_blue
   particleEffect bluefireflies
end

particles trebleclef
  life 10
  rate 0.2
  source -point
  emit -dir (0, 0, 1) 1 -speed 0.1
  texture "custom_trebleclef"
  alpha 1 0.6 0.3 0.1
  size 0.5
end

effect Meduza_trebleclef
   particleEffect trebleclef
end
Lab Assistant
#5 Old 22nd Aug 2023 at 2:44 PM
Thanks for sharing code for my effects! I should've done it myself, but I forgot about the thread at MTS. I still need to work on the "randomWalk" property. Currently it's a bit too random.
Alchemist
#6 Old 6th Oct 2023 at 12:21 PM
What's the correlation between the effect id and the location of the effect parameters in the file? I'm looking at the fx file for apartment life in a hex editor. I can't figure out how to go from looking at effect 540 to a specific spot in the file that contains 540's values.
Test Subject
Original Poster
#7 Old 10th Oct 2023 at 1:49 AM
The id represents the index of the effect in the file. So a visual effect of 540 would be the 540th visual effect in the file.

You might have a hard time with just a hex editor, but I'm yet to build an editor for the binary fx format. If you're technically inclined I have a kaitai struct for the format here https://gist.github.com/ammaraskar/...e0ea5dcf1e58478 that you can use with the kaitai web editor here as a fancier hex editor: https://ide.kaitai.io/
Test Subject
#8 Old 11th Jan 2024 at 6:55 AM
I've been playing around with this to see how new neighborhood effect items can be made and I managed to get a simple one working to make a year-round snowcover look!



The main.fx code I used to make the snowcover effect was based on the one Maxis used for the farm field terrain covers. Something which I also realized doing this is that if you use a custom texture for an effect, the texture has to be in the same group as the maxis textures (0x1C0532FA), otherwise I couldn't get the game to recognize it.
Code:
decal neighborhood_permafrost
  texture "nhood-permafrost"

  life 20
  alpha 0.8
  size 60
end

effect neighborhood_permafrost
   decalEffect neighborhood_permafrost
end


I think now that I've gotten this working I might see if I can create a permanent storm or something.
Back to top