Skip to content

Instantly share code, notes, and snippets.

@ammaraskar
ammaraskar / auto_gen_collider_srcs.py
Last active May 31, 2025 22:56
Auto generate tww decomp dCcD_Src structs
"""
Automatically writes source structs for colliders.
"""
from dataclasses import dataclass
from pathlib import Path
import collections
import json
import re
import struct
import textwrap

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:

image

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.

#
# A collection of standard parameterized materials
#
# Materials: Null
# VertexAlpha
# StandardMaterial
#
#enableShaderProgramDebugging -vertex
set NeutralRect=Rect(3872.0,-3008.0,4928.0,-1952.0)
set NeutralRectSpawnLoc=Rect(4288.0,-2688.0,4544.0,-2400.0)
function SpawnNeutrals takes nothing returns boolean
local group g
local rect r1
local rect r2
if NoNuetrals == true then
return false
endif
@ammaraskar
ammaraskar / effects.ksy
Last active January 4, 2023 14:25
sims2 effects resource
meta:
id: effects
file-extension: effects
endian: le
seq:
- id: first_short
type: u2
- id: num_particles
{
"1276":"fireflamesfx",
"111":"uiheadlinegroup_aspirationwealthsingleminus",
"1505":"sedona_2camparteffect_death",
"1170":"memoryposglowfx",
"1041":"washdishesinsink_childviewer2",
"843":"fxpinballtable_a",
"466":"floursack00n1b",
"907":"smartmilkworking",
"883":"fxtestmetaparticle",
@activate_goto
def f():
    x = 0
    print('Hello World')
    x += 1
    if x > 10:
        goto_8
    goto_2

Keybase proof

I hereby claim:

  • I am ammaraskar on github.
  • I am ammar2 (https://keybase.io/ammar2) on keybase.
  • I have a public key ASD_wxrl_XkR6rHcTMj1dAiYT5Jyhf30ntPPTdDE19EBjAo

To claim this, I am signing this object:

>>> class CustomGlobals(dict):
... def __getitem__(self, key):
... if key == 'x':
... return get_x()
... return super().__getitem__(key)
...
>>> def get_x():
... print('get_x called!')
... return 1+1
...