WA3E - Text Dump/.WOP Format Notes

Help Topics, Bug Reports, Feature Requests, etc.
Post Reply
User avatar
Qloof234
Rainbow AllStar
Posts: 4193
Joined: Wed Oct 03, 2007 10:33 pm
Location: Canada

WA3E - Text Dump/.WOP Format Notes

Post by Qloof234 » Tue Dec 29, 2015 9:45 pm

This is going to get long-winded and very technical, so hang in there.

Right, so. I know MNIK's already taken notes on the .wop file format, but I've taken some of my own as well (admittedly because I completely forgot about his notes on the format, but that's not the point). The .wop data structure (not including the actual in-editor adjusters) is as follows:

Code: Select all

$0000 - model length byte
$0004 - model name (assuming !None, i.e. 5 characters)
$0009 - texture length byte
$000D - texture name (assuming !None, i.e. 5 characters)
$0012 - XScale
$0016 - YScale
$001A - ZScale
$001E - XAdjust
$0022 - YAdjust
$0026 - ZAdjust
$002A - PitchAdjust
$002E - YawAdjust
$0032 - RollAdjust
$0036 - WAE X Offset
$003A - WAE Y Offset
$003E - WAE Z Offset
-- $0042 to $007A are UNKNOWN VARIABLES 1 to 15 --
$007E - MovementType
-- $0082 to $009E are UNKNOWN VARIABLES 16 to 23 --
$00A2 - DefensePower
$00A6 - UNKNOWN VARIABLE 25
$00AA - Object ID
$00AE - Type
$00B2 - SubType
$00B6 - Active
$00BA - UNKNOWN VARIABLE 26
$00BE - ActivationType
$00C2 - ActivationSpeed
$00C6 - UNKNOWN VARIABLE 27
$00CA - Timer
$00CE - TimerMax1
$00D2 - TimerMax2
$00D6 - UNKNOWN VARIABLE 28
$00DA - UNKNOWN VARIABLE 29
$00DE - WaterReact
-- $00E2 to $00F2 are UNKNOWN VARIABLES 30 to 34 --
$00F6 - Data0
$00FA - Data1
$00FE - Data2
$0102 - Data3
$0106 - Data4
$010A - Data5
$010E - Data6
$0112 - Data7
$0116 - Data8
$011A - Data9
$011E - String 1 length byte
$0122 - String 1 (assuming 4 characters)
$0126 - String 2 length byte
$012A - String 2 (assuming 4 characters)
$012E - UNKNOWN STRING 1 (35) length byte
$0132 - UNKNOWN STRING 1 (assuming 4 characters)
$0136 - UNKNOWN STRING 2 (36) length byte
$013A - UNKNOWN STRING 2 (assuming 4 characters)
$013E - Talkable
-- $0142 to $015A are UNKNOWN VARIABLES 37 to 43 --
$015E - MovementSpeed
-- $0162 to $017A are UNKNOWN VARIABLES 44 to 50 --
$017E - Exclamation
-- $0182 to $019E are UNKNOWN VARIABLES 51 to 58 - $0192 is the FROZEN variable --
$01A2 - ScaleAdjust
-- $01A6 to $01C6 are UNKNOWN VARIABLES 59 to 67 --
$01CA - UNKNOWN STRING 3 (68) length byte
$01CE - UNKNOWN STRING 3 (assuming 4 characters)
$01D2 - UNKNOWN STRING 4 (69) length byte
$01D6 - UNKNOWN STRING 4 (assuming 4 characters)
As an example for applying this to an actual .wop, we'll use the regular gate block. The model name is !ColourGate, which is 11 characters as opposed to !None's 5. This means we have an offset of +6 for each of these addresses - in other words, for instance, Data0 won't be at $00F6, but at $00FC instead.

If none of the object strings are in use (ObjectTextData0, ObjectTextData1, 35, 36, 68, and 69), then we subtract 4 from the offsets above. For instance, the regular gate object has no text strings (and indeed, no use for them), so the length byte for string 2 is at $0126 + 6 - 4, or $0124. Remember that this is all in HEX, not decimal - in other words, we count like this: 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10.

Still with me? Alright, cool.

So, where am I going with all this? Well, a week ago, I did some .exe digging in both wg.exe and editor3d.exe - Emerald was wondering if an object's YAW could be adjusted with CMD4. As far as we know (and I'm reasonably convinced of this for reasons I'll get into), it can't, but I decided to dig a bit deeper than just playing about with the command to see if things happened in-game.

I ended up finding a rather large string list in the editor .exe - one that turned out to be quite interesting. Here it is, after having been cleaned up and annotated slightly:

Code: Select all

_vcurrentobjectmodelname
_vcurrentobjecttexturename
_vcurrentobjectxscale
_vcurrentobjectyscale
_vcurrentobjectzscale
_vcurrentobjectxadjust
_vcurrentobjectyadjust
_vcurrentobjectzadjust
_vcurrentobjectpitchadjust
_vcurrentobjectyawadjust
_vcurrentobjectrolladjust
_vcurrentobjectx
_vcurrentobjecty
_vcurrentobjectz
_vcurrentobjectoldx		UNK 1?
_vcurrentobjectoldy		UNK 2?
_vcurrentobjectoldz		UNK 3?
_vcurrentobjectdx		UNK 4?
_vcurrentobjectdy		UNK 5?
_vcurrentobjectdz		UNK 6?
_vcurrentobjectpitch		UNK 7?
_vcurrentobjectyaw		UNK 8?
_vcurrentobjectroll		UNK 9?
_vcurrentobjectpitch2		UNK 10?
_vcurrentobjectyaw2		UNK 11?
_vcurrentobjectroll2		UNK 12?
_vcurrentobjectxgoal		UNK 13?
_vcurrentobjectygoal		UNK 14?
_vcurrentobjectzgoal		UNK 15?
_vcurrentobjectmovementtype
_vcurrentobjectmovementtypedata	UNK 16
_vcurrentobjectspeed		UNK 17?
_vcurrentobjectradius		UNK 18?
_vcurrentobjectradiustype	UNK 19?
_vcurrentobjectcollisionpower	UNK 20?
_vcurrentobjectpushdx		UNK 21?
_vcurrentobjectpushdy		UNK 22?
_vcurrentobjectattackpower	UNK 23?
_vcurrentobjectdefensepower	UNK 24 (FORMERLY)
_vcurrentobjectdestructiontype	UNK 25?
_vcurrentobjectid
_vcurrentobjecttype
_vcurrentobjectsubtype
_vcurrentobjectactive
_vcurrentobjectlastactive	UNK 26?
_vcurrentobjectactivationtype
_vcurrentobjectactivationspeed
_vcurrentobjectstatus		UNK 27?
_vcurrentobjecttimer
_vcurrentobjecttimermax1
_vcurrentobjecttimermax2
_vcurrentobjectteleportable	UNK 28?
_vcurrentobjectbuttonpush	UNK 29?
_vcurrentobjectwaterreact
_vcurrentobjecttelekinesisable	UNK 30?
_vcurrentobjectfreezable	UNK 31?
_vcurrentobjectreactive		UNK 32
_vcurrentobjectchild		UNK 33?
_vcurrentobjectparent		UNK 34?
_acurrentobjectdata
_acurrentobjectdata
_acurrentobjecttextdata		STR 35?
_acurrentobjecttextdata		STR 36?
_vcurrentobjecttalkable
_vcurrentobjectcurrentanim	UNK 37?
_vcurrentobjectstandardanim	UNK 38?
_vcurrentobjecttilex		UNK 39
_vcurrentobjecttiley		UNK 40
_vcurrentobjecttilex2		UNK 41
_vcurrentobjecttiley2		UNK 42
_vcurrentobjectfutureint	UNK 43?
_vcurrentobjectmovementspeed
_vcurrentobjectfutureint10	UNK 44? (NPC X DEST)
_vcurrentobjectfutureint11	UNK 45? (NPC Y DEST)
_vcurrentobjectfutureint12	UNK 46?
_vcurrentobjectfutureint13	UNK 47?
_vcurrentobjectfutureint14	UNK 48?
_vcurrentobjectfutureint15	UNK 49?
_vcurrentobjectfutureint16	UNK 50?
_vcurrentobjectexclamation
_vcurrentobjectshadow		UNK 51?
_vcurrentobjectlinked		UNK 52?
_vcurrentobjectlinkback		UNK 53?
_vcurrentobjectfutureint21	UNK 54?
_vcurrentobjectfrozen		UNK 55
_vcurrentobjectfutureint23	UNK 56?
_vcurrentobjectfutureint24	UNK 57?
_vcurrentobjectfutureint25	UNK 58?
_vcurrentobjectscaleadjust	
_vcurrentobjectfuturefloat2	UNK 59?
_vcurrentobjectfuturefloat3	UNK 60?
_vcurrentobjectfuturefloat4	UNK 61?
_vcurrentobjectfuturefloat5	UNK 62?
_vcurrentobjectfuturefloat6	UNK 63?
_vcurrentobjectfuturefloat7	UNK 64?
_vcurrentobjectfuturefloat8	UNK 65?
_vcurrentobjectfuturefloat9	UNK 66?
_vcurrentobjectfuturefloat10	UNK 67?
_vcurrentobjectfuturestring1	STR 68?
_vcurrentobjectfuturestring2	STR 69?
The named variables in this list match up exactly with the .wop data structure, minus the Data# adjusters. It also matches up fairly closely with the CMD4 value list we have, though there are some variables here that are skipped over. On top of that, the layout of this list puts "currentobjectfrozen" right where unknown variable 55 is in the .wop structure - which, as Caton discovered, is indeed the timer that controls when a frozen object thaws out. In other words, this string list is the .wop data structure, but with some more in-depth labelling than what we already have.

I've experimented with a few of the unknown values after finding this list. What I've noticed so far:
  • The WAE X/Y/Z offsets seem to have something to do with controlling object logic in-game. After manually setting all the values to 0 on a barrel, the barrel was rendered nonsolid in-game - I could pass through it and click on it as if it were an empty tile. However, spellballs were still blocked by the barrel model, and flashing the barrel restored its solidity. Further experimenting resulted in a tile that I couldn't cross over, but spellballs could - this was not affected when the barrel was flashed or destroyed.

    OldX/Y/Z seem to be completely deprecated. I believe these are a relic from the pixel-movement era of the game's development, seeing as they seem to work in co-ordinates instead of tiles.

    Yes, for some reason, Pitch/Yaw/Roll are repeated a total of 3 times. The first set, used in the Editor, seem to be "offset" values like X/Y/ZAdjust, while the second set seems to be used in the game itself to determine what direction an object's facing, if that makes sense. I don't know what the "Pitch2" values are about, though.

    Unknown variable 32 (currentobjectreactive) seems to be the "initialize" variable for an object. Setting this to 0 causes the object's model to spawn at full scale (slightly larger than average for coins, absolutely massive for chompers) at 0, 0, 0 with absolutely no interactivity.

    Variables 33 and 34 (currentobjectchild/parent respectively) are both set to -1 (FF FF FF FF) by default. Disappointingly, these seem to be deprecated.

    Variables 39 through 42 are an object's X/Y co-ordinates in the .wlv, repeated twice (39/41 for X, 40/42 for Y). I'm not entirely sure why they're repeated, but there you go.

    Variables 44 and 45 are listed as "futureint" 10 and 11 in the string list, indicating they were probably placeholder values, though they're actually used for an NPC's movement target. Amusingly, Chompers use the same variables for their targeting system, too.

    Variables 52 and 53 (currentobjectlinked/linkback) are... strange, to say the least. They're related to Flash in some way, as the names suggest, but I've yet to really figure out how. Clearing the values on a flashed Chomper in a save file resulted in me re-flashing nothing to the destination square, while the Chomper regained "solidity" and had its facing direction offset. I'm not really sure how to explain this.
I don't know if there's really anything else of use to be found here anymore, but I figured I'd post this for the sake of documentation, at the very least.
Image
User avatar
Pawelec
Rainbow Master
Posts: 690
Joined: Tue Jul 15, 2008 8:37 am

Post by Pawelec » Sun Feb 07, 2016 9:46 am

So here's a WOP maker code snippet Patrick sent me:

Code: Select all

file=WriteFile("..\..\Data\Editor\ObjectPresets\Monsters\Ghost.wop") 

WriteString file,"!Ghost" 
WriteString file,"!None" 
WriteFloat file,1 ; xscale 
WriteFloat file,1 ; yscale (y in logic) 
WriteFloat file,1 ; zscale (z in logic, i.e. height) 
WriteFloat file,0 ; xadjust 
WriteFloat file,0 ; yadjust (i.e. "-z") 
WriteFloat file,0 ; zadjust (i.e. height) 
WriteFloat file,0 ; pitch 
WriteFloat file,0 ; yawadjust 
WriteFloat file,0 ; roll 

WriteFloat file,0;ObjectX(Dest)=0 
WriteFloat file,0;ObjectY(Dest)=0 
WriteFloat file,0;ObjectZ(Dest)=0 
WriteFloat file,-999;ObjectOldX(Dest)=0 
WriteFloat file,-999;ObjectOldY(Dest)=0 
WriteFloat file,-999;ObjectOldZ(Dest)=0 

WriteFloat file,0;ObjectDX(Dest)=0 
WriteFloat file,0;ObjectDY(Dest)=0 
WriteFloat file,0;ObjectDZ(Dest)=0 

WriteFloat file,0;ObjectPitch(Dest)=0 
WriteFloat file,0;ObjectYaw(Dest)=0 
WriteFloat file,0;ObjectRoll(Dest)=0 
WriteFloat file,0;ObjectPitch2(Dest)=0 
WriteFloat file,0;ObjectYaw2(Dest)=0 
WriteFloat file,0;ObjectRoll2(Dest)=0 

WriteFloat file,0;ObjectXGoal(Dest)=0 
WriteFloat file,0;ObjectYGoal(Dest)=0 
WriteFloat file,0;ObjectZGoal(Dest)=0 

WriteInt file,0;ObjectMovementType(Dest)=0 
WriteInt file,0;ObjectMovementTypeData(Dest)=0 
WriteFloat file,.05;ObjectSpeed(Dest)=0 
WriteFloat file,.48;ObjectRadius(Dest)=0 
WriteInt file,1;ObjectRadiusType(Dest)=0 

WriteInt file,50;ObjectCollisionPower(Dest)=0 

WriteFloat file,0;ObjectPushDX(Dest)=0 
WriteFloat file,0;ObjectPushDY(Dest)=0 

WriteInt file,0;ObjectAttackPower(Dest)=0 
WriteInt file,0;ObjectDefensePower(Dest)=0 
WriteInt file,1;ObjectDestructionType(Dest)=0 

WriteInt file,-1;ObjectID(Dest)=-1 
WriteInt file,470; ObjectType(Dest)=0 
WriteInt file,0;ObjectSubType(Dest)=0 

WriteInt file,1001;ObjectActive(Dest)=0 
WriteInt file,0;ObjectLastActive(Dest)=0 
WriteInt file,0;ObjectActivationType(Dest)=0 
WriteInt file,0;ObjectActivationSpeed(Dest)=0 

WriteInt file,0;ObjectStatus(Dest)=0 
WriteInt file,0;ObjectTimer(Dest)=0 
WriteInt file,0;ObjectTimerMax1(Dest)=0 
WriteInt file,0;ObjectTimerMax2(Dest)=0 

WriteInt file,True;ObjectTeleportable(Dest)=False 
WriteInt file,True;ObjectButtonPush(Dest)=False 
WriteInt file,10;ObjectWaterReact(Dest)=0 

WriteInt file,False;ObjectTelekinesisable(Dest)=0 
WriteInt file,False;ObjectFreezable(Dest)=0 

WriteInt file,True;ObjectReactive(Dest)=True 

WriteInt file,-1;ObjectChild(Dest)=-1 
WriteInt file,-1;ObjectParent(Dest)=-1 

WriteInt file,6 
WriteInt file,1 
For k=2 To 9 
WriteInt file,0;ObjectData(Dest,k)=0 
Next 
For k=0 To 3 
WriteString file,"";ObjectTextData(Dest,k)="" 
Next 

WriteInt file,0	;Talkable with Dialog #1 
WriteInt file,0	;Current Anim 
WriteInt file,0	;StandardAnim 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,50	; movementspeed 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 
WriteInt file,0 

WriteFloat file,0 
WriteFloat file,0 
WriteFloat file,0 
WriteFloat file,0 
WriteFloat file,0 

WriteFloat file,0 
WriteFloat file,0 
WriteFloat file,0 
WriteFloat file,0 
WriteFloat file,0 
WriteString file,"" 
WriteString file,"" 



WriteString file,"Data0" ; distance 
WriteString file,"Data1" ; speed 


CloseFile file 

End
Strangely this doesn't seem to cover our recent parameter 46/47 discoveries.
"Let us return to the past; it will be progress."
by Giuseppe Verdi
Caton
Rainbow Master
Posts: 674
Joined: Sat Sep 27, 2014 7:18 pm

Post by Caton » Sun Feb 07, 2016 6:48 pm

he forgot the others like freeze timer and ghost effect.
User avatar
Pawelec
Rainbow Master
Posts: 690
Joined: Tue Jul 15, 2008 8:37 am

Post by Pawelec » Sun Feb 07, 2016 11:07 pm

Caton wrote:he forgot the others like freeze timer and ghost effect.
Caton, this is an original code snippet from MS, if something is not there then it's not directly named in that part of the code. It may be named somewhere else or function without being named.
"Let us return to the past; it will be progress."
by Giuseppe Verdi
Post Reply