FANDOM


Supported In:
C D/S/W W-CD
? ? ?

The scripting command SetVar has the opcode (0x1B).

Arguments

  • Byte - Variable ID
  • Byte - New Value
  • Byte - New Value [optional]
  • Byte - New Value [optional]
  • Byte - New Value [optional]


Description

Sets a game variable. Variables can be character (race, sex, or temporary age) or party (gold, gems, or date/time) specific. Most variables take a single byte, but some take two or four. Note the chart below. The variable is applied to the currently selected character (for example, by WhoWill or SetChar) or to all if selected character is 0 or 8.

Notes

For those arguments that take 2 or 4 values, watch the endianess. ie, 0x10 0xA0 0x86 0x01 = 0x0186A0 Experience = 100'000 Experience. Also, the set_nothings can probably be expanded and implemented in future games, if needed.

TypeArgumentsDescription
0x00 1 set_nothing
0x01 1 set_nothing
0x02 1 set_nothing
0x03 1 setSex
0x04 1 setRace
0x05 1 setClass
0x06 1 set_nothing
0x07 1 set_nothing
0x08 1 setCurHp
0x09 1 setCurSp
0x0A 1 setAcTemp2
0x0B 1 setLevelTemp
0x0C 1 setAgeTemp
0x0D 1 set_nothing
0x0E 1 set_nothing
0x0F 1 set_nothing
0x10 4 setExperience
0x11 1 setEpPoison
0x12 1 *unknown*
0x13 1 set_nothing
0x14 1 set_nothing
0x15 1 set_nothing
0x16 1 set_nothing
0x17 1 set_nothing
0x18 1 set_nothing
0x19 2 setMinutes
0x1A 1 set_nothing
0x1B 1 set_nothing
0x1C 1 set_nothing
0x1D 1 set_nothing
0x1E 1 set_nothing
0x1F 1 set_nothing
0x20 1 set_nothing
0x21 1 set_nothing
0x22 4 setGold
0x23 2 setGems
0x24 1 set_nothing
0x25 1 setMgtTemp
0x26 1 setIntTemp
0x27 1 setPersTemp
0x28 1 setEndTemp
0x29 1 setSpdTemp
0x2A 1 setAccTemp
0x2B 1 setLuckTemp
0x2C 1 set_nothing
0x2D 1 setMgtBase
0x2E 1 setIntBase
0x2F 1 setPersBase
0x30 1 setEndBase
0x31 1 setSpdBase
0x32 1 setAccBase
0x33 1 setLuckBase
0x34 1 setChFireBase
0x35 1 setChElecBase
0x36 1 setChColdBase
0x37 1 setChPoisBase
0x38 1 setChEnrgBase
0x39 1 setChMagBase
0x3A 1 setChFireTemp
0x3B 1 setChElecTemp
0x3C 1 setChColdTemp
0x3D 1 setChPoisTemp
0x3E 1 setChEnrgTemp
0x3F 1 setChMagTemp
0x40 1 setLevelBase
0x41 1 setFood
0x42 1 set_nothing
0x43 1 set_nothing
0x44 1 set_nothing
0x45 1 setLevitate
0x46 1 setLight
0x47 1 setEpFire
0x48 1 setEpElec
0x49 1 setEpCold
0x4A 1 *unknown*
0x4B 1 set_nothing
0x4C 1 *unknown*
0x4D 1 setAcTemp
0x4E 1 set_nothing
0x4F 1 setWizardEyeOn
0x50 1 set_nothing
0x51 1 set_nothing
0x52 1 set_nothing
0x53 1 *unknown*
0x54 1 *unknown*
0x55 1 setYear
0x56 1 set_nothing
0x57 1 set_nothing
0x58 1 set_nothing
0x59 1 set_nothing
0x5A 1 set_nothing
0x5B 1 set_nothing
0x5C 1 set_nothing
0x5D 1 set_nothing
0x5E 1 setWalkOnWater

TODO: What do 0x12, 0x4A, 0x4C, 0x53, and 0x54 set?

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.