AKA Let's try and have a thread about this that avoids drama.
For the longest time, no-one's really known what this command does. However, just a few days ago, through some speculation and .exe digging, we've managed to dig up what the elusive Command 4 actually does!Emerald141 [from the Unofficial WA Editor Guide] wrote:8.4. Command 4: Modify Object
The honest truth: I don’t understand this command. No one really does, and it seems rather unlikely it’s ever going to get used. But since it is one of the commands, and this is supposed to be a ‘complete’ guide, I decided to put it here anyway. The information put forth here was given by master hex editor ‘cbloopy’, who is now inactive.
Data1: Object ID
Data2: Object modifier you want changed
Data3: What you want the modifier changed to
Data4: Not used
To be specific, the sticking point in understanding the command was Data2 and Data3 - Data2 seemed logical enough, but no-one could find out what the modifier values actually were. Data3's problem was that it was hard to tell which values were actually correct and which weren't, because even if you got results out of it, they'd vary between objects.
However, the end result of too much free time, a HEX editor, and not knowing when to give up, has turned out to be a much better understanding of Command 4, or more specifically, how to use it.
As the description in Emerald's guide implies, it allows you to alter an object's settings directly. The modifiers in question are the same parameters you see in the Editor - Colour, SubColour, ID, and so forth. Here's a list of Data2 values that are known to have an effect (note that this list might not be complete and the effects of some values are unknown - the label from the game's code is included next to some values - mostly UNKNOWN or NO EFFECT values - for reference):
Additonal comments:1: MovementType (credit to Emerald141 for finding this)
2: UNKNOWN: MovementTypeData
3: UNKNOWN: RadiusType
4: UNKNOWN: Data10 (this seems to be used for an NPC's X destination)
5: UNKNOWN: AttackPower
6: NPC Greeting: DefensePower (re-purposed as of WA3)
7: DestructionType (see below)
9: Type (object logic)
10: SubType (sublogic)
14: UNKNOWN: Status
15: Frames remaining in current cycle: Timer (see below)
18: Teleportable (whether object can use teleporters or not)
19: PushButton (whether object can push buttons or not)
20: NO EFFECT: WaterReact
21: NO EFFECT: Telekinesisable
22: NO EFFECT: Freezable
32: Data9 (23 to 32 are the main object modifiers)
MovementType: How an object moves, i.e. bouncing around like a SpikeyBall, running away from the player like a Scritter, following them like a Chomper, etc. Not all values are known. Some can be found here.
MovementTypeData: cbloopy found this a long time ago, but to the best of my knowledge, no one knows what it actually does, if anything.
RadiusType: Probably an early development relic. Haven't tested this one.
Data10: Same as above, though it seems to be used for an NPC's X destination.
AttackPower/DefensePower: Probably an early development relic, though DefensePower was retooled into the NPC Greeting variable for WA3. Haven't experimented with values for DefensePower yet and I haven't tested AttackPower at all.
DestructionType: Changes the "type" of destruction animation that occurs when an object is destroyed. I only tested a few values - 1 is the default "white stars explosion" animation, while other values removed the effect entirely (though the score pop-up still appeared on destroying a chomper). Higher values might give different effects, I don't know.
Type: Object logic (i.e. key, coin, gate, NPC, etc.). Again, valid values can be found here.
SubType: Object "sub-logic". For objects with multiple behavioural styles (i.e. buttons - round buttons, square buttons, diamond buttons), this determines which "style" they use. Valid values can be found in the above link.
ActivationType: How an object "activates" (i.e. gates raising out of the ground, growing, fading in/out). Values can be found in the above link.
ActivationSpeed: How quickly an object activates (i.e. a gate opening/closing). Odd numbers and 0 don't work.
Status: At the very least, this is used for FireTraps - Namely, to determine whether they're firing or not (0 = not firing, 1 = firing). However, it still abides by the Timer settings - Setting a FireTrap's Status to 1 during an "off" cycle will make it fire for one frame then turn off again.
Frames remaining in current cycle/Timer: Connected to 14. Determines how many frames are left before the object switches statuses (i.e. Setting 15 to 60 while a FireTrap is off will make it start firing again after 60 frames/1 second, while setting it to 5 while it's on will make it turn off after 5 frames). Not sure if these two are used outside of FireTraps, though they likely are.
TimerMax1/TimerMax2: The "reference" values for objects with different cycles (i.e. TimerMax1 is how long a FireTrap will remain off for).
Teleportable/PushButton: Self-explanatory. When the value is 1, the object can use teleporters/push buttons. When the value is anything but 1, it can't.
WaterReact: Relic from early development. Has no apparent effect.
Telekinesisable/Freezable: Most likely early development relics. Probably controlled whether or not an object could be moved using the white Power glove or frozen using the blue Ice glove, in the pixel movement build. No apparent effect in the final game.
Data0 - Data9: These are used in almost every single object, besides most scenery. They rarely show up as such in-editor, though - for gates/keys/keycard, Data0 is Colour and Data1 is SubColour. For Stinker NPCs, Data0 is their eye/shoe colour, Data1 is their expression, Data2 is their hat model, Data3 is the hat colour, and so on. For Spikeyballs and Chompers (and presumably DragonTurtles, I haven't checked yet), Data2 is their speed.
One thing to keep in mind with these: If a Data# value controls an object's texture or model, any changes made to it will not appear in-game until you leave the level and come back. Whether that's stepping on an arrow that just redirects to that same level again, or using command 7 or whatever, texture/model changes only happen upon the level "refreshing". The only exception I know of is the Wee Stinker - Data8 controls the colour/texture, and for some reason it changes immediately (maybe because the game needs to swap between their expressions on the fly? who knows). There could be other exceptions, I don't know.
Particle effects, such as a Baby Boomer's fuse, change immediately. Another thing that changes immediately is a glove charger's colour and particles (because the game colours them on the fly). Logic changes also take effect immediately - Glove chargers can change spells without the level being reloaded.
As for what it could be used for... Here are a few ideas:
- - A Baby Boomer escort level where the Boomer can explode more than once (by CMD4 setting Data8 to 1)
- A "Magic Roulette" level, as exampled here
- Making a FireTrap's cycles a bit more unique (i.e. fire for 200 frames, rest for 150, fire for 200 frames, rest for 60 - if someone can figure out how to use value 14, this could go even further)
- Having a Chomper accelerate/decelerate (perhaps depending on player's progress through the level)
EDIT: Added details on value 1 to the list, courtesy of Emerald.
EDIT: Added details on value 19 to the list, courtesy of MNIK.
EDIT: Revamped list, added more details.