https://rpg.hamsterrepublic.com/ohrrpgce/api.php?action=feedcontributions&user=Bob+the+Hamster&feedformat=atomOHRRPGCE-Wiki - User contributions [en]2024-03-29T08:34:40ZUser contributionsMediaWiki 1.39.7https://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=SandBox&diff=34904SandBox2024-01-20T01:04:07Z<p>Bob the Hamster: remove successful test edit</p>
<hr />
<div>This is a page you can use to practice editing.<br />
See also the [[Help:Contents|Help]] article.<br />
<br />
----<br />
<br />
==Header==<br />
<br />
To make a link, simply put something in double-brackets like this: [[Main_Page]]<br />
<br />
To make a link with special link text, do this: [[Main_Page|go to the main page]]<br />
<br />
<!-- you can make comments that only show up in edit-mode by encolsing them in silly looking brackets like this --><br />
<br />
<!-- Here is an example screenshot --><br />
[[Image:Wander2.png|thumb|A battle from Wandering Hamster]]<br />
<br />
==Another Header==<br />
<br />
* this is a bullet list<br />
* yep, bullet lists are cool<br />
* we like bullet lists<br />
** it is also easy to nest bullet lists<br />
<br />
==Yet another Header==<br />
<br />
Put script examples inside the &lt;pre&gt; tag<br />
<br />
<pre><br />
script, example script, begin<br />
show text box (5)<br />
wait for text box<br />
end<br />
</pre><br />
<br />
===Don't forget Sub-Headers!===<br />
You can do tables too, but it's complicated:<br />
<br />
{|<br />
! One Header || Two header<br />
|-<br />
| style="color:red" | Red cell || style="color:blue" | Blue cell<br />
|}<br />
<br />
----<br />
<br />
To add a page to a category, use a link that starts with the magic word '''Category'''<br />
[[Category:Wiki Help]]<br />
<br />
----<br />
汉字,可以吗?<br />
Unicode appears to work...<br />
<br />
----<br />
ဂ်မ္း က်င့္ ဘို<br />
Burmese, however, is somewhat iffy.<br />
<br />
<!-- Don't forget to use the "Show Preview" button to make sure you got things right before you save! --></div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=SandBox&diff=34903SandBox2024-01-20T01:03:27Z<p>Bob the Hamster: test edit</p>
<hr />
<div>This is a page you can use to practice editing.<br />
See also the [[Help:Contents|Help]] article.<br />
<br />
----<br />
test edit after upgrade<br />
==Header==<br />
<br />
To make a link, simply put something in double-brackets like this: [[Main_Page]]<br />
<br />
To make a link with special link text, do this: [[Main_Page|go to the main page]]<br />
<br />
<!-- you can make comments that only show up in edit-mode by encolsing them in silly looking brackets like this --><br />
<br />
<!-- Here is an example screenshot --><br />
[[Image:Wander2.png|thumb|A battle from Wandering Hamster]]<br />
<br />
==Another Header==<br />
<br />
* this is a bullet list<br />
* yep, bullet lists are cool<br />
* we like bullet lists<br />
** it is also easy to nest bullet lists<br />
<br />
==Yet another Header==<br />
<br />
Put script examples inside the &lt;pre&gt; tag<br />
<br />
<pre><br />
script, example script, begin<br />
show text box (5)<br />
wait for text box<br />
end<br />
</pre><br />
<br />
===Don't forget Sub-Headers!===<br />
You can do tables too, but it's complicated:<br />
<br />
{|<br />
! One Header || Two header<br />
|-<br />
| style="color:red" | Red cell || style="color:blue" | Blue cell<br />
|}<br />
<br />
----<br />
<br />
To add a page to a category, use a link that starts with the magic word '''Category'''<br />
[[Category:Wiki Help]]<br />
<br />
----<br />
汉字,可以吗?<br />
Unicode appears to work...<br />
<br />
----<br />
ဂ်မ္း က်င့္ ဘို<br />
Burmese, however, is somewhat iffy.<br />
<br />
<!-- Don't forget to use the "Show Preview" button to make sure you got things right before you save! --></div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34783DT62023-09-11T20:03:10Z<p>Bob the Hamster: Target classes: "all-including-dead" "dead foe (heroes only)" and "foe-including-dead"</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br><br />
14 = all-including-dead<br><br />
15 = dead foe (heroes only)<br><br />
16 = foe-including-dead<br><br />
17 = Spawned by last attack<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||33: Exclude this attack from hero auto-battle {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (46)||34-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{WIP|inline}}<br />
|-<br />
|349||INT (1)|| change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default {{WIP|inline}}<br />
|-<br />
|350||INT (1)|| change target's defector target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default {{WIP|inline}}<br />
|-<br />
|351||INT (1)|| change target's flipped sprite status - 0=no change, 1=flipped, 2=unflipped, 3=set to default {{WIP|inline}}<br />
|-<br />
|352||INT (1)|| Spawn an enemy if there is room (0 for none or enemy ID+1) {{WIP|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34782DT62023-09-11T19:59:23Z<p>Bob the Hamster: "Spawned by last attack" target class</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br><br />
14 = Spawned by last attack<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||33: Exclude this attack from hero auto-battle {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (46)||34-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{WIP|inline}}<br />
|-<br />
|349||INT (1)|| change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default {{WIP|inline}}<br />
|-<br />
|350||INT (1)|| change target's defector target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default {{WIP|inline}}<br />
|-<br />
|351||INT (1)|| change target's flipped sprite status - 0=no change, 1=flipped, 2=unflipped, 3=set to default {{WIP|inline}}<br />
|-<br />
|352||INT (1)|| Spawn an enemy if there is room (0 for none or enemy ID+1) {{WIP|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Ohrrpgce_config.ini&diff=34781Ohrrpgce config.ini2023-09-10T19:11:18Z<p>Bob the Hamster: prompt_when_moving_hero_origin_on_the_same_map</p>
<hr />
<div>{{DISPLAYTITLE:ohrrpgce_config.ini}}<br />
<br />
{{WIP}}<br />
(This documents the upcoming [[ichorescent]] release. See [https://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Ohrrpgce_config.ini&oldid=34146 previous version] for the current stable release, [[hróðvitnir]], which acted quite different.)<br />
<br />
'''ohrrpgce_config.ini''' and '''gameconfig.ini'' are text files which contain remembered global configuration settings for both [[Custom]] and [[Game]], such as the things you can edit in the Map Editor Settings menu, like cursor movement speed. There are also various settings that can't be changed except by manually editing the files with a text editor.<br />
<br />
Game-specific settings and overrides for global settings are stored in a separate [[gameconfig.ini]] file for each game (which is documented in this article too). Also, [[Game]] stores some game-specific data in [[persist.reld]].<br />
<br />
=Location=<br />
If a file called ohrrpgce_config.ini exists in the same directory as the application (e.g. ohrrpgce-custom/ohrrpgce-game/custom.exe/game.exe/OHRRPGCE-Game.app, etc) then it's used. If it doesn't then [[settings_dir]]/ohrrpgce_config.ini is used instead, and created if it doesn't exist.<br />
<br />
After loading <gamename>.rpg, Game/Custom check for a file named <tt><gamename>_config.ini</tt> in the same directory as the .rpg (or next to the .app bundle on Mac when running a bundled game). If it doesn't exist, [[settings_dir]]/<gamename>/gameconfig.ini is used instead, and created if it doesn't exist.<br />
<br />
If there are two ohrrpgce_config.ini files or two gameconfig.ini files (in the locations mentioned above), only one is used, the other is ignored.<br />
<br />
Regardless of what the game-specific file is called, for the rest of this article it's referred to as '''gameconfig.ini'''.<br />
<br />
In the in-game '''F8 Debug Menu''' and '''F9 Global Settings menu''' in Custom are options to view/edit ohrrpgce_config.ini and gameconfig.ini. That's the easiest way to access files in setting_dir.<br />
<br />
=Format and usage=<br />
Each line is a separate setting and takes the form '''key = value''', where whitespace around the '''=''' are ignored (but not permitted before the key). Keys are case-insensitive. Lines in the file that aren't recognised (such as comments but also unrecognised key=value lines) will be ignored and preserved by the engine when modifying the file.<br />
<br />
The type of a value can be either ''bool'' (true or false), ''int'' (integer), ''float'' (a fractional number), ''string'' (text), or special types.<br />
A ''bool'' can be any number (nonzero is true) or any of the strings ''yes, no, true, false, on, off'' (case-insensitive, e.g. ''Yes'' works too).<br />
<br />
For organisation the key names are typically split into multiple components joined by '''.''', such as <tt>gfx.gfx_directx.backend_screenshot</tt>. All the components must be included.<br />
<br />
==App-specific settings==<br />
<br />
Each ''key'' may also include an optional '''prefix''' which makes the setting only apply to Game or Custom<br />
* '''game.''' : applies only to Game<br />
* '''edit.''' : applies only to Custom<br />
The most specific setting found is used, regardless of the order it appears in the file.<br />
<br />
For example, a file containing the lines <tt>edit.gfx.backend=sdl2</tt> and <tt>gfx.backend = directx</tt> (in either order) causes Game to run with gfx_directx and Custom to use gfx_sdl2.<br />
<br />
==Game-specific settings==<br />
Any time a setting is looked up, gameconfig.ini is checked first, first for a app-specific value, and then for a global value. If neither are there, ohrrpgce_config.ini is checked, first app specific, then global. Finally, a default value is used. <br />
<br />
For example, you can set <tt>gfx.screenshot_dir = screenshots</tt> in ohrrpgce_config.ini, to put all screenshots into a subdirectory called ''screenshots'' next to the current .rpg, while <tt>gfx.screenshot_dir = screenshots</tt> in a specific gameconfig.ini file only affects one game.<br />
<br />
Note that a lot of graphics related settings like ''gfx.backend'' don't cause Game/Custom to do anything when loading that game, because they only check the setting when starting up.<br />
<br />
==Writing settings==<br />
<br />
When Game/Custom write a setting (most commonly after you edit it in a Settings menu) they usually look up the setting as described above, and then overwrite it, and if it doesn't exist they save it to ohrrpgce_config.ini as a global (maximally-general Game+Custom shared) setting. So if you manually create a more specific setting they will from then on modify that instead of writing a global value.<br />
<br />
However a few settings, those documented at [[#Always game-specific]] are always saved in gameconfig.ini with the ''game.'' prefix.<br />
<br />
=Available settings=<br />
Not all of the settings can be edited from within Game/Custom, requiring you to edit the text file manually (creating it if necessary) if you want to change them.<br />
<br />
Note this list is sometimes out of date, and not all defaults are documented.<br />
<br />
==Shared settings==<br />
<br />
Settings respected by both Game and Custom.<br />
<br />
* '''gfx.backend''': The default graphics [[backend]]. Valid options currently include ''alleg'', ''directx'', ''fb'', ''sdl'', ''sdl2'', ''console''. Note that this is currently not re-applied after loading a game, so this setting is ignored in gameconfig.ini.<br />
* '''gfx.gfx_''$backend''.backend_screenshot''': ''bool'' (Default true.) Whether to take screenshots using the backend's own capability. Only offered by gfx_directx: takes a screenshot of the window as it actually appears, rather than what the engine presented. s<br />
* '''gfx.gfx_sdl2.render_driver''': Name of a render driver to use (see g/c_debug.txt for list of available ones). Likely possibilities include ''opengl'', ''opengles'', ''opengles2'', ''direct3d'', ''direct3d11'', ''software''. Affects vsync and startup time, but not actual rendering speed. {{WIP|inline}}<br />
* '''gfx.screenshot_dir''': Directory in which to put screenshots or .gifs. Can be a relative path (from the .rpg or whereever they're put by default) {{WIP|inline}}<br />
* '''gfx.screenshot_format''': File format for F12 screenshots. One of ''png'', ''bmp'', or ''gif''. (Overridden by '''gfx.gfx_$backend.backend_screenshot''<br />
* '''gfx.resolution_w''': ''int'' (default 480 in Custom, 320 in Game) Size of the window (remembered when quitting). In Game this is only used for the size of the .rpg browser. Like gfx.backend a game-specific setting is never read/written.<br />
* '''gfx.resolution_h''': ''int'' (default 320 in Custom, 200 in Game) See above.<br />
* '''gfx.zoom''': ''int'' (default 2) Scaling factor of the window. Like gfx.backend a game-specific setting is never read/written.<br />
* '''sliceedit.show_positions''': ''bool'' (default false) Show position of each slice in slice tree menu<br />
* '''sliceedit.show_root2''': ''bool'' (default true) Whether to show the collection root slice in the slice tree (replaces obsolete '''sliceedit.show_root''')<br />
* '''sliceedit.show_sizes''': ''bool'' (default false) Show size of each slice in slice tree menu<br />
<br />
==Custom-only==<br />
<br />
Settings (currently) only used by Custom. They normally aren't written with an ''edit.'' prefix. Adding that prefix would make no difference.<br />
<br />
* '''formedit.preview_music''': ''bool'' (default false)<br />
* '''idle_time''': ''int'' (default 30). Number of seconds of doing nothing before Custom stops increasing the Editing Time in the game stats<br />
* '''mapedit.cursor_follows_mouse''': ''bool''<br />
* '''mapedit.draw_npcs_overlaid''': ''int'': 0: Never, 1: Always, 2: In NPC mode only<br />
* '''mapedit.grid_color''': Either RGB triple like '''rgb(100,255,127)''' or a master palette index like '''14'''<br />
* '''mapedit.mouse_pan_multiplier''': ''float'' in range 1.0 to 5.0, default 1.0.<br />
* '''mapedit.per-tileset_current_tile''': ''bool''<br />
* '''mapedit.preview_with_minimaps''': ''bool'' (default true)<br />
* '''mapedit.shadows_when_skewing''': ''bool''<br />
* '''mapedit.shift_speed_x''': ''int''<br />
* '''mapedit.shift_speed_y''': ''int''<br />
* '''mapedit.show_grid''': ''bool'' Show the tile grid<br />
* '''mapedit.show_hero''': ''bool'' Show starting location of the hero in new games<br />
* '''mapedit.prompt_when_moving_hero_origin_on_the_same_map''': ''bool'' Prompt when moving hero origin on the same map<br />
* '''mapedit.show_npcs''': ''int'': 0: Off, 1: All, 2: Not Tag-conditional<br />
* '''mapedit.show_overhead''': ''bool'' (default true)<br />
* '''mapedit.tile_animations_enabled''': ''bool''<br />
* '''mapedit.wall_style''': ''0'': ants, ''1'': outlined, ''2'': pulse<br />
* '''mapedit.wall_thickness''': ''int'' (default 2) pixels thickness to draw the walls<br />
* '''show_quit_msg''': ''bool'' (Default true). If false, do not pop up a warning message about saving the game when quitting.<br />
* '''thingbrowser.enable_top_level''': ''bool'' defaults to YES. If NO, don't use the graphical thingbrowsers for items, etc. Useful on very slow computers.<br />
<br />
== Game-only ==<br />
<br />
Settings only used by Game.<br />
<br />
Currently, all Game-only settings are game-specific:<br />
<br />
== Always game-specific ==<br />
<br />
These settings are special in that Game will always write them to gameconfig.ini and with a ''game.'' prefix. (If a more general setting exists, e.g. without game. prefix it will be read the first time, then shadowed once Game writes the more specific one.)<br />
<br />
* '''gfx.margin''': ''int'' (default 8 on consoles, 0 elsewhere) Remembers the value of the TV safe margins option in the main menu. Interpreted as a percentage. Only used on consoles.<br />
* '''gfx.fullscreen''': ''bool'' Remembers the last fullscreen/windowed state of the game. If true, start the game in fullscreen. If missing, use the default specified in Custom.<br />
:: If "rungame fullscreen state: shared" is set, then only gfx.fullscreen from the gameconfig.ini file of the "master" (initially run) .rpg file is read/written, not the current .rpg switched to by {{plot|run game}}.<br />
<br />
<br />
The [[persist.reld]] [[RELOAD]] document is saved alongside gameconfig.ini in [[settings_dir]] and is a better place to store more complex structured data.<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=System_Requirements&diff=34779System Requirements2023-09-05T21:13:20Z<p>Bob the Hamster: /* Known to work */ MacOS 10.9 or newer</p>
<hr />
<div>__NOTOC__<br />
[[Image:98kaiju.gif|thumb|right|This one does the job!]]<br />
The system requirements for the [[OHRRPGCE]] are low, very low. It is neither hungry for memory nor hungry for processor cycles, nor demanding on your graphics card. It should run fine on even old crusty computers. The minimum CPU requirement for the typical game is approximately a 400MHz Pentium 2, and in the ballpark of 20-30MB of free memory, though some OHRRPGCE games (mainly those that aren't RPGs) will have far higher requirements: a Pentium 3 or 4 or better is recommended.<br />
<br />
The OHRRPGCE is known to work on the following operating systems:<br />
<br />
===Known to work===<br />
* Windows: all 32-bit and 64-bit versions, including [[Windows 9x Notes|95, 98, ME]], 2000, XP, Vista, 7, 8, 10<br />
** Support for Windows 95, 98, ME was (re-)added in [[fufluns]]<br />
* Mac OS X (10.9+ expected to work. Old PowerPC Macs not supported)<br />
** Older non-64-bit Macs (before roughly 2009) require using the 32-bit Mac app, which is not the default. Mac OS 10.9-10.14 can run both the 32-bit or 64-bit apps.<br />
* Linux distributions since ~2010, x86, x86_64, ARM or ARM64 (Debian, Ubuntu, Redhat/Fedora, Slackware...)<br />
** See [[Linux Notes]]/[[Linux library requirements]]<br />
** We don't provide binaries for ARM, but the OHRRPGCE works on [https://www.raspberrypi.org Raspberry Pi] if you compile it yourself<br />
* Android 2.3+ (see also [[Specific android device testing]])<br />
* [http://www.freebsd.org/ FreeBSD] (No binaries provided. See [[Compiling]])<br />
* [http://www.reactos.org/ ReactOS] (see [https://jira.reactos.org/browse/CORE-11050 this post])<br />
<br />
===Probably Working, but needs verification===<br />
* Other BSDs<br />
<br />
===Not Supported===<br />
* BeOS/Haiku<br />
* Android 2.2 or earlier. (Before [[fufluns]], Android 1.6-2.2 were supported)<br />
* [[DOS]] (Support was dropped in 2006, and you can still [[DOS|download that version]])<br />
<br />
=See Also=<br />
* [[OHRRPGCE Source Ports]]<br />
<br />
[[Category:Questions]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Music_and_Sound_Utilities&diff=34570Music and Sound Utilities2022-10-26T19:56:44Z<p>Bob the Hamster: chiptone does not require flash like bfxr does</p>
<hr />
<div>__NOTOC__<br />
=MP3/OGG Music=<br />
* [[Audacity]] Open Source Windows/Linux/Mac Sound Editor<br />
* [http://en.wikipedia.org/wiki/LMMS LMMS] Open source synthesizer and sequencer. Available for Linux, BSD, MacOSX and Windows. Large built in set of instruments; Variety of synthesizers; Wavetable synthesis, SoundFont, VST, LADSPA, and MIDI-in support. Renders to MP3 or OGG, among other formats.<br />
* If you want to convert MOD music to OGG/MP3, several mod players support a 'wav' output driver which dumps the sampled music to wav, which you can then encode into the desired format. If your soundcard has a 'capture' channel, you may also be able to capture the audio output as it's playing, via Audacity; You'll probably have to manually select the Capture channel as the mic input device for this to work.<br />
* [http://csounds.com/ Csound] Extremely powerful open source synthesizer, sequencer, and more. Cross-platform.<br />
* [http://sox.sourceforge.net/ SoX] A command-line program to convert and apply effects to sound files of various formats. "The Swiss Army knife of sound processing programs". Cross-platform.<br />
<br />
=Sound Effects=<br />
* [http://www.imitationpickles.org/ludum/2007/12/13/sfxr-sound-effects-for-all/ sfxr] provides a simple sound generation system that is capable of producing almost any simple 8bit style sound effect; For more complex sound effects you can combine sound effects with your sound editor.<br />
* [http://www.bfxr.net/ bfxr], and 'elaborated'/extended flash based version<br />
* [https://sfbgames.itch.io/chiptone chiptone] Sound effect generating tool (browser based, HTML5)<br />
* [http://labbed.net/software/labchirp/ LabChirp] is a free program for Windows (and Mono?) for creating sound effects with lots of features<br />
* It's also possible to use a tracker like FamiTracker to create sound effects!<br />
* Use one of the tools in the above section to edit your sound effects files as necessary<br />
<br />
=MOD Music=<br />
* [https://openmpt.org/download Openmpt] Free windows program (works well on linux and mac using [https://www.winehq.org/ wine]). Can be as simple or complex as you need it to be.<br />
* [http://www.milkytracker.org/ MilkyTracker] Open source, Linux/BSD/MacOSX/Windows/(other platforms. Intended as a FastTracker 2 clone, so best for composing .XMs. Imports a wide range of formats, exports MOD, XM, or WAV (so can be used to help convert modules to MP3/OGG format). Supports MIDI input. Note that the MilkyTracker's mod playback is fairly inaccurate.<br />
* [[AmigaMML]] Open source, cross-platform. Exports MOD and XM formats. Compose music using Music Macro Language.<br />
<br />
=MIDI Music=<br />
<br />
* [[Anvil Studio]] Shareware Windows MIDI composer<br />
* [[Rosegarden]] Open Source GNU/Linux MIDI composer<br />
* [http://ariamaestosa.sourceforge.net/download.html Aria Maestosa], a MIDI editor which covers all basic needs and has a simple interface. Has various editors including percussion and score editors.<br />
* [https://openmidiproject.osdn.jp/Sekaiju_en.html Sekaiju] A free and open source midi editor for creating and editing midi data on Windows. <br />
* [http://en.wikipedia.org/wiki/List_of_MIDI_editors_and_sequencers A list of MIDI sequencers]<br />
* Add more!<br />
<br />
=[[BAM]] Music=<br />
<br />
* [[Playbam]] two totally different BAM playback programs<br />
* [[Notate]] write BAM sheet music<br />
* [[MIDI2BAM]] convert MID files to BAM files<br />
* [http://hamsterrepublic.com/ohrrpgce/nightly/bam2mid.zip BAM2MID] is used internally by the OHR to play BAM as MIDIs<br />
* [[Stephanie's PC Piano]] play your keyboard like a piano<br />
* [[ABE (Amazing BAM Extractor)]] extract BAM music from an RPG file<br />
* [[VDMSound]] DOS sound compatibility<br />
* [[BAM Developer's Kit]] for programmers who want to work with BAM<br />
* [[ohrtool1|BAMTOVGM]] convert BAM files to VGM files<br />
<br />
=Other=<br />
* [http://www.drpetter.se/project_musagi.html Musagi], by Dr. Petter of [[Where can I find sound effects?|sfxr]] fame, is a tracker somewhat like ModPlug, but with more flexibility. Can be used to create NES- and Commodore 64-like chippy songs, or full fledged songs, which can be saved to WAVs. Use Audacity or SoX to convert to .ogg. [http://www.drpetter.se/tutorial_musagi1.html Here's a good tutorial for beginners.]<br />
<br />
* [http://tones.wolfram.com/generate/ Wolfram Tones] Can generate surprisingly good random music based on genre, which you can then tweak with a set of included online tools.<br />
<br />
* [http://online.boscaceoil.net/ Bosca Ceoil] is a very easy to use music editor that can be used right in your browser<br />
<br />
* [https://www.warmplace.ru/soft/sunvox/ Sunvox] is a multi-platform powerful modular synthesis with a tracker interface that exports to WAVs.<br />
<br />
* [https://github.com/nyanpasu64/j0CC-FamiTracker/releases/ Famitracker] is a windows only tracker for NES chiptune.<br />
<br />
* [https://battleofthebits.org/lyceum/ The Battle of the Bits lyceum] has learning resources and links to various music software.<br />
<br />
=See Also=<br />
* [[What are the advantages and drawbacks of the different music programs?]]<br />
<br />
[[Category:Music]]<br />
[[Category:Sound Effects]]<br />
[[Category:Extra Tools]]<br />
[[Category:Resources]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34568DT62022-10-24T00:14:45Z<p>Bob the Hamster: spawn an arbitrary enemy with an attack</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||33: Exclude this attack from hero auto-battle {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (46)||34-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{WIP|inline}}<br />
|-<br />
|349||INT (1)|| change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default {{WIP|inline}}<br />
|-<br />
|350||INT (1)|| change target's defector target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default {{WIP|inline}}<br />
|-<br />
|351||INT (1)|| change target's flipped sprite status - 0=no change, 1=flipped, 2=unflipped, 3=set to default {{WIP|inline}}<br />
|-<br />
|352||INT (1)|| Spawn an enemy if there is room (0 for none or enemy ID+1) {{WIP|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Game:Wandering_Hamster&diff=34502Game:Wandering Hamster2022-09-22T17:28:31Z<p>Bob the Hamster: </p>
<hr />
<div>__NOTOC__<br />
{| class="toccolours" cellpadding="4" style="border: 1px solid #999999; float: right; margin: 0 0 1em 1em; width: 22em; border-collapse: collapse; font-size: 95%;"<br />
| align="center" colspan=2 bgcolor="#ccccff" style="font-size:110%; border: 1px solid #999999;" | '''Wandering Hamster'''<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" | [[Image:Wandering hamster.png]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Developer(s)'''<br />
| style="border: 1px solid #999999; width:14em" | [[James Paige]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Release date'''<br />
| style="border: 1px solid #999999;" | First Demo 1997<br>Current Demo 2022-09-22<br>Final Release TBD<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Genre'''<br />
| style="border: 1px solid #999999;" | RPG<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''License'''<br />
| style="border: 1px solid #999999;" | [[GPL]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Download'''<br />
| style="border: 1px solid #999999; width:14em" | <br />
[https://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br><br />
[https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" bgcolor="#ccccff" | '''[[/credits|Credits]]''' | '''[[/soundtrack|Soundtrack]]''' | '''[[/secrets|Secrets]]''' | '''[[/development|Development]]''' | '''[[/bugs|Bugs]]'''<br />
|}<br />
<br />
<br />
Lord Hasim has been overthrown, plips run rampant, and a menacing evil lurks in the shadows... or is it a cactus? What hamster is spiffy enough to save the world? Bob!<br />
<br />
'''Wandering Hamster''' is the [[OHRRPGCE]] game developed by OHRRPGCE's developer [[James Paige]]. It is occasionally referred to in examples.<br />
<br />
=Downloads=<br />
<br />
* Get it from itch.io https://bob-the-hamster.itch.io/wander<br />
* [https://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br />
* [https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
<br />
You can also find a multitude of other downloadable [[OHRRPGCE]] games by many different authors [[Where can I find games?|here]]<br />
<br />
=Characters=<br />
===Bob the Hamster===<br />
[[Image:Bob.png |left]]<br />
Bob is our protagonist. He is a freelance (unemployed) monster-hunter and adventurer. He is a citizen of the town of Flanat, and the eldest son of the ''The Hamster'' family.<br />
<br style="clear: left" /><br />
<br />
===Misa DuHamstre===<br />
[[Image:Misa portrait.png|left]]<br />
Misa is Bob's friend, and a respected citizen of the town of Flanat. She is a bubble mage, an ancient and proud magical tradition which involves... bubbles.<br />
<br style="clear: left" /><br />
<br />
===Lord Hasim & Lord Broaste===<br />
[[Image:Hasim-and-broaste.png|left]]<br />
Lord Hasim is the ruler of the Kingdom of Flanat, and Lord Broaste is the ruler of the kingdom of Broastia on the other side of the mountain. The two are rivals, but an uneasy peace has been maintained between the two nations for many years.<br />
<br style="clear: left" /><br />
<br />
===Dusty===<br />
[[Image:Dusty.png|left]]<br />
Dusty is a wiener dog, and a male fashion model. To avoid his (largely imaginary) fans, he lives alone in a cottage by the sea.<br />
<br style="clear: left" /><br />
<br />
===Skeppio & Rathmara===<br />
[[Image:Skeppio-and-rathmara.png|left]]<br />
Skeppio and Rathmara are cats from the city-state of Ixnekolan. They are brother and sister. Normally cats don't like hamsters, but these two seem willing enough to work together with Bob.<br />
<br style="clear: left" /><br />
<br />
===Gisli Bearbreaker===<br />
[[Image:Gisli.png|left]]<br />
Gisli the Viking is a proud warrior from a distant land. He isn't very bright (or hygienic) but he is a good fellow to have around in a fight.<br />
<br style="clear: left" /><br />
<br />
===Captain Icefeather===<br />
[[Image:Icefeather.png|left]]<br />
Captain Icefeather is the daring and dangerous captain of the Unlucky Tortoise. If you make an enemy to her, you make an enemy of her whole crew-- but the same goes for friendship!<br />
<br />
=Future Plans=<br />
As you may have noticed, if you played far enough, Wandering Hamster is not a complete game yet. The story dead-ends shorty after you acquire the ship. You can wander the world and revisit old places, but the next important plot-quest has not been added yet.<br />
<br />
=How You Can Help=<br />
<br />
* Playtesting<br />
* Reporting bugs<br />
* Balance and difficulty issues (which enemies are too strong, too weak, too boring)<br />
* Improvements on existing pixel art<br />
* New pixel art in keeping with the theme of the game<br />
* [[/soundtrack|Music]] composition and remixes<br />
* Bribe James to keep working on it at https://www.patreon.com/Bob_the_Hamster<br />
<br />
See the [[/development|Development]] page for more info.<br />
<br />
<br />
==See Also==<br />
* [[Can I make my own version of Wandering Hamster?]]<br />
* [[Will Wandering Hamster ever be updated?]]<br />
* [https://bob-the-hamster.itch.io/wander Itch.io page for Wandering Hamster]<br />
* [https://www.slimesalad.com/forum/viewtopic.php?t=7046 Development Thread @ Slimesalad]<br />
* [https://www.slimesalad.com/forum/viewtopic.php?p=7355#7355 Wandering Hamster game page @ Slime Salad]<br />
* [http://www.youtube.com/view_play_list?p=9DFF0981C8BCB2B6 Let's Play Wandering Hamster (Youtube Walkthrough)]<br />
<br />
[[Category:Hamster Republic]]<br />
[[Category:Games]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Game:Wandering_Hamster&diff=34501Game:Wandering Hamster2022-09-22T17:28:10Z<p>Bob the Hamster: </p>
<hr />
<div>__NOTOC__<br />
{| class="toccolours" cellpadding="4" style="border: 1px solid #999999; float: right; margin: 0 0 1em 1em; width: 22em; border-collapse: collapse; font-size: 95%;"<br />
| align="center" colspan=2 bgcolor="#ccccff" style="font-size:110%; border: 1px solid #999999;" | '''Wandering Hamster'''<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" | [[Image:Wandering hamster.png]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Developer(s)'''<br />
| style="border: 1px solid #999999; width:14em" | [[James Paige]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Release date'''<br />
| style="border: 1px solid #999999;" | First Demo 1997<br>Current Demo 2022-09-22<br>Final Release TBD<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Genre'''<br />
| style="border: 1px solid #999999;" | RPG<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''License'''<br />
| style="border: 1px solid #999999;" | [[GPL]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Download'''<br />
| style="border: 1px solid #999999; width:14em" | <br />
[https://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br><br />
[https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" bgcolor="#ccccff" | '''[[/credits|Credits]]''' | '''[[/soundtrack|Soundtrack]]''' | '''[[/secrets|Secrets]]''' | '''[[/development|Development]]''' | '''[[/bugs|Bugs]]'''<br />
|}<br />
<br />
<br />
Lord Hasim has been overthrown, plips run rampant, and a menacing evil lurks in the shadows... or is it a cactus? What hamster is spiffy enough to save the world? Bob!<br />
<br />
'''Wandering Hamster''' is the [[OHRRPGCE]] game developed by OHRRPGCE's developer [[James Paige]]. It is occasionally referred to in examples.<br />
<br />
=Downloads=<br />
<br />
* get it from itch.io https://bob-the-hamster.itch.io/wander<br />
* [https://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br />
* [https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
<br />
You can also find a multitude of other downloadable [[OHRRPGCE]] games by many different authors [[Where can I find games?|here]]<br />
<br />
=Characters=<br />
===Bob the Hamster===<br />
[[Image:Bob.png |left]]<br />
Bob is our protagonist. He is a freelance (unemployed) monster-hunter and adventurer. He is a citizen of the town of Flanat, and the eldest son of the ''The Hamster'' family.<br />
<br style="clear: left" /><br />
<br />
===Misa DuHamstre===<br />
[[Image:Misa portrait.png|left]]<br />
Misa is Bob's friend, and a respected citizen of the town of Flanat. She is a bubble mage, an ancient and proud magical tradition which involves... bubbles.<br />
<br style="clear: left" /><br />
<br />
===Lord Hasim & Lord Broaste===<br />
[[Image:Hasim-and-broaste.png|left]]<br />
Lord Hasim is the ruler of the Kingdom of Flanat, and Lord Broaste is the ruler of the kingdom of Broastia on the other side of the mountain. The two are rivals, but an uneasy peace has been maintained between the two nations for many years.<br />
<br style="clear: left" /><br />
<br />
===Dusty===<br />
[[Image:Dusty.png|left]]<br />
Dusty is a wiener dog, and a male fashion model. To avoid his (largely imaginary) fans, he lives alone in a cottage by the sea.<br />
<br style="clear: left" /><br />
<br />
===Skeppio & Rathmara===<br />
[[Image:Skeppio-and-rathmara.png|left]]<br />
Skeppio and Rathmara are cats from the city-state of Ixnekolan. They are brother and sister. Normally cats don't like hamsters, but these two seem willing enough to work together with Bob.<br />
<br style="clear: left" /><br />
<br />
===Gisli Bearbreaker===<br />
[[Image:Gisli.png|left]]<br />
Gisli the Viking is a proud warrior from a distant land. He isn't very bright (or hygienic) but he is a good fellow to have around in a fight.<br />
<br style="clear: left" /><br />
<br />
===Captain Icefeather===<br />
[[Image:Icefeather.png|left]]<br />
Captain Icefeather is the daring and dangerous captain of the Unlucky Tortoise. If you make an enemy to her, you make an enemy of her whole crew-- but the same goes for friendship!<br />
<br />
=Future Plans=<br />
As you may have noticed, if you played far enough, Wandering Hamster is not a complete game yet. The story dead-ends shorty after you acquire the ship. You can wander the world and revisit old places, but the next important plot-quest has not been added yet.<br />
<br />
=How You Can Help=<br />
<br />
* Playtesting<br />
* Reporting bugs<br />
* Balance and difficulty issues (which enemies are too strong, too weak, too boring)<br />
* Improvements on existing pixel art<br />
* New pixel art in keeping with the theme of the game<br />
* [[/soundtrack|Music]] composition and remixes<br />
* Bribe James to keep working on it at https://www.patreon.com/Bob_the_Hamster<br />
<br />
See the [[/development|Development]] page for more info.<br />
<br />
<br />
==See Also==<br />
* [[Can I make my own version of Wandering Hamster?]]<br />
* [[Will Wandering Hamster ever be updated?]]<br />
* [https://bob-the-hamster.itch.io/wander Itch.io page for Wandering Hamster<br />
* [https://www.slimesalad.com/forum/viewtopic.php?t=7046 Development Thread @ Slimesalad]<br />
* [https://www.slimesalad.com/forum/viewtopic.php?p=7355#7355 Wandering Hamster game page @ Slime Salad]<br />
* [http://www.youtube.com/view_play_list?p=9DFF0981C8BCB2B6 Let's Play Wandering Hamster (Youtube Walkthrough)]<br />
<br />
[[Category:Hamster Republic]]<br />
[[Category:Games]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Game:Wandering_Hamster&diff=34500Game:Wandering Hamster2022-09-22T17:26:23Z<p>Bob the Hamster: https</p>
<hr />
<div>__NOTOC__<br />
{| class="toccolours" cellpadding="4" style="border: 1px solid #999999; float: right; margin: 0 0 1em 1em; width: 22em; border-collapse: collapse; font-size: 95%;"<br />
| align="center" colspan=2 bgcolor="#ccccff" style="font-size:110%; border: 1px solid #999999;" | '''Wandering Hamster'''<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" | [[Image:Wandering hamster.png]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Developer(s)'''<br />
| style="border: 1px solid #999999; width:14em" | [[James Paige]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Release date'''<br />
| style="border: 1px solid #999999;" | First Demo 1997<br>Current Demo 2022-09-22<br>Final Release TBD<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Genre'''<br />
| style="border: 1px solid #999999;" | RPG<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''License'''<br />
| style="border: 1px solid #999999;" | [[GPL]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Download'''<br />
| style="border: 1px solid #999999; width:14em" | <br />
[https://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br><br />
[https://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br><br />
[https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" bgcolor="#ccccff" | '''[[/credits|Credits]]''' | '''[[/soundtrack|Soundtrack]]''' | '''[[/secrets|Secrets]]''' | '''[[/development|Development]]''' | '''[[/bugs|Bugs]]'''<br />
|}<br />
<br />
<br />
Lord Hasim has been overthrown, plips run rampant, and a menacing evil lurks in the shadows... or is it a cactus? What hamster is spiffy enough to save the world? Bob!<br />
<br />
'''Wandering Hamster''' is the [[OHRRPGCE]] game developed by OHRRPGCE's developer [[James Paige]]. It is occasionally referred to in examples.<br />
<br />
=Downloads=<br />
<br />
* [https://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br />
* [https://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br />
* [https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
<br />
You can also find a multitude of other downloadable [[OHRRPGCE]] games by many different authors [[Where can I find games?|here]]<br />
<br />
=Characters=<br />
===Bob the Hamster===<br />
[[Image:Bob.png |left]]<br />
Bob is our protagonist. He is a freelance (unemployed) monster-hunter and adventurer. He is a citizen of the town of Flanat, and the eldest son of the ''The Hamster'' family.<br />
<br style="clear: left" /><br />
<br />
===Misa DuHamstre===<br />
[[Image:Misa portrait.png|left]]<br />
Misa is Bob's friend, and a respected citizen of the town of Flanat. She is a bubble mage, an ancient and proud magical tradition which involves... bubbles.<br />
<br style="clear: left" /><br />
<br />
===Lord Hasim & Lord Broaste===<br />
[[Image:Hasim-and-broaste.png|left]]<br />
Lord Hasim is the ruler of the Kingdom of Flanat, and Lord Broaste is the ruler of the kingdom of Broastia on the other side of the mountain. The two are rivals, but an uneasy peace has been maintained between the two nations for many years.<br />
<br style="clear: left" /><br />
<br />
===Dusty===<br />
[[Image:Dusty.png|left]]<br />
Dusty is a wiener dog, and a male fashion model. To avoid his (largely imaginary) fans, he lives alone in a cottage by the sea.<br />
<br style="clear: left" /><br />
<br />
===Skeppio & Rathmara===<br />
[[Image:Skeppio-and-rathmara.png|left]]<br />
Skeppio and Rathmara are cats from the city-state of Ixnekolan. They are brother and sister. Normally cats don't like hamsters, but these two seem willing enough to work together with Bob.<br />
<br style="clear: left" /><br />
<br />
===Gisli Bearbreaker===<br />
[[Image:Gisli.png|left]]<br />
Gisli the Viking is a proud warrior from a distant land. He isn't very bright (or hygienic) but he is a good fellow to have around in a fight.<br />
<br style="clear: left" /><br />
<br />
===Captain Icefeather===<br />
[[Image:Icefeather.png|left]]<br />
Captain Icefeather is the daring and dangerous captain of the Unlucky Tortoise. If you make an enemy to her, you make an enemy of her whole crew-- but the same goes for friendship!<br />
<br />
=Future Plans=<br />
As you may have noticed, if you played far enough, Wandering Hamster is not a complete game yet. The story dead-ends shorty after you acquire the ship. You can wander the world and revisit old places, but the next important plot-quest has not been added yet.<br />
<br />
=How You Can Help=<br />
<br />
* Playtesting<br />
* Reporting bugs<br />
* Balance and difficulty issues (which enemies are too strong, too weak, too boring)<br />
* Improvements on existing pixel art<br />
* New pixel art in keeping with the theme of the game<br />
* [[/soundtrack|Music]] composition and remixes<br />
* Bribe James to keep working on it at https://www.patreon.com/Bob_the_Hamster<br />
<br />
See the [[/development|Development]] page for more info.<br />
<br />
<br />
==See Also==<br />
* [[Can I make my own version of Wandering Hamster?]]<br />
* [[Will Wandering Hamster ever be updated?]]<br />
* [https://www.slimesalad.com/forum/viewtopic.php?t=7046 Development Thread @ Slimesalad]<br />
* [https://www.slimesalad.com/forum/viewtopic.php?p=7355#7355 Wandering Hamster game page @ Slime Salad]<br />
* [http://www.youtube.com/view_play_list?p=9DFF0981C8BCB2B6 Let's Play Wandering Hamster (Youtube Walkthrough)]<br />
<br />
[[Category:Hamster Republic]]<br />
[[Category:Games]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Game:Wandering_Hamster&diff=34499Game:Wandering Hamster2022-09-22T15:55:59Z<p>Bob the Hamster: </p>
<hr />
<div>__NOTOC__<br />
{| class="toccolours" cellpadding="4" style="border: 1px solid #999999; float: right; margin: 0 0 1em 1em; width: 22em; border-collapse: collapse; font-size: 95%;"<br />
| align="center" colspan=2 bgcolor="#ccccff" style="font-size:110%; border: 1px solid #999999;" | '''Wandering Hamster'''<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" | [[Image:Wandering hamster.png]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Developer(s)'''<br />
| style="border: 1px solid #999999; width:14em" | [[James Paige]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Release date'''<br />
| style="border: 1px solid #999999;" | First Demo 1997<br>Current Demo 2022-09-22<br>Final Release TBD<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Genre'''<br />
| style="border: 1px solid #999999;" | RPG<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''License'''<br />
| style="border: 1px solid #999999;" | [[GPL]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Download'''<br />
| style="border: 1px solid #999999; width:14em" | <br />
[http://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br><br />
[https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" bgcolor="#ccccff" | '''[[/credits|Credits]]''' | '''[[/soundtrack|Soundtrack]]''' | '''[[/secrets|Secrets]]''' | '''[[/development|Development]]''' | '''[[/bugs|Bugs]]'''<br />
|}<br />
<br />
<br />
Lord Hasim has been overthrown, plips run rampant, and a menacing evil lurks in the shadows... or is it a cactus? What hamster is spiffy enough to save the world? Bob!<br />
<br />
'''Wandering Hamster''' is the [[OHRRPGCE]] game developed by OHRRPGCE's developer [[James Paige]]. It is occasionally referred to in examples.<br />
<br />
=Downloads=<br />
<br />
* [http://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br />
* [https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
<br />
You can also find a multitude of other downloadable [[OHRRPGCE]] games by many different authors [[Where can I find games?|here]]<br />
<br />
=Characters=<br />
===Bob the Hamster===<br />
[[Image:Bob.png |left]]<br />
Bob is our protagonist. He is a freelance (unemployed) monster-hunter and adventurer. He is a citizen of the town of Flanat, and the eldest son of the ''The Hamster'' family.<br />
<br style="clear: left" /><br />
<br />
===Misa DuHamstre===<br />
[[Image:Misa portrait.png|left]]<br />
Misa is Bob's friend, and a respected citizen of the town of Flanat. She is a bubble mage, an ancient and proud magical tradition which involves... bubbles.<br />
<br style="clear: left" /><br />
<br />
===Lord Hasim & Lord Broaste===<br />
[[Image:Hasim-and-broaste.png|left]]<br />
Lord Hasim is the ruler of the Kingdom of Flanat, and Lord Broaste is the ruler of the kingdom of Broastia on the other side of the mountain. The two are rivals, but an uneasy peace has been maintained between the two nations for many years.<br />
<br style="clear: left" /><br />
<br />
===Dusty===<br />
[[Image:Dusty.png|left]]<br />
Dusty is a wiener dog, and a male fashion model. To avoid his (largely imaginary) fans, he lives alone in a cottage by the sea.<br />
<br style="clear: left" /><br />
<br />
===Skeppio & Rathmara===<br />
[[Image:Skeppio-and-rathmara.png|left]]<br />
Skeppio and Rathmara are cats from the city-state of Ixnekolan. They are brother and sister. Normally cats don't like hamsters, but these two seem willing enough to work together with Bob.<br />
<br style="clear: left" /><br />
<br />
===Gisli Bearbreaker===<br />
[[Image:Gisli.png|left]]<br />
Gisli the Viking is a proud warrior from a distant land. He isn't very bright (or hygienic) but he is a good fellow to have around in a fight.<br />
<br style="clear: left" /><br />
<br />
===Captain Icefeather===<br />
[[Image:Icefeather.png|left]]<br />
Captain Icefeather is the daring and dangerous captain of the Unlucky Tortoise. If you make an enemy to her, you make an enemy of her whole crew-- but the same goes for friendship!<br />
<br />
=Future Plans=<br />
As you may have noticed, if you played far enough, Wandering Hamster is not a complete game yet. The story dead-ends shorty after you acquire the ship. You can wander the world and revisit old places, but the next important plot-quest has not been added yet.<br />
<br />
=How You Can Help=<br />
<br />
* Playtesting<br />
* Reporting bugs<br />
* Balance and difficulty issues (which enemies are too strong, too weak, too boring)<br />
* Improvements on existing pixel art<br />
* New pixel art in keeping with the theme of the game<br />
* [[/soundtrack|Music]] composition and remixes<br />
* Bribe James to keep working on it at https://www.patreon.com/Bob_the_Hamster<br />
<br />
See the [[/development|Development]] page for more info.<br />
<br />
<br />
==See Also==<br />
* [[Can I make my own version of Wandering Hamster?]]<br />
* [[Will Wandering Hamster ever be updated?]]<br />
* [http://www.slimesalad.com/forum/viewtopic.php?t=7046 Development Thread @ Slimesalad]<br />
* [http://www.slimesalad.com/forum/viewtopic.php?p=7355#7355 Wandering Hamster game page @ Slime Salad]<br />
* [http://www.youtube.com/view_play_list?p=9DFF0981C8BCB2B6 Let's Play Wandering Hamster (Youtube Walkthrough)]<br />
<br />
[[Category:Hamster Republic]]<br />
[[Category:Games]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Game:Wandering_Hamster&diff=34498Game:Wandering Hamster2022-09-22T15:53:25Z<p>Bob the Hamster: Icefeather</p>
<hr />
<div>__NOTOC__<br />
{| class="toccolours" cellpadding="4" style="border: 1px solid #999999; float: right; margin: 0 0 1em 1em; width: 22em; border-collapse: collapse; font-size: 95%;"<br />
| align="center" colspan=2 bgcolor="#ccccff" style="font-size:110%; border: 1px solid #999999;" | '''Wandering Hamster'''<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" | [[Image:Wandering hamster.png]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Developer(s)'''<br />
| style="border: 1px solid #999999; width:14em" | [[James Paige]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Release date'''<br />
| style="border: 1px solid #999999;" | First Demo 1997<br>Current Demo 2022-09-22<br>Final Release TBD<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Genre'''<br />
| style="border: 1px solid #999999;" | RPG<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''License'''<br />
| style="border: 1px solid #999999;" | [[GPL]]<br />
|- valign="top"<br />
| style="border: 1px solid #999999;" bgcolor="#ccccff" | '''Download'''<br />
| style="border: 1px solid #999999; width:14em" | <br />
[http://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br><br />
[http://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br><br />
[https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
|-<br />
| style="border: 1px solid #999999;" align="center" colspan="2" bgcolor="#ccccff" | '''[[/credits|Credits]]''' | '''[[/soundtrack|Soundtrack]]''' | '''[[/secrets|Secrets]]''' | '''[[/development|Development]]''' | '''[[/bugs|Bugs]]'''<br />
|}<br />
<br />
<br />
Lord Hasim has been overthrown, plips run rampant, and a menacing evil lurks in the shadows... or is it a cactus? What hamster is spiffy enough to save the world? Bob!<br />
<br />
'''Wandering Hamster''' is the [[OHRRPGCE]] game developed by OHRRPGCE's developer [[James Paige]]. It is occasionally referred to in examples.<br />
<br />
=Downloads=<br />
<br />
* [http://HamsterRepublic.com/dl/wandering-hamster.exe Windows (installer)]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster.zip Windows (zip)]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster-mac.zip Mac OS X]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster-linux-x86_64.tar.gz Linux 64bit (tarball)]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster-linux-x86.tar.gz Linux 32bit (tarball)]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster_amd64.deb Debian/Ubuntu 64bit]<br />
* [http://HamsterRepublic.com/dl/wandering-hamster_i386.deb Debian/Ubuntu 32bit]<br />
* [https://play.google.com/store/apps/details?id=com.hamsterrepublic.wander&hl=en Android Version]<br />
<br />
You can also find a multitude of other downloadable [[OHRRPGCE]] games by many different authors [[Where can I find games?|here]]<br />
<br />
=Characters=<br />
===Bob the Hamster===<br />
[[Image:Bob.png |left]]<br />
Bob is our protagonist. He is a freelance (unemployed) monster-hunter and adventurer. He is a citizen of the town of Flanat, and the eldest son of the ''The Hamster'' family.<br />
<br style="clear: left" /><br />
<br />
===Misa DuHamstre===<br />
[[Image:Misa portrait.png|left]]<br />
Misa is Bob's friend, and a respected citizen of the town of Flanat. She is a bubble mage, an ancient and proud magical tradition which involves... bubbles.<br />
<br style="clear: left" /><br />
<br />
===Lord Hasim & Lord Broaste===<br />
[[Image:Hasim-and-broaste.png|left]]<br />
Lord Hasim is the ruler of the Kingdom of Flanat, and Lord Broaste is the ruler of the kingdom of Broastia on the other side of the mountain. The two are rivals, but an uneasy peace has been maintained between the two nations for many years.<br />
<br style="clear: left" /><br />
<br />
===Dusty===<br />
[[Image:Dusty.png|left]]<br />
Dusty is a wiener dog, and a male fashion model. To avoid his (largely imaginary) fans, he lives alone in a cottage by the sea.<br />
<br style="clear: left" /><br />
<br />
===Skeppio & Rathmara===<br />
[[Image:Skeppio-and-rathmara.png|left]]<br />
Skeppio and Rathmara are cats from the city-state of Ixnekolan. They are brother and sister. Normally cats don't like hamsters, but these two seem willing enough to work together with Bob.<br />
<br style="clear: left" /><br />
<br />
===Gisli Bearbreaker===<br />
[[Image:Gisli.png|left]]<br />
Gisli the Viking is a proud warrior from a distant land. He isn't very bright (or hygienic) but he is a good fellow to have around in a fight.<br />
<br style="clear: left" /><br />
<br />
===Captain Icefeather===<br />
[[Image:Icefeather.png|left]]<br />
Captain Icefeather is the daring and dangerous captain of the Unlucky Tortoise. If you make an enemy to her, you make an enemy of her whole crew-- but the same goes for friendship!<br />
<br />
=Future Plans=<br />
As you may have noticed, if you played far enough, Wandering Hamster is not a complete game yet. The story dead-ends at a dramatic point, and leaves you hanging<br />
<br />
=How You Can Help=<br />
<br />
* Playtesting<br />
* Reporting bugs<br />
* Balance and difficulty issues (which enemies are too strong, too weak, too boring)<br />
* Improvements on existing pixel art<br />
* New pixel art in keeping with the theme of the game<br />
* [[/soundtrack|Music]] composition and remixes<br />
* Bribe James to keep working on it at https://www.patreon.com/Bob_the_Hamster<br />
<br />
See the [[/development|Development]] page for more info.<br />
<br />
<br />
==See Also==<br />
* [[Can I make my own version of Wandering Hamster?]]<br />
* [[Will Wandering Hamster ever be updated?]]<br />
* [http://www.slimesalad.com/forum/viewtopic.php?t=7046 Development Thread @ Slimesalad]<br />
* [http://www.slimesalad.com/forum/viewtopic.php?p=7355#7355 Wandering Hamster game page @ Slime Salad]<br />
* [http://www.youtube.com/view_play_list?p=9DFF0981C8BCB2B6 Let's Play Wandering Hamster (Youtube Walkthrough)]<br />
<br />
[[Category:Hamster Republic]]<br />
[[Category:Games]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=File:Icefeather.png&diff=34497File:Icefeather.png2022-09-22T15:51:36Z<p>Bob the Hamster: </p>
<hr />
<div></div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Heroes.reld&diff=34446Heroes.reld2022-08-08T14:46:52Z<p>Bob the Hamster: option to disable victory dance</p>
<hr />
<div>A [[RELOAD]] format lump for storage of hero definitions.<br />
<br />
This lump replaced [[DT0]] in all versions after Dec 21 2012. (CURRENT_RPG_VERSION >= 19)<br />
<br />
* '''heroes''' - this is the root node<br />
** '''hero''' int - one node for each hero. value is id number<br />
*** '''name''' string<br />
**** '''maxlen''' int - max length of name when renaming. if node not present use default<br />
*** '''appearance''' contains appearance data<br />
**** '''walkabout'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
**** '''battle'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
***** '''hand_a''' - node containing hand offset data for attack frame A<br />
****** '''x''' int - x offset of hand<br />
****** '''y''' int - y offset of hand<br />
***** '''hand_b''' - node containing hand offset data for attack frame B<br />
****** '''x''' int - x offset of hand<br />
****** '''y''' int - y offset of hand<br />
***** '''skipvicdance''' bool - if nonzero, don't do victory animation {{WIP|inline}}<br />
**** '''portrait'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
*** '''default_level''' int - value is level number. Use default if node is not present<br />
*** '''default_weapon''' int - item id number<br />
*** '''default_auto_battle''' int - if not zero, this hero will default to fighting automatically in battle. If absent or zero, this hero will default to normal player control {{WIP|inline}}<br />
*** '''exp_mult''' float - multiplier in the hero's experience formula (minus 1). Defaults to 0.2, ie ''1.2*prev+5''<br />
*** '''stats_at_zero''' - contains stats at level 0<br />
**** '''stat''' int - one node for each stat. value is stat ID number 0-11<br />
***** '''value''' int - value for this stat<br />
*** '''stats_at_max''' - contains stats at max level (often, but not always level 99)<br />
**** '''stat''' int - one node for each stat. value is stat ID number 0-11<br />
***** '''value''' int - value for this stat<br />
*** '''battle_menus''' - stores the hero's battle menu data<br />
**** '''menu''' - one for each hero battle menu slot.<br />
***** '''kind''' only has one child node. The valid options are listed below<br />
****** '''weapon''' - if this node is present, this is the attack specified by the hero's equipped weapon<br />
****** '''attack''' int - if this node is present, this is an attack. Value is attack ID number<br />
****** '''items''' - if this node it present, this is the item menu<br />
****** '''spells''' int - if this node is present, this is a spell list. Value is list id 0-3<br />
****** '''skip''' - if this node it present, this menu item is "Skip Turn" {{WIP|inline}}<br />
***** '''caption''' string - the text of the of menu item. If blank or missing the default is used (the attack or spell list name, or the "Items" global string)<br />
***** '''color''' int - the text color, in the master palette. 0 or missing indicates to use the default, uilook(uiText).<br />
***** '''enable_tag1''' int - if this tag check fails the menu option will be disabled. >= 0 is ON, < 0 is OFF. If not present, default 0 meaning "always"<br />
***** '''enable_tag2''' int - same as above<br />
***** '''hide_disabled''' bool - if nonzero, indicates that if the menu item is disabled, it should be hidden instead of just unselectable. Spell lists with blank names are always hidden regardless, but all other things that disable a menu item (e.g. attack costs) do respect this.<br />
***** '''exclude_auto_battle''' bool - if nonzero, this battle menu item will never be used when the hero is in auto-battle mode {{WIP|inline}}<br />
*** '''spell_lists''' - Container for spell lists<br />
**** '''list''' int - one node for each spell list 0-3. value is list id number. Empty lists are not present.<br />
***** '''name''' string - name of the spell list<br />
***** '''spells''' - contains spells<br />
****** '''spell''' int - one node for each defined spell. value is id 0-23<br />
******* '''attack''' int - value is id number of attack to use for this spell<br />
******* '''learnlev''' int - level at which the hero learns the spell. Not present if not used<br />
******* '''itemlearn''' - node is present if the hero can learn this spell from an item<br />
******* '''tag''' int - if this tag check passes, the spell is visible (default "always")<br />
******* other nodes related to [[Plan for improved spell learning]] will go here later<br />
***** '''random''' - if this node is present, an attack is automatically randomly selected from the list<br />
***** '''use_lmp''' - if this node is present, all spells in this list require FF1-style level-based-mp <br />
*** '''elements''' - stores the hero's elemental strengths and weaknesses<br />
**** '''element''' int - an element; value is ID number. Element nodes not present will use the default of 1.0<br />
***** '''damage''' double - damage taken from this element (1.0 = 100% normal)<br />
*** '''rename_on_add''' - if present, the hero is renamed when added to the party<br />
*** '''rename_on_status''' - if present, the hero can be renamed on the status screen<br />
*** '''hide_empty_lists''' - if present, the hero's empty spell lists are hidden <br />
*** '''tags''' - contains tags automatically set by this hero<br />
**** '''have_hero''' int - tag to turn ON if the hero is in the party<br />
**** '''is_alive''' int - tag to turn ON if the hero is alive<br />
**** '''is_leader''' int - tag to turn ON if the hero is the leader<br />
**** '''is_active''' int - tag to turn on if the hero is a member of the active party<br />
**** '''checks''' - parent node for hero list of checks that set tags<br />
***** '''range''' - a list of zero or more range check nodes<br />
****** '''kind''' string - Currently always "level" but we can use this to check stats or other things later<br />
****** '''tag''' int - a tag number that will be turned on if the check succeeds.<br />
****** '''min''' int - Check if the hero's level is >= this<br />
****** '''max''' int - Check if the hero's level is <= this<br />
*** '''stat_options''' customize the display of stats<br />
**** '''stat''' int - zero or more nodes for containing stat options. The value is the stat ID number. If a stat has no node, it uses defaults<br />
***** '''hide''' - if this node is present, the stat should be hidden from this hero's status and equip screens<br />
*** '''counterattacks''' - parent node for hero's intrinsic counterattacks<br />
**** '''elemental''' - parent node for hero's elemental counterattacks<br />
***** '''element''' int - an optional node for each elemental 0-63. Elementals with no counterattack can be omitted<br />
****** '''attack''' int - id number of the counterattack<br />
**** '''nonelemental''' - parent node for hero's non-elemental counterattack<br />
***** '''attack''' int - id number of the counterattack<br />
**** '''statdamage''' - parent node for hero's stat damage counterattacks<br />
***** '''stat''' int - an optional node for each regular stat 0-11. Stats with no counterattack can be omitted<br />
****** '''attack''' int - id number of the counterattack<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=GEN&diff=34365GEN2022-03-06T16:32:31Z<p>Bob the Hamster: </p>
<hr />
<div>__NOTOC__<br />
The lump with the extension .GEN is a critical one. It contains miscellaneous information about a wide variety of unrelated things, especially max number of records for other files, password information, and other stuff that I felt like sticking in there too-- some of which really don't belong.<br />
<br />
New general options are increasingly being added to [[general.reld]] instead, the RELOAD-format alternative.<br />
<br />
{{BSAVE Header}}<br />
<br />
The .gen lump is normally 1007 bytes long (including 7 byte header). '''NOTE:''' The fixWipeGEN [[FIXBITS.BIN|fixbit]] must be checked when reading values at offsets 199 and up.<br />
<br />
The following is the meaning of each element.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|-<br />
|bgcolor="#FFC8C8"|Pink fields are runtime-only fields used by [[GAME]] that do not really belong GEN in the first place, but are there anyway to make including them in [[SAV]] files more convenient, which is now a moot argument because of the conversion to [[RSAV]].<br />
|-<br />
|bgcolor="#C8C8FF"|Blue fields are editor-only fields used by [[CUSTOM]], although almost all of them are also used in-game for error-checking valid data record numbers. GAME and CUSTOM will both automatically set all these "max/number of X" fields to the true values.<br />
|-<br />
|bgcolor="#C8FFC8"|Green records are preserved in [[RSAV]] files.<br />
|}<br />
<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Element || Data || Constant || Meaning<br />
|-<br />
|0||INT ||genMaxMap ||bgcolor="#C8C8FF"|Max (last) valid map number<br />
|-<br />
|1||INT ||genTitle ||Title screen backdrop index<br />
|-<br />
|2||INT ||genTitleMus ||title music<br />
|-<br />
|3||INT ||genVictMus ||victory music + 1 (0 for none)<br />
|-<br />
|4||INT ||genBatMus ||default battle music<br />
|-<br />
|5||INT ||genPassVersion||bgcolor="#C8C8FF"| passcode format number<br />
|-<br />
|6||INT ||genPW3Rot ||bgcolor="#D0D0D0"|old (third-style) passcode rotator<br />
|-<br />
|7-15||BYTE*17 + 1 || ||bgcolor="#D0D0D0"|old (third-style) obfuscated passcode + 1 unused byte<br />
|-<br />
|16-25||INT*10 || ||bgcolor="#D0D0D0"|ancient (first-style) obsolete password data<br />
|-<br />
|26||INT ||genMaxHeroPic ||bgcolor="#C8C8FF"|Last (max) valid hero spriteset number (in [[PT0]]/[[RGFX|heroes.rgfx]])<br />
|-<br />
|27||INT ||genMaxEnemy1Pic ||bgcolor="#C8C8FF"|Last (max) valid small enemy spriteset number (graphics in [[PT1]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as small enemy graphics.<br />
|-<br />
|28||INT ||genMaxEnemy2Pic ||bgcolor="#C8C8FF"|Last (max) valid medium spriteset number (graphics in [[PT2]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as medium enemy graphics.<br />
|-<br />
|29||INT ||genMaxEnemy3Pic ||bgcolor="#C8C8FF"|Last (max) valid large enemy spriteset number (in [[PT3]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as large enemy graphics.<br />
|-<br />
|30||INT ||genMaxNPCPic ||bgcolor="#C8C8FF"|Last (max) valid walkabout spriteset number (in [[PT4]]/[[RGFX|walkabouts.rgfx]])<br />
|-<br />
|31||INT ||genMaxWeaponPic ||bgcolor="#C8C8FF"|Last (max) valid weapon spriteset number (in [[PT5]]/[[RGFX|weapons.rgfx]])<br />
|-<br />
|32||INT ||genMaxAttackPic ||bgcolor="#C8C8FF"|Last (max) valid attack spriteset number (in [[PT6]]/[[RGFX|attacks.rgfx]])<br />
|-<br />
|33||INT ||genMaxTile ||bgcolor="#C8C8FF"|Last (max) tileset number in [[TIL]]<br />
|-<br />
|34||INT ||genMaxAttack ||bgcolor="#C8C8FF"|max attack definitions in [[DT6]]<br />
|-<br />
|35||INT ||genMaxHero ||bgcolor="#C8C8FF"|max hero definitions in [[DT0]]<br />
|-<br />
|36||INT ||genMaxEnemy ||bgcolor="#C8C8FF"|max enemy definitions in [[DT1]]<br />
|-<br />
|37||INT ||genMaxFormation ||bgcolor="#C8C8FF"|max formations in [[FOR]]<br />
|-<br />
|38||INT ||genMaxPal ||bgcolor="#C8C8FF"|max palettes in [[PAL]]<br />
|-<br />
|39||INT ||genMaxTextbox ||bgcolor="#C8C8FF"|max text boxes in [[SAY]]<br />
|-<br />
|40||INT ||genMaxPlotscript ||bgcolor="#C8C8FF"|total available plotscripts (number of records in [[PLOTSCR.LST]])<br />
|-<br />
|41||INT ||genNewgameScript ||ID of new-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|42||INT ||genGameoverScript||ID of game-over [[Script Trigger|plotscript]]<br />
|-<br />
|43||INT ||genMaxRegularScript||bgcolor="#C8C8FF"|ID of highest manually numbered old-style plotscript<br />
|-<br />
|bgcolor="#C8FFC8"|44||INT ||genSuspendBits ||bgcolor="#FFC8C8"|suspendstuff bits:<br><br />
0 - suspendnpcs<br><br />
1 - suspendplayer<br><br />
2 - suspendobstruction<br><br />
3 - suspendherowalls<br><br />
4 - suspendnpcwalls<br><br />
5 - suspendcatapillar<br><br />
6 - suspendrandomenemies<br><br />
7 - suspendboxadvance<br><br />
8 - suspendoverlay<br><br />
9 - suspendambientmusic<br><br />
10 - suspenddoors<br><br />
11 - suspendtimers<br><br />
|-<br />
|bgcolor="#C8FFC8"|45||INT ||genCamera ||bgcolor="#FFC8C8"|camera mode<br />
|-<br />
|bgcolor="#C8FFC8"|46||INT ||genCamArg1 ||bgcolor="#FFC8C8"|cameraarg1<br />
|-<br />
|bgcolor="#C8FFC8"|47||INT ||genCamArg2 ||bgcolor="#FFC8C8"|cameraarg2<br />
|-<br />
|bgcolor="#C8FFC8"|48||INT ||genCamArg3 ||bgcolor="#FFC8C8"|cameraarg3<br />
|-<br />
|bgcolor="#C8FFC8"|49||INT ||genCamArg4 ||bgcolor="#FFC8C8"|cameraarg4<br />
|-<br />
|bgcolor="#C8FFC8"|50||INT ||genScrBackdrop ||bgcolor="#FFC8C8"|Index of currently displaying script backdrop , or -1 for none. (Does not include textbox backdrops)<br />
|-<br />
|bgcolor="#C8FFC8"|51||INT ||genDays ||bgcolor="#FFC8C8"|days of play<br />
|-<br />
|bgcolor="#C8FFC8"|52||INT ||genHours ||bgcolor="#FFC8C8"|hours of play<br />
|-<br />
|bgcolor="#C8FFC8"|53||INT ||genMinutes ||bgcolor="#FFC8C8"|minutes of play<br />
|-<br />
|bgcolor="#C8FFC8"|54||INT ||genSeconds ||bgcolor="#FFC8C8"|seconds of play<br />
|-<br />
|55||INT ||genMaxVehicle ||bgcolor="#C8C8FF"|max vehicle types in [[VEH]]<br />
|-<br />
|56||INT ||genMaxTagname ||bgcolor="#C8C8FF"|Last named tag<br />
|-<br />
|bgcolor="#C8FFC8"|57||INT ||genLoadgameScript||load-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|58||INT ||genTextboxBackdrop||bgcolor="#FFC8C8"|Index of currently displaying text box backdrop<br />
|-<br />
|59||INT ||genEnemyDissolve || Default enemy dissolve type. See dissolve types in [[DT1]] (each dissolve type is numbered one less than it is in DT1, for example Random Pixels is 0. <br />
|-<br />
|bgcolor="#C8FFC8"|60||INT ||genJoy ||bgcolor="#FFC8C8"|Enable/disable joystick<br />
|-<br />
|bgcolor="#C8FFC8"|61||INT ||genPoisonChar||Posion status indicator char (default to 161 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|62||INT ||genStunChar ||Stun status indicator char (default to 159 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|63||INT ||genDamageCap||Damage cap (0 if there is none)<br />
|-<br />
|bgcolor="#C8FFC8"|64||INT ||genMuteChar ||Mute status indicator char (default to 163 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|65-76||INT*12 ||genStatCap||Stat caps for each stat, in this order:<br/>HP<br/>MP<br/>Atk<br/>Aim<br/>Def<br/>Dog<br/>Mag<br/>Wil<br/>Spd<br/>Ctr<br/>Focus<br/>Extra Hits<br />
|-<br />
|77||INT ||genMaxSFX||bgcolor="#C8C8FF"|Number of sound effects<br />
|-<br />
|78||INT ||genMasterPal||Master palette number in [[PALETTES.BIN]]<br />
|-<br />
|79||INT ||genMaxMasterPal||bgcolor="#C8C8FF"|Max master palette number in [[PALETTES.BIN]] and number of UI color sets in [[UICOLORS.BIN]]<br />
|-<br />
|80||INT ||genMaxMenu||Max menu in [[MENUS.BIN]]<br />
|-<br />
|81||INT ||genMaxMenuItem||Max menu item in [[MENUITEM.BIN]]<br />
|-<br />
|82||INT ||genMaxItem||Max item number in [[ITM]]<br />
|-<br />
|83||INT ||genMaxBoxBorder||Max valid box border spriteset number (in [[PT7]]/[[RGFX|boxborders.rgfx]])<br />
|-<br />
|84||INT ||genMaxPortrait||Max valid portrait spriteset number (in [[PT8]]/[[RGFX|portraits.rgfx]])<br />
|-<br />
|bgcolor="#C8FFC8"|85||INT ||genMaxInventory||Max available inventory slots. 599 is current default max. Gets rounded ''up'' to the next multiple of 3 slots (counting the zeroth slot). Zero uses the default max of 599 (600 counting zero)<br />
|-<br />
|86||INT ||genErrorLevel||Error suppression level: <br>0: default to 4<br>2: show all warnings<br>3: suppress some warnings<br>4: suppress warnings from weak type checking<br>5: don't show errors not displayed in old versions<br>6: show only errors about corruption or interpreter problems<br />
|-<br />
|bgcolor="#C8FFC8"|87||INT || genLevelCap ||Maximum hero level (0-genMaxLevel) (Unlike genMaxLevel, this can be changed with scripting, and has no effect on stat growth)<br />
|-<br />
|88||INT || genEquipMergeFormula ||Function used to calculate total hero elemental resistances from equipment:<br><br />
0: Awful compatible formula<br><br />
1: Multiplicative<br><br />
2: Additive<br />
|-<br />
|89||INT || genNumElements ||Number of elements which the game uses, up to 64 (any higher numbered ones should be ignored in-game)<br />
|-<br />
|90||INT || genUnlockedReserveXP ||Experience gained by unlocked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|91||INT || genLockedReserveXP ||Experience gained by locked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|92||INT || genPW4Hash ||bgcolor="#C8C8FF"|Hashed password, 0 if none<br />
|-<br />
|93||INT || genPW2Offset ||bgcolor="#D0D0D0"|old(second-style) passcode offset<br />
|-<br />
|94||INT || genPW2Length ||bgcolor="#D0D0D0"|old(second-style) passcode length (-1 if there is no password)<br />
|-<br />
|95||INT ||genVersion ||RPG file format version ID (The latest version number is CURRENT_RPG_VERSION in const.bi. See also [[Incrementing the RPG format version number]])<br />
|-<br />
|96||INT ||genStartMoney||starting money<br />
|-<br />
|97||INT ||genMaxShop ||bgcolor="#C8C8FF"|last shop in [[SHO]]<br />
|-<br />
|98||INT || genPW1Offset ||bgcolor="#D0D0D0"|old-old(first-style) passcode offset<br />
|-<br />
|99||INT || genPW1Length ||bgcolor="#D0D0D0"|old-old(first-style) passcode length<br />
|-<br />
|100||INT ||genNumBackdrops||bgcolor="#C8C8FF"|''Number'' of backdrops (in [[MXS]]/[[RGFX|backdrops.rgfx]])<br />
|-<br />
|101||INT ||genBits ||[[#General bitsets]] 0-15<br />
|-<br />
|102||INT ||genStartX ||starting X<br />
|-<br />
|103||INT ||genStartY ||starting Y<br />
|-<br />
|104||INT ||genStartMap ||starting Map<br />
|-<br />
|105||INT ||genOneTimeNPC ||bgcolor="#C8C8FF"|one-time-NPC indexer<br />
|-<br />
|106-170||INT*65|| genOneTimeNPCBits ||bgcolor="#C8C8FF"|one-time-NPC placeholder bits. there are 0-1039 bits, but savegames store 0-1031 and the NPC editor only allows 0-1000<br />
|-<br />
|171||INT ||genDefaultDeathSfx ||Default enemy death sound effect ID + 1 (0 for none)<br />
|-<br />
|172||INT ||genMaxSong||bgcolor="#C8C8FF"|last song number ([[SNG]] and [[BAM]])<br />
|-<br />
|173||INT ||genAcceptSfx||Sound effect to use for "accept" (in menus) ID + 1 (0 for none)<br />
|-<br />
|174||INT ||genCancelSfx||Sound effect to use for "cancel" (in menus) ID + 1 (0 for none)<br />
|-<br />
|175||INT ||genChooseSfx||Sound effect to use for moving the cursor (in menus) ID + 1 (0 for none)<br />
|-<br />
|176||INT ||gentextboxLetter || Sound effect to use for displaying text box lines ID + 1 (0 for none)<br />
|-<br />
|177-178||INT*2 ||genBits2 || [[#General bitsets]] 16-47<br />
|-<br />
|179||INT ||genItemLearnSFX || Sound effect when learning a spell from an item. ID + 1 (0 for none)<br />
|-<br />
|180||INT ||genCantLearnSFX || Sound effect when a hero couldn't learn spell from item. ID + 1 (0 for none)<br />
|-<br />
|181||INT ||genBuySFX || Sound effect when buying an item from a shop. ID + 1 (0 for none)<br />
|-<br />
|182||INT ||genHireSFX || Sound effect when hiring a hero from a shop. ID + 1 (0 for none)<br />
|-<br />
|183||INT ||genSellSFX || Sound effect when selling an item to a shop. ID + 1 (0 for none)<br />
|-<br />
|184||INT ||genCantBuySFX || Sound effect when you can't afford item/hire. ID + 1 (0 for none)<br />
|-<br />
|185||INT ||genCantSellSFX || Sound effect when trying to sell an unsellable item. ID + 1 (0 for none)<br />
|-<br />
|186||INT ||genDamageDisplayTicks || Number of ticks to display damage numbers in battle (default 7)<br />
|-<br />
|187||INT ||genDamageDisplayRise || Number of pixels the displayed damage should rise (default 14)<br />
|-<br />
|188||INT ||genHeroWeakHP || % HP threshold for hero weak state (default to 20 if 0)<br />
|-<br />
|189||INT ||genEnemyWeakHP || % HP threshold for enemy weak state (default to 20 if 0)<br />
|-<br />
|190||INT ||genAutosortScheme || Method of autosorting inventory:<br><br />
0 - by item type<br><br />
1 - into usable/not usable<br><br />
2 - alphabetically<br><br />
3 - by ID number<br><br />
4 - no reordering beyond compacting<br />
|-<br />
|191||INT || genMaxLevel || Maximum level (0-99) This is the unchanging maximum allowed level for heroes. it is used in the hero stats editor. (Not to be confused with genLevelCap)<br />
|-<br />
|192||INT || genBattleMode || Battle mode 0=Active-time, 1=Turn-based<br />
|-<br />
|193||INT || genItemStackSize || Default maximum size of an inventory stack<br />
|-<br />
|194||INT || genResolutionX || Width in pixels of the game screen (not including graphics backend scaling) or 0 for default, 320x200<br />
|-<br />
|195||INT || genResolutionY || Height in pixels of the game screen (see above).<br />
|-<br />
|196||INT || genEscMenuScript || [[Script Trigger|plotscript]] to run when pressing ESC or ALT to open the menu (if zero, just open the menu)<br />
|- <br />
|197||INT || genSaveSlotCount || The number of available save slots, 1 to 1000. If 0, the default of 4 will be used. In versions older than [[fufluns]] the valid range was 1-32<br />
|-<br />
|198||INT || genMillisecPerFrame || Number of milliseconds per frame, or 55 if zero.<br />
|-<br />
|199||INT || genStealSuccessSFX || ID+1 of sound effect to play for a successful item steal attack, or zero for none.<br />
|-<br />
|200||INT || genStealFailSFX || ID+1 of sound effect to play for an unsuccessful item steal attack, or zero for none.<br />
|-<br />
|201||INT || genStealNoItemSFX || ID+1 of sound effect to play for an item steal attack with nothing to steal, or zero for none.<br />
|-<br />
|bgcolor="#C8FFC8"|202||INT ||genRegenChar ||Regen status indicator char (default to 32 if 0).<br />
|-<br />
|203||INT || genDefaultScale || (Obsolete). For a short while, contained the default scale/zoom factor of the display (1-16), or zero for whatever default is suitable.<br />
|-<br />
|204||INT || genDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This setting is editable, and is used as the base for genCurrentDebugMode<br />
|-<br />
|205||INT || genCurrentDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This is not directly editable. It is set based on genDebugMode but may be temporarily modified by the "Distribute Game" menu or the "Test Game" feature<br />
|-<br />
|206||INT || genStartHero || ID number the initial hero when starting a new game.<br />
|-<br />
|207||INT || genStartTextbox || ID number a textbox to open when starting a new game, 0 means none.<br />
|-<br />
|208||INT || genWindowSize || Default window size about X% of screen, in multiples of 10% (1-10). 10 means maximize. If 0, default to 8.<br />
|-<br />
|209||INT || genLivePreviewWindowSize || Test-Game default window size about X% of screen, in multiples of 10%. 10 means maximize. If 0, default to 5.<br />
|-<br />
|210||INT || genFullscreen || If 1 (or nonzero), default to fullscreen if there is no remembered preference for this game from previous plays.<br />
|-<br />
|211||INT || genMusicVolume || Initial music volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|212||INT || genSFXVolume || Initial global sound effects volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|213||INT || genRungameFullscreenIndependent || If false, fullscreen settings/config for games spawned by rungame are ignored<br />
|-<br />
|214||INT || genSkipBattleRewardsTicks || If > 0 then the battle rewards messages will automatically advance after this many ticks<br />
|-<br />
|215||INT|| genDefOnkeypressScript|| Default on-keypress Plot[[script Trigger]]<br />
|-<br />
|216||INT|| genDefEachStepScript|| Default each-step Plot[[script Trigger]]<br />
|-<br />
|217||INT|| genDefAfterBattleScript|| Default after-battle Plot[[script Trigger]]<br />
|-<br />
|218||INT|| genDefInsteadOfBattleScript|| Default instead-of-battle Plot[[script Trigger]]<br />
|-<br />
|219||INT|| genDefMapAutorunScript|| Default map autorun Plot[[script Trigger]]<br />
|-<br />
|220||INT|| genMaxEnemyPic ||bgcolor="#C8C8FF"|Last (max) valid enemy spriteset number (in [[RGFX|enemies.rgfx]])<br />
|-<br />
|221||INT|| genMinimapAlgorithm || Algorithm for producing in-game minimaps:<br><br />
0 - Smooth scaling (default)<br><br />
1 - Scatter - original random pixel selection algorithm<br><br />
2 - Majority: (Approximate) most common color<br />
|-<br />
|222-225||INT*4|| genBits3 || [[#General bitsets]] 48-111<br />
|-<br />
|226||INT|| genDefCounterProvoke || Default Provoke Counterattacks setting for attacks. Value 0-8, same meanings as [[DT6]] Provoke Counterattacks setting, except Default means 'Always'<br />
|-<br />
|227||INT|| genInventSlotx1Display || When to display x1 in inventory: 0: always, 1: never, 2: only if item maximum stacksize > 1<br />
|-<br />
|228||INT|| genCameraOnWalkaboutFocus || How to calculate walkabout camera focus: 0: on tile, 1: on sprite, 2: on sprite minus Z/offset <br />
|-<br />
|229||INT|| genTicksPerWalkFrame || Number of ticks per walking frame. 0 = default (110ms/frame; ticks calculated from genMillisecPerFrame and rounded to a whole number)<br />
|-<br />
|230||INT|| genAddHeroScript || Script trigger called when hero added<br />
|-<br />
|231||INT|| genRemoveHeroScript || Script trigger called when hero deleted/removed<br />
|-<br />
|232||INT|| genMoveHeroScript || Script trigger called when hero moved to a different slot<br />
|-<br />
|233||INT|| gen8bitBlendAlgo || Algorithm to use for palette lookups for blending in 8-bit color mode:<br><br />
0 - Dither (Half of pixels (in a chequered pattern) are nearest-matched, with 1/2 or 3/4 (alternating) of error diffused to next pixel)<br><br />
1 - Less Dither (Like 'Dither' but only 1/4 of error diffused, without alternation)<br><br />
2 - No Dither (nearest match color)<br />
|-<br />
|234||INT|| genPreviewBackdrop || 0 or ID+1 of backdrop to use for enemy previews (and maybe more in future)<br />
|-<br />
|235||INT|| gen32bitMode || 1 for 32-bit color mode, 0 for 8-bit<br />
|-<br />
|236||INT|| genDefaultBattleMenu || 0 for default, or menu ID + 1 {{WIP|inline}}<br />
|-<br />
|237-499||INT || ||bgcolor="#D0D0D0"| unused space<br />
|}<br />
<br />
'''Maximums''' : "max XYZ" means 'the highest numbered XYZ'. If you have 80 enemies defined, then "max enemy" == 79, because the numbering starts from 0.<br />
<br />
== General bitsets ==<br />
<br />
Preference bits, backcompat bits and battle system bits are stored in a single bit array, which is split into pieces beginning at gen(genBits), gen(genBits2) and gen(genBits3). They are accessed with the <tt>prefbit()</tt> and <tt>setprefbit()</tt> functions in FB code, and {{plot|read preference bit}} and {{plot|write preference bit}} functions in HS code.<br />
<br />
'''Note''': in the Preference Bitsets and other editors, some of the names of bits are '''reversed''' from what they are below.<br />
For example the editor has a bit named "Restore HP on level-up" which appears ON if bit 2 ("Don't restore HP on level-up") is OFF.<br />
<br />
Also note that some bits are turned on during game upgrade by [[fixbits]].<br />
<br />
* 0 - Pause in battle on spell and item menus<br />
* 1 - Enable Caterpillar party<br />
* 2 - Don't restore HP on level-up<br />
* 3 - Don't restore MP on level-up<br />
* 4 - Inns don't revive dead heros<br />
* 5 - Hero swapping always available<br />
* 6 - Hide ready meter in battle<br />
* 7 - Hide health bar in battle<br />
* 8 - Disable debugging keys<br />
* 9 - Simulate old level-up bug<br />
* 10 - Permit double-triggering of scripts<br />
* 11 - Skip title screen<br />
* 12 - Skip load screen<br />
* 13 - Pause in battle on all menus<br />
* 14 - Disable Hero's Battle Cursor<br />
* 15 - Default passability disabled by default<br />
* 16 - Simulate pushable NPC collision bug<br />
* 17 - Disable ESC to run from battle<br />
* 18 - Don't save gameover/loadgame script IDs (actually prevents ''using'' the stored "game over" or "loadgame" script ID number in preference to the ones specified by gen(genGameoverScript) and gen(genLoadgameScript))<br />
* 19 - Dead heroes gain share of experience<br />
* 20 - Locked heros can't be rearranged<br />
* 21 - Attack captions pause battle meters<br />
* 22 - Don't randomize battle ready-meters<br />
* 23 - Battle menus wait for attack animations<br />
* 24 - Enable better scancodes for scripts<br />
* 25 - Simulate old fail vs. elemental resist bit<br />
* 26 - 0 damage when immune to attack elements<br />
* 27 - Recreate map slices when changing maps<br />
* 28 - Harm tiles harm non-caterpillar heroes<br />
* 29 - Ignore extra Hits stat<br />
* 30 - Don't divide experience between heroes<br />
* 31 - Don't reset max stats after OOB attack<br />
* 32 - Don't limit max tags to 1000<br />
* 33 - Enable bug 430<br />
* 34 - showtextbox happens immediately<br />
* 35 - Pause battle while targeting attacks<br />
* 36 - Old attack positioning at bottom-left of target<br />
* 37 - Wrap map layers over edge of Crop maps<br />
* 38 - Never show script timer during battles<br />
* 39 - Draw Backdrop slice above Script layer<br />
* 40 - Don't stop music when starting/loading game<br />
* 41 - Keep caterpillar length the same when speed changes<br />
* 42 - Heroes use Walk in Place animation while idle.<br />
* 43 - Cap minimum stats at zero.<br />
* 44 - Hide empty save slots at the bottom of the save/load menu<br />
* 45 - Attack IDs in scripts are offset by +1 {{Future|inline}}<br />
* 46 - Negative damage harmtiles '''don't''' cure above max HP<br />
* 47 - Don't map joystick controls to keyboard keys for scripts<br />
* 48 - Disable ESC to cancel/change a hero's attack (turn-based battles only)<br />
* 49 - Show hero MP meter<br />
* 50 - Non-turn attack delays '''don't''' also cause turn delays<br />
* 51 - Don't break Speed ties randomly (turn-based battles only)<br />
* 52 - Ignore MP~ stat<br />
* 53 - "!Map joystick (left) stick to dpad"<br />
* 54 - Auto-targeted attacks in random spell lists respect attack costs {{WIP|inline}}<br />
* 55 - Turncoats and defectors always treat self as an ally {{WIP|inline}}<br />
* Bits up to 111 unused<br />
<br />
== Passwords ==<br />
The password protection in the RPG format is necessarily wet-paper-bag weak, due to the GNU GPL licensing of the engine. RPG password protection works entirely on the honor system. It's kinda like that faded sign hanging on the gates of Anhk-Morpork that says "Thank you for not invading our city"<br />
<br />
Here is how to read the password. Please-please-pretty-please dont just ignore it. It is flimsy pathetic laughable protection, but its all we have! Dont take away our wire umbrella in the lightening storm!<br />
<br />
Over time there have been 4 different password formats, referred to as PW1, PW2, PW3, PW4. All are stored in the GEN lump. The format is determined by looking at genVersion and genPassVersion (go down this table):<br />
<br />
{| border="1" cellpadding="1"<br />
! Format || Indicator || Introduced || Last used<br />
|-<br />
|PW4 || gen(genPassVersion) = 257 || pre-Zenzizenzic (Dec 28 2010) || Still in use.<br />
|-<br />
|PW3 || gen(genPassVersion) = 256 || Ozarks (June 28 2004) || Still partial back-compat (see below)<br />
|-<br />
|PW2 || gen(genVersion) >= 3 || June 18 1999 || Written until Dec 28 2010<br />
|-<br />
|PW1 || Otherwise || Stone Age ||<br />
|}<br />
<br />
For backwards compatibility, Custom also writes a blank PW3 password is there is no password, or a random PW3 password if there is one.<br />
<br />
The easiest thing to do when decoding an RPG file that still has its password in an old format is to print a warning message telling the user to upgrade their RPG file with CUSTOM.EXE<br />
<br />
=== PW4 ===<br />
This new format stores just a 9-bit hash of the password, in gen(genPW4Hash), so that it is not retrievable.<br />
<br />
The hash is calculated as follows (or see common.bas for the FB version):<br />
<br />
unsigned short passwordhash (char *p) {<br />
if (strlen(p) == 0) return 0;<br />
unsigned int hash = 0;<br />
while (*p)<br />
hash = hash * 3 + *p++ * 31;<br />
return (hash & 511) | 512;<br />
}<br />
<br />
=== PW3 ===<br />
In this format, the password is obscured with weak, but space-wasting encryption, and the length of the password is totally unprotected.<br />
<br />
GEN(6) is the password rotator. It will always be a random number from 1 to 254 that will be used to ascii-rotate/obfuscate the password.<br />
<br />
GEN(7-15) is the password text. There are 17 bytes of data here (so the high byte of GEN(15) is unused). Read this string of 17 bytes. ascii-rotate each character by subtracting GEN(6) and if the result is < 0 then add 255, and then discard all characters with ascii values less than 32 (space). The resulting string will be your password. If the string is empty (all 17 chars were under 32) then the RPG file does not have a password.<br />
<br />
=== PW2 ===<br />
This information describes the obsolete scattertable-based password storage format. It is only here as a curiosity... and a monument of shame to security-through-obscurity.<br />
The body of the scattertable lived at GEN(200) to GEN(359), with the "scattertable head" at gen(199).<br />
The first element of the password mess GEN(200) is the bit-offset of the first bit in the password, relative to the beginning of the scattertable head (199). The next element (201) is the bit-offset of the next bit in the password, and so on. So GEN(200) thru GEN(207) will give you the bits that make up the first ascii char of the password. GEN(208)-GEN(215) gives you the next char, and so on up to GEN(94)+1 bytes. After you have read all the chars from the scattertable, rotate them down by the value of GEN(93) (that is to say, subtract GEN(93) from the ascii value of each char, and if the result is less than 0, add 256).<br />
<br />
Clear as mud, right? Here is an example. Lets suppose that the data in the GEN lump looks like this<br />
<br />
<pre><br />
GEN(93)=172 the ascii-rotate offset<br />
GEN(94)=23 the number of bits -1.<br />
23+1 = 24, thats the total number of bits in the password<br />
There are 8 bits in each char of the password, so 24<br />
divided by 8 is 3. That means this password will end up being 3 chars long.<br />
<br />
BIT OFFSETS/SCATTERTABLE<br />
GEN(199)=8 [0001 0000 0000 0000] dummy number. Never 0 or 255<br />
GEN(200)=4 [0010 0000 0000 0000] Start here. bit 4 in the table is a 0<br />
GEN(201)=3 [1100 0000 0000 0000] bit 3 in the table is a 1, now we have 01<br />
GEN(202)=18[0100 1000 0000 0000] bit 18 is 1: 011<br />
GEN(203)=18[0100 1000 0000 0000] bit 18 is 1: 0111<br />
GEN(204)=54[0110 1100 0000 0000] bit 58 is 0: 01110<br />
GEN(205)=33[1000 0010 0000 0000] bit 33 is 1: 011101<br />
GEN(206)=85[1010 1010 0000 0000] bit 85 is 1: 0111011<br />
GEN(207)=82[0100 1010 0000 0000] bit 82 is 1: 01110111<br />
</pre><br />
<br />
So we end up with 01110111 which is char 238, (a wierd ascii math symbol) Now we subtract the value of GEN(93) and we get 66, which is the ascii code for upper case B, so we know the first letter of the password is B.<br />
<br />
Ah, what fun. what a mess. what a waste. *sigh*<br />
<br />
===PW1===<br />
<br />
We didn't bother to document this here, but it's yet another scheme, very similar to PW3! If you care, you can read the read_PW1_password() function in the source. It stores the password in gen(5) upwards, and in gen(genPW1Offset) and gen(genPW1Length) (gen(98) and gen(99).<br />
<br />
=See Also=<br />
* [http://thread.gmane.org/gmane.games.ohrrpgce.devel/17774 Garbage in GEN], an investigation of junk in high areas of GEN in older games<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=GEN&diff=34364GEN2022-03-04T03:30:56Z<p>Bob the Hamster: add wip tag to new prefbit</p>
<hr />
<div>__NOTOC__<br />
The lump with the extension .GEN is a critical one. It contains miscellaneous information about a wide variety of unrelated things, especially max number of records for other files, password information, and other stuff that I felt like sticking in there too-- some of which really don't belong.<br />
<br />
New general options are increasingly being added to [[general.reld]] instead, the RELOAD-format alternative.<br />
<br />
{{BSAVE Header}}<br />
<br />
The .gen lump is normally 1007 bytes long (including 7 byte header). '''NOTE:''' The fixWipeGEN [[FIXBITS.BIN|fixbit]] must be checked when reading values at offsets 199 and up.<br />
<br />
The following is the meaning of each element.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|-<br />
|bgcolor="#FFC8C8"|Pink fields are runtime-only fields used by [[GAME]] that do not really belong GEN in the first place, but are there anyway to make including them in [[SAV]] files more convenient, which is now a moot argument because of the conversion to [[RSAV]].<br />
|-<br />
|bgcolor="#C8C8FF"|Blue fields are editor-only fields used by [[CUSTOM]], although almost all of them are also used in-game for error-checking valid data record numbers. GAME and CUSTOM will both automatically set all these "max/number of X" fields to the true values.<br />
|-<br />
|bgcolor="#C8FFC8"|Green records are preserved in [[RSAV]] files.<br />
|}<br />
<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Element || Data || Constant || Meaning<br />
|-<br />
|0||INT ||genMaxMap ||bgcolor="#C8C8FF"|Max (last) valid map number<br />
|-<br />
|1||INT ||genTitle ||Title screen backdrop index<br />
|-<br />
|2||INT ||genTitleMus ||title music<br />
|-<br />
|3||INT ||genVictMus ||victory music + 1 (0 for none)<br />
|-<br />
|4||INT ||genBatMus ||default battle music<br />
|-<br />
|5||INT ||genPassVersion||bgcolor="#C8C8FF"| passcode format number<br />
|-<br />
|6||INT ||genPW3Rot ||bgcolor="#D0D0D0"|old (third-style) passcode rotator<br />
|-<br />
|7-15||BYTE*17 + 1 || ||bgcolor="#D0D0D0"|old (third-style) obfuscated passcode + 1 unused byte<br />
|-<br />
|16-25||INT*10 || ||bgcolor="#D0D0D0"|ancient (first-style) obsolete password data<br />
|-<br />
|26||INT ||genMaxHeroPic ||bgcolor="#C8C8FF"|Last (max) valid hero spriteset number (in [[PT0]]/[[RGFX|heroes.rgfx]])<br />
|-<br />
|27||INT ||genMaxEnemy1Pic ||bgcolor="#C8C8FF"|Last (max) valid small enemy spriteset number (graphics in [[PT1]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as small enemy graphics.<br />
|-<br />
|28||INT ||genMaxEnemy2Pic ||bgcolor="#C8C8FF"|Last (max) valid medium spriteset number (graphics in [[PT2]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as medium enemy graphics.<br />
|-<br />
|29||INT ||genMaxEnemy3Pic ||bgcolor="#C8C8FF"|Last (max) valid large enemy spriteset number (in [[PT3]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as large enemy graphics.<br />
|-<br />
|30||INT ||genMaxNPCPic ||bgcolor="#C8C8FF"|Last (max) valid walkabout spriteset number (in [[PT4]]/[[RGFX|walkabouts.rgfx]])<br />
|-<br />
|31||INT ||genMaxWeaponPic ||bgcolor="#C8C8FF"|Last (max) valid weapon spriteset number (in [[PT5]]/[[RGFX|weapons.rgfx]])<br />
|-<br />
|32||INT ||genMaxAttackPic ||bgcolor="#C8C8FF"|Last (max) valid attack spriteset number (in [[PT6]]/[[RGFX|attacks.rgfx]])<br />
|-<br />
|33||INT ||genMaxTile ||bgcolor="#C8C8FF"|Last (max) tileset number in [[TIL]]<br />
|-<br />
|34||INT ||genMaxAttack ||bgcolor="#C8C8FF"|max attack definitions in [[DT6]]<br />
|-<br />
|35||INT ||genMaxHero ||bgcolor="#C8C8FF"|max hero definitions in [[DT0]]<br />
|-<br />
|36||INT ||genMaxEnemy ||bgcolor="#C8C8FF"|max enemy definitions in [[DT1]]<br />
|-<br />
|37||INT ||genMaxFormation ||bgcolor="#C8C8FF"|max formations in [[FOR]]<br />
|-<br />
|38||INT ||genMaxPal ||bgcolor="#C8C8FF"|max palettes in [[PAL]]<br />
|-<br />
|39||INT ||genMaxTextbox ||bgcolor="#C8C8FF"|max text boxes in [[SAY]]<br />
|-<br />
|40||INT ||genMaxPlotscript ||bgcolor="#C8C8FF"|total available plotscripts (number of records in [[PLOTSCR.LST]])<br />
|-<br />
|41||INT ||genNewgameScript ||ID of new-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|42||INT ||genGameoverScript||ID of game-over [[Script Trigger|plotscript]]<br />
|-<br />
|43||INT ||genMaxRegularScript||bgcolor="#C8C8FF"|ID of highest manually numbered old-style plotscript<br />
|-<br />
|bgcolor="#C8FFC8"|44||INT ||genSuspendBits ||bgcolor="#FFC8C8"|suspendstuff bits:<br><br />
0 - suspendnpcs<br><br />
1 - suspendplayer<br><br />
2 - suspendobstruction<br><br />
3 - suspendherowalls<br><br />
4 - suspendnpcwalls<br><br />
5 - suspendcatapillar<br><br />
6 - suspendrandomenemies<br><br />
7 - suspendboxadvance<br><br />
8 - suspendoverlay<br><br />
9 - suspendambientmusic<br><br />
10 - suspenddoors<br><br />
11 - suspendtimers<br><br />
|-<br />
|bgcolor="#C8FFC8"|45||INT ||genCamera ||bgcolor="#FFC8C8"|camera mode<br />
|-<br />
|bgcolor="#C8FFC8"|46||INT ||genCamArg1 ||bgcolor="#FFC8C8"|cameraarg1<br />
|-<br />
|bgcolor="#C8FFC8"|47||INT ||genCamArg2 ||bgcolor="#FFC8C8"|cameraarg2<br />
|-<br />
|bgcolor="#C8FFC8"|48||INT ||genCamArg3 ||bgcolor="#FFC8C8"|cameraarg3<br />
|-<br />
|bgcolor="#C8FFC8"|49||INT ||genCamArg4 ||bgcolor="#FFC8C8"|cameraarg4<br />
|-<br />
|bgcolor="#C8FFC8"|50||INT ||genScrBackdrop ||bgcolor="#FFC8C8"|Index of currently displaying script backdrop , or -1 for none. (Does not include textbox backdrops)<br />
|-<br />
|bgcolor="#C8FFC8"|51||INT ||genDays ||bgcolor="#FFC8C8"|days of play<br />
|-<br />
|bgcolor="#C8FFC8"|52||INT ||genHours ||bgcolor="#FFC8C8"|hours of play<br />
|-<br />
|bgcolor="#C8FFC8"|53||INT ||genMinutes ||bgcolor="#FFC8C8"|minutes of play<br />
|-<br />
|bgcolor="#C8FFC8"|54||INT ||genSeconds ||bgcolor="#FFC8C8"|seconds of play<br />
|-<br />
|55||INT ||genMaxVehicle ||bgcolor="#C8C8FF"|max vehicle types in [[VEH]]<br />
|-<br />
|56||INT ||genMaxTagname ||bgcolor="#C8C8FF"|Last named tag<br />
|-<br />
|bgcolor="#C8FFC8"|57||INT ||genLoadgameScript||load-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|58||INT ||genTextboxBackdrop||bgcolor="#FFC8C8"|Index of currently displaying text box backdrop<br />
|-<br />
|59||INT ||genEnemyDissolve || Default enemy dissolve type. See dissolve types in [[DT1]] (each dissolve type is numbered one less than it is in DT1, for example Random Pixels is 0. <br />
|-<br />
|bgcolor="#C8FFC8"|60||INT ||genJoy ||bgcolor="#FFC8C8"|Enable/disable joystick<br />
|-<br />
|bgcolor="#C8FFC8"|61||INT ||genPoisonChar||Posion status indicator char (default to 161 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|62||INT ||genStunChar ||Stun status indicator char (default to 159 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|63||INT ||genDamageCap||Damage cap (0 if there is none)<br />
|-<br />
|bgcolor="#C8FFC8"|64||INT ||genMuteChar ||Mute status indicator char (default to 163 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|65-76||INT*12 ||genStatCap||Stat caps for each stat, in this order:<br/>HP<br/>MP<br/>Atk<br/>Aim<br/>Def<br/>Dog<br/>Mag<br/>Wil<br/>Spd<br/>Ctr<br/>Focus<br/>Extra Hits<br />
|-<br />
|77||INT ||genMaxSFX||bgcolor="#C8C8FF"|Number of sound effects<br />
|-<br />
|78||INT ||genMasterPal||Master palette number in [[PALETTES.BIN]]<br />
|-<br />
|79||INT ||genMaxMasterPal||bgcolor="#C8C8FF"|Max master palette number in [[PALETTES.BIN]] and number of UI color sets in [[UICOLORS.BIN]]<br />
|-<br />
|80||INT ||genMaxMenu||Max menu in [[MENUS.BIN]]<br />
|-<br />
|81||INT ||genMaxMenuItem||Max menu item in [[MENUITEM.BIN]]<br />
|-<br />
|82||INT ||genMaxItem||Max item number in [[ITM]]<br />
|-<br />
|83||INT ||genMaxBoxBorder||Max valid box border spriteset number (in [[PT7]]/[[RGFX|boxborders.rgfx]])<br />
|-<br />
|84||INT ||genMaxPortrait||Max valid portrait spriteset number (in [[PT8]]/[[RGFX|portraits.rgfx]])<br />
|-<br />
|bgcolor="#C8FFC8"|85||INT ||genMaxInventory||Max available inventory slots. 599 is current default max. Gets rounded ''up'' to the next multiple of 3 slots (counting the zeroth slot). Zero uses the default max of 599 (600 counting zero)<br />
|-<br />
|86||INT ||genErrorLevel||Error suppression level: <br>0: default to 4<br>2: show all warnings<br>3: suppress some warnings<br>4: suppress warnings from weak type checking<br>5: don't show errors not displayed in old versions<br>6: show only errors about corruption or interpreter problems<br />
|-<br />
|bgcolor="#C8FFC8"|87||INT || genLevelCap ||Maximum hero level (0-genMaxLevel) (Unlike genMaxLevel, this can be changed with scripting, and has no effect on stat growth)<br />
|-<br />
|88||INT || genEquipMergeFormula ||Function used to calculate total hero elemental resistances from equipment:<br><br />
0: Awful compatible formula<br><br />
1: Multiplicative<br><br />
2: Additive<br />
|-<br />
|89||INT || genNumElements ||Number of elements which the game uses, up to 64 (any higher numbered ones should be ignored in-game)<br />
|-<br />
|90||INT || genUnlockedReserveXP ||Experience gained by unlocked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|91||INT || genLockedReserveXP ||Experience gained by locked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|92||INT || genPW4Hash ||bgcolor="#C8C8FF"|Hashed password, 0 if none<br />
|-<br />
|93||INT || genPW2Offset ||bgcolor="#D0D0D0"|old(second-style) passcode offset<br />
|-<br />
|94||INT || genPW2Length ||bgcolor="#D0D0D0"|old(second-style) passcode length (-1 if there is no password)<br />
|-<br />
|95||INT ||genVersion ||RPG file format version ID (The latest version number is CURRENT_RPG_VERSION in const.bi. See also [[Incrementing the RPG format version number]])<br />
|-<br />
|96||INT ||genStartMoney||starting money<br />
|-<br />
|97||INT ||genMaxShop ||bgcolor="#C8C8FF"|last shop in [[SHO]]<br />
|-<br />
|98||INT || genPW1Offset ||bgcolor="#D0D0D0"|old-old(first-style) passcode offset<br />
|-<br />
|99||INT || genPW1Length ||bgcolor="#D0D0D0"|old-old(first-style) passcode length<br />
|-<br />
|100||INT ||genNumBackdrops||bgcolor="#C8C8FF"|''Number'' of backdrops (in [[MXS]]/[[RGFX|backdrops.rgfx]])<br />
|-<br />
|101||INT ||genBits ||[[#General bitsets]] 0-15<br />
|-<br />
|102||INT ||genStartX ||starting X<br />
|-<br />
|103||INT ||genStartY ||starting Y<br />
|-<br />
|104||INT ||genStartMap ||starting Map<br />
|-<br />
|105||INT ||genOneTimeNPC ||bgcolor="#C8C8FF"|one-time-NPC indexer<br />
|-<br />
|106-170||INT*65|| genOneTimeNPCBits ||bgcolor="#C8C8FF"|one-time-NPC placeholder bits. there are 0-1039 bits, but savegames store 0-1031 and the NPC editor only allows 0-1000<br />
|-<br />
|171||INT ||genDefaultDeathSfx ||Default enemy death sound effect ID + 1 (0 for none)<br />
|-<br />
|172||INT ||genMaxSong||bgcolor="#C8C8FF"|last song number ([[SNG]] and [[BAM]])<br />
|-<br />
|173||INT ||genAcceptSfx||Sound effect to use for "accept" (in menus) ID + 1 (0 for none)<br />
|-<br />
|174||INT ||genCancelSfx||Sound effect to use for "cancel" (in menus) ID + 1 (0 for none)<br />
|-<br />
|175||INT ||genChooseSfx||Sound effect to use for moving the cursor (in menus) ID + 1 (0 for none)<br />
|-<br />
|176||INT ||gentextboxLetter || Sound effect to use for displaying text box lines ID + 1 (0 for none)<br />
|-<br />
|177-178||INT*2 ||genBits2 || [[#General bitsets]] 16-47<br />
|-<br />
|179||INT ||genItemLearnSFX || Sound effect when learning a spell from an item. ID + 1 (0 for none)<br />
|-<br />
|180||INT ||genCantLearnSFX || Sound effect when a hero couldn't learn spell from item. ID + 1 (0 for none)<br />
|-<br />
|181||INT ||genBuySFX || Sound effect when buying an item from a shop. ID + 1 (0 for none)<br />
|-<br />
|182||INT ||genHireSFX || Sound effect when hiring a hero from a shop. ID + 1 (0 for none)<br />
|-<br />
|183||INT ||genSellSFX || Sound effect when selling an item to a shop. ID + 1 (0 for none)<br />
|-<br />
|184||INT ||genCantBuySFX || Sound effect when you can't afford item/hire. ID + 1 (0 for none)<br />
|-<br />
|185||INT ||genCantSellSFX || Sound effect when trying to sell an unsellable item. ID + 1 (0 for none)<br />
|-<br />
|186||INT ||genDamageDisplayTicks || Number of ticks to display damage numbers in battle (default 7)<br />
|-<br />
|187||INT ||genDamageDisplayRise || Number of pixels the displayed damage should rise (default 14)<br />
|-<br />
|188||INT ||genHeroWeakHP || % HP threshold for hero weak state (default to 20 if 0)<br />
|-<br />
|189||INT ||genEnemyWeakHP || % HP threshold for enemy weak state (default to 20 if 0)<br />
|-<br />
|190||INT ||genAutosortScheme || Method of autosorting inventory:<br><br />
0 - by item type<br><br />
1 - into usable/not usable<br><br />
2 - alphabetically<br><br />
3 - by ID number<br><br />
4 - no reordering beyond compacting<br />
|-<br />
|191||INT || genMaxLevel || Maximum level (0-99) This is the unchanging maximum allowed level for heroes. it is used in the hero stats editor. (Not to be confused with genLevelCap)<br />
|-<br />
|192||INT || genBattleMode || Battle mode 0=Active-time, 1=Turn-based<br />
|-<br />
|193||INT || genItemStackSize || Default maximum size of an inventory stack<br />
|-<br />
|194||INT || genResolutionX || Width in pixels of the game screen (not including graphics backend scaling) or 0 for default, 320x200<br />
|-<br />
|195||INT || genResolutionY || Height in pixels of the game screen (see above).<br />
|-<br />
|196||INT || genEscMenuScript || [[Script Trigger|plotscript]] to run when pressing ESC or ALT to open the menu (if zero, just open the menu)<br />
|- <br />
|197||INT || genSaveSlotCount || The number of available save slots, 1 to 1000. If 0, the default of 4 will be used. In versions older than [[fufluns]] the valid range was 1-32<br />
|-<br />
|198||INT || genMillisecPerFrame || Number of milliseconds per frame, or 55 if zero.<br />
|-<br />
|199||INT || genStealSuccessSFX || ID+1 of sound effect to play for a successful item steal attack, or zero for none.<br />
|-<br />
|200||INT || genStealFailSFX || ID+1 of sound effect to play for an unsuccessful item steal attack, or zero for none.<br />
|-<br />
|201||INT || genStealNoItemSFX || ID+1 of sound effect to play for an item steal attack with nothing to steal, or zero for none.<br />
|-<br />
|bgcolor="#C8FFC8"|202||INT ||genRegenChar ||Regen status indicator char (default to 32 if 0).<br />
|-<br />
|203||INT || genDefaultScale || (Obsolete). For a short while, contained the default scale/zoom factor of the display (1-16), or zero for whatever default is suitable.<br />
|-<br />
|204||INT || genDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This setting is editable, and is used as the base for genCurrentDebugMode<br />
|-<br />
|205||INT || genCurrentDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This is not directly editable. It is set based on genDebugMode but may be temporarily modified by the "Distribute Game" menu or the "Test Game" feature<br />
|-<br />
|206||INT || genStartHero || ID number the initial hero when starting a new game.<br />
|-<br />
|207||INT || genStartTextbox || ID number a textbox to open when starting a new game, 0 means none.<br />
|-<br />
|208||INT || genWindowSize || Default window size about X% of screen, in multiples of 10% (1-10). 10 means maximize. If 0, default to 8.<br />
|-<br />
|209||INT || genLivePreviewWindowSize || Test-Game default window size about X% of screen, in multiples of 10%. 10 means maximize. If 0, default to 5.<br />
|-<br />
|210||INT || genFullscreen || If 1 (or nonzero), default to fullscreen if there is no remembered preference for this game from previous plays.<br />
|-<br />
|211||INT || genMusicVolume || Initial music volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|212||INT || genSFXVolume || Initial global sound effects volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|213||INT || genRungameFullscreenIndependent || If false, fullscreen settings/config for games spawned by rungame are ignored<br />
|-<br />
|214||INT || genSkipBattleRewardsTicks || If > 0 then the battle rewards messages will automatically advance after this many ticks<br />
|-<br />
|215||INT|| genDefOnkeypressScript|| Default on-keypress Plot[[script Trigger]]<br />
|-<br />
|216||INT|| genDefEachStepScript|| Default each-step Plot[[script Trigger]]<br />
|-<br />
|217||INT|| genDefAfterBattleScript|| Default after-battle Plot[[script Trigger]]<br />
|-<br />
|218||INT|| genDefInsteadOfBattleScript|| Default instead-of-battle Plot[[script Trigger]]<br />
|-<br />
|219||INT|| genDefMapAutorunScript|| Default map autorun Plot[[script Trigger]]<br />
|-<br />
|220||INT|| genMaxEnemyPic ||bgcolor="#C8C8FF"|Last (max) valid enemy spriteset number (in [[RGFX|enemies.rgfx]])<br />
|-<br />
|221||INT|| genMinimapAlgorithm || Algorithm for producing in-game minimaps:<br><br />
0 - Smooth scaling (default)<br><br />
1 - Scatter - original random pixel selection algorithm<br><br />
2 - Majority: (Approximate) most common color<br />
|-<br />
|222-225||INT*4|| genBits3 || [[#General bitsets]] 48-111<br />
|-<br />
|226||INT|| genDefCounterProvoke || Default Provoke Counterattacks setting for attacks. Value 0-8, same meanings as [[DT6]] Provoke Counterattacks setting, except Default means 'Always'<br />
|-<br />
|227||INT|| genInventSlotx1Display || When to display x1 in inventory: 0: always, 1: never, 2: only if item maximum stacksize > 1<br />
|-<br />
|228||INT|| genCameraOnWalkaboutFocus || How to calculate walkabout camera focus: 0: on tile, 1: on sprite, 2: on sprite minus Z/offset <br />
|-<br />
|229||INT|| genTicksPerWalkFrame || Number of ticks per walking frame. 0 = default (110ms/frame; ticks calculated from genMillisecPerFrame and rounded to a whole number)<br />
|-<br />
|230||INT|| genAddHeroScript || Script trigger called when hero added<br />
|-<br />
|231||INT|| genRemoveHeroScript || Script trigger called when hero deleted/removed<br />
|-<br />
|232||INT|| genMoveHeroScript || Script trigger called when hero moved to a different slot<br />
|-<br />
|233||INT|| gen8bitBlendAlgo || Algorithm to use for palette lookups for blending in 8-bit color mode:<br><br />
0 - Dither (Half of pixels (in a chequered pattern) are nearest-matched, with 1/2 or 3/4 (alternating) of error diffused to next pixel)<br><br />
1 - Less Dither (Like 'Dither' but only 1/4 of error diffused, without alternation)<br><br />
2 - No Dither (nearest match color)<br />
|-<br />
|234||INT|| genPreviewBackdrop || 0 or ID+1 of backdrop to use for enemy previews (and maybe more in future)<br />
|-<br />
|235||INT|| gen32bitMode || 1 for 32-bit color mode, 0 for 8-bit<br />
|-<br />
|236||INT|| genDefaultBattleMenu || 0 for default, or menu ID + 1 {{WIP|inline}}<br />
|-<br />
|237-499||INT || ||bgcolor="#D0D0D0"| unused space<br />
|}<br />
<br />
'''Maximums''' : "max XYZ" means 'the highest numbered XYZ'. If you have 80 enemies defined, then "max enemy" == 79, because the numbering starts from 0.<br />
<br />
== General bitsets ==<br />
<br />
Preference bits, backcompat bits and battle system bits are stored in a single bit array, which is split into pieces beginning at gen(genBits), gen(genBits2) and gen(genBits3). They are accessed with the <tt>prefbit()</tt> and <tt>setprefbit()</tt> functions in FB code, and {{plot|read preference bit}} and {{plot|write preference bit}} functions in HS code.<br />
<br />
'''Note''': in the Preference Bitsets and other editors, some of the names of bits are '''reversed''' from what they are below.<br />
For example the editor has a bit named "Restore HP on level-up" which appears ON if bit 2 ("Don't restore HP on level-up") is OFF.<br />
<br />
Also note that some bits are turned on during game upgrade by [[fixbits]].<br />
<br />
* 0 - Pause in battle on spell and item menus<br />
* 1 - Enable Caterpillar party<br />
* 2 - Don't restore HP on level-up<br />
* 3 - Don't restore MP on level-up<br />
* 4 - Inns don't revive dead heros<br />
* 5 - Hero swapping always available<br />
* 6 - Hide ready meter in battle<br />
* 7 - Hide health bar in battle<br />
* 8 - Disable debugging keys<br />
* 9 - Simulate old level-up bug<br />
* 10 - Permit double-triggering of scripts<br />
* 11 - Skip title screen<br />
* 12 - Skip load screen<br />
* 13 - Pause in battle on all menus<br />
* 14 - Disable Hero's Battle Cursor<br />
* 15 - Default passability disabled by default<br />
* 16 - Simulate pushable NPC collision bug<br />
* 17 - Disable ESC to run from battle<br />
* 18 - Don't save gameover/loadgame script IDs (actually prevents ''using'' the stored "game over" or "loadgame" script ID number in preference to the ones specified by gen(genGameoverScript) and gen(genLoadgameScript))<br />
* 19 - Dead heroes gain share of experience<br />
* 20 - Locked heros can't be rearranged<br />
* 21 - Attack captions pause battle meters<br />
* 22 - Don't randomize battle ready-meters<br />
* 23 - Battle menus wait for attack animations<br />
* 24 - Enable better scancodes for scripts<br />
* 25 - Simulate old fail vs. elemental resist bit<br />
* 26 - 0 damage when immune to attack elements<br />
* 27 - Recreate map slices when changing maps<br />
* 28 - Harm tiles harm non-caterpillar heroes<br />
* 29 - Ignore extra Hits stat<br />
* 30 - Don't divide experience between heroes<br />
* 31 - Don't reset max stats after OOB attack<br />
* 32 - Don't limit max tags to 1000<br />
* 33 - Enable bug 430<br />
* 34 - showtextbox happens immediately<br />
* 35 - Pause battle while targeting attacks<br />
* 36 - Old attack positioning at bottom-left of target<br />
* 37 - Wrap map layers over edge of Crop maps<br />
* 38 - Never show script timer during battles<br />
* 39 - Draw Backdrop slice above Script layer<br />
* 40 - Don't stop music when starting/loading game<br />
* 41 - Keep caterpillar length the same when speed changes<br />
* 42 - Heroes use Walk in Place animation while idle.<br />
* 43 - Cap minimum stats at zero.<br />
* 44 - Hide empty save slots at the bottom of the save/load menu<br />
* 45 - Attack IDs in scripts are offset by +1 {{Future|inline}}<br />
* 46 - Negative damage harmtiles '''don't''' cure above max HP<br />
* 47 - Don't map joystick controls to keyboard keys for scripts<br />
* 48 - Disable ESC to cancel/change a hero's attack (turn-based battles only)<br />
* 49 - Show hero MP meter<br />
* 50 - Non-turn attack delays '''don't''' also cause turn delays<br />
* 51 - Don't break Speed ties randomly (turn-based battles only)<br />
* 52 - Ignore MP~ stat<br />
* 53 - "!Map joystick (left) stick to dpad"<br />
* 54 - Random spell lists respect attack costs {{WIP|inline}}<br />
* 55 - Turncoats and defectors always treat self as an ally {{WIP|inline}}<br />
* Bits up to 111 unused<br />
<br />
== Passwords ==<br />
The password protection in the RPG format is necessarily wet-paper-bag weak, due to the GNU GPL licensing of the engine. RPG password protection works entirely on the honor system. It's kinda like that faded sign hanging on the gates of Anhk-Morpork that says "Thank you for not invading our city"<br />
<br />
Here is how to read the password. Please-please-pretty-please dont just ignore it. It is flimsy pathetic laughable protection, but its all we have! Dont take away our wire umbrella in the lightening storm!<br />
<br />
Over time there have been 4 different password formats, referred to as PW1, PW2, PW3, PW4. All are stored in the GEN lump. The format is determined by looking at genVersion and genPassVersion (go down this table):<br />
<br />
{| border="1" cellpadding="1"<br />
! Format || Indicator || Introduced || Last used<br />
|-<br />
|PW4 || gen(genPassVersion) = 257 || pre-Zenzizenzic (Dec 28 2010) || Still in use.<br />
|-<br />
|PW3 || gen(genPassVersion) = 256 || Ozarks (June 28 2004) || Still partial back-compat (see below)<br />
|-<br />
|PW2 || gen(genVersion) >= 3 || June 18 1999 || Written until Dec 28 2010<br />
|-<br />
|PW1 || Otherwise || Stone Age ||<br />
|}<br />
<br />
For backwards compatibility, Custom also writes a blank PW3 password is there is no password, or a random PW3 password if there is one.<br />
<br />
The easiest thing to do when decoding an RPG file that still has its password in an old format is to print a warning message telling the user to upgrade their RPG file with CUSTOM.EXE<br />
<br />
=== PW4 ===<br />
This new format stores just a 9-bit hash of the password, in gen(genPW4Hash), so that it is not retrievable.<br />
<br />
The hash is calculated as follows (or see common.bas for the FB version):<br />
<br />
unsigned short passwordhash (char *p) {<br />
if (strlen(p) == 0) return 0;<br />
unsigned int hash = 0;<br />
while (*p)<br />
hash = hash * 3 + *p++ * 31;<br />
return (hash & 511) | 512;<br />
}<br />
<br />
=== PW3 ===<br />
In this format, the password is obscured with weak, but space-wasting encryption, and the length of the password is totally unprotected.<br />
<br />
GEN(6) is the password rotator. It will always be a random number from 1 to 254 that will be used to ascii-rotate/obfuscate the password.<br />
<br />
GEN(7-15) is the password text. There are 17 bytes of data here (so the high byte of GEN(15) is unused). Read this string of 17 bytes. ascii-rotate each character by subtracting GEN(6) and if the result is < 0 then add 255, and then discard all characters with ascii values less than 32 (space). The resulting string will be your password. If the string is empty (all 17 chars were under 32) then the RPG file does not have a password.<br />
<br />
=== PW2 ===<br />
This information describes the obsolete scattertable-based password storage format. It is only here as a curiosity... and a monument of shame to security-through-obscurity.<br />
The body of the scattertable lived at GEN(200) to GEN(359), with the "scattertable head" at gen(199).<br />
The first element of the password mess GEN(200) is the bit-offset of the first bit in the password, relative to the beginning of the scattertable head (199). The next element (201) is the bit-offset of the next bit in the password, and so on. So GEN(200) thru GEN(207) will give you the bits that make up the first ascii char of the password. GEN(208)-GEN(215) gives you the next char, and so on up to GEN(94)+1 bytes. After you have read all the chars from the scattertable, rotate them down by the value of GEN(93) (that is to say, subtract GEN(93) from the ascii value of each char, and if the result is less than 0, add 256).<br />
<br />
Clear as mud, right? Here is an example. Lets suppose that the data in the GEN lump looks like this<br />
<br />
<pre><br />
GEN(93)=172 the ascii-rotate offset<br />
GEN(94)=23 the number of bits -1.<br />
23+1 = 24, thats the total number of bits in the password<br />
There are 8 bits in each char of the password, so 24<br />
divided by 8 is 3. That means this password will end up being 3 chars long.<br />
<br />
BIT OFFSETS/SCATTERTABLE<br />
GEN(199)=8 [0001 0000 0000 0000] dummy number. Never 0 or 255<br />
GEN(200)=4 [0010 0000 0000 0000] Start here. bit 4 in the table is a 0<br />
GEN(201)=3 [1100 0000 0000 0000] bit 3 in the table is a 1, now we have 01<br />
GEN(202)=18[0100 1000 0000 0000] bit 18 is 1: 011<br />
GEN(203)=18[0100 1000 0000 0000] bit 18 is 1: 0111<br />
GEN(204)=54[0110 1100 0000 0000] bit 58 is 0: 01110<br />
GEN(205)=33[1000 0010 0000 0000] bit 33 is 1: 011101<br />
GEN(206)=85[1010 1010 0000 0000] bit 85 is 1: 0111011<br />
GEN(207)=82[0100 1010 0000 0000] bit 82 is 1: 01110111<br />
</pre><br />
<br />
So we end up with 01110111 which is char 238, (a wierd ascii math symbol) Now we subtract the value of GEN(93) and we get 66, which is the ascii code for upper case B, so we know the first letter of the password is B.<br />
<br />
Ah, what fun. what a mess. what a waste. *sigh*<br />
<br />
===PW1===<br />
<br />
We didn't bother to document this here, but it's yet another scheme, very similar to PW3! If you care, you can read the read_PW1_password() function in the source. It stores the password in gen(5) upwards, and in gen(genPW1Offset) and gen(genPW1Length) (gen(98) and gen(99).<br />
<br />
=See Also=<br />
* [http://thread.gmane.org/gmane.games.ohrrpgce.devel/17774 Garbage in GEN], an investigation of junk in high areas of GEN in older games<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=GEN&diff=34363GEN2022-03-04T03:30:21Z<p>Bob the Hamster: prefbit "Turncoats and defectors always treat self as an ally"</p>
<hr />
<div>__NOTOC__<br />
The lump with the extension .GEN is a critical one. It contains miscellaneous information about a wide variety of unrelated things, especially max number of records for other files, password information, and other stuff that I felt like sticking in there too-- some of which really don't belong.<br />
<br />
New general options are increasingly being added to [[general.reld]] instead, the RELOAD-format alternative.<br />
<br />
{{BSAVE Header}}<br />
<br />
The .gen lump is normally 1007 bytes long (including 7 byte header). '''NOTE:''' The fixWipeGEN [[FIXBITS.BIN|fixbit]] must be checked when reading values at offsets 199 and up.<br />
<br />
The following is the meaning of each element.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|-<br />
|bgcolor="#FFC8C8"|Pink fields are runtime-only fields used by [[GAME]] that do not really belong GEN in the first place, but are there anyway to make including them in [[SAV]] files more convenient, which is now a moot argument because of the conversion to [[RSAV]].<br />
|-<br />
|bgcolor="#C8C8FF"|Blue fields are editor-only fields used by [[CUSTOM]], although almost all of them are also used in-game for error-checking valid data record numbers. GAME and CUSTOM will both automatically set all these "max/number of X" fields to the true values.<br />
|-<br />
|bgcolor="#C8FFC8"|Green records are preserved in [[RSAV]] files.<br />
|}<br />
<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Element || Data || Constant || Meaning<br />
|-<br />
|0||INT ||genMaxMap ||bgcolor="#C8C8FF"|Max (last) valid map number<br />
|-<br />
|1||INT ||genTitle ||Title screen backdrop index<br />
|-<br />
|2||INT ||genTitleMus ||title music<br />
|-<br />
|3||INT ||genVictMus ||victory music + 1 (0 for none)<br />
|-<br />
|4||INT ||genBatMus ||default battle music<br />
|-<br />
|5||INT ||genPassVersion||bgcolor="#C8C8FF"| passcode format number<br />
|-<br />
|6||INT ||genPW3Rot ||bgcolor="#D0D0D0"|old (third-style) passcode rotator<br />
|-<br />
|7-15||BYTE*17 + 1 || ||bgcolor="#D0D0D0"|old (third-style) obfuscated passcode + 1 unused byte<br />
|-<br />
|16-25||INT*10 || ||bgcolor="#D0D0D0"|ancient (first-style) obsolete password data<br />
|-<br />
|26||INT ||genMaxHeroPic ||bgcolor="#C8C8FF"|Last (max) valid hero spriteset number (in [[PT0]]/[[RGFX|heroes.rgfx]])<br />
|-<br />
|27||INT ||genMaxEnemy1Pic ||bgcolor="#C8C8FF"|Last (max) valid small enemy spriteset number (graphics in [[PT1]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as small enemy graphics.<br />
|-<br />
|28||INT ||genMaxEnemy2Pic ||bgcolor="#C8C8FF"|Last (max) valid medium spriteset number (graphics in [[PT2]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as medium enemy graphics.<br />
|-<br />
|29||INT ||genMaxEnemy3Pic ||bgcolor="#C8C8FF"|Last (max) valid large enemy spriteset number (in [[PT3]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as large enemy graphics.<br />
|-<br />
|30||INT ||genMaxNPCPic ||bgcolor="#C8C8FF"|Last (max) valid walkabout spriteset number (in [[PT4]]/[[RGFX|walkabouts.rgfx]])<br />
|-<br />
|31||INT ||genMaxWeaponPic ||bgcolor="#C8C8FF"|Last (max) valid weapon spriteset number (in [[PT5]]/[[RGFX|weapons.rgfx]])<br />
|-<br />
|32||INT ||genMaxAttackPic ||bgcolor="#C8C8FF"|Last (max) valid attack spriteset number (in [[PT6]]/[[RGFX|attacks.rgfx]])<br />
|-<br />
|33||INT ||genMaxTile ||bgcolor="#C8C8FF"|Last (max) tileset number in [[TIL]]<br />
|-<br />
|34||INT ||genMaxAttack ||bgcolor="#C8C8FF"|max attack definitions in [[DT6]]<br />
|-<br />
|35||INT ||genMaxHero ||bgcolor="#C8C8FF"|max hero definitions in [[DT0]]<br />
|-<br />
|36||INT ||genMaxEnemy ||bgcolor="#C8C8FF"|max enemy definitions in [[DT1]]<br />
|-<br />
|37||INT ||genMaxFormation ||bgcolor="#C8C8FF"|max formations in [[FOR]]<br />
|-<br />
|38||INT ||genMaxPal ||bgcolor="#C8C8FF"|max palettes in [[PAL]]<br />
|-<br />
|39||INT ||genMaxTextbox ||bgcolor="#C8C8FF"|max text boxes in [[SAY]]<br />
|-<br />
|40||INT ||genMaxPlotscript ||bgcolor="#C8C8FF"|total available plotscripts (number of records in [[PLOTSCR.LST]])<br />
|-<br />
|41||INT ||genNewgameScript ||ID of new-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|42||INT ||genGameoverScript||ID of game-over [[Script Trigger|plotscript]]<br />
|-<br />
|43||INT ||genMaxRegularScript||bgcolor="#C8C8FF"|ID of highest manually numbered old-style plotscript<br />
|-<br />
|bgcolor="#C8FFC8"|44||INT ||genSuspendBits ||bgcolor="#FFC8C8"|suspendstuff bits:<br><br />
0 - suspendnpcs<br><br />
1 - suspendplayer<br><br />
2 - suspendobstruction<br><br />
3 - suspendherowalls<br><br />
4 - suspendnpcwalls<br><br />
5 - suspendcatapillar<br><br />
6 - suspendrandomenemies<br><br />
7 - suspendboxadvance<br><br />
8 - suspendoverlay<br><br />
9 - suspendambientmusic<br><br />
10 - suspenddoors<br><br />
11 - suspendtimers<br><br />
|-<br />
|bgcolor="#C8FFC8"|45||INT ||genCamera ||bgcolor="#FFC8C8"|camera mode<br />
|-<br />
|bgcolor="#C8FFC8"|46||INT ||genCamArg1 ||bgcolor="#FFC8C8"|cameraarg1<br />
|-<br />
|bgcolor="#C8FFC8"|47||INT ||genCamArg2 ||bgcolor="#FFC8C8"|cameraarg2<br />
|-<br />
|bgcolor="#C8FFC8"|48||INT ||genCamArg3 ||bgcolor="#FFC8C8"|cameraarg3<br />
|-<br />
|bgcolor="#C8FFC8"|49||INT ||genCamArg4 ||bgcolor="#FFC8C8"|cameraarg4<br />
|-<br />
|bgcolor="#C8FFC8"|50||INT ||genScrBackdrop ||bgcolor="#FFC8C8"|Index of currently displaying script backdrop , or -1 for none. (Does not include textbox backdrops)<br />
|-<br />
|bgcolor="#C8FFC8"|51||INT ||genDays ||bgcolor="#FFC8C8"|days of play<br />
|-<br />
|bgcolor="#C8FFC8"|52||INT ||genHours ||bgcolor="#FFC8C8"|hours of play<br />
|-<br />
|bgcolor="#C8FFC8"|53||INT ||genMinutes ||bgcolor="#FFC8C8"|minutes of play<br />
|-<br />
|bgcolor="#C8FFC8"|54||INT ||genSeconds ||bgcolor="#FFC8C8"|seconds of play<br />
|-<br />
|55||INT ||genMaxVehicle ||bgcolor="#C8C8FF"|max vehicle types in [[VEH]]<br />
|-<br />
|56||INT ||genMaxTagname ||bgcolor="#C8C8FF"|Last named tag<br />
|-<br />
|bgcolor="#C8FFC8"|57||INT ||genLoadgameScript||load-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|58||INT ||genTextboxBackdrop||bgcolor="#FFC8C8"|Index of currently displaying text box backdrop<br />
|-<br />
|59||INT ||genEnemyDissolve || Default enemy dissolve type. See dissolve types in [[DT1]] (each dissolve type is numbered one less than it is in DT1, for example Random Pixels is 0. <br />
|-<br />
|bgcolor="#C8FFC8"|60||INT ||genJoy ||bgcolor="#FFC8C8"|Enable/disable joystick<br />
|-<br />
|bgcolor="#C8FFC8"|61||INT ||genPoisonChar||Posion status indicator char (default to 161 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|62||INT ||genStunChar ||Stun status indicator char (default to 159 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|63||INT ||genDamageCap||Damage cap (0 if there is none)<br />
|-<br />
|bgcolor="#C8FFC8"|64||INT ||genMuteChar ||Mute status indicator char (default to 163 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|65-76||INT*12 ||genStatCap||Stat caps for each stat, in this order:<br/>HP<br/>MP<br/>Atk<br/>Aim<br/>Def<br/>Dog<br/>Mag<br/>Wil<br/>Spd<br/>Ctr<br/>Focus<br/>Extra Hits<br />
|-<br />
|77||INT ||genMaxSFX||bgcolor="#C8C8FF"|Number of sound effects<br />
|-<br />
|78||INT ||genMasterPal||Master palette number in [[PALETTES.BIN]]<br />
|-<br />
|79||INT ||genMaxMasterPal||bgcolor="#C8C8FF"|Max master palette number in [[PALETTES.BIN]] and number of UI color sets in [[UICOLORS.BIN]]<br />
|-<br />
|80||INT ||genMaxMenu||Max menu in [[MENUS.BIN]]<br />
|-<br />
|81||INT ||genMaxMenuItem||Max menu item in [[MENUITEM.BIN]]<br />
|-<br />
|82||INT ||genMaxItem||Max item number in [[ITM]]<br />
|-<br />
|83||INT ||genMaxBoxBorder||Max valid box border spriteset number (in [[PT7]]/[[RGFX|boxborders.rgfx]])<br />
|-<br />
|84||INT ||genMaxPortrait||Max valid portrait spriteset number (in [[PT8]]/[[RGFX|portraits.rgfx]])<br />
|-<br />
|bgcolor="#C8FFC8"|85||INT ||genMaxInventory||Max available inventory slots. 599 is current default max. Gets rounded ''up'' to the next multiple of 3 slots (counting the zeroth slot). Zero uses the default max of 599 (600 counting zero)<br />
|-<br />
|86||INT ||genErrorLevel||Error suppression level: <br>0: default to 4<br>2: show all warnings<br>3: suppress some warnings<br>4: suppress warnings from weak type checking<br>5: don't show errors not displayed in old versions<br>6: show only errors about corruption or interpreter problems<br />
|-<br />
|bgcolor="#C8FFC8"|87||INT || genLevelCap ||Maximum hero level (0-genMaxLevel) (Unlike genMaxLevel, this can be changed with scripting, and has no effect on stat growth)<br />
|-<br />
|88||INT || genEquipMergeFormula ||Function used to calculate total hero elemental resistances from equipment:<br><br />
0: Awful compatible formula<br><br />
1: Multiplicative<br><br />
2: Additive<br />
|-<br />
|89||INT || genNumElements ||Number of elements which the game uses, up to 64 (any higher numbered ones should be ignored in-game)<br />
|-<br />
|90||INT || genUnlockedReserveXP ||Experience gained by unlocked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|91||INT || genLockedReserveXP ||Experience gained by locked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|92||INT || genPW4Hash ||bgcolor="#C8C8FF"|Hashed password, 0 if none<br />
|-<br />
|93||INT || genPW2Offset ||bgcolor="#D0D0D0"|old(second-style) passcode offset<br />
|-<br />
|94||INT || genPW2Length ||bgcolor="#D0D0D0"|old(second-style) passcode length (-1 if there is no password)<br />
|-<br />
|95||INT ||genVersion ||RPG file format version ID (The latest version number is CURRENT_RPG_VERSION in const.bi. See also [[Incrementing the RPG format version number]])<br />
|-<br />
|96||INT ||genStartMoney||starting money<br />
|-<br />
|97||INT ||genMaxShop ||bgcolor="#C8C8FF"|last shop in [[SHO]]<br />
|-<br />
|98||INT || genPW1Offset ||bgcolor="#D0D0D0"|old-old(first-style) passcode offset<br />
|-<br />
|99||INT || genPW1Length ||bgcolor="#D0D0D0"|old-old(first-style) passcode length<br />
|-<br />
|100||INT ||genNumBackdrops||bgcolor="#C8C8FF"|''Number'' of backdrops (in [[MXS]]/[[RGFX|backdrops.rgfx]])<br />
|-<br />
|101||INT ||genBits ||[[#General bitsets]] 0-15<br />
|-<br />
|102||INT ||genStartX ||starting X<br />
|-<br />
|103||INT ||genStartY ||starting Y<br />
|-<br />
|104||INT ||genStartMap ||starting Map<br />
|-<br />
|105||INT ||genOneTimeNPC ||bgcolor="#C8C8FF"|one-time-NPC indexer<br />
|-<br />
|106-170||INT*65|| genOneTimeNPCBits ||bgcolor="#C8C8FF"|one-time-NPC placeholder bits. there are 0-1039 bits, but savegames store 0-1031 and the NPC editor only allows 0-1000<br />
|-<br />
|171||INT ||genDefaultDeathSfx ||Default enemy death sound effect ID + 1 (0 for none)<br />
|-<br />
|172||INT ||genMaxSong||bgcolor="#C8C8FF"|last song number ([[SNG]] and [[BAM]])<br />
|-<br />
|173||INT ||genAcceptSfx||Sound effect to use for "accept" (in menus) ID + 1 (0 for none)<br />
|-<br />
|174||INT ||genCancelSfx||Sound effect to use for "cancel" (in menus) ID + 1 (0 for none)<br />
|-<br />
|175||INT ||genChooseSfx||Sound effect to use for moving the cursor (in menus) ID + 1 (0 for none)<br />
|-<br />
|176||INT ||gentextboxLetter || Sound effect to use for displaying text box lines ID + 1 (0 for none)<br />
|-<br />
|177-178||INT*2 ||genBits2 || [[#General bitsets]] 16-47<br />
|-<br />
|179||INT ||genItemLearnSFX || Sound effect when learning a spell from an item. ID + 1 (0 for none)<br />
|-<br />
|180||INT ||genCantLearnSFX || Sound effect when a hero couldn't learn spell from item. ID + 1 (0 for none)<br />
|-<br />
|181||INT ||genBuySFX || Sound effect when buying an item from a shop. ID + 1 (0 for none)<br />
|-<br />
|182||INT ||genHireSFX || Sound effect when hiring a hero from a shop. ID + 1 (0 for none)<br />
|-<br />
|183||INT ||genSellSFX || Sound effect when selling an item to a shop. ID + 1 (0 for none)<br />
|-<br />
|184||INT ||genCantBuySFX || Sound effect when you can't afford item/hire. ID + 1 (0 for none)<br />
|-<br />
|185||INT ||genCantSellSFX || Sound effect when trying to sell an unsellable item. ID + 1 (0 for none)<br />
|-<br />
|186||INT ||genDamageDisplayTicks || Number of ticks to display damage numbers in battle (default 7)<br />
|-<br />
|187||INT ||genDamageDisplayRise || Number of pixels the displayed damage should rise (default 14)<br />
|-<br />
|188||INT ||genHeroWeakHP || % HP threshold for hero weak state (default to 20 if 0)<br />
|-<br />
|189||INT ||genEnemyWeakHP || % HP threshold for enemy weak state (default to 20 if 0)<br />
|-<br />
|190||INT ||genAutosortScheme || Method of autosorting inventory:<br><br />
0 - by item type<br><br />
1 - into usable/not usable<br><br />
2 - alphabetically<br><br />
3 - by ID number<br><br />
4 - no reordering beyond compacting<br />
|-<br />
|191||INT || genMaxLevel || Maximum level (0-99) This is the unchanging maximum allowed level for heroes. it is used in the hero stats editor. (Not to be confused with genLevelCap)<br />
|-<br />
|192||INT || genBattleMode || Battle mode 0=Active-time, 1=Turn-based<br />
|-<br />
|193||INT || genItemStackSize || Default maximum size of an inventory stack<br />
|-<br />
|194||INT || genResolutionX || Width in pixels of the game screen (not including graphics backend scaling) or 0 for default, 320x200<br />
|-<br />
|195||INT || genResolutionY || Height in pixels of the game screen (see above).<br />
|-<br />
|196||INT || genEscMenuScript || [[Script Trigger|plotscript]] to run when pressing ESC or ALT to open the menu (if zero, just open the menu)<br />
|- <br />
|197||INT || genSaveSlotCount || The number of available save slots, 1 to 1000. If 0, the default of 4 will be used. In versions older than [[fufluns]] the valid range was 1-32<br />
|-<br />
|198||INT || genMillisecPerFrame || Number of milliseconds per frame, or 55 if zero.<br />
|-<br />
|199||INT || genStealSuccessSFX || ID+1 of sound effect to play for a successful item steal attack, or zero for none.<br />
|-<br />
|200||INT || genStealFailSFX || ID+1 of sound effect to play for an unsuccessful item steal attack, or zero for none.<br />
|-<br />
|201||INT || genStealNoItemSFX || ID+1 of sound effect to play for an item steal attack with nothing to steal, or zero for none.<br />
|-<br />
|bgcolor="#C8FFC8"|202||INT ||genRegenChar ||Regen status indicator char (default to 32 if 0).<br />
|-<br />
|203||INT || genDefaultScale || (Obsolete). For a short while, contained the default scale/zoom factor of the display (1-16), or zero for whatever default is suitable.<br />
|-<br />
|204||INT || genDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This setting is editable, and is used as the base for genCurrentDebugMode<br />
|-<br />
|205||INT || genCurrentDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This is not directly editable. It is set based on genDebugMode but may be temporarily modified by the "Distribute Game" menu or the "Test Game" feature<br />
|-<br />
|206||INT || genStartHero || ID number the initial hero when starting a new game.<br />
|-<br />
|207||INT || genStartTextbox || ID number a textbox to open when starting a new game, 0 means none.<br />
|-<br />
|208||INT || genWindowSize || Default window size about X% of screen, in multiples of 10% (1-10). 10 means maximize. If 0, default to 8.<br />
|-<br />
|209||INT || genLivePreviewWindowSize || Test-Game default window size about X% of screen, in multiples of 10%. 10 means maximize. If 0, default to 5.<br />
|-<br />
|210||INT || genFullscreen || If 1 (or nonzero), default to fullscreen if there is no remembered preference for this game from previous plays.<br />
|-<br />
|211||INT || genMusicVolume || Initial music volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|212||INT || genSFXVolume || Initial global sound effects volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|213||INT || genRungameFullscreenIndependent || If false, fullscreen settings/config for games spawned by rungame are ignored<br />
|-<br />
|214||INT || genSkipBattleRewardsTicks || If > 0 then the battle rewards messages will automatically advance after this many ticks<br />
|-<br />
|215||INT|| genDefOnkeypressScript|| Default on-keypress Plot[[script Trigger]]<br />
|-<br />
|216||INT|| genDefEachStepScript|| Default each-step Plot[[script Trigger]]<br />
|-<br />
|217||INT|| genDefAfterBattleScript|| Default after-battle Plot[[script Trigger]]<br />
|-<br />
|218||INT|| genDefInsteadOfBattleScript|| Default instead-of-battle Plot[[script Trigger]]<br />
|-<br />
|219||INT|| genDefMapAutorunScript|| Default map autorun Plot[[script Trigger]]<br />
|-<br />
|220||INT|| genMaxEnemyPic ||bgcolor="#C8C8FF"|Last (max) valid enemy spriteset number (in [[RGFX|enemies.rgfx]])<br />
|-<br />
|221||INT|| genMinimapAlgorithm || Algorithm for producing in-game minimaps:<br><br />
0 - Smooth scaling (default)<br><br />
1 - Scatter - original random pixel selection algorithm<br><br />
2 - Majority: (Approximate) most common color<br />
|-<br />
|222-225||INT*4|| genBits3 || [[#General bitsets]] 48-111<br />
|-<br />
|226||INT|| genDefCounterProvoke || Default Provoke Counterattacks setting for attacks. Value 0-8, same meanings as [[DT6]] Provoke Counterattacks setting, except Default means 'Always'<br />
|-<br />
|227||INT|| genInventSlotx1Display || When to display x1 in inventory: 0: always, 1: never, 2: only if item maximum stacksize > 1<br />
|-<br />
|228||INT|| genCameraOnWalkaboutFocus || How to calculate walkabout camera focus: 0: on tile, 1: on sprite, 2: on sprite minus Z/offset <br />
|-<br />
|229||INT|| genTicksPerWalkFrame || Number of ticks per walking frame. 0 = default (110ms/frame; ticks calculated from genMillisecPerFrame and rounded to a whole number)<br />
|-<br />
|230||INT|| genAddHeroScript || Script trigger called when hero added<br />
|-<br />
|231||INT|| genRemoveHeroScript || Script trigger called when hero deleted/removed<br />
|-<br />
|232||INT|| genMoveHeroScript || Script trigger called when hero moved to a different slot<br />
|-<br />
|233||INT|| gen8bitBlendAlgo || Algorithm to use for palette lookups for blending in 8-bit color mode:<br><br />
0 - Dither (Half of pixels (in a chequered pattern) are nearest-matched, with 1/2 or 3/4 (alternating) of error diffused to next pixel)<br><br />
1 - Less Dither (Like 'Dither' but only 1/4 of error diffused, without alternation)<br><br />
2 - No Dither (nearest match color)<br />
|-<br />
|234||INT|| genPreviewBackdrop || 0 or ID+1 of backdrop to use for enemy previews (and maybe more in future)<br />
|-<br />
|235||INT|| gen32bitMode || 1 for 32-bit color mode, 0 for 8-bit<br />
|-<br />
|236||INT|| genDefaultBattleMenu || 0 for default, or menu ID + 1 {{WIP|inline}}<br />
|-<br />
|237-499||INT || ||bgcolor="#D0D0D0"| unused space<br />
|}<br />
<br />
'''Maximums''' : "max XYZ" means 'the highest numbered XYZ'. If you have 80 enemies defined, then "max enemy" == 79, because the numbering starts from 0.<br />
<br />
== General bitsets ==<br />
<br />
Preference bits, backcompat bits and battle system bits are stored in a single bit array, which is split into pieces beginning at gen(genBits), gen(genBits2) and gen(genBits3). They are accessed with the <tt>prefbit()</tt> and <tt>setprefbit()</tt> functions in FB code, and {{plot|read preference bit}} and {{plot|write preference bit}} functions in HS code.<br />
<br />
'''Note''': in the Preference Bitsets and other editors, some of the names of bits are '''reversed''' from what they are below.<br />
For example the editor has a bit named "Restore HP on level-up" which appears ON if bit 2 ("Don't restore HP on level-up") is OFF.<br />
<br />
Also note that some bits are turned on during game upgrade by [[fixbits]].<br />
<br />
* 0 - Pause in battle on spell and item menus<br />
* 1 - Enable Caterpillar party<br />
* 2 - Don't restore HP on level-up<br />
* 3 - Don't restore MP on level-up<br />
* 4 - Inns don't revive dead heros<br />
* 5 - Hero swapping always available<br />
* 6 - Hide ready meter in battle<br />
* 7 - Hide health bar in battle<br />
* 8 - Disable debugging keys<br />
* 9 - Simulate old level-up bug<br />
* 10 - Permit double-triggering of scripts<br />
* 11 - Skip title screen<br />
* 12 - Skip load screen<br />
* 13 - Pause in battle on all menus<br />
* 14 - Disable Hero's Battle Cursor<br />
* 15 - Default passability disabled by default<br />
* 16 - Simulate pushable NPC collision bug<br />
* 17 - Disable ESC to run from battle<br />
* 18 - Don't save gameover/loadgame script IDs (actually prevents ''using'' the stored "game over" or "loadgame" script ID number in preference to the ones specified by gen(genGameoverScript) and gen(genLoadgameScript))<br />
* 19 - Dead heroes gain share of experience<br />
* 20 - Locked heros can't be rearranged<br />
* 21 - Attack captions pause battle meters<br />
* 22 - Don't randomize battle ready-meters<br />
* 23 - Battle menus wait for attack animations<br />
* 24 - Enable better scancodes for scripts<br />
* 25 - Simulate old fail vs. elemental resist bit<br />
* 26 - 0 damage when immune to attack elements<br />
* 27 - Recreate map slices when changing maps<br />
* 28 - Harm tiles harm non-caterpillar heroes<br />
* 29 - Ignore extra Hits stat<br />
* 30 - Don't divide experience between heroes<br />
* 31 - Don't reset max stats after OOB attack<br />
* 32 - Don't limit max tags to 1000<br />
* 33 - Enable bug 430<br />
* 34 - showtextbox happens immediately<br />
* 35 - Pause battle while targeting attacks<br />
* 36 - Old attack positioning at bottom-left of target<br />
* 37 - Wrap map layers over edge of Crop maps<br />
* 38 - Never show script timer during battles<br />
* 39 - Draw Backdrop slice above Script layer<br />
* 40 - Don't stop music when starting/loading game<br />
* 41 - Keep caterpillar length the same when speed changes<br />
* 42 - Heroes use Walk in Place animation while idle.<br />
* 43 - Cap minimum stats at zero.<br />
* 44 - Hide empty save slots at the bottom of the save/load menu<br />
* 45 - Attack IDs in scripts are offset by +1 {{Future|inline}}<br />
* 46 - Negative damage harmtiles '''don't''' cure above max HP<br />
* 47 - Don't map joystick controls to keyboard keys for scripts<br />
* 48 - Disable ESC to cancel/change a hero's attack (turn-based battles only)<br />
* 49 - Show hero MP meter<br />
* 50 - Non-turn attack delays '''don't''' also cause turn delays<br />
* 51 - Don't break Speed ties randomly (turn-based battles only)<br />
* 52 - Ignore MP~ stat<br />
* 53 - "!Map joystick (left) stick to dpad"<br />
* 54 - Random spell lists respect attack costs {{WIP|inline}}<br />
* 55 - Turncoats and defectors always treat self as an ally<br />
* Bits up to 111 unused<br />
<br />
== Passwords ==<br />
The password protection in the RPG format is necessarily wet-paper-bag weak, due to the GNU GPL licensing of the engine. RPG password protection works entirely on the honor system. It's kinda like that faded sign hanging on the gates of Anhk-Morpork that says "Thank you for not invading our city"<br />
<br />
Here is how to read the password. Please-please-pretty-please dont just ignore it. It is flimsy pathetic laughable protection, but its all we have! Dont take away our wire umbrella in the lightening storm!<br />
<br />
Over time there have been 4 different password formats, referred to as PW1, PW2, PW3, PW4. All are stored in the GEN lump. The format is determined by looking at genVersion and genPassVersion (go down this table):<br />
<br />
{| border="1" cellpadding="1"<br />
! Format || Indicator || Introduced || Last used<br />
|-<br />
|PW4 || gen(genPassVersion) = 257 || pre-Zenzizenzic (Dec 28 2010) || Still in use.<br />
|-<br />
|PW3 || gen(genPassVersion) = 256 || Ozarks (June 28 2004) || Still partial back-compat (see below)<br />
|-<br />
|PW2 || gen(genVersion) >= 3 || June 18 1999 || Written until Dec 28 2010<br />
|-<br />
|PW1 || Otherwise || Stone Age ||<br />
|}<br />
<br />
For backwards compatibility, Custom also writes a blank PW3 password is there is no password, or a random PW3 password if there is one.<br />
<br />
The easiest thing to do when decoding an RPG file that still has its password in an old format is to print a warning message telling the user to upgrade their RPG file with CUSTOM.EXE<br />
<br />
=== PW4 ===<br />
This new format stores just a 9-bit hash of the password, in gen(genPW4Hash), so that it is not retrievable.<br />
<br />
The hash is calculated as follows (or see common.bas for the FB version):<br />
<br />
unsigned short passwordhash (char *p) {<br />
if (strlen(p) == 0) return 0;<br />
unsigned int hash = 0;<br />
while (*p)<br />
hash = hash * 3 + *p++ * 31;<br />
return (hash & 511) | 512;<br />
}<br />
<br />
=== PW3 ===<br />
In this format, the password is obscured with weak, but space-wasting encryption, and the length of the password is totally unprotected.<br />
<br />
GEN(6) is the password rotator. It will always be a random number from 1 to 254 that will be used to ascii-rotate/obfuscate the password.<br />
<br />
GEN(7-15) is the password text. There are 17 bytes of data here (so the high byte of GEN(15) is unused). Read this string of 17 bytes. ascii-rotate each character by subtracting GEN(6) and if the result is < 0 then add 255, and then discard all characters with ascii values less than 32 (space). The resulting string will be your password. If the string is empty (all 17 chars were under 32) then the RPG file does not have a password.<br />
<br />
=== PW2 ===<br />
This information describes the obsolete scattertable-based password storage format. It is only here as a curiosity... and a monument of shame to security-through-obscurity.<br />
The body of the scattertable lived at GEN(200) to GEN(359), with the "scattertable head" at gen(199).<br />
The first element of the password mess GEN(200) is the bit-offset of the first bit in the password, relative to the beginning of the scattertable head (199). The next element (201) is the bit-offset of the next bit in the password, and so on. So GEN(200) thru GEN(207) will give you the bits that make up the first ascii char of the password. GEN(208)-GEN(215) gives you the next char, and so on up to GEN(94)+1 bytes. After you have read all the chars from the scattertable, rotate them down by the value of GEN(93) (that is to say, subtract GEN(93) from the ascii value of each char, and if the result is less than 0, add 256).<br />
<br />
Clear as mud, right? Here is an example. Lets suppose that the data in the GEN lump looks like this<br />
<br />
<pre><br />
GEN(93)=172 the ascii-rotate offset<br />
GEN(94)=23 the number of bits -1.<br />
23+1 = 24, thats the total number of bits in the password<br />
There are 8 bits in each char of the password, so 24<br />
divided by 8 is 3. That means this password will end up being 3 chars long.<br />
<br />
BIT OFFSETS/SCATTERTABLE<br />
GEN(199)=8 [0001 0000 0000 0000] dummy number. Never 0 or 255<br />
GEN(200)=4 [0010 0000 0000 0000] Start here. bit 4 in the table is a 0<br />
GEN(201)=3 [1100 0000 0000 0000] bit 3 in the table is a 1, now we have 01<br />
GEN(202)=18[0100 1000 0000 0000] bit 18 is 1: 011<br />
GEN(203)=18[0100 1000 0000 0000] bit 18 is 1: 0111<br />
GEN(204)=54[0110 1100 0000 0000] bit 58 is 0: 01110<br />
GEN(205)=33[1000 0010 0000 0000] bit 33 is 1: 011101<br />
GEN(206)=85[1010 1010 0000 0000] bit 85 is 1: 0111011<br />
GEN(207)=82[0100 1010 0000 0000] bit 82 is 1: 01110111<br />
</pre><br />
<br />
So we end up with 01110111 which is char 238, (a wierd ascii math symbol) Now we subtract the value of GEN(93) and we get 66, which is the ascii code for upper case B, so we know the first letter of the password is B.<br />
<br />
Ah, what fun. what a mess. what a waste. *sigh*<br />
<br />
===PW1===<br />
<br />
We didn't bother to document this here, but it's yet another scheme, very similar to PW3! If you care, you can read the read_PW1_password() function in the source. It stores the password in gen(5) upwards, and in gen(genPW1Offset) and gen(genPW1Length) (gen(98) and gen(99).<br />
<br />
=See Also=<br />
* [http://thread.gmane.org/gmane.games.ohrrpgce.devel/17774 Garbage in GEN], an investigation of junk in high areas of GEN in older games<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=How_do_I_give_my_game_an_icon%3F&diff=34361How do I give my game an icon?2022-02-20T18:57:36Z<p>Bob the Hamster: old icon converter site is dead, found a different one</p>
<hr />
<div>=Windows and Mac=<br />
<br />
Starting with the [[Callipygous]] stable release, all you have to do is create a Square image in your favorite image editor, save it as a .png file, and then convert it with an icon converting tool such as https://cloudconvert.com/png-converter Save the resulting .ico file for Windows and .icns file for Mac.<br />
<br />
Save these files into the same folder as the .rpg file, and then use '''Export .ZIP (Windows)''' or '''Export Windows Installer''' or '''Export Mac OS X App Bundle''' in the Distribute Game menu. If your game is '''gamename.rpg''' then the icon file should be named '''gamename.ico''' for Windows or '''gamename.icns''' for Mac.<br />
<br />
=On Android=<br />
<br />
Android icons should be square PNG images. The preferred size is 256x256 pixels. (Google play requires 512x512 for your store listing, but resizing a png is easy)<br />
<br />
=Linux=<br />
<br />
Linux Icons are not supported yet, but hopefully they will be in a future version. <br />
<br />
=Change icon in Source Code=<br />
<br />
The game icon can be changed in the [[Source|source files]] of the OHRRPGCE, too, by replacing game.ico and [[compiling]].<br />
(If compiling [[etheldreme]] or older, build/gicon.obj has to be manually deleted before recompiling.)<br />
<br />
=See Also=<br />
* [[What files do I need to give people so they can play my RPG?]]<br />
<br />
[[Category:Questions]] [[Category:Artwork]]<br />
[[Category:Game Distribution]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34360DT62022-02-20T15:02:33Z<p>Bob the Hamster: flipped sprite status</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||33: Exclude this attack from hero auto-battle {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (46)||34-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{WIP|inline}}<br />
|-<br />
|349||INT (1)|| change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default {{WIP|inline}}<br />
|-<br />
|350||INT (1)|| change target's defector target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default {{WIP|inline}}<br />
|-<br />
|351||INT (1)|| change target's flipped sprite status - 0=no change, 1=flipped, 2=unflipped, 3=set to default {{WIP|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Heroes.reld&diff=34359Heroes.reld2022-02-14T21:53:35Z<p>Bob the Hamster: exclude_auto_battle</p>
<hr />
<div>A [[RELOAD]] format lump for storage of hero definitions.<br />
<br />
This lump replaced [[DT0]] in all versions after Dec 21 2012. (CURRENT_RPG_VERSION >= 19)<br />
<br />
* '''heroes''' - this is the root node<br />
** '''hero''' int - one node for each hero. value is id number<br />
*** '''name''' string<br />
**** '''maxlen''' int - max length of name when renaming. if node not present use default<br />
*** '''appearance''' contains appearance data<br />
**** '''walkabout'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
**** '''battle'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
***** '''hand_a''' - node containing hand offset data for attack frame A<br />
****** '''x''' int - x offset of hand<br />
****** '''y''' int - y offset of hand<br />
***** '''hand_b''' - node containing hand offset data for attack frame B<br />
****** '''x''' int - x offset of hand<br />
****** '''y''' int - y offset of hand<br />
**** '''portrait'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
*** '''default_level''' int - value is level number. Use default if node is not present<br />
*** '''default_weapon''' int - item id number<br />
*** '''default_auto_battle''' int - if not zero, this hero will default to fighting automatically in battle. If absent or zero, this hero will default to normal player control {{WIP|inline}}<br />
*** '''exp_mult''' float - multiplier in the hero's experience formula (minus 1). Defaults to 0.2, ie ''1.2*prev+5''<br />
*** '''stats_at_zero''' - contains stats at level 0<br />
**** '''stat''' int - one node for each stat. value is stat ID number 0-11<br />
***** '''value''' int - value for this stat<br />
*** '''stats_at_max''' - contains stats at max level (often, but not always level 99)<br />
**** '''stat''' int - one node for each stat. value is stat ID number 0-11<br />
***** '''value''' int - value for this stat<br />
*** '''battle_menus''' - stores the hero's battle menu data<br />
**** '''menu''' - one for each hero battle menu slot.<br />
***** '''kind''' only has one child node. The valid options are listed below<br />
****** '''weapon''' - if this node is present, this is the attack specified by the hero's equipped weapon<br />
****** '''attack''' int - if this node is present, this is an attack. Value is attack ID number<br />
****** '''items''' - if this node it present, this is the item menu<br />
****** '''spells''' int - if this node is present, this is a spell list. Value is list id 0-3<br />
****** '''skip''' - if this node it present, this menu item is "Skip Turn" {{WIP|inline}}<br />
***** '''caption''' string - the text of the of menu item. If blank or missing the default is used (the attack or spell list name, or the "Items" global string)<br />
***** '''color''' int - the text color, in the master palette. 0 or missing indicates to use the default, uilook(uiText).<br />
***** '''enable_tag1''' int - if this tag check fails the menu option will be disabled. >= 0 is ON, < 0 is OFF. If not present, default 0 meaning "always"<br />
***** '''enable_tag2''' int - same as above<br />
***** '''hide_disabled''' bool - if nonzero, indicates that if the menu item is disabled, it should be hidden instead of just unselectable. Spell lists with blank names are always hidden regardless, but all other things that disable a menu item (e.g. attack costs) do respect this.<br />
***** '''exclude_auto_battle''' bool - if nonzero, this battle menu item will never be used when the hero is in auto-battle mode {{WIP|inline}}<br />
*** '''spell_lists''' - Container for spell lists<br />
**** '''list''' int - one node for each spell list 0-3. value is list id number. Empty lists are not present.<br />
***** '''name''' string - name of the spell list<br />
***** '''spells''' - contains spells<br />
****** '''spell''' int - one node for each defined spell. value is id 0-23<br />
******* '''attack''' int - value is id number of attack to use for this spell<br />
******* '''learnlev''' int - level at which the hero learns the spell. Not present if not used<br />
******* '''itemlearn''' - node is present if the hero can learn this spell from an item<br />
******* '''tag''' int - if this tag check passes, the spell is visible (default "always")<br />
******* other nodes related to [[Plan for improved spell learning]] will go here later<br />
***** '''random''' - if this node is present, an attack is automatically randomly selected from the list<br />
***** '''use_lmp''' - if this node is present, all spells in this list require FF1-style level-based-mp <br />
*** '''elements''' - stores the hero's elemental strengths and weaknesses<br />
**** '''element''' int - an element; value is ID number. Element nodes not present will use the default of 1.0<br />
***** '''damage''' double - damage taken from this element (1.0 = 100% normal)<br />
*** '''rename_on_add''' - if present, the hero is renamed when added to the party<br />
*** '''rename_on_status''' - if present, the hero can be renamed on the status screen<br />
*** '''hide_empty_lists''' - if present, the hero's empty spell lists are hidden <br />
*** '''tags''' - contains tags automatically set by this hero<br />
**** '''have_hero''' int - tag to turn ON if the hero is in the party<br />
**** '''is_alive''' int - tag to turn ON if the hero is alive<br />
**** '''is_leader''' int - tag to turn ON if the hero is the leader<br />
**** '''is_active''' int - tag to turn on if the hero is a member of the active party<br />
**** '''checks''' - parent node for hero list of checks that set tags<br />
***** '''range''' - a list of zero or more range check nodes<br />
****** '''kind''' string - Currently always "level" but we can use this to check stats or other things later<br />
****** '''tag''' int - a tag number that will be turned on if the check succeeds.<br />
****** '''min''' int - Check if the hero's level is >= this<br />
****** '''max''' int - Check if the hero's level is <= this<br />
*** '''stat_options''' customize the display of stats<br />
**** '''stat''' int - zero or more nodes for containing stat options. The value is the stat ID number. If a stat has no node, it uses defaults<br />
***** '''hide''' - if this node is present, the stat should be hidden from this hero's status and equip screens<br />
*** '''counterattacks''' - parent node for hero's intrinsic counterattacks<br />
**** '''elemental''' - parent node for hero's elemental counterattacks<br />
***** '''element''' int - an optional node for each elemental 0-63. Elementals with no counterattack can be omitted<br />
****** '''attack''' int - id number of the counterattack<br />
**** '''nonelemental''' - parent node for hero's non-elemental counterattack<br />
***** '''attack''' int - id number of the counterattack<br />
**** '''statdamage''' - parent node for hero's stat damage counterattacks<br />
***** '''stat''' int - an optional node for each regular stat 0-11. Stats with no counterattack can be omitted<br />
****** '''attack''' int - id number of the counterattack<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34358DT62022-02-13T15:31:57Z<p>Bob the Hamster: bit to exclude attack from hero auto-battle</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||33: Exclude this attack from hero auto-battle {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (46)||34-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{WIP|inline}}<br />
|-<br />
|349||INT (1)|| change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default {{WIP|inline}}<br />
|-<br />
|350||INT (1)|| change target's defector target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default {{WIP|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=GEN&diff=34357GEN2022-02-12T14:04:10Z<p>Bob the Hamster: okay, who's been implementing bits without documenting them? :D</p>
<hr />
<div>__NOTOC__<br />
The lump with the extension .GEN is a critical one. It contains miscellaneous information about a wide variety of unrelated things, especially max number of records for other files, password information, and other stuff that I felt like sticking in there too-- some of which really don't belong.<br />
<br />
New general options are increasingly being added to [[general.reld]] instead, the RELOAD-format alternative.<br />
<br />
{{BSAVE Header}}<br />
<br />
The .gen lump is normally 1007 bytes long (including 7 byte header). '''NOTE:''' The fixWipeGEN [[FIXBITS.BIN|fixbit]] must be checked when reading values at offsets 199 and up.<br />
<br />
The following is the meaning of each element.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|-<br />
|bgcolor="#FFC8C8"|Pink fields are runtime-only fields used by [[GAME]] that do not really belong GEN in the first place, but are there anyway to make including them in [[SAV]] files more convenient, which is now a moot argument because of the conversion to [[RSAV]].<br />
|-<br />
|bgcolor="#C8C8FF"|Blue fields are editor-only fields used by [[CUSTOM]], although almost all of them are also used in-game for error-checking valid data record numbers. GAME and CUSTOM will both automatically set all these "max/number of X" fields to the true values.<br />
|-<br />
|bgcolor="#C8FFC8"|Green records are preserved in [[RSAV]] files.<br />
|}<br />
<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Element || Data || Constant || Meaning<br />
|-<br />
|0||INT ||genMaxMap ||bgcolor="#C8C8FF"|Max (last) valid map number<br />
|-<br />
|1||INT ||genTitle ||Title screen backdrop index<br />
|-<br />
|2||INT ||genTitleMus ||title music<br />
|-<br />
|3||INT ||genVictMus ||victory music + 1 (0 for none)<br />
|-<br />
|4||INT ||genBatMus ||default battle music<br />
|-<br />
|5||INT ||genPassVersion||bgcolor="#C8C8FF"| passcode format number<br />
|-<br />
|6||INT ||genPW3Rot ||bgcolor="#D0D0D0"|old (third-style) passcode rotator<br />
|-<br />
|7-15||BYTE*17 + 1 || ||bgcolor="#D0D0D0"|old (third-style) obfuscated passcode + 1 unused byte<br />
|-<br />
|16-25||INT*10 || ||bgcolor="#D0D0D0"|ancient (first-style) obsolete password data<br />
|-<br />
|26||INT ||genMaxHeroPic ||bgcolor="#C8C8FF"|Last (max) valid hero spriteset number (in [[PT0]]/[[RGFX|heroes.rgfx]])<br />
|-<br />
|27||INT ||genMaxEnemy1Pic ||bgcolor="#C8C8FF"|Last (max) valid small enemy spriteset number (graphics in [[PT1]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as small enemy graphics.<br />
|-<br />
|28||INT ||genMaxEnemy2Pic ||bgcolor="#C8C8FF"|Last (max) valid medium spriteset number (graphics in [[PT2]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as medium enemy graphics.<br />
|-<br />
|29||INT ||genMaxEnemy3Pic ||bgcolor="#C8C8FF"|Last (max) valid large enemy spriteset number (in [[PT3]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as large enemy graphics.<br />
|-<br />
|30||INT ||genMaxNPCPic ||bgcolor="#C8C8FF"|Last (max) valid walkabout spriteset number (in [[PT4]]/[[RGFX|walkabouts.rgfx]])<br />
|-<br />
|31||INT ||genMaxWeaponPic ||bgcolor="#C8C8FF"|Last (max) valid weapon spriteset number (in [[PT5]]/[[RGFX|weapons.rgfx]])<br />
|-<br />
|32||INT ||genMaxAttackPic ||bgcolor="#C8C8FF"|Last (max) valid attack spriteset number (in [[PT6]]/[[RGFX|attacks.rgfx]])<br />
|-<br />
|33||INT ||genMaxTile ||bgcolor="#C8C8FF"|Last (max) tileset number in [[TIL]]<br />
|-<br />
|34||INT ||genMaxAttack ||bgcolor="#C8C8FF"|max attack definitions in [[DT6]]<br />
|-<br />
|35||INT ||genMaxHero ||bgcolor="#C8C8FF"|max hero definitions in [[DT0]]<br />
|-<br />
|36||INT ||genMaxEnemy ||bgcolor="#C8C8FF"|max enemy definitions in [[DT1]]<br />
|-<br />
|37||INT ||genMaxFormation ||bgcolor="#C8C8FF"|max formations in [[FOR]]<br />
|-<br />
|38||INT ||genMaxPal ||bgcolor="#C8C8FF"|max palettes in [[PAL]]<br />
|-<br />
|39||INT ||genMaxTextbox ||bgcolor="#C8C8FF"|max text boxes in [[SAY]]<br />
|-<br />
|40||INT ||genMaxPlotscript ||bgcolor="#C8C8FF"|total available plotscripts (number of records in [[PLOTSCR.LST]])<br />
|-<br />
|41||INT ||genNewgameScript ||ID of new-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|42||INT ||genGameoverScript||ID of game-over [[Script Trigger|plotscript]]<br />
|-<br />
|43||INT ||genMaxRegularScript||bgcolor="#C8C8FF"|ID of highest manually numbered old-style plotscript<br />
|-<br />
|bgcolor="#C8FFC8"|44||INT ||genSuspendBits ||bgcolor="#FFC8C8"|suspendstuff bits:<br><br />
0 - suspendnpcs<br><br />
1 - suspendplayer<br><br />
2 - suspendobstruction<br><br />
3 - suspendherowalls<br><br />
4 - suspendnpcwalls<br><br />
5 - suspendcatapillar<br><br />
6 - suspendrandomenemies<br><br />
7 - suspendboxadvance<br><br />
8 - suspendoverlay<br><br />
9 - suspendambientmusic<br><br />
10 - suspenddoors<br><br />
11 - suspendtimers<br><br />
|-<br />
|bgcolor="#C8FFC8"|45||INT ||genCamera ||bgcolor="#FFC8C8"|camera mode<br />
|-<br />
|bgcolor="#C8FFC8"|46||INT ||genCamArg1 ||bgcolor="#FFC8C8"|cameraarg1<br />
|-<br />
|bgcolor="#C8FFC8"|47||INT ||genCamArg2 ||bgcolor="#FFC8C8"|cameraarg2<br />
|-<br />
|bgcolor="#C8FFC8"|48||INT ||genCamArg3 ||bgcolor="#FFC8C8"|cameraarg3<br />
|-<br />
|bgcolor="#C8FFC8"|49||INT ||genCamArg4 ||bgcolor="#FFC8C8"|cameraarg4<br />
|-<br />
|bgcolor="#C8FFC8"|50||INT ||genScrBackdrop ||bgcolor="#FFC8C8"|Index of currently displaying script backdrop , or -1 for none. (Does not include textbox backdrops)<br />
|-<br />
|bgcolor="#C8FFC8"|51||INT ||genDays ||bgcolor="#FFC8C8"|days of play<br />
|-<br />
|bgcolor="#C8FFC8"|52||INT ||genHours ||bgcolor="#FFC8C8"|hours of play<br />
|-<br />
|bgcolor="#C8FFC8"|53||INT ||genMinutes ||bgcolor="#FFC8C8"|minutes of play<br />
|-<br />
|bgcolor="#C8FFC8"|54||INT ||genSeconds ||bgcolor="#FFC8C8"|seconds of play<br />
|-<br />
|55||INT ||genMaxVehicle ||bgcolor="#C8C8FF"|max vehicle types in [[VEH]]<br />
|-<br />
|56||INT ||genMaxTagname ||bgcolor="#C8C8FF"|Last named tag<br />
|-<br />
|bgcolor="#C8FFC8"|57||INT ||genLoadgameScript||load-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|58||INT ||genTextboxBackdrop||bgcolor="#FFC8C8"|Index of currently displaying text box backdrop<br />
|-<br />
|59||INT ||genEnemyDissolve || Default enemy dissolve type. See dissolve types in [[DT1]] (each dissolve type is numbered one less than it is in DT1, for example Random Pixels is 0. <br />
|-<br />
|bgcolor="#C8FFC8"|60||INT ||genJoy ||bgcolor="#FFC8C8"|Enable/disable joystick<br />
|-<br />
|bgcolor="#C8FFC8"|61||INT ||genPoisonChar||Posion status indicator char (default to 161 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|62||INT ||genStunChar ||Stun status indicator char (default to 159 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|63||INT ||genDamageCap||Damage cap (0 if there is none)<br />
|-<br />
|bgcolor="#C8FFC8"|64||INT ||genMuteChar ||Mute status indicator char (default to 163 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|65-76||INT*12 ||genStatCap||Stat caps for each stat, in this order:<br/>HP<br/>MP<br/>Atk<br/>Aim<br/>Def<br/>Dog<br/>Mag<br/>Wil<br/>Spd<br/>Ctr<br/>Focus<br/>Extra Hits<br />
|-<br />
|77||INT ||genMaxSFX||bgcolor="#C8C8FF"|Number of sound effects<br />
|-<br />
|78||INT ||genMasterPal||Master palette number in [[PALETTES.BIN]]<br />
|-<br />
|79||INT ||genMaxMasterPal||bgcolor="#C8C8FF"|Max master palette number in [[PALETTES.BIN]] and number of UI color sets in [[UICOLORS.BIN]]<br />
|-<br />
|80||INT ||genMaxMenu||Max menu in [[MENUS.BIN]]<br />
|-<br />
|81||INT ||genMaxMenuItem||Max menu item in [[MENUITEM.BIN]]<br />
|-<br />
|82||INT ||genMaxItem||Max item number in [[ITM]]<br />
|-<br />
|83||INT ||genMaxBoxBorder||Max valid box border spriteset number (in [[PT7]]/[[RGFX|boxborders.rgfx]])<br />
|-<br />
|84||INT ||genMaxPortrait||Max valid portrait spriteset number (in [[PT8]]/[[RGFX|portraits.rgfx]])<br />
|-<br />
|bgcolor="#C8FFC8"|85||INT ||genMaxInventory||Max available inventory slots. 599 is current default max. Gets rounded ''up'' to the next multiple of 3 slots (counting the zeroth slot). Zero uses the default max of 599 (600 counting zero)<br />
|-<br />
|86||INT ||genErrorLevel||Error suppression level: <br>0: default to 4<br>2: show all warnings<br>3: suppress some warnings<br>4: suppress warnings from weak type checking<br>5: don't show errors not displayed in old versions<br>6: show only errors about corruption or interpreter problems<br />
|-<br />
|bgcolor="#C8FFC8"|87||INT || genLevelCap ||Maximum hero level (0-genMaxLevel) (Unlike genMaxLevel, this can be changed with scripting, and has no effect on stat growth)<br />
|-<br />
|88||INT || genEquipMergeFormula ||Function used to calculate total hero elemental resistances from equipment:<br><br />
0: Awful compatible formula<br><br />
1: Multiplicative<br><br />
2: Additive<br />
|-<br />
|89||INT || genNumElements ||Number of elements which the game uses, up to 64 (any higher numbered ones should be ignored in-game)<br />
|-<br />
|90||INT || genUnlockedReserveXP ||Experience gained by unlocked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|91||INT || genLockedReserveXP ||Experience gained by locked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|92||INT || genPW4Hash ||bgcolor="#C8C8FF"|Hashed password, 0 if none<br />
|-<br />
|93||INT || genPW2Offset ||bgcolor="#D0D0D0"|old(second-style) passcode offset<br />
|-<br />
|94||INT || genPW2Length ||bgcolor="#D0D0D0"|old(second-style) passcode length (-1 if there is no password)<br />
|-<br />
|95||INT ||genVersion ||RPG file format version ID (The latest version number is CURRENT_RPG_VERSION in const.bi. See also [[Incrementing the RPG format version number]])<br />
|-<br />
|96||INT ||genStartMoney||starting money<br />
|-<br />
|97||INT ||genMaxShop ||bgcolor="#C8C8FF"|last shop in [[SHO]]<br />
|-<br />
|98||INT || genPW1Offset ||bgcolor="#D0D0D0"|old-old(first-style) passcode offset<br />
|-<br />
|99||INT || genPW1Length ||bgcolor="#D0D0D0"|old-old(first-style) passcode length<br />
|-<br />
|100||INT ||genNumBackdrops||bgcolor="#C8C8FF"|''Number'' of backdrops (in [[MXS]]/[[RGFX|backdrops.rgfx]])<br />
|-<br />
|101||INT ||genBits ||[[#General bitsets]] 0-15<br />
|-<br />
|102||INT ||genStartX ||starting X<br />
|-<br />
|103||INT ||genStartY ||starting Y<br />
|-<br />
|104||INT ||genStartMap ||starting Map<br />
|-<br />
|105||INT ||genOneTimeNPC ||bgcolor="#C8C8FF"|one-time-NPC indexer<br />
|-<br />
|106-170||INT*65|| genOneTimeNPCBits ||bgcolor="#C8C8FF"|one-time-NPC placeholder bits. there are 0-1039 bits, but savegames store 0-1031 and the NPC editor only allows 0-1000<br />
|-<br />
|171||INT ||genDefaultDeathSfx ||Default enemy death sound effect ID + 1 (0 for none)<br />
|-<br />
|172||INT ||genMaxSong||bgcolor="#C8C8FF"|last song number ([[SNG]] and [[BAM]])<br />
|-<br />
|173||INT ||genAcceptSfx||Sound effect to use for "accept" (in menus) ID + 1 (0 for none)<br />
|-<br />
|174||INT ||genCancelSfx||Sound effect to use for "cancel" (in menus) ID + 1 (0 for none)<br />
|-<br />
|175||INT ||genChooseSfx||Sound effect to use for moving the cursor (in menus) ID + 1 (0 for none)<br />
|-<br />
|176||INT ||gentextboxLetter || Sound effect to use for displaying text box lines ID + 1 (0 for none)<br />
|-<br />
|177-178||INT*2 ||genBits2 || [[#General bitsets]] 16-47<br />
|-<br />
|179||INT ||genItemLearnSFX || Sound effect when learning a spell from an item. ID + 1 (0 for none)<br />
|-<br />
|180||INT ||genCantLearnSFX || Sound effect when a hero couldn't learn spell from item. ID + 1 (0 for none)<br />
|-<br />
|181||INT ||genBuySFX || Sound effect when buying an item from a shop. ID + 1 (0 for none)<br />
|-<br />
|182||INT ||genHireSFX || Sound effect when hiring a hero from a shop. ID + 1 (0 for none)<br />
|-<br />
|183||INT ||genSellSFX || Sound effect when selling an item to a shop. ID + 1 (0 for none)<br />
|-<br />
|184||INT ||genCantBuySFX || Sound effect when you can't afford item/hire. ID + 1 (0 for none)<br />
|-<br />
|185||INT ||genCantSellSFX || Sound effect when trying to sell an unsellable item. ID + 1 (0 for none)<br />
|-<br />
|186||INT ||genDamageDisplayTicks || Number of ticks to display damage numbers in battle (default 7)<br />
|-<br />
|187||INT ||genDamageDisplayRise || Number of pixels the displayed damage should rise (default 14)<br />
|-<br />
|188||INT ||genHeroWeakHP || % HP threshold for hero weak state (default to 20 if 0)<br />
|-<br />
|189||INT ||genEnemyWeakHP || % HP threshold for enemy weak state (default to 20 if 0)<br />
|-<br />
|190||INT ||genAutosortScheme || Method of autosorting inventory:<br><br />
0 - by item type<br><br />
1 - into usable/not usable<br><br />
2 - alphabetically<br><br />
3 - by ID number<br><br />
4 - no reordering beyond compacting<br />
|-<br />
|191||INT || genMaxLevel || Maximum level (0-99) This is the unchanging maximum allowed level for heroes. it is used in the hero stats editor. (Not to be confused with genLevelCap)<br />
|-<br />
|192||INT || genBattleMode || Battle mode 0=Active-time, 1=Turn-based<br />
|-<br />
|193||INT || genItemStackSize || Default maximum size of an inventory stack<br />
|-<br />
|194||INT || genResolutionX || Width in pixels of the game screen (not including graphics backend scaling) or 0 for default, 320x200<br />
|-<br />
|195||INT || genResolutionY || Height in pixels of the game screen (see above).<br />
|-<br />
|196||INT || genEscMenuScript || [[Script Trigger|plotscript]] to run when pressing ESC or ALT to open the menu (if zero, just open the menu)<br />
|- <br />
|197||INT || genSaveSlotCount || The number of available save slots, 1 to 1000. If 0, the default of 4 will be used. In versions older than [[fufluns]] the valid range was 1-32<br />
|-<br />
|198||INT || genMillisecPerFrame || Number of milliseconds per frame, or 55 if zero.<br />
|-<br />
|199||INT || genStealSuccessSFX || ID+1 of sound effect to play for a successful item steal attack, or zero for none.<br />
|-<br />
|200||INT || genStealFailSFX || ID+1 of sound effect to play for an unsuccessful item steal attack, or zero for none.<br />
|-<br />
|201||INT || genStealNoItemSFX || ID+1 of sound effect to play for an item steal attack with nothing to steal, or zero for none.<br />
|-<br />
|bgcolor="#C8FFC8"|202||INT ||genRegenChar ||Regen status indicator char (default to 32 if 0).<br />
|-<br />
|203||INT || genDefaultScale || (Obsolete). For a short while, contained the default scale/zoom factor of the display (1-16), or zero for whatever default is suitable.<br />
|-<br />
|204||INT || genDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This setting is editable, and is used as the base for genCurrentDebugMode<br />
|-<br />
|205||INT || genCurrentDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This is not directly editable. It is set based on genDebugMode but may be temporarily modified by the "Distribute Game" menu or the "Test Game" feature<br />
|-<br />
|206||INT || genStartHero || ID number the initial hero when starting a new game.<br />
|-<br />
|207||INT || genStartTextbox || ID number a textbox to open when starting a new game, 0 means none.<br />
|-<br />
|208||INT || genWindowSize || Default window size about X% of screen, in multiples of 10% (1-10). 10 means maximize. If 0, default to 8.<br />
|-<br />
|209||INT || genLivePreviewWindowSize || Test-Game default window size about X% of screen, in multiples of 10%. 10 means maximize. If 0, default to 5.<br />
|-<br />
|210||INT || genFullscreen || If 1 (or nonzero), default to fullscreen if there is no remembered preference for this game from previous plays.<br />
|-<br />
|211||INT || genMusicVolume || Initial music volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|212||INT || genSFXVolume || Initial global sound effects volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|213||INT || genRungameFullscreenIndependent || If false, fullscreen settings/config for games spawned by rungame are ignored<br />
|-<br />
|214||INT || genSkipBattleRewardsTicks || If > 0 then the battle rewards messages will automatically advance after this many ticks<br />
|-<br />
|215||INT|| genDefOnkeypressScript|| Default on-keypress Plot[[script Trigger]]<br />
|-<br />
|216||INT|| genDefEachStepScript|| Default each-step Plot[[script Trigger]]<br />
|-<br />
|217||INT|| genDefAfterBattleScript|| Default after-battle Plot[[script Trigger]]<br />
|-<br />
|218||INT|| genDefInsteadOfBattleScript|| Default instead-of-battle Plot[[script Trigger]]<br />
|-<br />
|219||INT|| genDefMapAutorunScript|| Default map autorun Plot[[script Trigger]]<br />
|-<br />
|220||INT|| genMaxEnemyPic ||bgcolor="#C8C8FF"|Last (max) valid enemy spriteset number (in [[RGFX|enemies.rgfx]])<br />
|-<br />
|221||INT|| genMinimapAlgorithm || Algorithm for producing in-game minimaps:<br><br />
0 - Smooth scaling (default)<br><br />
1 - Scatter - original random pixel selection algorithm<br><br />
2 - Majority: (Approximate) most common color<br />
|-<br />
|222-225||INT*4|| genBits3 || [[#General bitsets]] 48-111<br />
|-<br />
|226||INT|| genDefCounterProvoke || Default Provoke Counterattacks setting for attacks. Value 0-8, same meanings as [[DT6]] Provoke Counterattacks setting, except Default means 'Always'<br />
|-<br />
|227||INT|| genInventSlotx1Display || When to display x1 in inventory: 0: always, 1: never, 2: only if item maximum stacksize > 1<br />
|-<br />
|228||INT|| genCameraOnWalkaboutFocus || How to calculate walkabout camera focus: 0: on tile, 1: on sprite, 2: on sprite minus Z/offset <br />
|-<br />
|229||INT|| genTicksPerWalkFrame || Number of ticks per walking frame. 0 = default (110ms/frame; ticks calculated from genMillisecPerFrame and rounded to a whole number)<br />
|-<br />
|230||INT|| genAddHeroScript || Script trigger called when hero added<br />
|-<br />
|231||INT|| genRemoveHeroScript || Script trigger called when hero deleted/removed<br />
|-<br />
|232||INT|| genMoveHeroScript || Script trigger called when hero moved to a different slot<br />
|-<br />
|233||INT|| gen8bitBlendAlgo || Algorithm to use for palette lookups for blending in 8-bit color mode:<br><br />
0 - Dither (Half of pixels (in a chequered pattern) are nearest-matched, with 1/2 or 3/4 (alternating) of error diffused to next pixel)<br><br />
1 - Less Dither (Like 'Dither' but only 1/4 of error diffused, without alternation)<br><br />
2 - No Dither (nearest match color)<br />
|-<br />
|234||INT|| genPreviewBackdrop || 0 or ID+1 of backdrop to use for enemy previews (and maybe more in future)<br />
|-<br />
|235||INT|| gen32bitMode || 1 for 32-bit color mode, 0 for 8-bit<br />
|-<br />
|236||INT|| genDefaultBattleMenu || 0 for default, or menu ID + 1 {{WIP|inline}}<br />
|-<br />
|237-499||INT || ||bgcolor="#D0D0D0"| unused space<br />
|}<br />
<br />
'''Maximums''' : "max XYZ" means 'the highest numbered XYZ'. If you have 80 enemies defined, then "max enemy" == 79, because the numbering starts from 0.<br />
<br />
== General bitsets ==<br />
<br />
Preference bits, backcompat bits and battle system bits are stored in a single bit array, which is split into pieces beginning at gen(genBits), gen(genBits2) and gen(genBits3). They are accessed with the <tt>prefbit()</tt> and <tt>setprefbit()</tt> functions in FB code, and {{plot|read preference bit}} and {{plot|write preference bit}} functions in HS code.<br />
<br />
'''Note''': in the Preference Bitsets and other editors, some of the names of bits are '''reversed''' from what they are below.<br />
For example the editor has a bit named "Restore HP on level-up" which appears ON if bit 2 ("Don't restore HP on level-up") is OFF.<br />
<br />
Also note that some bits are turned on during game upgrade by [[fixbits]].<br />
<br />
* 0 - Pause in battle on spell and item menus<br />
* 1 - Enable Caterpillar party<br />
* 2 - Don't restore HP on level-up<br />
* 3 - Don't restore MP on level-up<br />
* 4 - Inns don't revive dead heros<br />
* 5 - Hero swapping always available<br />
* 6 - Hide ready meter in battle<br />
* 7 - Hide health bar in battle<br />
* 8 - Disable debugging keys<br />
* 9 - Simulate old level-up bug<br />
* 10 - Permit double-triggering of scripts<br />
* 11 - Skip title screen<br />
* 12 - Skip load screen<br />
* 13 - Pause in battle on all menus<br />
* 14 - Disable Hero's Battle Cursor<br />
* 15 - Default passability disabled by default<br />
* 16 - Simulate pushable NPC collision bug<br />
* 17 - Disable ESC to run from battle<br />
* 18 - Don't save gameover/loadgame script IDs (actually prevents ''using'' the stored "game over" or "loadgame" script ID number in preference to the ones specified by gen(genGameoverScript) and gen(genLoadgameScript))<br />
* 19 - Dead heroes gain share of experience<br />
* 20 - Locked heros can't be rearranged<br />
* 21 - Attack captions pause battle meters<br />
* 22 - Don't randomize battle ready-meters<br />
* 23 - Battle menus wait for attack animations<br />
* 24 - Enable better scancodes for scripts<br />
* 25 - Simulate old fail vs. elemental resist bit<br />
* 26 - 0 damage when immune to attack elements<br />
* 27 - Recreate map slices when changing maps<br />
* 28 - Harm tiles harm non-caterpillar heroes<br />
* 29 - Ignore extra Hits stat<br />
* 30 - Don't divide experience between heroes<br />
* 31 - Don't reset max stats after OOB attack<br />
* 32 - Don't limit max tags to 1000<br />
* 33 - Enable bug 430<br />
* 34 - showtextbox happens immediately<br />
* 35 - Pause battle while targeting attacks<br />
* 36 - Old attack positioning at bottom-left of target<br />
* 37 - Wrap map layers over edge of Crop maps<br />
* 38 - Never show script timer during battles<br />
* 39 - Draw Backdrop slice above Script layer<br />
* 40 - Don't stop music when starting/loading game<br />
* 41 - Keep caterpillar length the same when speed changes<br />
* 42 - Heroes use Walk in Place animation while idle.<br />
* 43 - Cap minimum stats at zero.<br />
* 44 - Hide empty save slots at the bottom of the save/load menu<br />
* 45 - Attack IDs in scripts are offset by +1 {{Future|inline}}<br />
* 46 - Negative damage harmtiles '''don't''' cure above max HP<br />
* 47 - Don't map joystick controls to keyboard keys for scripts<br />
* 48 - Disable ESC to cancel/change a hero's attack (turn-based battles only)<br />
* 49 - Show hero MP meter<br />
* 50 - Non-turn attack delays '''don't''' also cause turn delays<br />
* 51 - Don't break Speed ties randomly (turn-based battles only)<br />
* 52 - Ignore MP~ stat<br />
* 53 - "!Map joystick (left) stick to dpad"<br />
* 54 - Random spell lists respect attack costs {{WIP|inline}}<br />
* Bits up to 111 unused<br />
<br />
== Passwords ==<br />
The password protection in the RPG format is necessarily wet-paper-bag weak, due to the GNU GPL licensing of the engine. RPG password protection works entirely on the honor system. It's kinda like that faded sign hanging on the gates of Anhk-Morpork that says "Thank you for not invading our city"<br />
<br />
Here is how to read the password. Please-please-pretty-please dont just ignore it. It is flimsy pathetic laughable protection, but its all we have! Dont take away our wire umbrella in the lightening storm!<br />
<br />
Over time there have been 4 different password formats, referred to as PW1, PW2, PW3, PW4. All are stored in the GEN lump. The format is determined by looking at genVersion and genPassVersion (go down this table):<br />
<br />
{| border="1" cellpadding="1"<br />
! Format || Indicator || Introduced || Last used<br />
|-<br />
|PW4 || gen(genPassVersion) = 257 || pre-Zenzizenzic (Dec 28 2010) || Still in use.<br />
|-<br />
|PW3 || gen(genPassVersion) = 256 || Ozarks (June 28 2004) || Still partial back-compat (see below)<br />
|-<br />
|PW2 || gen(genVersion) >= 3 || June 18 1999 || Written until Dec 28 2010<br />
|-<br />
|PW1 || Otherwise || Stone Age ||<br />
|}<br />
<br />
For backwards compatibility, Custom also writes a blank PW3 password is there is no password, or a random PW3 password if there is one.<br />
<br />
The easiest thing to do when decoding an RPG file that still has its password in an old format is to print a warning message telling the user to upgrade their RPG file with CUSTOM.EXE<br />
<br />
=== PW4 ===<br />
This new format stores just a 9-bit hash of the password, in gen(genPW4Hash), so that it is not retrievable.<br />
<br />
The hash is calculated as follows (or see common.bas for the FB version):<br />
<br />
unsigned short passwordhash (char *p) {<br />
if (strlen(p) == 0) return 0;<br />
unsigned int hash = 0;<br />
while (*p)<br />
hash = hash * 3 + *p++ * 31;<br />
return (hash & 511) | 512;<br />
}<br />
<br />
=== PW3 ===<br />
In this format, the password is obscured with weak, but space-wasting encryption, and the length of the password is totally unprotected.<br />
<br />
GEN(6) is the password rotator. It will always be a random number from 1 to 254 that will be used to ascii-rotate/obfuscate the password.<br />
<br />
GEN(7-15) is the password text. There are 17 bytes of data here (so the high byte of GEN(15) is unused). Read this string of 17 bytes. ascii-rotate each character by subtracting GEN(6) and if the result is < 0 then add 255, and then discard all characters with ascii values less than 32 (space). The resulting string will be your password. If the string is empty (all 17 chars were under 32) then the RPG file does not have a password.<br />
<br />
=== PW2 ===<br />
This information describes the obsolete scattertable-based password storage format. It is only here as a curiosity... and a monument of shame to security-through-obscurity.<br />
The body of the scattertable lived at GEN(200) to GEN(359), with the "scattertable head" at gen(199).<br />
The first element of the password mess GEN(200) is the bit-offset of the first bit in the password, relative to the beginning of the scattertable head (199). The next element (201) is the bit-offset of the next bit in the password, and so on. So GEN(200) thru GEN(207) will give you the bits that make up the first ascii char of the password. GEN(208)-GEN(215) gives you the next char, and so on up to GEN(94)+1 bytes. After you have read all the chars from the scattertable, rotate them down by the value of GEN(93) (that is to say, subtract GEN(93) from the ascii value of each char, and if the result is less than 0, add 256).<br />
<br />
Clear as mud, right? Here is an example. Lets suppose that the data in the GEN lump looks like this<br />
<br />
<pre><br />
GEN(93)=172 the ascii-rotate offset<br />
GEN(94)=23 the number of bits -1.<br />
23+1 = 24, thats the total number of bits in the password<br />
There are 8 bits in each char of the password, so 24<br />
divided by 8 is 3. That means this password will end up being 3 chars long.<br />
<br />
BIT OFFSETS/SCATTERTABLE<br />
GEN(199)=8 [0001 0000 0000 0000] dummy number. Never 0 or 255<br />
GEN(200)=4 [0010 0000 0000 0000] Start here. bit 4 in the table is a 0<br />
GEN(201)=3 [1100 0000 0000 0000] bit 3 in the table is a 1, now we have 01<br />
GEN(202)=18[0100 1000 0000 0000] bit 18 is 1: 011<br />
GEN(203)=18[0100 1000 0000 0000] bit 18 is 1: 0111<br />
GEN(204)=54[0110 1100 0000 0000] bit 58 is 0: 01110<br />
GEN(205)=33[1000 0010 0000 0000] bit 33 is 1: 011101<br />
GEN(206)=85[1010 1010 0000 0000] bit 85 is 1: 0111011<br />
GEN(207)=82[0100 1010 0000 0000] bit 82 is 1: 01110111<br />
</pre><br />
<br />
So we end up with 01110111 which is char 238, (a wierd ascii math symbol) Now we subtract the value of GEN(93) and we get 66, which is the ascii code for upper case B, so we know the first letter of the password is B.<br />
<br />
Ah, what fun. what a mess. what a waste. *sigh*<br />
<br />
===PW1===<br />
<br />
We didn't bother to document this here, but it's yet another scheme, very similar to PW3! If you care, you can read the read_PW1_password() function in the source. It stores the password in gen(5) upwards, and in gen(genPW1Offset) and gen(genPW1Length) (gen(98) and gen(99).<br />
<br />
=See Also=<br />
* [http://thread.gmane.org/gmane.games.ohrrpgce.devel/17774 Garbage in GEN], an investigation of junk in high areas of GEN in older games<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=GEN&diff=34356GEN2022-02-12T13:57:46Z<p>Bob the Hamster: backcompat bit for random spell lists to respect costs</p>
<hr />
<div>__NOTOC__<br />
The lump with the extension .GEN is a critical one. It contains miscellaneous information about a wide variety of unrelated things, especially max number of records for other files, password information, and other stuff that I felt like sticking in there too-- some of which really don't belong.<br />
<br />
New general options are increasingly being added to [[general.reld]] instead, the RELOAD-format alternative.<br />
<br />
{{BSAVE Header}}<br />
<br />
The .gen lump is normally 1007 bytes long (including 7 byte header). '''NOTE:''' The fixWipeGEN [[FIXBITS.BIN|fixbit]] must be checked when reading values at offsets 199 and up.<br />
<br />
The following is the meaning of each element.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|-<br />
|bgcolor="#FFC8C8"|Pink fields are runtime-only fields used by [[GAME]] that do not really belong GEN in the first place, but are there anyway to make including them in [[SAV]] files more convenient, which is now a moot argument because of the conversion to [[RSAV]].<br />
|-<br />
|bgcolor="#C8C8FF"|Blue fields are editor-only fields used by [[CUSTOM]], although almost all of them are also used in-game for error-checking valid data record numbers. GAME and CUSTOM will both automatically set all these "max/number of X" fields to the true values.<br />
|-<br />
|bgcolor="#C8FFC8"|Green records are preserved in [[RSAV]] files.<br />
|}<br />
<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Element || Data || Constant || Meaning<br />
|-<br />
|0||INT ||genMaxMap ||bgcolor="#C8C8FF"|Max (last) valid map number<br />
|-<br />
|1||INT ||genTitle ||Title screen backdrop index<br />
|-<br />
|2||INT ||genTitleMus ||title music<br />
|-<br />
|3||INT ||genVictMus ||victory music + 1 (0 for none)<br />
|-<br />
|4||INT ||genBatMus ||default battle music<br />
|-<br />
|5||INT ||genPassVersion||bgcolor="#C8C8FF"| passcode format number<br />
|-<br />
|6||INT ||genPW3Rot ||bgcolor="#D0D0D0"|old (third-style) passcode rotator<br />
|-<br />
|7-15||BYTE*17 + 1 || ||bgcolor="#D0D0D0"|old (third-style) obfuscated passcode + 1 unused byte<br />
|-<br />
|16-25||INT*10 || ||bgcolor="#D0D0D0"|ancient (first-style) obsolete password data<br />
|-<br />
|26||INT ||genMaxHeroPic ||bgcolor="#C8C8FF"|Last (max) valid hero spriteset number (in [[PT0]]/[[RGFX|heroes.rgfx]])<br />
|-<br />
|27||INT ||genMaxEnemy1Pic ||bgcolor="#C8C8FF"|Last (max) valid small enemy spriteset number (graphics in [[PT1]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as small enemy graphics.<br />
|-<br />
|28||INT ||genMaxEnemy2Pic ||bgcolor="#C8C8FF"|Last (max) valid medium spriteset number (graphics in [[PT2]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as medium enemy graphics.<br />
|-<br />
|29||INT ||genMaxEnemy3Pic ||bgcolor="#C8C8FF"|Last (max) valid large enemy spriteset number (in [[PT3]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as large enemy graphics.<br />
|-<br />
|30||INT ||genMaxNPCPic ||bgcolor="#C8C8FF"|Last (max) valid walkabout spriteset number (in [[PT4]]/[[RGFX|walkabouts.rgfx]])<br />
|-<br />
|31||INT ||genMaxWeaponPic ||bgcolor="#C8C8FF"|Last (max) valid weapon spriteset number (in [[PT5]]/[[RGFX|weapons.rgfx]])<br />
|-<br />
|32||INT ||genMaxAttackPic ||bgcolor="#C8C8FF"|Last (max) valid attack spriteset number (in [[PT6]]/[[RGFX|attacks.rgfx]])<br />
|-<br />
|33||INT ||genMaxTile ||bgcolor="#C8C8FF"|Last (max) tileset number in [[TIL]]<br />
|-<br />
|34||INT ||genMaxAttack ||bgcolor="#C8C8FF"|max attack definitions in [[DT6]]<br />
|-<br />
|35||INT ||genMaxHero ||bgcolor="#C8C8FF"|max hero definitions in [[DT0]]<br />
|-<br />
|36||INT ||genMaxEnemy ||bgcolor="#C8C8FF"|max enemy definitions in [[DT1]]<br />
|-<br />
|37||INT ||genMaxFormation ||bgcolor="#C8C8FF"|max formations in [[FOR]]<br />
|-<br />
|38||INT ||genMaxPal ||bgcolor="#C8C8FF"|max palettes in [[PAL]]<br />
|-<br />
|39||INT ||genMaxTextbox ||bgcolor="#C8C8FF"|max text boxes in [[SAY]]<br />
|-<br />
|40||INT ||genMaxPlotscript ||bgcolor="#C8C8FF"|total available plotscripts (number of records in [[PLOTSCR.LST]])<br />
|-<br />
|41||INT ||genNewgameScript ||ID of new-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|42||INT ||genGameoverScript||ID of game-over [[Script Trigger|plotscript]]<br />
|-<br />
|43||INT ||genMaxRegularScript||bgcolor="#C8C8FF"|ID of highest manually numbered old-style plotscript<br />
|-<br />
|bgcolor="#C8FFC8"|44||INT ||genSuspendBits ||bgcolor="#FFC8C8"|suspendstuff bits:<br><br />
0 - suspendnpcs<br><br />
1 - suspendplayer<br><br />
2 - suspendobstruction<br><br />
3 - suspendherowalls<br><br />
4 - suspendnpcwalls<br><br />
5 - suspendcatapillar<br><br />
6 - suspendrandomenemies<br><br />
7 - suspendboxadvance<br><br />
8 - suspendoverlay<br><br />
9 - suspendambientmusic<br><br />
10 - suspenddoors<br><br />
11 - suspendtimers<br><br />
|-<br />
|bgcolor="#C8FFC8"|45||INT ||genCamera ||bgcolor="#FFC8C8"|camera mode<br />
|-<br />
|bgcolor="#C8FFC8"|46||INT ||genCamArg1 ||bgcolor="#FFC8C8"|cameraarg1<br />
|-<br />
|bgcolor="#C8FFC8"|47||INT ||genCamArg2 ||bgcolor="#FFC8C8"|cameraarg2<br />
|-<br />
|bgcolor="#C8FFC8"|48||INT ||genCamArg3 ||bgcolor="#FFC8C8"|cameraarg3<br />
|-<br />
|bgcolor="#C8FFC8"|49||INT ||genCamArg4 ||bgcolor="#FFC8C8"|cameraarg4<br />
|-<br />
|bgcolor="#C8FFC8"|50||INT ||genScrBackdrop ||bgcolor="#FFC8C8"|Index of currently displaying script backdrop , or -1 for none. (Does not include textbox backdrops)<br />
|-<br />
|bgcolor="#C8FFC8"|51||INT ||genDays ||bgcolor="#FFC8C8"|days of play<br />
|-<br />
|bgcolor="#C8FFC8"|52||INT ||genHours ||bgcolor="#FFC8C8"|hours of play<br />
|-<br />
|bgcolor="#C8FFC8"|53||INT ||genMinutes ||bgcolor="#FFC8C8"|minutes of play<br />
|-<br />
|bgcolor="#C8FFC8"|54||INT ||genSeconds ||bgcolor="#FFC8C8"|seconds of play<br />
|-<br />
|55||INT ||genMaxVehicle ||bgcolor="#C8C8FF"|max vehicle types in [[VEH]]<br />
|-<br />
|56||INT ||genMaxTagname ||bgcolor="#C8C8FF"|Last named tag<br />
|-<br />
|bgcolor="#C8FFC8"|57||INT ||genLoadgameScript||load-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|58||INT ||genTextboxBackdrop||bgcolor="#FFC8C8"|Index of currently displaying text box backdrop<br />
|-<br />
|59||INT ||genEnemyDissolve || Default enemy dissolve type. See dissolve types in [[DT1]] (each dissolve type is numbered one less than it is in DT1, for example Random Pixels is 0. <br />
|-<br />
|bgcolor="#C8FFC8"|60||INT ||genJoy ||bgcolor="#FFC8C8"|Enable/disable joystick<br />
|-<br />
|bgcolor="#C8FFC8"|61||INT ||genPoisonChar||Posion status indicator char (default to 161 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|62||INT ||genStunChar ||Stun status indicator char (default to 159 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|63||INT ||genDamageCap||Damage cap (0 if there is none)<br />
|-<br />
|bgcolor="#C8FFC8"|64||INT ||genMuteChar ||Mute status indicator char (default to 163 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|65-76||INT*12 ||genStatCap||Stat caps for each stat, in this order:<br/>HP<br/>MP<br/>Atk<br/>Aim<br/>Def<br/>Dog<br/>Mag<br/>Wil<br/>Spd<br/>Ctr<br/>Focus<br/>Extra Hits<br />
|-<br />
|77||INT ||genMaxSFX||bgcolor="#C8C8FF"|Number of sound effects<br />
|-<br />
|78||INT ||genMasterPal||Master palette number in [[PALETTES.BIN]]<br />
|-<br />
|79||INT ||genMaxMasterPal||bgcolor="#C8C8FF"|Max master palette number in [[PALETTES.BIN]] and number of UI color sets in [[UICOLORS.BIN]]<br />
|-<br />
|80||INT ||genMaxMenu||Max menu in [[MENUS.BIN]]<br />
|-<br />
|81||INT ||genMaxMenuItem||Max menu item in [[MENUITEM.BIN]]<br />
|-<br />
|82||INT ||genMaxItem||Max item number in [[ITM]]<br />
|-<br />
|83||INT ||genMaxBoxBorder||Max valid box border spriteset number (in [[PT7]]/[[RGFX|boxborders.rgfx]])<br />
|-<br />
|84||INT ||genMaxPortrait||Max valid portrait spriteset number (in [[PT8]]/[[RGFX|portraits.rgfx]])<br />
|-<br />
|bgcolor="#C8FFC8"|85||INT ||genMaxInventory||Max available inventory slots. 599 is current default max. Gets rounded ''up'' to the next multiple of 3 slots (counting the zeroth slot). Zero uses the default max of 599 (600 counting zero)<br />
|-<br />
|86||INT ||genErrorLevel||Error suppression level: <br>0: default to 4<br>2: show all warnings<br>3: suppress some warnings<br>4: suppress warnings from weak type checking<br>5: don't show errors not displayed in old versions<br>6: show only errors about corruption or interpreter problems<br />
|-<br />
|bgcolor="#C8FFC8"|87||INT || genLevelCap ||Maximum hero level (0-genMaxLevel) (Unlike genMaxLevel, this can be changed with scripting, and has no effect on stat growth)<br />
|-<br />
|88||INT || genEquipMergeFormula ||Function used to calculate total hero elemental resistances from equipment:<br><br />
0: Awful compatible formula<br><br />
1: Multiplicative<br><br />
2: Additive<br />
|-<br />
|89||INT || genNumElements ||Number of elements which the game uses, up to 64 (any higher numbered ones should be ignored in-game)<br />
|-<br />
|90||INT || genUnlockedReserveXP ||Experience gained by unlocked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|91||INT || genLockedReserveXP ||Experience gained by locked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|92||INT || genPW4Hash ||bgcolor="#C8C8FF"|Hashed password, 0 if none<br />
|-<br />
|93||INT || genPW2Offset ||bgcolor="#D0D0D0"|old(second-style) passcode offset<br />
|-<br />
|94||INT || genPW2Length ||bgcolor="#D0D0D0"|old(second-style) passcode length (-1 if there is no password)<br />
|-<br />
|95||INT ||genVersion ||RPG file format version ID (The latest version number is CURRENT_RPG_VERSION in const.bi. See also [[Incrementing the RPG format version number]])<br />
|-<br />
|96||INT ||genStartMoney||starting money<br />
|-<br />
|97||INT ||genMaxShop ||bgcolor="#C8C8FF"|last shop in [[SHO]]<br />
|-<br />
|98||INT || genPW1Offset ||bgcolor="#D0D0D0"|old-old(first-style) passcode offset<br />
|-<br />
|99||INT || genPW1Length ||bgcolor="#D0D0D0"|old-old(first-style) passcode length<br />
|-<br />
|100||INT ||genNumBackdrops||bgcolor="#C8C8FF"|''Number'' of backdrops (in [[MXS]]/[[RGFX|backdrops.rgfx]])<br />
|-<br />
|101||INT ||genBits ||[[#General bitsets]] 0-15<br />
|-<br />
|102||INT ||genStartX ||starting X<br />
|-<br />
|103||INT ||genStartY ||starting Y<br />
|-<br />
|104||INT ||genStartMap ||starting Map<br />
|-<br />
|105||INT ||genOneTimeNPC ||bgcolor="#C8C8FF"|one-time-NPC indexer<br />
|-<br />
|106-170||INT*65|| genOneTimeNPCBits ||bgcolor="#C8C8FF"|one-time-NPC placeholder bits. there are 0-1039 bits, but savegames store 0-1031 and the NPC editor only allows 0-1000<br />
|-<br />
|171||INT ||genDefaultDeathSfx ||Default enemy death sound effect ID + 1 (0 for none)<br />
|-<br />
|172||INT ||genMaxSong||bgcolor="#C8C8FF"|last song number ([[SNG]] and [[BAM]])<br />
|-<br />
|173||INT ||genAcceptSfx||Sound effect to use for "accept" (in menus) ID + 1 (0 for none)<br />
|-<br />
|174||INT ||genCancelSfx||Sound effect to use for "cancel" (in menus) ID + 1 (0 for none)<br />
|-<br />
|175||INT ||genChooseSfx||Sound effect to use for moving the cursor (in menus) ID + 1 (0 for none)<br />
|-<br />
|176||INT ||gentextboxLetter || Sound effect to use for displaying text box lines ID + 1 (0 for none)<br />
|-<br />
|177-178||INT*2 ||genBits2 || [[#General bitsets]] 16-47<br />
|-<br />
|179||INT ||genItemLearnSFX || Sound effect when learning a spell from an item. ID + 1 (0 for none)<br />
|-<br />
|180||INT ||genCantLearnSFX || Sound effect when a hero couldn't learn spell from item. ID + 1 (0 for none)<br />
|-<br />
|181||INT ||genBuySFX || Sound effect when buying an item from a shop. ID + 1 (0 for none)<br />
|-<br />
|182||INT ||genHireSFX || Sound effect when hiring a hero from a shop. ID + 1 (0 for none)<br />
|-<br />
|183||INT ||genSellSFX || Sound effect when selling an item to a shop. ID + 1 (0 for none)<br />
|-<br />
|184||INT ||genCantBuySFX || Sound effect when you can't afford item/hire. ID + 1 (0 for none)<br />
|-<br />
|185||INT ||genCantSellSFX || Sound effect when trying to sell an unsellable item. ID + 1 (0 for none)<br />
|-<br />
|186||INT ||genDamageDisplayTicks || Number of ticks to display damage numbers in battle (default 7)<br />
|-<br />
|187||INT ||genDamageDisplayRise || Number of pixels the displayed damage should rise (default 14)<br />
|-<br />
|188||INT ||genHeroWeakHP || % HP threshold for hero weak state (default to 20 if 0)<br />
|-<br />
|189||INT ||genEnemyWeakHP || % HP threshold for enemy weak state (default to 20 if 0)<br />
|-<br />
|190||INT ||genAutosortScheme || Method of autosorting inventory:<br><br />
0 - by item type<br><br />
1 - into usable/not usable<br><br />
2 - alphabetically<br><br />
3 - by ID number<br><br />
4 - no reordering beyond compacting<br />
|-<br />
|191||INT || genMaxLevel || Maximum level (0-99) This is the unchanging maximum allowed level for heroes. it is used in the hero stats editor. (Not to be confused with genLevelCap)<br />
|-<br />
|192||INT || genBattleMode || Battle mode 0=Active-time, 1=Turn-based<br />
|-<br />
|193||INT || genItemStackSize || Default maximum size of an inventory stack<br />
|-<br />
|194||INT || genResolutionX || Width in pixels of the game screen (not including graphics backend scaling) or 0 for default, 320x200<br />
|-<br />
|195||INT || genResolutionY || Height in pixels of the game screen (see above).<br />
|-<br />
|196||INT || genEscMenuScript || [[Script Trigger|plotscript]] to run when pressing ESC or ALT to open the menu (if zero, just open the menu)<br />
|- <br />
|197||INT || genSaveSlotCount || The number of available save slots, 1 to 1000. If 0, the default of 4 will be used. In versions older than [[fufluns]] the valid range was 1-32<br />
|-<br />
|198||INT || genMillisecPerFrame || Number of milliseconds per frame, or 55 if zero.<br />
|-<br />
|199||INT || genStealSuccessSFX || ID+1 of sound effect to play for a successful item steal attack, or zero for none.<br />
|-<br />
|200||INT || genStealFailSFX || ID+1 of sound effect to play for an unsuccessful item steal attack, or zero for none.<br />
|-<br />
|201||INT || genStealNoItemSFX || ID+1 of sound effect to play for an item steal attack with nothing to steal, or zero for none.<br />
|-<br />
|bgcolor="#C8FFC8"|202||INT ||genRegenChar ||Regen status indicator char (default to 32 if 0).<br />
|-<br />
|203||INT || genDefaultScale || (Obsolete). For a short while, contained the default scale/zoom factor of the display (1-16), or zero for whatever default is suitable.<br />
|-<br />
|204||INT || genDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This setting is editable, and is used as the base for genCurrentDebugMode<br />
|-<br />
|205||INT || genCurrentDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This is not directly editable. It is set based on genDebugMode but may be temporarily modified by the "Distribute Game" menu or the "Test Game" feature<br />
|-<br />
|206||INT || genStartHero || ID number the initial hero when starting a new game.<br />
|-<br />
|207||INT || genStartTextbox || ID number a textbox to open when starting a new game, 0 means none.<br />
|-<br />
|208||INT || genWindowSize || Default window size about X% of screen, in multiples of 10% (1-10). 10 means maximize. If 0, default to 8.<br />
|-<br />
|209||INT || genLivePreviewWindowSize || Test-Game default window size about X% of screen, in multiples of 10%. 10 means maximize. If 0, default to 5.<br />
|-<br />
|210||INT || genFullscreen || If 1 (or nonzero), default to fullscreen if there is no remembered preference for this game from previous plays.<br />
|-<br />
|211||INT || genMusicVolume || Initial music volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|212||INT || genSFXVolume || Initial global sound effects volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|213||INT || genRungameFullscreenIndependent || If false, fullscreen settings/config for games spawned by rungame are ignored<br />
|-<br />
|214||INT || genSkipBattleRewardsTicks || If > 0 then the battle rewards messages will automatically advance after this many ticks<br />
|-<br />
|215||INT|| genDefOnkeypressScript|| Default on-keypress Plot[[script Trigger]]<br />
|-<br />
|216||INT|| genDefEachStepScript|| Default each-step Plot[[script Trigger]]<br />
|-<br />
|217||INT|| genDefAfterBattleScript|| Default after-battle Plot[[script Trigger]]<br />
|-<br />
|218||INT|| genDefInsteadOfBattleScript|| Default instead-of-battle Plot[[script Trigger]]<br />
|-<br />
|219||INT|| genDefMapAutorunScript|| Default map autorun Plot[[script Trigger]]<br />
|-<br />
|220||INT|| genMaxEnemyPic ||bgcolor="#C8C8FF"|Last (max) valid enemy spriteset number (in [[RGFX|enemies.rgfx]])<br />
|-<br />
|221||INT|| genMinimapAlgorithm || Algorithm for producing in-game minimaps:<br><br />
0 - Smooth scaling (default)<br><br />
1 - Scatter - original random pixel selection algorithm<br><br />
2 - Majority: (Approximate) most common color<br />
|-<br />
|222-225||INT*4|| genBits3 || [[#General bitsets]] 48-111<br />
|-<br />
|226||INT|| genDefCounterProvoke || Default Provoke Counterattacks setting for attacks. Value 0-8, same meanings as [[DT6]] Provoke Counterattacks setting, except Default means 'Always'<br />
|-<br />
|227||INT|| genInventSlotx1Display || When to display x1 in inventory: 0: always, 1: never, 2: only if item maximum stacksize > 1<br />
|-<br />
|228||INT|| genCameraOnWalkaboutFocus || How to calculate walkabout camera focus: 0: on tile, 1: on sprite, 2: on sprite minus Z/offset <br />
|-<br />
|229||INT|| genTicksPerWalkFrame || Number of ticks per walking frame. 0 = default (110ms/frame; ticks calculated from genMillisecPerFrame and rounded to a whole number)<br />
|-<br />
|230||INT|| genAddHeroScript || Script trigger called when hero added<br />
|-<br />
|231||INT|| genRemoveHeroScript || Script trigger called when hero deleted/removed<br />
|-<br />
|232||INT|| genMoveHeroScript || Script trigger called when hero moved to a different slot<br />
|-<br />
|233||INT|| gen8bitBlendAlgo || Algorithm to use for palette lookups for blending in 8-bit color mode:<br><br />
0 - Dither (Half of pixels (in a chequered pattern) are nearest-matched, with 1/2 or 3/4 (alternating) of error diffused to next pixel)<br><br />
1 - Less Dither (Like 'Dither' but only 1/4 of error diffused, without alternation)<br><br />
2 - No Dither (nearest match color)<br />
|-<br />
|234||INT|| genPreviewBackdrop || 0 or ID+1 of backdrop to use for enemy previews (and maybe more in future)<br />
|-<br />
|235||INT|| gen32bitMode || 1 for 32-bit color mode, 0 for 8-bit<br />
|-<br />
|236||INT|| genDefaultBattleMenu || 0 for default, or menu ID + 1 {{WIP|inline}}<br />
|-<br />
|237-499||INT || ||bgcolor="#D0D0D0"| unused space<br />
|}<br />
<br />
'''Maximums''' : "max XYZ" means 'the highest numbered XYZ'. If you have 80 enemies defined, then "max enemy" == 79, because the numbering starts from 0.<br />
<br />
== General bitsets ==<br />
<br />
Preference bits, backcompat bits and battle system bits are stored in a single bit array, which is split into pieces beginning at gen(genBits), gen(genBits2) and gen(genBits3). They are accessed with the <tt>prefbit()</tt> and <tt>setprefbit()</tt> functions in FB code, and {{plot|read preference bit}} and {{plot|write preference bit}} functions in HS code.<br />
<br />
'''Note''': in the Preference Bitsets and other editors, some of the names of bits are '''reversed''' from what they are below.<br />
For example the editor has a bit named "Restore HP on level-up" which appears ON if bit 2 ("Don't restore HP on level-up") is OFF.<br />
<br />
Also note that some bits are turned on during game upgrade by [[fixbits]].<br />
<br />
* 0 - Pause in battle on spell and item menus<br />
* 1 - Enable Caterpillar party<br />
* 2 - Don't restore HP on level-up<br />
* 3 - Don't restore MP on level-up<br />
* 4 - Inns don't revive dead heros<br />
* 5 - Hero swapping always available<br />
* 6 - Hide ready meter in battle<br />
* 7 - Hide health bar in battle<br />
* 8 - Disable debugging keys<br />
* 9 - Simulate old level-up bug<br />
* 10 - Permit double-triggering of scripts<br />
* 11 - Skip title screen<br />
* 12 - Skip load screen<br />
* 13 - Pause in battle on all menus<br />
* 14 - Disable Hero's Battle Cursor<br />
* 15 - Default passability disabled by default<br />
* 16 - Simulate pushable NPC collision bug<br />
* 17 - Disable ESC to run from battle<br />
* 18 - Don't save gameover/loadgame script IDs (actually prevents ''using'' the stored "game over" or "loadgame" script ID number in preference to the ones specified by gen(genGameoverScript) and gen(genLoadgameScript))<br />
* 19 - Dead heroes gain share of experience<br />
* 20 - Locked heros can't be rearranged<br />
* 21 - Attack captions pause battle meters<br />
* 22 - Don't randomize battle ready-meters<br />
* 23 - Battle menus wait for attack animations<br />
* 24 - Enable better scancodes for scripts<br />
* 25 - Simulate old fail vs. elemental resist bit<br />
* 26 - 0 damage when immune to attack elements<br />
* 27 - Recreate map slices when changing maps<br />
* 28 - Harm tiles harm non-caterpillar heroes<br />
* 29 - Ignore extra Hits stat<br />
* 30 - Don't divide experience between heroes<br />
* 31 - Don't reset max stats after OOB attack<br />
* 32 - Don't limit max tags to 1000<br />
* 33 - Enable bug 430<br />
* 34 - showtextbox happens immediately<br />
* 35 - Pause battle while targeting attacks<br />
* 36 - Old attack positioning at bottom-left of target<br />
* 37 - Wrap map layers over edge of Crop maps<br />
* 38 - Never show script timer during battles<br />
* 39 - Draw Backdrop slice above Script layer<br />
* 40 - Don't stop music when starting/loading game<br />
* 41 - Keep caterpillar length the same when speed changes<br />
* 42 - Heroes use Walk in Place animation while idle.<br />
* 43 - Cap minimum stats at zero.<br />
* 44 - Hide empty save slots at the bottom of the save/load menu<br />
* 45 - Attack IDs in scripts are offset by +1 {{Future|inline}}<br />
* 46 - Negative damage harmtiles '''don't''' cure above max HP<br />
* 47 - Don't map joystick controls to keyboard keys for scripts<br />
* 48 - Disable ESC to cancel/change a hero's attack (turn-based battles only)<br />
* 49 - Show hero MP meter<br />
* 50 - Non-turn attack delays '''don't''' also cause turn delays<br />
* 51 - Don't break Speed ties randomly (turn-based battles only)<br />
* 52 - Ignore MP~ stat<br />
* 53 - Random spell lists respect attack costs {{WIP|inline}}<br />
* Bits up to 111 unused<br />
<br />
== Passwords ==<br />
The password protection in the RPG format is necessarily wet-paper-bag weak, due to the GNU GPL licensing of the engine. RPG password protection works entirely on the honor system. It's kinda like that faded sign hanging on the gates of Anhk-Morpork that says "Thank you for not invading our city"<br />
<br />
Here is how to read the password. Please-please-pretty-please dont just ignore it. It is flimsy pathetic laughable protection, but its all we have! Dont take away our wire umbrella in the lightening storm!<br />
<br />
Over time there have been 4 different password formats, referred to as PW1, PW2, PW3, PW4. All are stored in the GEN lump. The format is determined by looking at genVersion and genPassVersion (go down this table):<br />
<br />
{| border="1" cellpadding="1"<br />
! Format || Indicator || Introduced || Last used<br />
|-<br />
|PW4 || gen(genPassVersion) = 257 || pre-Zenzizenzic (Dec 28 2010) || Still in use.<br />
|-<br />
|PW3 || gen(genPassVersion) = 256 || Ozarks (June 28 2004) || Still partial back-compat (see below)<br />
|-<br />
|PW2 || gen(genVersion) >= 3 || June 18 1999 || Written until Dec 28 2010<br />
|-<br />
|PW1 || Otherwise || Stone Age ||<br />
|}<br />
<br />
For backwards compatibility, Custom also writes a blank PW3 password is there is no password, or a random PW3 password if there is one.<br />
<br />
The easiest thing to do when decoding an RPG file that still has its password in an old format is to print a warning message telling the user to upgrade their RPG file with CUSTOM.EXE<br />
<br />
=== PW4 ===<br />
This new format stores just a 9-bit hash of the password, in gen(genPW4Hash), so that it is not retrievable.<br />
<br />
The hash is calculated as follows (or see common.bas for the FB version):<br />
<br />
unsigned short passwordhash (char *p) {<br />
if (strlen(p) == 0) return 0;<br />
unsigned int hash = 0;<br />
while (*p)<br />
hash = hash * 3 + *p++ * 31;<br />
return (hash & 511) | 512;<br />
}<br />
<br />
=== PW3 ===<br />
In this format, the password is obscured with weak, but space-wasting encryption, and the length of the password is totally unprotected.<br />
<br />
GEN(6) is the password rotator. It will always be a random number from 1 to 254 that will be used to ascii-rotate/obfuscate the password.<br />
<br />
GEN(7-15) is the password text. There are 17 bytes of data here (so the high byte of GEN(15) is unused). Read this string of 17 bytes. ascii-rotate each character by subtracting GEN(6) and if the result is < 0 then add 255, and then discard all characters with ascii values less than 32 (space). The resulting string will be your password. If the string is empty (all 17 chars were under 32) then the RPG file does not have a password.<br />
<br />
=== PW2 ===<br />
This information describes the obsolete scattertable-based password storage format. It is only here as a curiosity... and a monument of shame to security-through-obscurity.<br />
The body of the scattertable lived at GEN(200) to GEN(359), with the "scattertable head" at gen(199).<br />
The first element of the password mess GEN(200) is the bit-offset of the first bit in the password, relative to the beginning of the scattertable head (199). The next element (201) is the bit-offset of the next bit in the password, and so on. So GEN(200) thru GEN(207) will give you the bits that make up the first ascii char of the password. GEN(208)-GEN(215) gives you the next char, and so on up to GEN(94)+1 bytes. After you have read all the chars from the scattertable, rotate them down by the value of GEN(93) (that is to say, subtract GEN(93) from the ascii value of each char, and if the result is less than 0, add 256).<br />
<br />
Clear as mud, right? Here is an example. Lets suppose that the data in the GEN lump looks like this<br />
<br />
<pre><br />
GEN(93)=172 the ascii-rotate offset<br />
GEN(94)=23 the number of bits -1.<br />
23+1 = 24, thats the total number of bits in the password<br />
There are 8 bits in each char of the password, so 24<br />
divided by 8 is 3. That means this password will end up being 3 chars long.<br />
<br />
BIT OFFSETS/SCATTERTABLE<br />
GEN(199)=8 [0001 0000 0000 0000] dummy number. Never 0 or 255<br />
GEN(200)=4 [0010 0000 0000 0000] Start here. bit 4 in the table is a 0<br />
GEN(201)=3 [1100 0000 0000 0000] bit 3 in the table is a 1, now we have 01<br />
GEN(202)=18[0100 1000 0000 0000] bit 18 is 1: 011<br />
GEN(203)=18[0100 1000 0000 0000] bit 18 is 1: 0111<br />
GEN(204)=54[0110 1100 0000 0000] bit 58 is 0: 01110<br />
GEN(205)=33[1000 0010 0000 0000] bit 33 is 1: 011101<br />
GEN(206)=85[1010 1010 0000 0000] bit 85 is 1: 0111011<br />
GEN(207)=82[0100 1010 0000 0000] bit 82 is 1: 01110111<br />
</pre><br />
<br />
So we end up with 01110111 which is char 238, (a wierd ascii math symbol) Now we subtract the value of GEN(93) and we get 66, which is the ascii code for upper case B, so we know the first letter of the password is B.<br />
<br />
Ah, what fun. what a mess. what a waste. *sigh*<br />
<br />
===PW1===<br />
<br />
We didn't bother to document this here, but it's yet another scheme, very similar to PW3! If you care, you can read the read_PW1_password() function in the source. It stores the password in gen(5) upwards, and in gen(genPW1Offset) and gen(genPW1Length) (gen(98) and gen(99).<br />
<br />
=See Also=<br />
* [http://thread.gmane.org/gmane.games.ohrrpgce.devel/17774 Garbage in GEN], an investigation of junk in high areas of GEN in older games<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=GEN&diff=34353GEN2022-02-07T01:26:20Z<p>Bob the Hamster: </p>
<hr />
<div>__NOTOC__<br />
The lump with the extension .GEN is a critical one. It contains miscellaneous information about a wide variety of unrelated things, especially max number of records for other files, password information, and other stuff that I felt like sticking in there too-- some of which really don't belong.<br />
<br />
New general options are increasingly being added to [[general.reld]] instead, the RELOAD-format alternative.<br />
<br />
{{BSAVE Header}}<br />
<br />
The .gen lump is normally 1007 bytes long (including 7 byte header). '''NOTE:''' The fixWipeGEN [[FIXBITS.BIN|fixbit]] must be checked when reading values at offsets 199 and up.<br />
<br />
The following is the meaning of each element.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|-<br />
|bgcolor="#FFC8C8"|Pink fields are runtime-only fields used by [[GAME]] that do not really belong GEN in the first place, but are there anyway to make including them in [[SAV]] files more convenient, which is now a moot argument because of the conversion to [[RSAV]].<br />
|-<br />
|bgcolor="#C8C8FF"|Blue fields are editor-only fields used by [[CUSTOM]], although almost all of them are also used in-game for error-checking valid data record numbers. GAME and CUSTOM will both automatically set all these "max/number of X" fields to the true values.<br />
|-<br />
|bgcolor="#C8FFC8"|Green records are preserved in [[RSAV]] files.<br />
|}<br />
<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Element || Data || Constant || Meaning<br />
|-<br />
|0||INT ||genMaxMap ||bgcolor="#C8C8FF"|Max (last) valid map number<br />
|-<br />
|1||INT ||genTitle ||Title screen backdrop index<br />
|-<br />
|2||INT ||genTitleMus ||title music<br />
|-<br />
|3||INT ||genVictMus ||victory music + 1 (0 for none)<br />
|-<br />
|4||INT ||genBatMus ||default battle music<br />
|-<br />
|5||INT ||genPassVersion||bgcolor="#C8C8FF"| passcode format number<br />
|-<br />
|6||INT ||genPW3Rot ||bgcolor="#D0D0D0"|old (third-style) passcode rotator<br />
|-<br />
|7-15||BYTE*17 + 1 || ||bgcolor="#D0D0D0"|old (third-style) obfuscated passcode + 1 unused byte<br />
|-<br />
|16-25||INT*10 || ||bgcolor="#D0D0D0"|ancient (first-style) obsolete password data<br />
|-<br />
|26||INT ||genMaxHeroPic ||bgcolor="#C8C8FF"|Last (max) valid hero spriteset number (in [[PT0]]/[[RGFX|heroes.rgfx]])<br />
|-<br />
|27||INT ||genMaxEnemy1Pic ||bgcolor="#C8C8FF"|Last (max) valid small enemy spriteset number (graphics in [[PT1]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as small enemy graphics.<br />
|-<br />
|28||INT ||genMaxEnemy2Pic ||bgcolor="#C8C8FF"|Last (max) valid medium spriteset number (graphics in [[PT2]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as medium enemy graphics.<br />
|-<br />
|29||INT ||genMaxEnemy3Pic ||bgcolor="#C8C8FF"|Last (max) valid large enemy spriteset number (in [[PT3]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as large enemy graphics.<br />
|-<br />
|30||INT ||genMaxNPCPic ||bgcolor="#C8C8FF"|Last (max) valid walkabout spriteset number (in [[PT4]]/[[RGFX|walkabouts.rgfx]])<br />
|-<br />
|31||INT ||genMaxWeaponPic ||bgcolor="#C8C8FF"|Last (max) valid weapon spriteset number (in [[PT5]]/[[RGFX|weapons.rgfx]])<br />
|-<br />
|32||INT ||genMaxAttackPic ||bgcolor="#C8C8FF"|Last (max) valid attack spriteset number (in [[PT6]]/[[RGFX|attacks.rgfx]])<br />
|-<br />
|33||INT ||genMaxTile ||bgcolor="#C8C8FF"|Last (max) tileset number in [[TIL]]<br />
|-<br />
|34||INT ||genMaxAttack ||bgcolor="#C8C8FF"|max attack definitions in [[DT6]]<br />
|-<br />
|35||INT ||genMaxHero ||bgcolor="#C8C8FF"|max hero definitions in [[DT0]]<br />
|-<br />
|36||INT ||genMaxEnemy ||bgcolor="#C8C8FF"|max enemy definitions in [[DT1]]<br />
|-<br />
|37||INT ||genMaxFormation ||bgcolor="#C8C8FF"|max formations in [[FOR]]<br />
|-<br />
|38||INT ||genMaxPal ||bgcolor="#C8C8FF"|max palettes in [[PAL]]<br />
|-<br />
|39||INT ||genMaxTextbox ||bgcolor="#C8C8FF"|max text boxes in [[SAY]]<br />
|-<br />
|40||INT ||genMaxPlotscript ||bgcolor="#C8C8FF"|total available plotscripts (number of records in [[PLOTSCR.LST]])<br />
|-<br />
|41||INT ||genNewgameScript ||ID of new-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|42||INT ||genGameoverScript||ID of game-over [[Script Trigger|plotscript]]<br />
|-<br />
|43||INT ||genMaxRegularScript||bgcolor="#C8C8FF"|ID of highest manually numbered old-style plotscript<br />
|-<br />
|bgcolor="#C8FFC8"|44||INT ||genSuspendBits ||bgcolor="#FFC8C8"|suspendstuff bits:<br><br />
0 - suspendnpcs<br><br />
1 - suspendplayer<br><br />
2 - suspendobstruction<br><br />
3 - suspendherowalls<br><br />
4 - suspendnpcwalls<br><br />
5 - suspendcatapillar<br><br />
6 - suspendrandomenemies<br><br />
7 - suspendboxadvance<br><br />
8 - suspendoverlay<br><br />
9 - suspendambientmusic<br><br />
10 - suspenddoors<br><br />
11 - suspendtimers<br><br />
|-<br />
|bgcolor="#C8FFC8"|45||INT ||genCamera ||bgcolor="#FFC8C8"|camera mode<br />
|-<br />
|bgcolor="#C8FFC8"|46||INT ||genCamArg1 ||bgcolor="#FFC8C8"|cameraarg1<br />
|-<br />
|bgcolor="#C8FFC8"|47||INT ||genCamArg2 ||bgcolor="#FFC8C8"|cameraarg2<br />
|-<br />
|bgcolor="#C8FFC8"|48||INT ||genCamArg3 ||bgcolor="#FFC8C8"|cameraarg3<br />
|-<br />
|bgcolor="#C8FFC8"|49||INT ||genCamArg4 ||bgcolor="#FFC8C8"|cameraarg4<br />
|-<br />
|bgcolor="#C8FFC8"|50||INT ||genScrBackdrop ||bgcolor="#FFC8C8"|Index of currently displaying script backdrop , or -1 for none. (Does not include textbox backdrops)<br />
|-<br />
|bgcolor="#C8FFC8"|51||INT ||genDays ||bgcolor="#FFC8C8"|days of play<br />
|-<br />
|bgcolor="#C8FFC8"|52||INT ||genHours ||bgcolor="#FFC8C8"|hours of play<br />
|-<br />
|bgcolor="#C8FFC8"|53||INT ||genMinutes ||bgcolor="#FFC8C8"|minutes of play<br />
|-<br />
|bgcolor="#C8FFC8"|54||INT ||genSeconds ||bgcolor="#FFC8C8"|seconds of play<br />
|-<br />
|55||INT ||genMaxVehicle ||bgcolor="#C8C8FF"|max vehicle types in [[VEH]]<br />
|-<br />
|56||INT ||genMaxTagname ||bgcolor="#C8C8FF"|Last named tag<br />
|-<br />
|bgcolor="#C8FFC8"|57||INT ||genLoadgameScript||load-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|58||INT ||genTextboxBackdrop||bgcolor="#FFC8C8"|Index of currently displaying text box backdrop<br />
|-<br />
|59||INT ||genEnemyDissolve || Default enemy dissolve type. See dissolve types in [[DT1]] (each dissolve type is numbered one less than it is in DT1, for example Random Pixels is 0. <br />
|-<br />
|bgcolor="#C8FFC8"|60||INT ||genJoy ||bgcolor="#FFC8C8"|Enable/disable joystick<br />
|-<br />
|bgcolor="#C8FFC8"|61||INT ||genPoisonChar||Posion status indicator char (default to 161 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|62||INT ||genStunChar ||Stun status indicator char (default to 159 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|63||INT ||genDamageCap||Damage cap (0 if there is none)<br />
|-<br />
|bgcolor="#C8FFC8"|64||INT ||genMuteChar ||Mute status indicator char (default to 163 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|65-76||INT*12 ||genStatCap||Stat caps for each stat, in this order:<br/>HP<br/>MP<br/>Atk<br/>Aim<br/>Def<br/>Dog<br/>Mag<br/>Wil<br/>Spd<br/>Ctr<br/>Focus<br/>Extra Hits<br />
|-<br />
|77||INT ||genMaxSFX||bgcolor="#C8C8FF"|Number of sound effects<br />
|-<br />
|78||INT ||genMasterPal||Master palette number in [[PALETTES.BIN]]<br />
|-<br />
|79||INT ||genMaxMasterPal||bgcolor="#C8C8FF"|Max master palette number in [[PALETTES.BIN]] and number of UI color sets in [[UICOLORS.BIN]]<br />
|-<br />
|80||INT ||genMaxMenu||Max menu in [[MENUS.BIN]]<br />
|-<br />
|81||INT ||genMaxMenuItem||Max menu item in [[MENUITEM.BIN]]<br />
|-<br />
|82||INT ||genMaxItem||Max item number in [[ITM]]<br />
|-<br />
|83||INT ||genMaxBoxBorder||Max valid box border spriteset number (in [[PT7]]/[[RGFX|boxborders.rgfx]])<br />
|-<br />
|84||INT ||genMaxPortrait||Max valid portrait spriteset number (in [[PT8]]/[[RGFX|portraits.rgfx]])<br />
|-<br />
|bgcolor="#C8FFC8"|85||INT ||genMaxInventory||Max available inventory slots. 599 is current default max. Gets rounded ''up'' to the next multiple of 3 slots (counting the zeroth slot). Zero uses the default max of 599 (600 counting zero)<br />
|-<br />
|86||INT ||genErrorLevel||Error suppression level: <br>0: default to 4<br>2: show all warnings<br>3: suppress some warnings<br>4: suppress warnings from weak type checking<br>5: don't show errors not displayed in old versions<br>6: show only errors about corruption or interpreter problems<br />
|-<br />
|bgcolor="#C8FFC8"|87||INT || genLevelCap ||Maximum hero level (0-genMaxLevel) (Unlike genMaxLevel, this can be changed with scripting, and has no effect on stat growth)<br />
|-<br />
|88||INT || genEquipMergeFormula ||Function used to calculate total hero elemental resistances from equipment:<br><br />
0: Awful compatible formula<br><br />
1: Multiplicative<br><br />
2: Additive<br />
|-<br />
|89||INT || genNumElements ||Number of elements which the game uses, up to 64 (any higher numbered ones should be ignored in-game)<br />
|-<br />
|90||INT || genUnlockedReserveXP ||Experience gained by unlocked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|91||INT || genLockedReserveXP ||Experience gained by locked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|92||INT || genPW4Hash ||bgcolor="#C8C8FF"|Hashed password, 0 if none<br />
|-<br />
|93||INT || genPW2Offset ||bgcolor="#D0D0D0"|old(second-style) passcode offset<br />
|-<br />
|94||INT || genPW2Length ||bgcolor="#D0D0D0"|old(second-style) passcode length (-1 if there is no password)<br />
|-<br />
|95||INT ||genVersion ||RPG file format version ID (The latest version number is CURRENT_RPG_VERSION in const.bi. See also [[Incrementing the RPG format version number]])<br />
|-<br />
|96||INT ||genStartMoney||starting money<br />
|-<br />
|97||INT ||genMaxShop ||bgcolor="#C8C8FF"|last shop in [[SHO]]<br />
|-<br />
|98||INT || genPW1Offset ||bgcolor="#D0D0D0"|old-old(first-style) passcode offset<br />
|-<br />
|99||INT || genPW1Length ||bgcolor="#D0D0D0"|old-old(first-style) passcode length<br />
|-<br />
|100||INT ||genNumBackdrops||bgcolor="#C8C8FF"|''Number'' of backdrops (in [[MXS]]/[[RGFX|backdrops.rgfx]])<br />
|-<br />
|101||INT ||genBits ||[[#General bitsets]] 0-15<br />
|-<br />
|102||INT ||genStartX ||starting X<br />
|-<br />
|103||INT ||genStartY ||starting Y<br />
|-<br />
|104||INT ||genStartMap ||starting Map<br />
|-<br />
|105||INT ||genOneTimeNPC ||bgcolor="#C8C8FF"|one-time-NPC indexer<br />
|-<br />
|106-170||INT*65|| genOneTimeNPCBits ||bgcolor="#C8C8FF"|one-time-NPC placeholder bits. there are 0-1039 bits, but savegames store 0-1031 and the NPC editor only allows 0-1000<br />
|-<br />
|171||INT ||genDefaultDeathSfx ||Default enemy death sound effect ID + 1 (0 for none)<br />
|-<br />
|172||INT ||genMaxSong||bgcolor="#C8C8FF"|last song number ([[SNG]] and [[BAM]])<br />
|-<br />
|173||INT ||genAcceptSfx||Sound effect to use for "accept" (in menus) ID + 1 (0 for none)<br />
|-<br />
|174||INT ||genCancelSfx||Sound effect to use for "cancel" (in menus) ID + 1 (0 for none)<br />
|-<br />
|175||INT ||genChooseSfx||Sound effect to use for moving the cursor (in menus) ID + 1 (0 for none)<br />
|-<br />
|176||INT ||gentextboxLetter || Sound effect to use for displaying text box lines ID + 1 (0 for none)<br />
|-<br />
|177-178||INT*2 ||genBits2 || [[#General bitsets]] 16-47<br />
|-<br />
|179||INT ||genItemLearnSFX || Sound effect when learning a spell from an item. ID + 1 (0 for none)<br />
|-<br />
|180||INT ||genCantLearnSFX || Sound effect when a hero couldn't learn spell from item. ID + 1 (0 for none)<br />
|-<br />
|181||INT ||genBuySFX || Sound effect when buying an item from a shop. ID + 1 (0 for none)<br />
|-<br />
|182||INT ||genHireSFX || Sound effect when hiring a hero from a shop. ID + 1 (0 for none)<br />
|-<br />
|183||INT ||genSellSFX || Sound effect when selling an item to a shop. ID + 1 (0 for none)<br />
|-<br />
|184||INT ||genCantBuySFX || Sound effect when you can't afford item/hire. ID + 1 (0 for none)<br />
|-<br />
|185||INT ||genCantSellSFX || Sound effect when trying to sell an unsellable item. ID + 1 (0 for none)<br />
|-<br />
|186||INT ||genDamageDisplayTicks || Number of ticks to display damage numbers in battle (default 7)<br />
|-<br />
|187||INT ||genDamageDisplayRise || Number of pixels the displayed damage should rise (default 14)<br />
|-<br />
|188||INT ||genHeroWeakHP || % HP threshold for hero weak state (default to 20 if 0)<br />
|-<br />
|189||INT ||genEnemyWeakHP || % HP threshold for enemy weak state (default to 20 if 0)<br />
|-<br />
|190||INT ||genAutosortScheme || Method of autosorting inventory:<br><br />
0 - by item type<br><br />
1 - into usable/not usable<br><br />
2 - alphabetically<br><br />
3 - by ID number<br><br />
4 - no reordering beyond compacting<br />
|-<br />
|191||INT || genMaxLevel || Maximum level (0-99) This is the unchanging maximum allowed level for heroes. it is used in the hero stats editor. (Not to be confused with genLevelCap)<br />
|-<br />
|192||INT || genBattleMode || Battle mode 0=Active-time, 1=Turn-based<br />
|-<br />
|193||INT || genItemStackSize || Default maximum size of an inventory stack<br />
|-<br />
|194||INT || genResolutionX || Width in pixels of the game screen (not including graphics backend scaling) or 0 for default, 320x200<br />
|-<br />
|195||INT || genResolutionY || Height in pixels of the game screen (see above).<br />
|-<br />
|196||INT || genEscMenuScript || [[Script Trigger|plotscript]] to run when pressing ESC or ALT to open the menu (if zero, just open the menu)<br />
|- <br />
|197||INT || genSaveSlotCount || The number of available save slots, 1 to 1000. If 0, the default of 4 will be used. In versions older than [[fufluns]] the valid range was 1-32<br />
|-<br />
|198||INT || genMillisecPerFrame || Number of milliseconds per frame, or 55 if zero.<br />
|-<br />
|199||INT || genStealSuccessSFX || ID+1 of sound effect to play for a successful item steal attack, or zero for none.<br />
|-<br />
|200||INT || genStealFailSFX || ID+1 of sound effect to play for an unsuccessful item steal attack, or zero for none.<br />
|-<br />
|201||INT || genStealNoItemSFX || ID+1 of sound effect to play for an item steal attack with nothing to steal, or zero for none.<br />
|-<br />
|bgcolor="#C8FFC8"|202||INT ||genRegenChar ||Regen status indicator char (default to 32 if 0).<br />
|-<br />
|203||INT || genDefaultScale || (Obsolete). For a short while, contained the default scale/zoom factor of the display (1-16), or zero for whatever default is suitable.<br />
|-<br />
|204||INT || genDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This setting is editable, and is used as the base for genCurrentDebugMode<br />
|-<br />
|205||INT || genCurrentDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This is not directly editable. It is set based on genDebugMode but may be temporarily modified by the "Distribute Game" menu or the "Test Game" feature<br />
|-<br />
|206||INT || genStartHero || ID number the initial hero when starting a new game.<br />
|-<br />
|207||INT || genStartTextbox || ID number a textbox to open when starting a new game, 0 means none.<br />
|-<br />
|208||INT || genWindowSize || Default window size about X% of screen, in multiples of 10% (1-10). 10 means maximize. If 0, default to 8.<br />
|-<br />
|209||INT || genLivePreviewWindowSize || Test-Game default window size about X% of screen, in multiples of 10%. 10 means maximize. If 0, default to 5.<br />
|-<br />
|210||INT || genFullscreen || If 1 (or nonzero), default to fullscreen if there is no remembered preference for this game from previous plays.<br />
|-<br />
|211||INT || genMusicVolume || Initial music volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|212||INT || genSFXVolume || Initial global sound effects volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|213||INT || genRungameFullscreenIndependent || If false, fullscreen settings/config for games spawned by rungame are ignored<br />
|-<br />
|214||INT || genSkipBattleRewardsTicks || If > 0 then the battle rewards messages will automatically advance after this many ticks<br />
|-<br />
|215||INT|| genDefOnkeypressScript|| Default on-keypress Plot[[script Trigger]]<br />
|-<br />
|216||INT|| genDefEachStepScript|| Default each-step Plot[[script Trigger]]<br />
|-<br />
|217||INT|| genDefAfterBattleScript|| Default after-battle Plot[[script Trigger]]<br />
|-<br />
|218||INT|| genDefInsteadOfBattleScript|| Default instead-of-battle Plot[[script Trigger]]<br />
|-<br />
|219||INT|| genDefMapAutorunScript|| Default map autorun Plot[[script Trigger]]<br />
|-<br />
|220||INT|| genMaxEnemyPic ||bgcolor="#C8C8FF"|Last (max) valid enemy spriteset number (in [[RGFX|enemies.rgfx]])<br />
|-<br />
|221||INT|| genMinimapAlgorithm || Algorithm for producing in-game minimaps:<br><br />
0 - Smooth scaling (default)<br><br />
1 - Scatter - original random pixel selection algorithm<br><br />
2 - Majority: (Approximate) most common color<br />
|-<br />
|222-225||INT*4|| genBits3 || [[#General bitsets]] 48-111<br />
|-<br />
|226||INT|| genDefCounterProvoke || Default Provoke Counterattacks setting for attacks. Value 0-8, same meanings as [[DT6]] Provoke Counterattacks setting, except Default means 'Always'<br />
|-<br />
|227||INT|| genInventSlotx1Display || When to display x1 in inventory: 0: always, 1: never, 2: only if item maximum stacksize > 1<br />
|-<br />
|228||INT|| genCameraOnWalkaboutFocus || How to calculate walkabout camera focus: 0: on tile, 1: on sprite, 2: on sprite minus Z/offset <br />
|-<br />
|229||INT|| genTicksPerWalkFrame || Number of ticks per walking frame. 0 = default (110ms/frame; ticks calculated from genMillisecPerFrame and rounded to a whole number)<br />
|-<br />
|230||INT|| genAddHeroScript || Script trigger called when hero added<br />
|-<br />
|231||INT|| genRemoveHeroScript || Script trigger called when hero deleted/removed<br />
|-<br />
|232||INT|| genMoveHeroScript || Script trigger called when hero moved to a different slot<br />
|-<br />
|233||INT|| gen8bitBlendAlgo || Algorithm to use for palette lookups for blending in 8-bit color mode:<br><br />
0 - Dither (Half of pixels (in a chequered pattern) are nearest-matched, with 1/2 or 3/4 (alternating) of error diffused to next pixel)<br><br />
1 - Less Dither (Like 'Dither' but only 1/4 of error diffused, without alternation)<br><br />
2 - No Dither (nearest match color)<br />
|-<br />
|234||INT|| genPreviewBackdrop || 0 or ID+1 of backdrop to use for enemy previews (and maybe more in future)<br />
|-<br />
|235||INT|| gen32bitMode || 1 for 32-bit color mode, 0 for 8-bit<br />
|-<br />
|236||INT|| genDefaultBattleMenu || 0 for default, or menu ID + 1 {{WIP|inline}}<br />
|-<br />
|237-499||INT || ||bgcolor="#D0D0D0"| unused space<br />
|}<br />
<br />
'''Maximums''' : "max XYZ" means 'the highest numbered XYZ'. If you have 80 enemies defined, then "max enemy" == 79, because the numbering starts from 0.<br />
<br />
== General bitsets ==<br />
<br />
Preference bits, backcompat bits and battle system bits are stored in a single bit array, which is split into pieces beginning at gen(genBits), gen(genBits2) and gen(genBits3). They are accessed with the <tt>prefbit()</tt> and <tt>setprefbit()</tt> functions in FB code, and {{plot|read preference bit}} and {{plot|write preference bit}} functions in HS code.<br />
<br />
'''Note''': in the Preference Bitsets and other editors, some of the names of bits are '''reversed''' from what they are below.<br />
For example the editor has a bit named "Restore HP on level-up" which appears ON if bit 2 ("Don't restore HP on level-up") is OFF.<br />
<br />
Also note that some bits are turned on during game upgrade by [[fixbits]].<br />
<br />
* 0 - Pause in battle on spell and item menus<br />
* 1 - Enable Caterpillar party<br />
* 2 - Don't restore HP on level-up<br />
* 3 - Don't restore MP on level-up<br />
* 4 - Inns don't revive dead heros<br />
* 5 - Hero swapping always available<br />
* 6 - Hide ready meter in battle<br />
* 7 - Hide health bar in battle<br />
* 8 - Disable debugging keys<br />
* 9 - Simulate old level-up bug<br />
* 10 - Permit double-triggering of scripts<br />
* 11 - Skip title screen<br />
* 12 - Skip load screen<br />
* 13 - Pause in battle on all menus<br />
* 14 - Disable Hero's Battle Cursor<br />
* 15 - Default passability disabled by default<br />
* 16 - Simulate pushable NPC collision bug<br />
* 17 - Disable ESC to run from battle<br />
* 18 - Don't save gameover/loadgame script IDs (actually prevents ''using'' the stored "game over" or "loadgame" script ID number in preference to the ones specified by gen(genGameoverScript) and gen(genLoadgameScript))<br />
* 19 - Dead heroes gain share of experience<br />
* 20 - Locked heros can't be rearranged<br />
* 21 - Attack captions pause battle meters<br />
* 22 - Don't randomize battle ready-meters<br />
* 23 - Battle menus wait for attack animations<br />
* 24 - Enable better scancodes for scripts<br />
* 25 - Simulate old fail vs. elemental resist bit<br />
* 26 - 0 damage when immune to attack elements<br />
* 27 - Recreate map slices when changing maps<br />
* 28 - Harm tiles harm non-caterpillar heroes<br />
* 29 - Ignore extra Hits stat<br />
* 30 - Don't divide experience between heroes<br />
* 31 - Don't reset max stats after OOB attack<br />
* 32 - Don't limit max tags to 1000<br />
* 33 - Enable bug 430<br />
* 34 - showtextbox happens immediately<br />
* 35 - Pause battle while targeting attacks<br />
* 36 - Old attack positioning at bottom-left of target<br />
* 37 - Wrap map layers over edge of Crop maps<br />
* 38 - Never show script timer during battles<br />
* 39 - Draw Backdrop slice above Script layer<br />
* 40 - Don't stop music when starting/loading game<br />
* 41 - Keep caterpillar length the same when speed changes<br />
* 42 - Heroes use Walk in Place animation while idle.<br />
* 43 - Cap minimum stats at zero.<br />
* 44 - Hide empty save slots at the bottom of the save/load menu<br />
* 45 - Attack IDs in scripts are offset by +1 {{Future|inline}}<br />
* 46 - Negative damage harmtiles '''don't''' cure above max HP<br />
* 47 - Don't map joystick controls to keyboard keys for scripts<br />
* 48 - Disable ESC to cancel/change a hero's attack (turn-based battles only)<br />
* 49 - Show hero MP meter<br />
* 50 - Non-turn attack delays '''don't''' also cause turn delays<br />
* 51 - Don't break Speed ties randomly (turn-based battles only)<br />
* 52 - Ignore MP~ stat<br />
* Bits up to 111 unused<br />
<br />
== Passwords ==<br />
The password protection in the RPG format is necessarily wet-paper-bag weak, due to the GNU GPL licensing of the engine. RPG password protection works entirely on the honor system. It's kinda like that faded sign hanging on the gates of Anhk-Morpork that says "Thank you for not invading our city"<br />
<br />
Here is how to read the password. Please-please-pretty-please dont just ignore it. It is flimsy pathetic laughable protection, but its all we have! Dont take away our wire umbrella in the lightening storm!<br />
<br />
Over time there have been 4 different password formats, referred to as PW1, PW2, PW3, PW4. All are stored in the GEN lump. The format is determined by looking at genVersion and genPassVersion (go down this table):<br />
<br />
{| border="1" cellpadding="1"<br />
! Format || Indicator || Introduced || Last used<br />
|-<br />
|PW4 || gen(genPassVersion) = 257 || pre-Zenzizenzic (Dec 28 2010) || Still in use.<br />
|-<br />
|PW3 || gen(genPassVersion) = 256 || Ozarks (June 28 2004) || Still partial back-compat (see below)<br />
|-<br />
|PW2 || gen(genVersion) >= 3 || June 18 1999 || Written until Dec 28 2010<br />
|-<br />
|PW1 || Otherwise || Stone Age ||<br />
|}<br />
<br />
For backwards compatibility, Custom also writes a blank PW3 password is there is no password, or a random PW3 password if there is one.<br />
<br />
The easiest thing to do when decoding an RPG file that still has its password in an old format is to print a warning message telling the user to upgrade their RPG file with CUSTOM.EXE<br />
<br />
=== PW4 ===<br />
This new format stores just a 9-bit hash of the password, in gen(genPW4Hash), so that it is not retrievable.<br />
<br />
The hash is calculated as follows (or see common.bas for the FB version):<br />
<br />
unsigned short passwordhash (char *p) {<br />
if (strlen(p) == 0) return 0;<br />
unsigned int hash = 0;<br />
while (*p)<br />
hash = hash * 3 + *p++ * 31;<br />
return (hash & 511) | 512;<br />
}<br />
<br />
=== PW3 ===<br />
In this format, the password is obscured with weak, but space-wasting encryption, and the length of the password is totally unprotected.<br />
<br />
GEN(6) is the password rotator. It will always be a random number from 1 to 254 that will be used to ascii-rotate/obfuscate the password.<br />
<br />
GEN(7-15) is the password text. There are 17 bytes of data here (so the high byte of GEN(15) is unused). Read this string of 17 bytes. ascii-rotate each character by subtracting GEN(6) and if the result is < 0 then add 255, and then discard all characters with ascii values less than 32 (space). The resulting string will be your password. If the string is empty (all 17 chars were under 32) then the RPG file does not have a password.<br />
<br />
=== PW2 ===<br />
This information describes the obsolete scattertable-based password storage format. It is only here as a curiosity... and a monument of shame to security-through-obscurity.<br />
The body of the scattertable lived at GEN(200) to GEN(359), with the "scattertable head" at gen(199).<br />
The first element of the password mess GEN(200) is the bit-offset of the first bit in the password, relative to the beginning of the scattertable head (199). The next element (201) is the bit-offset of the next bit in the password, and so on. So GEN(200) thru GEN(207) will give you the bits that make up the first ascii char of the password. GEN(208)-GEN(215) gives you the next char, and so on up to GEN(94)+1 bytes. After you have read all the chars from the scattertable, rotate them down by the value of GEN(93) (that is to say, subtract GEN(93) from the ascii value of each char, and if the result is less than 0, add 256).<br />
<br />
Clear as mud, right? Here is an example. Lets suppose that the data in the GEN lump looks like this<br />
<br />
<pre><br />
GEN(93)=172 the ascii-rotate offset<br />
GEN(94)=23 the number of bits -1.<br />
23+1 = 24, thats the total number of bits in the password<br />
There are 8 bits in each char of the password, so 24<br />
divided by 8 is 3. That means this password will end up being 3 chars long.<br />
<br />
BIT OFFSETS/SCATTERTABLE<br />
GEN(199)=8 [0001 0000 0000 0000] dummy number. Never 0 or 255<br />
GEN(200)=4 [0010 0000 0000 0000] Start here. bit 4 in the table is a 0<br />
GEN(201)=3 [1100 0000 0000 0000] bit 3 in the table is a 1, now we have 01<br />
GEN(202)=18[0100 1000 0000 0000] bit 18 is 1: 011<br />
GEN(203)=18[0100 1000 0000 0000] bit 18 is 1: 0111<br />
GEN(204)=54[0110 1100 0000 0000] bit 58 is 0: 01110<br />
GEN(205)=33[1000 0010 0000 0000] bit 33 is 1: 011101<br />
GEN(206)=85[1010 1010 0000 0000] bit 85 is 1: 0111011<br />
GEN(207)=82[0100 1010 0000 0000] bit 82 is 1: 01110111<br />
</pre><br />
<br />
So we end up with 01110111 which is char 238, (a wierd ascii math symbol) Now we subtract the value of GEN(93) and we get 66, which is the ascii code for upper case B, so we know the first letter of the password is B.<br />
<br />
Ah, what fun. what a mess. what a waste. *sigh*<br />
<br />
===PW1===<br />
<br />
We didn't bother to document this here, but it's yet another scheme, very similar to PW3! If you care, you can read the read_PW1_password() function in the source. It stores the password in gen(5) upwards, and in gen(genPW1Offset) and gen(genPW1Length) (gen(98) and gen(99).<br />
<br />
=See Also=<br />
* [http://thread.gmane.org/gmane.games.ohrrpgce.devel/17774 Garbage in GEN], an investigation of junk in high areas of GEN in older games<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=GEN&diff=34352GEN2022-02-07T01:25:56Z<p>Bob the Hamster: genDefaultBattleMenu</p>
<hr />
<div>__NOTOC__<br />
The lump with the extension .GEN is a critical one. It contains miscellaneous information about a wide variety of unrelated things, especially max number of records for other files, password information, and other stuff that I felt like sticking in there too-- some of which really don't belong.<br />
<br />
New general options are increasingly being added to [[general.reld]] instead, the RELOAD-format alternative.<br />
<br />
{{BSAVE Header}}<br />
<br />
The .gen lump is normally 1007 bytes long (including 7 byte header). '''NOTE:''' The fixWipeGEN [[FIXBITS.BIN|fixbit]] must be checked when reading values at offsets 199 and up.<br />
<br />
The following is the meaning of each element.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|-<br />
|bgcolor="#FFC8C8"|Pink fields are runtime-only fields used by [[GAME]] that do not really belong GEN in the first place, but are there anyway to make including them in [[SAV]] files more convenient, which is now a moot argument because of the conversion to [[RSAV]].<br />
|-<br />
|bgcolor="#C8C8FF"|Blue fields are editor-only fields used by [[CUSTOM]], although almost all of them are also used in-game for error-checking valid data record numbers. GAME and CUSTOM will both automatically set all these "max/number of X" fields to the true values.<br />
|-<br />
|bgcolor="#C8FFC8"|Green records are preserved in [[RSAV]] files.<br />
|}<br />
<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Element || Data || Constant || Meaning<br />
|-<br />
|0||INT ||genMaxMap ||bgcolor="#C8C8FF"|Max (last) valid map number<br />
|-<br />
|1||INT ||genTitle ||Title screen backdrop index<br />
|-<br />
|2||INT ||genTitleMus ||title music<br />
|-<br />
|3||INT ||genVictMus ||victory music + 1 (0 for none)<br />
|-<br />
|4||INT ||genBatMus ||default battle music<br />
|-<br />
|5||INT ||genPassVersion||bgcolor="#C8C8FF"| passcode format number<br />
|-<br />
|6||INT ||genPW3Rot ||bgcolor="#D0D0D0"|old (third-style) passcode rotator<br />
|-<br />
|7-15||BYTE*17 + 1 || ||bgcolor="#D0D0D0"|old (third-style) obfuscated passcode + 1 unused byte<br />
|-<br />
|16-25||INT*10 || ||bgcolor="#D0D0D0"|ancient (first-style) obsolete password data<br />
|-<br />
|26||INT ||genMaxHeroPic ||bgcolor="#C8C8FF"|Last (max) valid hero spriteset number (in [[PT0]]/[[RGFX|heroes.rgfx]])<br />
|-<br />
|27||INT ||genMaxEnemy1Pic ||bgcolor="#C8C8FF"|Last (max) valid small enemy spriteset number (graphics in [[PT1]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as small enemy graphics.<br />
|-<br />
|28||INT ||genMaxEnemy2Pic ||bgcolor="#C8C8FF"|Last (max) valid medium spriteset number (graphics in [[PT2]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as medium enemy graphics.<br />
|-<br />
|29||INT ||genMaxEnemy3Pic ||bgcolor="#C8C8FF"|Last (max) valid large enemy spriteset number (in [[PT3]]/[[RGFX|enemies.rgfx]]). Includes only the spritesets in enemies.rgfx which are counted as large enemy graphics.<br />
|-<br />
|30||INT ||genMaxNPCPic ||bgcolor="#C8C8FF"|Last (max) valid walkabout spriteset number (in [[PT4]]/[[RGFX|walkabouts.rgfx]])<br />
|-<br />
|31||INT ||genMaxWeaponPic ||bgcolor="#C8C8FF"|Last (max) valid weapon spriteset number (in [[PT5]]/[[RGFX|weapons.rgfx]])<br />
|-<br />
|32||INT ||genMaxAttackPic ||bgcolor="#C8C8FF"|Last (max) valid attack spriteset number (in [[PT6]]/[[RGFX|attacks.rgfx]])<br />
|-<br />
|33||INT ||genMaxTile ||bgcolor="#C8C8FF"|Last (max) tileset number in [[TIL]]<br />
|-<br />
|34||INT ||genMaxAttack ||bgcolor="#C8C8FF"|max attack definitions in [[DT6]]<br />
|-<br />
|35||INT ||genMaxHero ||bgcolor="#C8C8FF"|max hero definitions in [[DT0]]<br />
|-<br />
|36||INT ||genMaxEnemy ||bgcolor="#C8C8FF"|max enemy definitions in [[DT1]]<br />
|-<br />
|37||INT ||genMaxFormation ||bgcolor="#C8C8FF"|max formations in [[FOR]]<br />
|-<br />
|38||INT ||genMaxPal ||bgcolor="#C8C8FF"|max palettes in [[PAL]]<br />
|-<br />
|39||INT ||genMaxTextbox ||bgcolor="#C8C8FF"|max text boxes in [[SAY]]<br />
|-<br />
|40||INT ||genMaxPlotscript ||bgcolor="#C8C8FF"|total available plotscripts (number of records in [[PLOTSCR.LST]])<br />
|-<br />
|41||INT ||genNewgameScript ||ID of new-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|42||INT ||genGameoverScript||ID of game-over [[Script Trigger|plotscript]]<br />
|-<br />
|43||INT ||genMaxRegularScript||bgcolor="#C8C8FF"|ID of highest manually numbered old-style plotscript<br />
|-<br />
|bgcolor="#C8FFC8"|44||INT ||genSuspendBits ||bgcolor="#FFC8C8"|suspendstuff bits:<br><br />
0 - suspendnpcs<br><br />
1 - suspendplayer<br><br />
2 - suspendobstruction<br><br />
3 - suspendherowalls<br><br />
4 - suspendnpcwalls<br><br />
5 - suspendcatapillar<br><br />
6 - suspendrandomenemies<br><br />
7 - suspendboxadvance<br><br />
8 - suspendoverlay<br><br />
9 - suspendambientmusic<br><br />
10 - suspenddoors<br><br />
11 - suspendtimers<br><br />
|-<br />
|bgcolor="#C8FFC8"|45||INT ||genCamera ||bgcolor="#FFC8C8"|camera mode<br />
|-<br />
|bgcolor="#C8FFC8"|46||INT ||genCamArg1 ||bgcolor="#FFC8C8"|cameraarg1<br />
|-<br />
|bgcolor="#C8FFC8"|47||INT ||genCamArg2 ||bgcolor="#FFC8C8"|cameraarg2<br />
|-<br />
|bgcolor="#C8FFC8"|48||INT ||genCamArg3 ||bgcolor="#FFC8C8"|cameraarg3<br />
|-<br />
|bgcolor="#C8FFC8"|49||INT ||genCamArg4 ||bgcolor="#FFC8C8"|cameraarg4<br />
|-<br />
|bgcolor="#C8FFC8"|50||INT ||genScrBackdrop ||bgcolor="#FFC8C8"|Index of currently displaying script backdrop , or -1 for none. (Does not include textbox backdrops)<br />
|-<br />
|bgcolor="#C8FFC8"|51||INT ||genDays ||bgcolor="#FFC8C8"|days of play<br />
|-<br />
|bgcolor="#C8FFC8"|52||INT ||genHours ||bgcolor="#FFC8C8"|hours of play<br />
|-<br />
|bgcolor="#C8FFC8"|53||INT ||genMinutes ||bgcolor="#FFC8C8"|minutes of play<br />
|-<br />
|bgcolor="#C8FFC8"|54||INT ||genSeconds ||bgcolor="#FFC8C8"|seconds of play<br />
|-<br />
|55||INT ||genMaxVehicle ||bgcolor="#C8C8FF"|max vehicle types in [[VEH]]<br />
|-<br />
|56||INT ||genMaxTagname ||bgcolor="#C8C8FF"|Last named tag<br />
|-<br />
|bgcolor="#C8FFC8"|57||INT ||genLoadgameScript||load-game [[Script Trigger|plotscript]]<br />
|-<br />
|bgcolor="#C8FFC8"|58||INT ||genTextboxBackdrop||bgcolor="#FFC8C8"|Index of currently displaying text box backdrop<br />
|-<br />
|59||INT ||genEnemyDissolve || Default enemy dissolve type. See dissolve types in [[DT1]] (each dissolve type is numbered one less than it is in DT1, for example Random Pixels is 0. <br />
|-<br />
|bgcolor="#C8FFC8"|60||INT ||genJoy ||bgcolor="#FFC8C8"|Enable/disable joystick<br />
|-<br />
|bgcolor="#C8FFC8"|61||INT ||genPoisonChar||Posion status indicator char (default to 161 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|62||INT ||genStunChar ||Stun status indicator char (default to 159 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|63||INT ||genDamageCap||Damage cap (0 if there is none)<br />
|-<br />
|bgcolor="#C8FFC8"|64||INT ||genMuteChar ||Mute status indicator char (default to 163 if 0)<br />
|-<br />
|bgcolor="#C8FFC8"|65-76||INT*12 ||genStatCap||Stat caps for each stat, in this order:<br/>HP<br/>MP<br/>Atk<br/>Aim<br/>Def<br/>Dog<br/>Mag<br/>Wil<br/>Spd<br/>Ctr<br/>Focus<br/>Extra Hits<br />
|-<br />
|77||INT ||genMaxSFX||bgcolor="#C8C8FF"|Number of sound effects<br />
|-<br />
|78||INT ||genMasterPal||Master palette number in [[PALETTES.BIN]]<br />
|-<br />
|79||INT ||genMaxMasterPal||bgcolor="#C8C8FF"|Max master palette number in [[PALETTES.BIN]] and number of UI color sets in [[UICOLORS.BIN]]<br />
|-<br />
|80||INT ||genMaxMenu||Max menu in [[MENUS.BIN]]<br />
|-<br />
|81||INT ||genMaxMenuItem||Max menu item in [[MENUITEM.BIN]]<br />
|-<br />
|82||INT ||genMaxItem||Max item number in [[ITM]]<br />
|-<br />
|83||INT ||genMaxBoxBorder||Max valid box border spriteset number (in [[PT7]]/[[RGFX|boxborders.rgfx]])<br />
|-<br />
|84||INT ||genMaxPortrait||Max valid portrait spriteset number (in [[PT8]]/[[RGFX|portraits.rgfx]])<br />
|-<br />
|bgcolor="#C8FFC8"|85||INT ||genMaxInventory||Max available inventory slots. 599 is current default max. Gets rounded ''up'' to the next multiple of 3 slots (counting the zeroth slot). Zero uses the default max of 599 (600 counting zero)<br />
|-<br />
|86||INT ||genErrorLevel||Error suppression level: <br>0: default to 4<br>2: show all warnings<br>3: suppress some warnings<br>4: suppress warnings from weak type checking<br>5: don't show errors not displayed in old versions<br>6: show only errors about corruption or interpreter problems<br />
|-<br />
|bgcolor="#C8FFC8"|87||INT || genLevelCap ||Maximum hero level (0-genMaxLevel) (Unlike genMaxLevel, this can be changed with scripting, and has no effect on stat growth)<br />
|-<br />
|88||INT || genEquipMergeFormula ||Function used to calculate total hero elemental resistances from equipment:<br><br />
0: Awful compatible formula<br><br />
1: Multiplicative<br><br />
2: Additive<br />
|-<br />
|89||INT || genNumElements ||Number of elements which the game uses, up to 64 (any higher numbered ones should be ignored in-game)<br />
|-<br />
|90||INT || genUnlockedReserveXP ||Experience gained by unlocked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|91||INT || genLockedReserveXP ||Experience gained by locked reserve heroes, as a % of that given to active party heroes<br />
|-<br />
|92||INT || genPW4Hash ||bgcolor="#C8C8FF"|Hashed password, 0 if none<br />
|-<br />
|93||INT || genPW2Offset ||bgcolor="#D0D0D0"|old(second-style) passcode offset<br />
|-<br />
|94||INT || genPW2Length ||bgcolor="#D0D0D0"|old(second-style) passcode length (-1 if there is no password)<br />
|-<br />
|95||INT ||genVersion ||RPG file format version ID (The latest version number is CURRENT_RPG_VERSION in const.bi. See also [[Incrementing the RPG format version number]])<br />
|-<br />
|96||INT ||genStartMoney||starting money<br />
|-<br />
|97||INT ||genMaxShop ||bgcolor="#C8C8FF"|last shop in [[SHO]]<br />
|-<br />
|98||INT || genPW1Offset ||bgcolor="#D0D0D0"|old-old(first-style) passcode offset<br />
|-<br />
|99||INT || genPW1Length ||bgcolor="#D0D0D0"|old-old(first-style) passcode length<br />
|-<br />
|100||INT ||genNumBackdrops||bgcolor="#C8C8FF"|''Number'' of backdrops (in [[MXS]]/[[RGFX|backdrops.rgfx]])<br />
|-<br />
|101||INT ||genBits ||[[#General bitsets]] 0-15<br />
|-<br />
|102||INT ||genStartX ||starting X<br />
|-<br />
|103||INT ||genStartY ||starting Y<br />
|-<br />
|104||INT ||genStartMap ||starting Map<br />
|-<br />
|105||INT ||genOneTimeNPC ||bgcolor="#C8C8FF"|one-time-NPC indexer<br />
|-<br />
|106-170||INT*65|| genOneTimeNPCBits ||bgcolor="#C8C8FF"|one-time-NPC placeholder bits. there are 0-1039 bits, but savegames store 0-1031 and the NPC editor only allows 0-1000<br />
|-<br />
|171||INT ||genDefaultDeathSfx ||Default enemy death sound effect ID + 1 (0 for none)<br />
|-<br />
|172||INT ||genMaxSong||bgcolor="#C8C8FF"|last song number ([[SNG]] and [[BAM]])<br />
|-<br />
|173||INT ||genAcceptSfx||Sound effect to use for "accept" (in menus) ID + 1 (0 for none)<br />
|-<br />
|174||INT ||genCancelSfx||Sound effect to use for "cancel" (in menus) ID + 1 (0 for none)<br />
|-<br />
|175||INT ||genChooseSfx||Sound effect to use for moving the cursor (in menus) ID + 1 (0 for none)<br />
|-<br />
|176||INT ||gentextboxLetter || Sound effect to use for displaying text box lines ID + 1 (0 for none)<br />
|-<br />
|177-178||INT*2 ||genBits2 || [[#General bitsets]] 16-47<br />
|-<br />
|179||INT ||genItemLearnSFX || Sound effect when learning a spell from an item. ID + 1 (0 for none)<br />
|-<br />
|180||INT ||genCantLearnSFX || Sound effect when a hero couldn't learn spell from item. ID + 1 (0 for none)<br />
|-<br />
|181||INT ||genBuySFX || Sound effect when buying an item from a shop. ID + 1 (0 for none)<br />
|-<br />
|182||INT ||genHireSFX || Sound effect when hiring a hero from a shop. ID + 1 (0 for none)<br />
|-<br />
|183||INT ||genSellSFX || Sound effect when selling an item to a shop. ID + 1 (0 for none)<br />
|-<br />
|184||INT ||genCantBuySFX || Sound effect when you can't afford item/hire. ID + 1 (0 for none)<br />
|-<br />
|185||INT ||genCantSellSFX || Sound effect when trying to sell an unsellable item. ID + 1 (0 for none)<br />
|-<br />
|186||INT ||genDamageDisplayTicks || Number of ticks to display damage numbers in battle (default 7)<br />
|-<br />
|187||INT ||genDamageDisplayRise || Number of pixels the displayed damage should rise (default 14)<br />
|-<br />
|188||INT ||genHeroWeakHP || % HP threshold for hero weak state (default to 20 if 0)<br />
|-<br />
|189||INT ||genEnemyWeakHP || % HP threshold for enemy weak state (default to 20 if 0)<br />
|-<br />
|190||INT ||genAutosortScheme || Method of autosorting inventory:<br><br />
0 - by item type<br><br />
1 - into usable/not usable<br><br />
2 - alphabetically<br><br />
3 - by ID number<br><br />
4 - no reordering beyond compacting<br />
|-<br />
|191||INT || genMaxLevel || Maximum level (0-99) This is the unchanging maximum allowed level for heroes. it is used in the hero stats editor. (Not to be confused with genLevelCap)<br />
|-<br />
|192||INT || genBattleMode || Battle mode 0=Active-time, 1=Turn-based<br />
|-<br />
|193||INT || genItemStackSize || Default maximum size of an inventory stack<br />
|-<br />
|194||INT || genResolutionX || Width in pixels of the game screen (not including graphics backend scaling) or 0 for default, 320x200<br />
|-<br />
|195||INT || genResolutionY || Height in pixels of the game screen (see above).<br />
|-<br />
|196||INT || genEscMenuScript || [[Script Trigger|plotscript]] to run when pressing ESC or ALT to open the menu (if zero, just open the menu)<br />
|- <br />
|197||INT || genSaveSlotCount || The number of available save slots, 1 to 1000. If 0, the default of 4 will be used. In versions older than [[fufluns]] the valid range was 1-32<br />
|-<br />
|198||INT || genMillisecPerFrame || Number of milliseconds per frame, or 55 if zero.<br />
|-<br />
|199||INT || genStealSuccessSFX || ID+1 of sound effect to play for a successful item steal attack, or zero for none.<br />
|-<br />
|200||INT || genStealFailSFX || ID+1 of sound effect to play for an unsuccessful item steal attack, or zero for none.<br />
|-<br />
|201||INT || genStealNoItemSFX || ID+1 of sound effect to play for an item steal attack with nothing to steal, or zero for none.<br />
|-<br />
|bgcolor="#C8FFC8"|202||INT ||genRegenChar ||Regen status indicator char (default to 32 if 0).<br />
|-<br />
|203||INT || genDefaultScale || (Obsolete). For a short while, contained the default scale/zoom factor of the display (1-16), or zero for whatever default is suitable.<br />
|-<br />
|204||INT || genDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This setting is editable, and is used as the base for genCurrentDebugMode<br />
|-<br />
|205||INT || genCurrentDebugMode || 0=Release mode, script errors hidden, 1=Debug mode, script errors shown. This is not directly editable. It is set based on genDebugMode but may be temporarily modified by the "Distribute Game" menu or the "Test Game" feature<br />
|-<br />
|206||INT || genStartHero || ID number the initial hero when starting a new game.<br />
|-<br />
|207||INT || genStartTextbox || ID number a textbox to open when starting a new game, 0 means none.<br />
|-<br />
|208||INT || genWindowSize || Default window size about X% of screen, in multiples of 10% (1-10). 10 means maximize. If 0, default to 8.<br />
|-<br />
|209||INT || genLivePreviewWindowSize || Test-Game default window size about X% of screen, in multiples of 10%. 10 means maximize. If 0, default to 5.<br />
|-<br />
|210||INT || genFullscreen || If 1 (or nonzero), default to fullscreen if there is no remembered preference for this game from previous plays.<br />
|-<br />
|211||INT || genMusicVolume || Initial music volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|212||INT || genSFXVolume || Initial global sound effects volume as a percentage (Needs initialising if fixInitDefaultVolumes false)<br />
|-<br />
|213||INT || genRungameFullscreenIndependent || If false, fullscreen settings/config for games spawned by rungame are ignored<br />
|-<br />
|214||INT || genSkipBattleRewardsTicks || If > 0 then the battle rewards messages will automatically advance after this many ticks<br />
|-<br />
|215||INT|| genDefOnkeypressScript|| Default on-keypress Plot[[script Trigger]]<br />
|-<br />
|216||INT|| genDefEachStepScript|| Default each-step Plot[[script Trigger]]<br />
|-<br />
|217||INT|| genDefAfterBattleScript|| Default after-battle Plot[[script Trigger]]<br />
|-<br />
|218||INT|| genDefInsteadOfBattleScript|| Default instead-of-battle Plot[[script Trigger]]<br />
|-<br />
|219||INT|| genDefMapAutorunScript|| Default map autorun Plot[[script Trigger]]<br />
|-<br />
|220||INT|| genMaxEnemyPic ||bgcolor="#C8C8FF"|Last (max) valid enemy spriteset number (in [[RGFX|enemies.rgfx]])<br />
|-<br />
|221||INT|| genMinimapAlgorithm || Algorithm for producing in-game minimaps:<br><br />
0 - Smooth scaling (default)<br><br />
1 - Scatter - original random pixel selection algorithm<br><br />
2 - Majority: (Approximate) most common color<br />
|-<br />
|222-225||INT*4|| genBits3 || [[#General bitsets]] 48-111<br />
|-<br />
|226||INT|| genDefCounterProvoke || Default Provoke Counterattacks setting for attacks. Value 0-8, same meanings as [[DT6]] Provoke Counterattacks setting, except Default means 'Always'<br />
|-<br />
|227||INT|| genInventSlotx1Display || When to display x1 in inventory: 0: always, 1: never, 2: only if item maximum stacksize > 1<br />
|-<br />
|228||INT|| genCameraOnWalkaboutFocus || How to calculate walkabout camera focus: 0: on tile, 1: on sprite, 2: on sprite minus Z/offset <br />
|-<br />
|229||INT|| genTicksPerWalkFrame || Number of ticks per walking frame. 0 = default (110ms/frame; ticks calculated from genMillisecPerFrame and rounded to a whole number)<br />
|-<br />
|230||INT|| genAddHeroScript || Script trigger called when hero added<br />
|-<br />
|231||INT|| genRemoveHeroScript || Script trigger called when hero deleted/removed<br />
|-<br />
|232||INT|| genMoveHeroScript || Script trigger called when hero moved to a different slot<br />
|-<br />
|233||INT|| gen8bitBlendAlgo || Algorithm to use for palette lookups for blending in 8-bit color mode:<br><br />
0 - Dither (Half of pixels (in a chequered pattern) are nearest-matched, with 1/2 or 3/4 (alternating) of error diffused to next pixel)<br><br />
1 - Less Dither (Like 'Dither' but only 1/4 of error diffused, without alternation)<br><br />
2 - No Dither (nearest match color)<br />
|-<br />
|234||INT|| genPreviewBackdrop || 0 or ID+1 of backdrop to use for enemy previews (and maybe more in future)<br />
|-<br />
|235||INT|| gen32bitMode || 1 for 32-bit color mode, 0 for 8-bit<br />
|-<br />
|236||INT|| genDefaultBattleMenu || 0 for default, or menu ID + 1 {{WIP|inline}}<br />
|-<br />
|235-499||INT || ||bgcolor="#D0D0D0"| unused space<br />
|}<br />
<br />
'''Maximums''' : "max XYZ" means 'the highest numbered XYZ'. If you have 80 enemies defined, then "max enemy" == 79, because the numbering starts from 0.<br />
<br />
== General bitsets ==<br />
<br />
Preference bits, backcompat bits and battle system bits are stored in a single bit array, which is split into pieces beginning at gen(genBits), gen(genBits2) and gen(genBits3). They are accessed with the <tt>prefbit()</tt> and <tt>setprefbit()</tt> functions in FB code, and {{plot|read preference bit}} and {{plot|write preference bit}} functions in HS code.<br />
<br />
'''Note''': in the Preference Bitsets and other editors, some of the names of bits are '''reversed''' from what they are below.<br />
For example the editor has a bit named "Restore HP on level-up" which appears ON if bit 2 ("Don't restore HP on level-up") is OFF.<br />
<br />
Also note that some bits are turned on during game upgrade by [[fixbits]].<br />
<br />
* 0 - Pause in battle on spell and item menus<br />
* 1 - Enable Caterpillar party<br />
* 2 - Don't restore HP on level-up<br />
* 3 - Don't restore MP on level-up<br />
* 4 - Inns don't revive dead heros<br />
* 5 - Hero swapping always available<br />
* 6 - Hide ready meter in battle<br />
* 7 - Hide health bar in battle<br />
* 8 - Disable debugging keys<br />
* 9 - Simulate old level-up bug<br />
* 10 - Permit double-triggering of scripts<br />
* 11 - Skip title screen<br />
* 12 - Skip load screen<br />
* 13 - Pause in battle on all menus<br />
* 14 - Disable Hero's Battle Cursor<br />
* 15 - Default passability disabled by default<br />
* 16 - Simulate pushable NPC collision bug<br />
* 17 - Disable ESC to run from battle<br />
* 18 - Don't save gameover/loadgame script IDs (actually prevents ''using'' the stored "game over" or "loadgame" script ID number in preference to the ones specified by gen(genGameoverScript) and gen(genLoadgameScript))<br />
* 19 - Dead heroes gain share of experience<br />
* 20 - Locked heros can't be rearranged<br />
* 21 - Attack captions pause battle meters<br />
* 22 - Don't randomize battle ready-meters<br />
* 23 - Battle menus wait for attack animations<br />
* 24 - Enable better scancodes for scripts<br />
* 25 - Simulate old fail vs. elemental resist bit<br />
* 26 - 0 damage when immune to attack elements<br />
* 27 - Recreate map slices when changing maps<br />
* 28 - Harm tiles harm non-caterpillar heroes<br />
* 29 - Ignore extra Hits stat<br />
* 30 - Don't divide experience between heroes<br />
* 31 - Don't reset max stats after OOB attack<br />
* 32 - Don't limit max tags to 1000<br />
* 33 - Enable bug 430<br />
* 34 - showtextbox happens immediately<br />
* 35 - Pause battle while targeting attacks<br />
* 36 - Old attack positioning at bottom-left of target<br />
* 37 - Wrap map layers over edge of Crop maps<br />
* 38 - Never show script timer during battles<br />
* 39 - Draw Backdrop slice above Script layer<br />
* 40 - Don't stop music when starting/loading game<br />
* 41 - Keep caterpillar length the same when speed changes<br />
* 42 - Heroes use Walk in Place animation while idle.<br />
* 43 - Cap minimum stats at zero.<br />
* 44 - Hide empty save slots at the bottom of the save/load menu<br />
* 45 - Attack IDs in scripts are offset by +1 {{Future|inline}}<br />
* 46 - Negative damage harmtiles '''don't''' cure above max HP<br />
* 47 - Don't map joystick controls to keyboard keys for scripts<br />
* 48 - Disable ESC to cancel/change a hero's attack (turn-based battles only)<br />
* 49 - Show hero MP meter<br />
* 50 - Non-turn attack delays '''don't''' also cause turn delays<br />
* 51 - Don't break Speed ties randomly (turn-based battles only)<br />
* 52 - Ignore MP~ stat<br />
* Bits up to 111 unused<br />
<br />
== Passwords ==<br />
The password protection in the RPG format is necessarily wet-paper-bag weak, due to the GNU GPL licensing of the engine. RPG password protection works entirely on the honor system. It's kinda like that faded sign hanging on the gates of Anhk-Morpork that says "Thank you for not invading our city"<br />
<br />
Here is how to read the password. Please-please-pretty-please dont just ignore it. It is flimsy pathetic laughable protection, but its all we have! Dont take away our wire umbrella in the lightening storm!<br />
<br />
Over time there have been 4 different password formats, referred to as PW1, PW2, PW3, PW4. All are stored in the GEN lump. The format is determined by looking at genVersion and genPassVersion (go down this table):<br />
<br />
{| border="1" cellpadding="1"<br />
! Format || Indicator || Introduced || Last used<br />
|-<br />
|PW4 || gen(genPassVersion) = 257 || pre-Zenzizenzic (Dec 28 2010) || Still in use.<br />
|-<br />
|PW3 || gen(genPassVersion) = 256 || Ozarks (June 28 2004) || Still partial back-compat (see below)<br />
|-<br />
|PW2 || gen(genVersion) >= 3 || June 18 1999 || Written until Dec 28 2010<br />
|-<br />
|PW1 || Otherwise || Stone Age ||<br />
|}<br />
<br />
For backwards compatibility, Custom also writes a blank PW3 password is there is no password, or a random PW3 password if there is one.<br />
<br />
The easiest thing to do when decoding an RPG file that still has its password in an old format is to print a warning message telling the user to upgrade their RPG file with CUSTOM.EXE<br />
<br />
=== PW4 ===<br />
This new format stores just a 9-bit hash of the password, in gen(genPW4Hash), so that it is not retrievable.<br />
<br />
The hash is calculated as follows (or see common.bas for the FB version):<br />
<br />
unsigned short passwordhash (char *p) {<br />
if (strlen(p) == 0) return 0;<br />
unsigned int hash = 0;<br />
while (*p)<br />
hash = hash * 3 + *p++ * 31;<br />
return (hash & 511) | 512;<br />
}<br />
<br />
=== PW3 ===<br />
In this format, the password is obscured with weak, but space-wasting encryption, and the length of the password is totally unprotected.<br />
<br />
GEN(6) is the password rotator. It will always be a random number from 1 to 254 that will be used to ascii-rotate/obfuscate the password.<br />
<br />
GEN(7-15) is the password text. There are 17 bytes of data here (so the high byte of GEN(15) is unused). Read this string of 17 bytes. ascii-rotate each character by subtracting GEN(6) and if the result is < 0 then add 255, and then discard all characters with ascii values less than 32 (space). The resulting string will be your password. If the string is empty (all 17 chars were under 32) then the RPG file does not have a password.<br />
<br />
=== PW2 ===<br />
This information describes the obsolete scattertable-based password storage format. It is only here as a curiosity... and a monument of shame to security-through-obscurity.<br />
The body of the scattertable lived at GEN(200) to GEN(359), with the "scattertable head" at gen(199).<br />
The first element of the password mess GEN(200) is the bit-offset of the first bit in the password, relative to the beginning of the scattertable head (199). The next element (201) is the bit-offset of the next bit in the password, and so on. So GEN(200) thru GEN(207) will give you the bits that make up the first ascii char of the password. GEN(208)-GEN(215) gives you the next char, and so on up to GEN(94)+1 bytes. After you have read all the chars from the scattertable, rotate them down by the value of GEN(93) (that is to say, subtract GEN(93) from the ascii value of each char, and if the result is less than 0, add 256).<br />
<br />
Clear as mud, right? Here is an example. Lets suppose that the data in the GEN lump looks like this<br />
<br />
<pre><br />
GEN(93)=172 the ascii-rotate offset<br />
GEN(94)=23 the number of bits -1.<br />
23+1 = 24, thats the total number of bits in the password<br />
There are 8 bits in each char of the password, so 24<br />
divided by 8 is 3. That means this password will end up being 3 chars long.<br />
<br />
BIT OFFSETS/SCATTERTABLE<br />
GEN(199)=8 [0001 0000 0000 0000] dummy number. Never 0 or 255<br />
GEN(200)=4 [0010 0000 0000 0000] Start here. bit 4 in the table is a 0<br />
GEN(201)=3 [1100 0000 0000 0000] bit 3 in the table is a 1, now we have 01<br />
GEN(202)=18[0100 1000 0000 0000] bit 18 is 1: 011<br />
GEN(203)=18[0100 1000 0000 0000] bit 18 is 1: 0111<br />
GEN(204)=54[0110 1100 0000 0000] bit 58 is 0: 01110<br />
GEN(205)=33[1000 0010 0000 0000] bit 33 is 1: 011101<br />
GEN(206)=85[1010 1010 0000 0000] bit 85 is 1: 0111011<br />
GEN(207)=82[0100 1010 0000 0000] bit 82 is 1: 01110111<br />
</pre><br />
<br />
So we end up with 01110111 which is char 238, (a wierd ascii math symbol) Now we subtract the value of GEN(93) and we get 66, which is the ascii code for upper case B, so we know the first letter of the password is B.<br />
<br />
Ah, what fun. what a mess. what a waste. *sigh*<br />
<br />
===PW1===<br />
<br />
We didn't bother to document this here, but it's yet another scheme, very similar to PW3! If you care, you can read the read_PW1_password() function in the source. It stores the password in gen(5) upwards, and in gen(genPW1Offset) and gen(genPW1Length) (gen(98) and gen(99).<br />
<br />
=See Also=<br />
* [http://thread.gmane.org/gmane.games.ohrrpgce.devel/17774 Garbage in GEN], an investigation of junk in high areas of GEN in older games<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Heroes.reld&diff=34351Heroes.reld2022-02-06T21:12:46Z<p>Bob the Hamster: skip turn</p>
<hr />
<div>A [[RELOAD]] format lump for storage of hero definitions.<br />
<br />
This lump replaced [[DT0]] in all versions after Dec 21 2012. (CURRENT_RPG_VERSION >= 19)<br />
<br />
* '''heroes''' - this is the root node<br />
** '''hero''' int - one node for each hero. value is id number<br />
*** '''name''' string<br />
**** '''maxlen''' int - max length of name when renaming. if node not present use default<br />
*** '''appearance''' contains appearance data<br />
**** '''walkabout'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
**** '''battle'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
***** '''hand_a''' - node containing hand offset data for attack frame A<br />
****** '''x''' int - x offset of hand<br />
****** '''y''' int - y offset of hand<br />
***** '''hand_b''' - node containing hand offset data for attack frame B<br />
****** '''x''' int - x offset of hand<br />
****** '''y''' int - y offset of hand<br />
**** '''portrait'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
*** '''default_level''' int - value is level number. Use default if node is not present<br />
*** '''default_weapon''' int - item id number<br />
*** '''default_auto_battle''' int - if not zero, this hero will default to fighting automatically in battle. If absent or zero, this hero will default to normal player control {{WIP|inline}}<br />
*** '''exp_mult''' float - multiplier in the hero's experience formula (minus 1). Defaults to 0.2, ie ''1.2*prev+5''<br />
*** '''stats_at_zero''' - contains stats at level 0<br />
**** '''stat''' int - one node for each stat. value is stat ID number 0-11<br />
***** '''value''' int - value for this stat<br />
*** '''stats_at_max''' - contains stats at max level (often, but not always level 99)<br />
**** '''stat''' int - one node for each stat. value is stat ID number 0-11<br />
***** '''value''' int - value for this stat<br />
*** '''battle_menus''' - stores the hero's battle menu data<br />
**** '''menu''' - one for each hero battle menu slot.<br />
***** '''kind''' only has one child node. The valid options are listed below<br />
****** '''weapon''' - if this node is present, this is the attack specified by the hero's equipped weapon<br />
****** '''attack''' int - if this node is present, this is an attack. Value is attack ID number<br />
****** '''items''' - if this node it present, this is the item menu<br />
****** '''spells''' int - if this node is present, this is a spell list. Value is list id 0-3<br />
****** '''skip''' - if this node it present, this menu item is "Skip Turn" {{WIP|inline}}<br />
***** '''caption''' string - the text of the of menu item. If blank or missing the default is used (the attack or spell list name, or the "Items" global string)<br />
***** '''color''' int - the text color, in the master palette. 0 or missing indicates to use the default, uilook(uiText).<br />
***** '''enable_tag1''' int - if this tag check fails the menu option will be disabled. >= 0 is ON, < 0 is OFF. If not present, default 0 meaning "always"<br />
***** '''enable_tag2''' int - same as above<br />
***** '''hide_disabled''' bool - if nonzero, indicates that if the menu item is disabled, it should be hidden instead of just unselectable. Spell lists with blank names are always hidden regardless, but all other things that disable a menu item (e.g. attack costs) do respect this.<br />
*** '''spell_lists''' - Container for spell lists<br />
**** '''list''' int - one node for each spell list 0-3. value is list id number. Empty lists are not present.<br />
***** '''name''' string - name of the spell list<br />
***** '''spells''' - contains spells<br />
****** '''spell''' int - one node for each defined spell. value is id 0-23<br />
******* '''attack''' int - value is id number of attack to use for this spell<br />
******* '''learnlev''' int - level at which the hero learns the spell. Not present if not used<br />
******* '''itemlearn''' - node is present if the hero can learn this spell from an item<br />
******* '''tag''' int - if this tag check passes, the spell is visible (default "always")<br />
******* other nodes related to [[Plan for improved spell learning]] will go here later<br />
***** '''random''' - if this node is present, an attack is automatically randomly selected from the list<br />
***** '''use_lmp''' - if this node is present, all spells in this list require FF1-style level-based-mp <br />
*** '''elements''' - stores the hero's elemental strengths and weaknesses<br />
**** '''element''' int - an element; value is ID number. Element nodes not present will use the default of 1.0<br />
***** '''damage''' double - damage taken from this element (1.0 = 100% normal)<br />
*** '''rename_on_add''' - if present, the hero is renamed when added to the party<br />
*** '''rename_on_status''' - if present, the hero can be renamed on the status screen<br />
*** '''hide_empty_lists''' - if present, the hero's empty spell lists are hidden <br />
*** '''tags''' - contains tags automatically set by this hero<br />
**** '''have_hero''' int - tag to turn ON if the hero is in the party<br />
**** '''is_alive''' int - tag to turn ON if the hero is alive<br />
**** '''is_leader''' int - tag to turn ON if the hero is the leader<br />
**** '''is_active''' int - tag to turn on if the hero is a member of the active party<br />
**** '''checks''' - parent node for hero list of checks that set tags<br />
***** '''range''' - a list of zero or more range check nodes<br />
****** '''kind''' string - Currently always "level" but we can use this to check stats or other things later<br />
****** '''tag''' int - a tag number that will be turned on if the check succeeds.<br />
****** '''min''' int - Check if the hero's level is >= this<br />
****** '''max''' int - Check if the hero's level is <= this<br />
*** '''stat_options''' customize the display of stats<br />
**** '''stat''' int - zero or more nodes for containing stat options. The value is the stat ID number. If a stat has no node, it uses defaults<br />
***** '''hide''' - if this node is present, the stat should be hidden from this hero's status and equip screens<br />
*** '''counterattacks''' - parent node for hero's intrinsic counterattacks<br />
**** '''elemental''' - parent node for hero's elemental counterattacks<br />
***** '''element''' int - an optional node for each elemental 0-63. Elementals with no counterattack can be omitted<br />
****** '''attack''' int - id number of the counterattack<br />
**** '''nonelemental''' - parent node for hero's non-elemental counterattack<br />
***** '''attack''' int - id number of the counterattack<br />
**** '''statdamage''' - parent node for hero's stat damage counterattacks<br />
***** '''stat''' int - an optional node for each regular stat 0-11. Stats with no counterattack can be omitted<br />
****** '''attack''' int - id number of the counterattack<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=STT&diff=34350STT2022-02-05T20:33:29Z<p>Bob the Hamster: skip turn string</p>
<hr />
<div>The STT lump holds every configurable string that you can edit in CUSTOM (the Global Text Strings menu).<br />
<br />
The STT lump is somewhat unusual as it is upgraded when the Global Text Strings menu is used rather than in the game upgrade process. Not all strings may be stored, depending on the when the lump was last edited. An otherwise modern game could in theory have its .STT lump missing entirely. If strings are missing you need to supply defaults. You can find the defaults in the source by looking at SUB edit_global_text_strings in customsubs.bas. (Game actually uses slightly different defaults, but it doesn't really matter.)<br />
<br />
Every string starts at an offset that is a multiple of 11 (0-based). The first byte is the length, followed by ''length'' bytes of characters. Every string has a maximum length, which is the most that Game will read. The file is thus organised into fields of 11 bytes, however, some fields are double or triple width! (In this case, the max string length is usually 20 or 30, not 21 or 32.) You don't actually need to know the field widths to read or write the strings, just the field offsets, and also the maximum string lengths if writing.<br />
<br />
This table helps you easily read strings. (NOTE: out of date!)<br />
For each item in the table, read (v * 11) bytes, where v is the value from the table. The first byte is the string length, the remainder are string contents (and junk, if (v * 11) > str_length)<br />
<br />
lengths = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,<br />
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, <br />
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,<br />
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,<br />
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,<br />
2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2,<br />
2, 2, 1, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 3, <br />
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1,<br />
1, 1, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2,<br />
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,<br />
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,<br />
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,<br />
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]<br />
<br />
This table shows the record offset of each string (to get byte offset, multiply the record offset by 11)<br />
<br />
<pre><br />
RECORD DESCRIPTION CHARS<br />
0 Health Points 10<br />
1 Spell Points 10<br />
2 Attack Power 10<br />
3 Accuracy 10<br />
4 Extra Hits 10<br />
5 Blocking Power 10<br />
6 Dodge Rate 10<br />
7 Counter Rate 10<br />
8 Speed 10<br />
9 Enemy Type 1 10 (obsolete)<br />
10 Enemy Type 2 10 (obsolete)<br />
11 Enemy Type 3 10 (obsolete)<br />
12 Enemy Type 4 10 (obsolete)<br />
13 Enemy Type 5 10 (obsolete)<br />
14 Enemy Type 6 10 (obsolete)<br />
15 Enemy Type 7 10 (obsolete)<br />
16 Enemy Type 8 10 (obsolete)<br />
17 Elemental 1 10 (obsolete)<br />
18 Elemental 2 10 (obsolete)<br />
19 Elemental 3 10 (obsolete)<br />
20 Elemental 4 10 (obsolete)<br />
21 Elemental 5 10 (obsolete)<br />
22 Elemental 6 10 (obsolete)<br />
23 Elemental 7 10 (obsolete)<br />
24 Elemental 8 10 (obsolete)<br />
25 Armor 1 10<br />
26 Armor 2 10<br />
27 Armor 3 10<br />
28 Armor 4 10<br />
29 Spell Skill 10<br />
30 Spell Block 10<br />
31 Spell cost % 10<br />
32 Money 10 (obsolete)<br />
33 Experience 10<br />
34 Item 10<br />
35 DONE 10<br />
36 AUTOSORT 10<br />
37 TRASH 10<br />
38 Weapon 10<br />
39 -REMOVE- 10<br />
40 -EXIT- 10<br />
41 Discard 10<br />
42 Cannot 10<br />
43 Level 10<br />
44 Yes 10<br />
45 No 10<br />
46 EXIT 10<br />
47 for next 10<br />
48 REMOVE 10<br />
49 Pay 10<br />
50 Cancel 10<br />
51 CANCEL 10<br />
52 NEW GAME 10<br />
53 EXIT 10<br />
54 PAUSE 10<br />
55 Quit Playing? 20<br />
57 Yes 10<br />
58 No 10<br />
59 CANCEL 10<br />
60 Items 10<br />
61 Spells 10<br />
62 Status 10<br />
63 Equip 10<br />
64 Order 10<br />
65 Team 10<br />
66 Save 10<br />
67 Quit 10<br />
68 Map 10<br />
69 Volume (menu) 10<br />
70 Buy 10<br />
71 Sell 10<br />
72 Inn 10<br />
73 Hire 10<br />
74 Exit 10<br />
75 CANNOT SELL 20<br />
77 Worth 20<br />
79 Trade for 20<br />
81 and a 10<br />
82 Worth Nothing 20<br />
84 Sold 10<br />
85 Trade for 20<br />
87 Joins for 20<br />
89 Cannot Afford 20<br />
91 Cannot Hire 20<br />
93 Purchased 20<br />
95 Joined! 20<br />
97 in stock 20<br />
99 Equip: 10<br />
100 No Room In Party 20<br />
102 Replace Old Data? 20<br />
104 Who's Status? 20<br />
106 Who's Spells? 20<br />
108 Equip Who? 20<br />
110 Nothing 10<br />
111 Has Nothing 30<br />
114 Cannot Steal 30<br />
117 Stole 30<br />
120 miss 20<br />
122 fail 20<br />
124 learned 10<br />
125 Found 10<br />
126 Gained 10<br />
127 Weak to 10 (obsolete)<br />
128 Strong to 10 (obsolete)<br />
129 Absorbs 10 (obsolete)<br />
130 No Elemental Effects 30<br />
133 has no spells 20<br />
135 Which Hero? 20<br />
137 Name the Hero 20<br />
139 Found a 20<br />
141 Found 20<br />
143 THE INN COSTS 20<br />
145 You have 20<br />
147 CANNOT RUN! 20<br />
149 Level up for 20<br />
151 levels for 20<br />
153 and 10<br />
154 day 10<br />
155 days 10<br />
156 hour 10<br />
157 hours 10<br />
158 minute 10<br />
159 minutes 10<br />
160 Level MP 20<br />
162 Takes > 100% element dmg 25<br />
165 Takes 0 to 100% element dmg 25<br />
168 Takes 0% element dmg 25<br />
171 Takes < 0% element dmg 25<br />
174+i*2 Elemental i 14 (for i = 0 to 63)<br />
302 Elemental Effects: 30<br />
305 No room in inventory 30<br />
308 Margins 10<br />
309 The shop is empty 30<br />
312 (unused)<br />
313 Purchases 10<br />
314 Switch to windowed 20<br />
316 Switch to fullscreen 20<br />
318 Music Volume 20<br />
320 Sound Volume 20<br />
322 Load 20<br />
324 You own 20<br />
326 Equipped 20<br />
328 Trade-in amount " (have $X)" 20<br />
330 Currency (with '#' embed) 16<br />
332 Skip Turn (in battle) 20<br />
</pre><br />
<br />
The obsolete elemental fields should be used as defaults for the first 8 elements if the new ones are missing, and should have their own default as well, of course. The obsolete enemytype fields should be used to construct the names for the next 8 elements.<br />
<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT1&diff=34348DT12022-02-05T01:07:21Z<p>Bob the Hamster: turncoat and defector starting status for enemies</p>
<hr />
<div>The DT1 lump stores the data for all enemies in the game. It has no header, and the length of each record is stored in [[BINSIZE.BIN]] (currently 744 bytes)<br />
<br />
<br />
== Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Offset || Data || Meaning<br />
|-<br />
| colspan="3" | Record start<br />
|-<br />
|0-16||FVSTR (1i+16i=17i)||Name of Enemy<br />
|-<br />
|17||INT||Thievability of Enemy:<br />
-1 = Is not thievable<br>0 = Once only<br>1 >= Infinitely thievable<br />
|-<br />
|18||INT||Stealable item<br />
|-<br />
|19||INT||Item Steal Chance %<br />
|-<br />
|20||INT||Rare stealable item<br />
|-<br />
|21||INT||Rare Item Steal Chance % (if regular steal failed)<br />
|-<br />
|22||INT||Dissolve animation<br><br />
0=Use default in gen(genEnemyDissolve)<br><br />
1=Random pixels<br><br />
2=Crossfade<br><br />
3=Diagonal vanish<br><br />
4=Sink into ground<br><br />
5=Squash<br><br />
6=Melt<br><br />
7=Vapourise<br><br />
8=Phase out<br><br />
9=Squeeze<br><br />
10=Shrink<br><br />
11=Flicker<br><br />
|-<br />
|23||INT||Dissolve animation length in ticks (0=default: Squash,Vapourise,Phase out use sprite width/5, others use sprite width/2)<br />
|-<br />
|24||INT||Death sound effect ID + 1 (0 for default, -1 for none)<br />
|-<br />
|25||INT||Battle targeting cursor X offset (relative to top-center)<br />
|-<br />
|26||INT||Battle targeting cursor Y offset (relative to top-center)<br />
|-<br />
|27-52||INT (26)||Unused<br />
|-<br />
|53||INT||Picture<br />
|-<br />
|54||INT||Palette, or -1 for default<br />
|-<br />
|55||INT||Picture Size:<br />
0 = Small (From [[PT1]])<br>1 = Medium (From [[PT2]])<br>2 = Large (From [[PT3]])<br />
|-<br />
|56||INT||Gold reward<br />
|-<br />
|57||INT||Experience reward<br />
|-<br />
|58||INT||Item reward<br />
|-<br />
|59||INT||Item drop %<br />
|-<br />
|60||INT||Rare item<br />
|-<br />
|61||INT||Rare item drop % (If a regular item is not dropped)<br />
|-<br />
|62||INT||HP<br />
|-<br />
|63||INT||MP<br />
|-<br />
|64||INT||Strength<br />
|-<br />
|65||INT||Accuracy<br />
|-<br />
|66||INT||Defense<br />
|-<br />
|67||INT||Dodge<br />
|-<br />
|68||INT||Magic<br />
|-<br />
|69||INT||Will<br />
|-<br />
|70||INT||Speed<br />
|-<br />
|71||INT||Counter<br />
|-<br />
|72||INT||MP~<br />
|-<br />
|73||INT||Extra Hits<br />
|-<br />
| rowspan="18" |74-78 Enemy Bitsets||BIT (8)||0 - 7: Weak to Elemental 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||8 - 15: Strong to Elemental 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||16 - 23: Absorbs Elemental 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||24 - 31: Is Enemytype 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (22)||32 - 53: Unused<br />
|-<br />
|BIT||54: Harmed by Cure<br />
|-<br />
|BIT||55: MP Idiot<br />
|-<br />
|BIT||56: Boss<br />
|-<br />
|BIT||57: Unescapable<br />
|-<br />
|BIT||58: Die Without Boss<br />
|-<br />
|BIT||59: Flee instead of Die<br />
|-<br />
|BIT||60: Untargetable by Enemies<br />
|-<br />
|BIT||61: Untargetable by Heros<br />
|-<br />
|BIT||62: Win battle even if left alive<br />
|-<br />
|BIT||63: Never flinch when hit<br />
|-<br />
|BIT||64: Ignored for "Alone" AI<br />
|-<br />
|BIT||65: Give rewards even if left alive {{WIP|inline}}<br />
|-<br />
|BIT||66: Controlled by the player {{WIP|inline}}<br />
|-<br />
|BIT||67: Turncoat, attacks its allies {{WIP|inline}}<br />
|-<br />
|BIT||68: Defector, grouped with heroes {{WIP|inline}}<br />
|-<br />
|BIT (12)||69 - 79: Unused<br />
|-<br />
|79||INT||Enemy to Spawn on death + 1<br />
|-<br />
|80||INT||Enemy to Spawn on Non-Elemental Death + 1<br />
|-<br />
|81||INT||Enemy to Spawn when alone + 1<br />
|-<br />
|82||INT||Enemy to Spawn on Non-Elemental Hit + 1<br />
|-<br />
|83-90||INT (8)||Enemy to Spawn on Elemental 1 - 8 Hit + 1<br />
|-<br />
|91||INT||Number of enemy copies to spawn on spawn trigger<br />
|-<br />
|92-96||INT (5)||Regular attacks + 1, 0 if unused<br />
|-<br />
|97-101||INT (5)||Desperation attacks + 1, 0 if unused<br />
|-<br />
|102-106||INT (5)||Alone attacks + 1, 0 if unused<br />
|-<br />
|107-114||INT (8)||Counter attack to elementals 0-7. atk_id + 1, 0=none<br />
|-<br />
|115-126||INT (12)||Counter attack damage to stats. atk_id + 1, 0=none<br />
|-<br />
|127-182||INT (56)||Counter attack to elementals 8-63. atk_id + 1, 0=none<br />
|-<br />
|183-238||INT (56)||Enemy to Spawn on Elemental 9-64 Hit + 1<br />
|-<br />
|239-366||FLOAT (64)||Damage taken from elemental 1-64 (1.0 is 100%) [[#Note 1]]<br />
|-<br />
|367||INT||On-death bequest attack. Attack ID+1 or 0 for none.<br />
|-<br />
|368||INT||Counter attack to non-elemental attack. atk_id + 1, 0=none<br />
|-<br />
|369||INT||Dissolve-in animation at battle start, or when spawned<br><br />
0=No dissolve, appear instantly<br><br />
1=Random pixels<br><br />
2=Crossfade<br><br />
3=Diagonal vanish<br><br />
4=Sink into ground<br><br />
5=Squash<br><br />
6=Melt<br><br />
7=Vapourise<br><br />
8=Phase out<br><br />
9=Squeeze<br><br />
10=Shrink<br><br />
11=Flicker<br><br />
|-<br />
|370||INT||Dissolve-in animation length in ticks (0=default: Squash,Vapourise,Phase out use sprite width/5, others use sprite width/2)<br />
|-<br />
|371||INT||On a multi-element hit:<br> 0: only use first matching spawn condition<br> 1: process all conditions <br />
|}<br />
<br />
==Note 1==<br />
The old elemental and enemytype bits should only be used to load the enemy's elemental resists if fixEnemyElementals is OFF. (Default to 1.0. For elements 1 to 8: multiply by -1.0 for absorb, 2.0 for weak, 0.12 for strong. For elements 9 to 16: Set to 1.8 if the 'is enemytype i-8' is set.)<br />
<br />
If fixEnemyElementals is ON, load elemental resists from the new data; the old bits contain garbage.<br />
<br />
==Note 2==<br />
<br />
Before 2002, offsets 17-52 used to be an FVSTR containing a death message, which was never implemented, but which could be edited in Custom, and a number of people did. It is blanked out by the engine if attack.bin does not exist.<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Stealable/Rare Stealable item||[[ITM]]<br />
|-<br />
|Death sound effect||(sound file)<br />
|-<br />
|Picture||[[PT1]],[[PT2]] or [[PT3]], according to Picture Size field<br />
|-<br />
|Palette||[[PAL]]<br />
|-<br />
|Enemy to spawn on/when *||DT1 (this lump)<br />
|-<br />
|*attack*||[[DT6]]<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34308DT62022-01-23T22:10:07Z<p>Bob the Hamster: fix WIP template</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (47)||33-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{WIP|inline}}<br />
|-<br />
|349||INT (1)|| change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default {{WIP|inline}}<br />
|-<br />
|350||INT (1)|| change target's defector target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default {{WIP|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34307DT62022-01-23T22:05:52Z<p>Bob the Hamster: defector status</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (47)||33-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{wip|inline}}<br />
|-<br />
|349||INT (1)|| change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default {{wip|inline}}<br />
|-<br />
|350||INT (1)|| change target's defector target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default {{wip|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34306DT62022-01-23T21:40:39Z<p>Bob the Hamster: turncoat attacker and quisling target status</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (47)||33-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{wip|inline}}<br />
|-<br />
|349||INT (1)|| change target's turncoat attacker status - 0=no change, 1=attacks allies, 2=attacks foes, 3=set to default {{wip|inline}}<br />
|-<br />
|350||INT (1)|| change target's quisling target status - 0=no change, 1=changes sides, 2=remains loyal, 3=set to default {{wip|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Heroes.reld&diff=34305Heroes.reld2022-01-23T01:02:21Z<p>Bob the Hamster: default_auto_battle</p>
<hr />
<div>A [[RELOAD]] format lump for storage of hero definitions.<br />
<br />
This lump replaced [[DT0]] in all versions after Dec 21 2012. (CURRENT_RPG_VERSION >= 19)<br />
<br />
* '''heroes''' - this is the root node<br />
** '''hero''' int - one node for each hero. value is id number<br />
*** '''name''' string<br />
**** '''maxlen''' int - max length of name when renaming. if node not present use default<br />
*** '''appearance''' contains appearance data<br />
**** '''walkabout'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
**** '''battle'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
***** '''hand_a''' - node containing hand offset data for attack frame A<br />
****** '''x''' int - x offset of hand<br />
****** '''y''' int - y offset of hand<br />
***** '''hand_b''' - node containing hand offset data for attack frame B<br />
****** '''x''' int - x offset of hand<br />
****** '''y''' int - y offset of hand<br />
**** '''portrait'''<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette number. If not is not present use default palette for pic<br />
*** '''default_level''' int - value is level number. Use default if node is not present<br />
*** '''default_weapon''' int - item id number<br />
*** '''default_auto_battle''' int - if not zero, this hero will default to fighting automatically in battle. If absent or zero, this hero will default to normal player control {{WIP|inline}}<br />
*** '''exp_mult''' float - multiplier in the hero's experience formula (minus 1). Defaults to 0.2, ie ''1.2*prev+5''<br />
*** '''stats_at_zero''' - contains stats at level 0<br />
**** '''stat''' int - one node for each stat. value is stat ID number 0-11<br />
***** '''value''' int - value for this stat<br />
*** '''stats_at_max''' - contains stats at max level (often, but not always level 99)<br />
**** '''stat''' int - one node for each stat. value is stat ID number 0-11<br />
***** '''value''' int - value for this stat<br />
*** '''battle_menus''' - stores the hero's battle menu data<br />
**** '''menu''' - one for each hero battle menu slot.<br />
***** '''kind''' only has one child node. The valid options are listed below<br />
****** '''weapon''' - if this node is present, this is the attack specified by the hero's equipped weapon<br />
****** '''attack''' int - if this node is present, this is an attack. Value is attack ID number<br />
****** '''items''' - if this node it present, this is the item menu<br />
****** '''spells''' int - if this node is present, this is a spell list. Value is list id 0-3<br />
***** '''caption''' string - the text of the of menu item. If blank or missing the default is used (the attack or spell list name, or the "Items" global string)<br />
***** '''color''' int - the text color, in the master palette. 0 or missing indicates to use the default, uilook(uiText).<br />
***** '''enable_tag1''' int - if this tag check fails the menu option will be disabled. >= 0 is ON, < 0 is OFF. If not present, default 0 meaning "always"<br />
***** '''enable_tag2''' int - same as above<br />
***** '''hide_disabled''' bool - if nonzero, indicates that if the menu item is disabled, it should be hidden instead of just unselectable. Spell lists with blank names are always hidden regardless, but all other things that disable a menu item (e.g. attack costs) do respect this.<br />
*** '''spell_lists''' - Container for spell lists<br />
**** '''list''' int - one node for each spell list 0-3. value is list id number. Empty lists are not present.<br />
***** '''name''' string - name of the spell list<br />
***** '''spells''' - contains spells<br />
****** '''spell''' int - one node for each defined spell. value is id 0-23<br />
******* '''attack''' int - value is id number of attack to use for this spell<br />
******* '''learnlev''' int - level at which the hero learns the spell. Not present if not used<br />
******* '''itemlearn''' - node is present if the hero can learn this spell from an item<br />
******* '''tag''' int - if this tag check passes, the spell is visible (default "always")<br />
******* other nodes related to [[Plan for improved spell learning]] will go here later<br />
***** '''random''' - if this node is present, an attack is automatically randomly selected from the list<br />
***** '''use_lmp''' - if this node is present, all spells in this list require FF1-style level-based-mp <br />
*** '''elements''' - stores the hero's elemental strengths and weaknesses<br />
**** '''element''' int - an element; value is ID number. Element nodes not present will use the default of 1.0<br />
***** '''damage''' double - damage taken from this element (1.0 = 100% normal)<br />
*** '''rename_on_add''' - if present, the hero is renamed when added to the party<br />
*** '''rename_on_status''' - if present, the hero can be renamed on the status screen<br />
*** '''hide_empty_lists''' - if present, the hero's empty spell lists are hidden <br />
*** '''tags''' - contains tags automatically set by this hero<br />
**** '''have_hero''' int - tag to turn ON if the hero is in the party<br />
**** '''is_alive''' int - tag to turn ON if the hero is alive<br />
**** '''is_leader''' int - tag to turn ON if the hero is the leader<br />
**** '''is_active''' int - tag to turn on if the hero is a member of the active party<br />
**** '''checks''' - parent node for hero list of checks that set tags<br />
***** '''range''' - a list of zero or more range check nodes<br />
****** '''kind''' string - Currently always "level" but we can use this to check stats or other things later<br />
****** '''tag''' int - a tag number that will be turned on if the check succeeds.<br />
****** '''min''' int - Check if the hero's level is >= this<br />
****** '''max''' int - Check if the hero's level is <= this<br />
*** '''stat_options''' customize the display of stats<br />
**** '''stat''' int - zero or more nodes for containing stat options. The value is the stat ID number. If a stat has no node, it uses defaults<br />
***** '''hide''' - if this node is present, the stat should be hidden from this hero's status and equip screens<br />
*** '''counterattacks''' - parent node for hero's intrinsic counterattacks<br />
**** '''elemental''' - parent node for hero's elemental counterattacks<br />
***** '''element''' int - an optional node for each elemental 0-63. Elementals with no counterattack can be omitted<br />
****** '''attack''' int - id number of the counterattack<br />
**** '''nonelemental''' - parent node for hero's non-elemental counterattack<br />
***** '''attack''' int - id number of the counterattack<br />
**** '''statdamage''' - parent node for hero's stat damage counterattacks<br />
***** '''stat''' int - an optional node for each regular stat 0-11. Stats with no counterattack can be omitted<br />
****** '''attack''' int - id number of the counterattack<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=RSAV&diff=34304RSAV2022-01-22T23:03:34Z<p>Bob the Hamster: fix WIP template</p>
<hr />
<div>RSAV (Reload-Save) is the new format for savegames that the [[OHRRPGCE]] started using with the [[zenzizenzic]] release.<br />
<br />
RSAV is a [[RELOAD]] document.<br />
<br />
Although the tree structure of the rsav document is strict, the order in which the elements appear is flexible.<br />
<br />
When loading a document that is missing a node, it is appropriate to use a reasonable default value instead of completely failing.<br />
<br />
Node names in ''italics'' are obsolete; they were once saved, but are not any more. Node names in '''''bold italics''''' are obsolete and no longer saved, but are still read and somehow upgraded.<br />
<br />
* '''rsav''' - this is the root node<br />
** '''ver''' int - increment this to produce a warning message when loading a new rsav file in an old game player<br />
** '''game_client''' string - name of the program used to write this file. Optional and should be ignored if not recognised. The official client uses "OHRRPGCE", and writes the following children:<br />
*** '''branch_name''' string - name of the release or branch, eg. "ypsiliform+2", "wip", from codename.txt<br />
*** '''revision''' integer - SVN revision number<br />
** '''state''' - stores misc game state<br />
*** '''current_map''' int - the number of the current map<br />
*** '''caterpillar''' - hero walkabout party positions on the map<br />
**** '''hero''' int - node for each caterpillar slot, value is caterpillar index 0-3<br />
***** '''x''' int - x position in pixels<br />
***** '''y''' int - y position in pixels<br />
***** '''d''' int - direction as int 0-3<br />
*** '''random_battle_countdown''' int - number of steps to the next random battle<br />
*** '''camera''' - stores camera state<br />
**** '''x''' int - camera offset in pixels<br />
**** '''y''' int - camera offset in pixels<br />
**** '''mode''' int - camera mode number<br />
**** '''arg1''' int - camera mode argument<br />
**** '''arg2''' int - camera mode argument<br />
**** '''arg3''' int - camera mode argument<br />
**** '''arg4''' int - camera mode argument<br />
*** '''gold''' int - obviously stores your parties remaining gold<br />
*** '''playtime''' - stores info about how long you have played<br />
**** '''days''' int<br />
**** '''hours''' int<br />
**** '''minutes''' int<br />
**** '''seconds''' int<br />
*** '''textbox''' - stores current text box state<br />
**** '''backdrop''' int - backdrop shown by text box<br />
*** '''status_char''' - stores character used to label status afflictions<br />
**** '''poison''' int - char number<br />
**** '''stun''' int - char number<br />
**** '''mute''' int - char number<br />
**** '''regen''' int - char number<br />
*** '''damage_cap''' int - maximum damage<br />
*** '''level_cap''' int - maximum level (default to 99 if missing)<br />
*** '''stats''' contains properties of stats<br />
**** '''stat''' int - value is stat ID number 0-11<br />
***** '''cap''' int - maximum value for this stat<br />
** '''script''' - stores state of script-related things<br />
*** '''globals''' - stores script globals (integers only for now)<br />
**** '''global''' int - one node for each global variable. Value is the global id number. If the global's value is 0, this node will not be present<br />
***** '''int''' int - integer value of the global<br />
*** '''strings''' - stores the plotstrings which can be displayed on the screen. Strings are only saved and loaded if '''saved_game.strings''' exists in [[general.reld]]. This means the node might be missing even if it's currently set to be saved/loaded.<br />
**** '''string''' int - ID number, from 0-99. A node might be omitted if the string is unused (that is, all fields equal to zero/empty string/default value)<br />
***** '''visible''' bool - whether the string is displayed<br />
***** '''str''' str - contents of string<br />
***** '''x''' int - x position<br />
***** '''y''' int - y position<br />
***** '''col''' int - 0-255: font colour index in master palette, or -1: use uiText colour (the default)<br />
***** '''bgcol''' int - colour index of font background. Used only if the string style is 'flat' (in which case 0 is transparent), but still saved if it's not in case the style is later changed to flat.<br />
***** '''style''' int - font option: 0 = edged, 1 = flat (not edged)<br />
*** '''gameover_script''' - stored gameover trigger (Note: this is (currently) always saved but not loaded if the "Don't save gameover/loadgame script IDs" bit is set)<br />
**** '''id''' int - script id of old-style script (should not coexist with name)<br />
**** '''name''' str - script name of new-style script (should not coexist with id)<br />
*** '''loadgame_script''' - stored loadgame trigger (Note as for gameover_script)<br />
**** '''id''' int - script id of old-style script (should not coexist with name)<br />
**** '''name''' str - script name of new-style script (should not coexist with id)<br />
*** '''suspend''' - stores state of script suspend commands. If the child nodes are missing, those things are not suspended<br />
**** '''npcs''' - node present if suspended<br />
**** '''player''' - node present if suspended<br />
**** '''obstruction''' - node present if suspended<br />
**** '''herowalls''' - node present if suspended<br />
**** '''npcwalls''' - node present if suspended<br />
**** '''caterpillar''' - node present if suspended<br />
**** '''randomenemies''' - node present if suspended<br />
**** '''boxadvance''' - node present if suspended<br />
**** '''overlays''' - node present if suspended<br />
**** '''ambientmusic''' - node present if suspended<br />
*** '''backdrop''' int - backdrop shown by script<br />
** '''maps''' - stores map state data<br />
*** '''map''' int - value is map id number. Currently only stores the current map, but will store others in the future.<br />
**** '''npcs''' - stores NPC locations for the current map (FIXME: this isn't loaded yet!)<br />
***** '''npc''' int - for each npc instance. value is instance slot id number 0-299. Nodes only exist for NPCs that exist and that are explicitly saved (including ones that exist but are hidden by tags)<br />
****** '''id''' int - npc id number 0-max<br />
****** '''x''' int - x position in pixels<br />
****** '''y''' int - y position in pixels<br />
****** '''d''' int - direction 0-3<br />
****** '''fr''' int - walking frame number 0-1<br />
****** '''xgo''' int - queued horizontal walking distance in pixels. Only present if the npc is actually moving<br />
****** '''ygo''' int - queued vertical waking distance in pixels. Only present if the npc is actually moving<br />
****** '''extra''' int - one for each extra data 0-2 (optional: default to 0 if omitted). The value is the extra slot number<br />
******* '''int''' int - integer value stored in the extra slot<br />
****** '''ignore_walls''' - if present, npc can pass through walls<br />
****** '''not_obstruction''' - if present, npc can pass through heroes and npcs and vice-versa<br />
****** '''suspend_use''' - if present, npc can only be activated with usenpc<br />
****** '''suspend_ai''' - if present, npc move-type is ignored<br />
****** '''edit''' int - edit count, used in determining if an NPC's save state is still valid (''unimplemented'')<br />
** '''tags''' - stores tags<br />
*** '''count''' int - number of tags<br />
*** '''data''' - blob of bitsets<br />
** '''onetime''' - stores one-time-use tags<br />
*** '''count''' int - number of tags<br />
*** '''data''' - blob of bitsets<br />
** '''party''' - stores the state of the heroes in your party<br />
*** '''slot''' int - one node for each party member, value is party slot id 0-40<br />
**** '''id''' int - hero ID number. Not present if slot has no hero (other data is present even if hero has no id)<br />
**** '''name''' string - the hero's name<br />
**** '''locked''' - node exists if the hero is locked<br />
**** '''stats''' - contains saved stats<br />
***** '''stat''' int - one node for each stat, value is stat id number 0-11. If this node is not present than the stats are cur=0, max=0<br />
****** '''cur''' int - current stat value<br />
****** '''max''' int - max stat value<br />
****** '''base''' int - base stat value. Not present in pre-Beelzebufo saves. If missing, should be computed from max stats and equipment.<br />
**** '''lev''' int - hero's current level<br />
**** '''lev_gain''' int - number of levels gained in last battle or script<br />
**** '''exp''' int - current experience points<br />
**** '''exp_next''' int - experience points for next level<br />
**** '''exp_mult''' float - experience curve multiplier for this hero (defaults to the value in the hero definition if not present)<br />
**** '''def_wep''' int - hero's default weapon<br />
**** '''wep''' - stores info about hero's current weapon<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette id<br />
**** '''hand''' - stores the hero's hand position. If this node doesn't exist, default hand positions should be used<br />
***** '''frame''' int - 0 for attack A and 1 for attack B. If this node doesn't exist, default hand positions should be used<br />
****** '''x''' int - x position of the hand relative to the top left corner of the hero sprite<br />
****** '''y''' int - y position of the hand relative to the top left corner of the hero sprite<br />
**** '''in_battle''' - stores info about hero's appearance in battle<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette id<br />
**** '''walkabout''' - stores info about hero's appearance on the map<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette id<br />
**** '''portrait''' - stores info about hero's portrait in textboxes and status screen<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette id<br />
**** <s>'''battle_menus'''</s> - Obsolete. Was previously used to store hero battle menu data<br />
**** '''spell_lists''' - contains the hero's spell lists<br />
***** '''list''' int - one node for each spell list, value is list id 0-3<br />
****** '''spells''' - contains the spells<br />
******* '''spell''' int - one node for each spell in the list, value is list slot id 0-23. Node is not present if this spell slot is empty<br />
******** '''attack''' int - attack id number used by this spell. Node is not present if this spell slot is empty<br />
**** '''level_mp''' - contains hero's level mp<br />
***** '''lev''' int - one node for each level mp level 0-7. Only stored when val is non-zero<br />
****** '''val''' int - the current value for this level of level mp. Only stored when val is non-zero<br />
**** '''equipment''' - contains the hero's equipped items<br />
***** '''equip''' int - one for each equipment slot 0-4. value is slot id number. This node is not present for empty slots.<br />
****** '''item''' int - the item id number equipped in this slot. This node is not present for empty slots.<br />
**** '''elements''' - stores the hero's elemental strengths and weaknesses<br />
***** '''element''' int - an element; ignored if larger than the highest enabled element, not saved in older versions<br />
****** '''damage''' double - damage taken from this element (1.0 = 100% normal)<br />
***** ''weak'' int - if present, the hero is weak to the element. Value is element ID number<br />
***** ''strong'' int - if present, the hero is strong to the element. Value is element ID number<br />
***** ''absorb'' int - if present, the hero absorbs the element. Value is element ID number<br />
**** ''rename_on_add'' - if present, the hero is renamed when added to the party (totally absurd to have saved this)<br />
**** '''rename_on_status''' - if present, the hero can be renamed on the status screen<br />
**** ''hide_empty_lists'' - if present, the hero's empty spell lists are hidden<br />
**** '''auto_battle''' - if present with a non-zero value, the hero fights automatically in battle {{WIP|inline}}<br />
** '''inventory''' - stores the party's inventory of items<br />
*** '''size''' int - number of inventory slots available (or zero for default)<br />
*** '''slots''' - contains the list of items<br />
**** '''slot''' int - One for each non-empty inventory slot. Value is slot number.<br />
***** '''item''' int - item id number<br />
***** '''count''' int - number of items stacked in this slot<br />
** '''shops''' - stores shop state.<br />
*** '''shop''' int - one node for each defined shop. Value is shop ID number<br />
**** '''slots''' - contains data about each shop thing/stuff stock slot<br />
***** '''slot''' int - one node for each used shop stock slot - but slots may be omitted. Value is the stockidx of a shop stuff, NOT the thing's index in the shop.<br />
****** '''stock''' int - encodes number of shop stuffs left in stock for this slot. 0 if not initialized yet. -1 for infinite. >= 1 is amount in stock + 1 (eg 1 for out-of-stock). Defaults to 0 - omitted if not initialized yet.<br />
****** '''orig_type''' int - the type of the shop stuff (at the time at the shop stock was initialized, which might not match shop data when the game was saved) - 0 for an item, 1 for a hero. Omitted if not initialized (may be missing even if '''stock''' is present).<br />
****** '''orig_id''' int - the item/hero ID of the shop stuff (when the stock was initialized). Omitted if not initialized.<br />
****** '''orig_stock''' int - the initial "In Stock" of the shop stuff (when the stock was initialized). -1 for infinite stock, 0 for none, > 0 for a finite amount (not offset by 1 like '''stock'''). Omitted if not initialized.<br />
** '''vehicle''' - stores state of currently active vehicle<br />
*** '''id''' int - id number of the vehicle definition (only stored when actually riding a vehicle)<br />
*** '''state''' - contains the state of the active vehicle (only stored when actually riding a vehicle)<br />
**** '''active''' int - true if the vehicle is active<br />
**** '''npc''' int - reference to vehicle npc<br />
**** '''old_speed''' int - saved hero speed from before mounting the vehicle<br />
**** '''mounting''' - present if vehicle is currently in mounting state<br />
**** '''rising''' - present if vehicle is currently in rising state<br />
**** '''falling''' - present if vehicle is currently in falling state<br />
**** '''init_dismount''' - present if vehicle is currently initializing a dismount<br />
**** '''trigger_cleanup''' - present if vehicle is currently triggering cleanup of itself<br />
**** '''ahead''' - present if the hero is taking a step ahead after dismounting a vehicle<br />
** '''slices''' - stores saved slice trees<br />
*** '''sprite_layer''' - if present, this is the root node of a saved [[Slicetree_n_n.reld]] slice collection. Note that the root node of a slice collection normally has an empty name, but this one has the name '''sprite_layer'''.<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=RSAV&diff=34303RSAV2022-01-22T23:00:55Z<p>Bob the Hamster: save auto_battle</p>
<hr />
<div>RSAV (Reload-Save) is the new format for savegames that the [[OHRRPGCE]] started using with the [[zenzizenzic]] release.<br />
<br />
RSAV is a [[RELOAD]] document.<br />
<br />
Although the tree structure of the rsav document is strict, the order in which the elements appear is flexible.<br />
<br />
When loading a document that is missing a node, it is appropriate to use a reasonable default value instead of completely failing.<br />
<br />
Node names in ''italics'' are obsolete; they were once saved, but are not any more. Node names in '''''bold italics''''' are obsolete and no longer saved, but are still read and somehow upgraded.<br />
<br />
* '''rsav''' - this is the root node<br />
** '''ver''' int - increment this to produce a warning message when loading a new rsav file in an old game player<br />
** '''game_client''' string - name of the program used to write this file. Optional and should be ignored if not recognised. The official client uses "OHRRPGCE", and writes the following children:<br />
*** '''branch_name''' string - name of the release or branch, eg. "ypsiliform+2", "wip", from codename.txt<br />
*** '''revision''' integer - SVN revision number<br />
** '''state''' - stores misc game state<br />
*** '''current_map''' int - the number of the current map<br />
*** '''caterpillar''' - hero walkabout party positions on the map<br />
**** '''hero''' int - node for each caterpillar slot, value is caterpillar index 0-3<br />
***** '''x''' int - x position in pixels<br />
***** '''y''' int - y position in pixels<br />
***** '''d''' int - direction as int 0-3<br />
*** '''random_battle_countdown''' int - number of steps to the next random battle<br />
*** '''camera''' - stores camera state<br />
**** '''x''' int - camera offset in pixels<br />
**** '''y''' int - camera offset in pixels<br />
**** '''mode''' int - camera mode number<br />
**** '''arg1''' int - camera mode argument<br />
**** '''arg2''' int - camera mode argument<br />
**** '''arg3''' int - camera mode argument<br />
**** '''arg4''' int - camera mode argument<br />
*** '''gold''' int - obviously stores your parties remaining gold<br />
*** '''playtime''' - stores info about how long you have played<br />
**** '''days''' int<br />
**** '''hours''' int<br />
**** '''minutes''' int<br />
**** '''seconds''' int<br />
*** '''textbox''' - stores current text box state<br />
**** '''backdrop''' int - backdrop shown by text box<br />
*** '''status_char''' - stores character used to label status afflictions<br />
**** '''poison''' int - char number<br />
**** '''stun''' int - char number<br />
**** '''mute''' int - char number<br />
**** '''regen''' int - char number<br />
*** '''damage_cap''' int - maximum damage<br />
*** '''level_cap''' int - maximum level (default to 99 if missing)<br />
*** '''stats''' contains properties of stats<br />
**** '''stat''' int - value is stat ID number 0-11<br />
***** '''cap''' int - maximum value for this stat<br />
** '''script''' - stores state of script-related things<br />
*** '''globals''' - stores script globals (integers only for now)<br />
**** '''global''' int - one node for each global variable. Value is the global id number. If the global's value is 0, this node will not be present<br />
***** '''int''' int - integer value of the global<br />
*** '''strings''' - stores the plotstrings which can be displayed on the screen. Strings are only saved and loaded if '''saved_game.strings''' exists in [[general.reld]]. This means the node might be missing even if it's currently set to be saved/loaded.<br />
**** '''string''' int - ID number, from 0-99. A node might be omitted if the string is unused (that is, all fields equal to zero/empty string/default value)<br />
***** '''visible''' bool - whether the string is displayed<br />
***** '''str''' str - contents of string<br />
***** '''x''' int - x position<br />
***** '''y''' int - y position<br />
***** '''col''' int - 0-255: font colour index in master palette, or -1: use uiText colour (the default)<br />
***** '''bgcol''' int - colour index of font background. Used only if the string style is 'flat' (in which case 0 is transparent), but still saved if it's not in case the style is later changed to flat.<br />
***** '''style''' int - font option: 0 = edged, 1 = flat (not edged)<br />
*** '''gameover_script''' - stored gameover trigger (Note: this is (currently) always saved but not loaded if the "Don't save gameover/loadgame script IDs" bit is set)<br />
**** '''id''' int - script id of old-style script (should not coexist with name)<br />
**** '''name''' str - script name of new-style script (should not coexist with id)<br />
*** '''loadgame_script''' - stored loadgame trigger (Note as for gameover_script)<br />
**** '''id''' int - script id of old-style script (should not coexist with name)<br />
**** '''name''' str - script name of new-style script (should not coexist with id)<br />
*** '''suspend''' - stores state of script suspend commands. If the child nodes are missing, those things are not suspended<br />
**** '''npcs''' - node present if suspended<br />
**** '''player''' - node present if suspended<br />
**** '''obstruction''' - node present if suspended<br />
**** '''herowalls''' - node present if suspended<br />
**** '''npcwalls''' - node present if suspended<br />
**** '''caterpillar''' - node present if suspended<br />
**** '''randomenemies''' - node present if suspended<br />
**** '''boxadvance''' - node present if suspended<br />
**** '''overlays''' - node present if suspended<br />
**** '''ambientmusic''' - node present if suspended<br />
*** '''backdrop''' int - backdrop shown by script<br />
** '''maps''' - stores map state data<br />
*** '''map''' int - value is map id number. Currently only stores the current map, but will store others in the future.<br />
**** '''npcs''' - stores NPC locations for the current map (FIXME: this isn't loaded yet!)<br />
***** '''npc''' int - for each npc instance. value is instance slot id number 0-299. Nodes only exist for NPCs that exist and that are explicitly saved (including ones that exist but are hidden by tags)<br />
****** '''id''' int - npc id number 0-max<br />
****** '''x''' int - x position in pixels<br />
****** '''y''' int - y position in pixels<br />
****** '''d''' int - direction 0-3<br />
****** '''fr''' int - walking frame number 0-1<br />
****** '''xgo''' int - queued horizontal walking distance in pixels. Only present if the npc is actually moving<br />
****** '''ygo''' int - queued vertical waking distance in pixels. Only present if the npc is actually moving<br />
****** '''extra''' int - one for each extra data 0-2 (optional: default to 0 if omitted). The value is the extra slot number<br />
******* '''int''' int - integer value stored in the extra slot<br />
****** '''ignore_walls''' - if present, npc can pass through walls<br />
****** '''not_obstruction''' - if present, npc can pass through heroes and npcs and vice-versa<br />
****** '''suspend_use''' - if present, npc can only be activated with usenpc<br />
****** '''suspend_ai''' - if present, npc move-type is ignored<br />
****** '''edit''' int - edit count, used in determining if an NPC's save state is still valid (''unimplemented'')<br />
** '''tags''' - stores tags<br />
*** '''count''' int - number of tags<br />
*** '''data''' - blob of bitsets<br />
** '''onetime''' - stores one-time-use tags<br />
*** '''count''' int - number of tags<br />
*** '''data''' - blob of bitsets<br />
** '''party''' - stores the state of the heroes in your party<br />
*** '''slot''' int - one node for each party member, value is party slot id 0-40<br />
**** '''id''' int - hero ID number. Not present if slot has no hero (other data is present even if hero has no id)<br />
**** '''name''' string - the hero's name<br />
**** '''locked''' - node exists if the hero is locked<br />
**** '''stats''' - contains saved stats<br />
***** '''stat''' int - one node for each stat, value is stat id number 0-11. If this node is not present than the stats are cur=0, max=0<br />
****** '''cur''' int - current stat value<br />
****** '''max''' int - max stat value<br />
****** '''base''' int - base stat value. Not present in pre-Beelzebufo saves. If missing, should be computed from max stats and equipment.<br />
**** '''lev''' int - hero's current level<br />
**** '''lev_gain''' int - number of levels gained in last battle or script<br />
**** '''exp''' int - current experience points<br />
**** '''exp_next''' int - experience points for next level<br />
**** '''exp_mult''' float - experience curve multiplier for this hero (defaults to the value in the hero definition if not present)<br />
**** '''def_wep''' int - hero's default weapon<br />
**** '''wep''' - stores info about hero's current weapon<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette id<br />
**** '''hand''' - stores the hero's hand position. If this node doesn't exist, default hand positions should be used<br />
***** '''frame''' int - 0 for attack A and 1 for attack B. If this node doesn't exist, default hand positions should be used<br />
****** '''x''' int - x position of the hand relative to the top left corner of the hero sprite<br />
****** '''y''' int - y position of the hand relative to the top left corner of the hero sprite<br />
**** '''in_battle''' - stores info about hero's appearance in battle<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette id<br />
**** '''walkabout''' - stores info about hero's appearance on the map<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette id<br />
**** '''portrait''' - stores info about hero's portrait in textboxes and status screen<br />
***** '''pic''' int - picture id<br />
***** '''pal''' int - palette id<br />
**** <s>'''battle_menus'''</s> - Obsolete. Was previously used to store hero battle menu data<br />
**** '''spell_lists''' - contains the hero's spell lists<br />
***** '''list''' int - one node for each spell list, value is list id 0-3<br />
****** '''spells''' - contains the spells<br />
******* '''spell''' int - one node for each spell in the list, value is list slot id 0-23. Node is not present if this spell slot is empty<br />
******** '''attack''' int - attack id number used by this spell. Node is not present if this spell slot is empty<br />
**** '''level_mp''' - contains hero's level mp<br />
***** '''lev''' int - one node for each level mp level 0-7. Only stored when val is non-zero<br />
****** '''val''' int - the current value for this level of level mp. Only stored when val is non-zero<br />
**** '''equipment''' - contains the hero's equipped items<br />
***** '''equip''' int - one for each equipment slot 0-4. value is slot id number. This node is not present for empty slots.<br />
****** '''item''' int - the item id number equipped in this slot. This node is not present for empty slots.<br />
**** '''elements''' - stores the hero's elemental strengths and weaknesses<br />
***** '''element''' int - an element; ignored if larger than the highest enabled element, not saved in older versions<br />
****** '''damage''' double - damage taken from this element (1.0 = 100% normal)<br />
***** ''weak'' int - if present, the hero is weak to the element. Value is element ID number<br />
***** ''strong'' int - if present, the hero is strong to the element. Value is element ID number<br />
***** ''absorb'' int - if present, the hero absorbs the element. Value is element ID number<br />
**** ''rename_on_add'' - if present, the hero is renamed when added to the party (totally absurd to have saved this)<br />
**** '''rename_on_status''' - if present, the hero can be renamed on the status screen<br />
**** ''hide_empty_lists'' - if present, the hero's empty spell lists are hidden<br />
**** '''auto_battle''' - if present with a non-zero value, the hero fights automatically in battle {{wip|inline}}<br />
** '''inventory''' - stores the party's inventory of items<br />
*** '''size''' int - number of inventory slots available (or zero for default)<br />
*** '''slots''' - contains the list of items<br />
**** '''slot''' int - One for each non-empty inventory slot. Value is slot number.<br />
***** '''item''' int - item id number<br />
***** '''count''' int - number of items stacked in this slot<br />
** '''shops''' - stores shop state.<br />
*** '''shop''' int - one node for each defined shop. Value is shop ID number<br />
**** '''slots''' - contains data about each shop thing/stuff stock slot<br />
***** '''slot''' int - one node for each used shop stock slot - but slots may be omitted. Value is the stockidx of a shop stuff, NOT the thing's index in the shop.<br />
****** '''stock''' int - encodes number of shop stuffs left in stock for this slot. 0 if not initialized yet. -1 for infinite. >= 1 is amount in stock + 1 (eg 1 for out-of-stock). Defaults to 0 - omitted if not initialized yet.<br />
****** '''orig_type''' int - the type of the shop stuff (at the time at the shop stock was initialized, which might not match shop data when the game was saved) - 0 for an item, 1 for a hero. Omitted if not initialized (may be missing even if '''stock''' is present).<br />
****** '''orig_id''' int - the item/hero ID of the shop stuff (when the stock was initialized). Omitted if not initialized.<br />
****** '''orig_stock''' int - the initial "In Stock" of the shop stuff (when the stock was initialized). -1 for infinite stock, 0 for none, > 0 for a finite amount (not offset by 1 like '''stock'''). Omitted if not initialized.<br />
** '''vehicle''' - stores state of currently active vehicle<br />
*** '''id''' int - id number of the vehicle definition (only stored when actually riding a vehicle)<br />
*** '''state''' - contains the state of the active vehicle (only stored when actually riding a vehicle)<br />
**** '''active''' int - true if the vehicle is active<br />
**** '''npc''' int - reference to vehicle npc<br />
**** '''old_speed''' int - saved hero speed from before mounting the vehicle<br />
**** '''mounting''' - present if vehicle is currently in mounting state<br />
**** '''rising''' - present if vehicle is currently in rising state<br />
**** '''falling''' - present if vehicle is currently in falling state<br />
**** '''init_dismount''' - present if vehicle is currently initializing a dismount<br />
**** '''trigger_cleanup''' - present if vehicle is currently triggering cleanup of itself<br />
**** '''ahead''' - present if the hero is taking a step ahead after dismounting a vehicle<br />
** '''slices''' - stores saved slice trees<br />
*** '''sprite_layer''' - if present, this is the root node of a saved [[Slicetree_n_n.reld]] slice collection. Note that the root node of a slice collection normally has an empty name, but this one has the name '''sprite_layer'''.<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34301DT62022-01-22T00:50:41Z<p>Bob the Hamster: attack can change target controllability</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (47)||33-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|-<br />
|348||INT (1)|| change target controllable status - 0=no change, 1=make controllable, 2=make auto-acting, 3=set to default {{wip|inline}}<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34298DT62022-01-20T02:11:19Z<p>Bob the Hamster: fill and empty target ready meter</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="35" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|BIT (1)||31: Empty target ready meter {{WIP|inline}}<br />
|-<br />
|BIT (1)||32: Fill target ready meter {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (47)||33-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT1&diff=34293DT12022-01-18T01:36:25Z<p>Bob the Hamster: Controlled by the player bitset</p>
<hr />
<div>The DT1 lump stores the data for all enemies in the game. It has no header, and the length of each record is stored in [[BINSIZE.BIN]] (currently 744 bytes)<br />
<br />
<br />
== Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1"<br />
! Offset || Data || Meaning<br />
|-<br />
| colspan="3" | Record start<br />
|-<br />
|0-16||FVSTR (1i+16i=17i)||Name of Enemy<br />
|-<br />
|17||INT||Thievability of Enemy:<br />
-1 = Is not thievable<br>0 = Once only<br>1 >= Infinitely thievable<br />
|-<br />
|18||INT||Stealable item<br />
|-<br />
|19||INT||Item Steal Chance %<br />
|-<br />
|20||INT||Rare stealable item<br />
|-<br />
|21||INT||Rare Item Steal Chance % (if regular steal failed)<br />
|-<br />
|22||INT||Dissolve animation<br><br />
0=Use default in gen(genEnemyDissolve)<br><br />
1=Random pixels<br><br />
2=Crossfade<br><br />
3=Diagonal vanish<br><br />
4=Sink into ground<br><br />
5=Squash<br><br />
6=Melt<br><br />
7=Vapourise<br><br />
8=Phase out<br><br />
9=Squeeze<br><br />
10=Shrink<br><br />
11=Flicker<br><br />
|-<br />
|23||INT||Dissolve animation length in ticks (0=default: Squash,Vapourise,Phase out use sprite width/5, others use sprite width/2)<br />
|-<br />
|24||INT||Death sound effect ID + 1 (0 for default, -1 for none)<br />
|-<br />
|25||INT||Battle targeting cursor X offset (relative to top-center)<br />
|-<br />
|26||INT||Battle targeting cursor Y offset (relative to top-center)<br />
|-<br />
|27-52||INT (26)||Unused<br />
|-<br />
|53||INT||Picture<br />
|-<br />
|54||INT||Palette, or -1 for default<br />
|-<br />
|55||INT||Picture Size:<br />
0 = Small (From [[PT1]])<br>1 = Medium (From [[PT2]])<br>2 = Large (From [[PT3]])<br />
|-<br />
|56||INT||Gold reward<br />
|-<br />
|57||INT||Experience reward<br />
|-<br />
|58||INT||Item reward<br />
|-<br />
|59||INT||Item drop %<br />
|-<br />
|60||INT||Rare item<br />
|-<br />
|61||INT||Rare item drop % (If a regular item is not dropped)<br />
|-<br />
|62||INT||HP<br />
|-<br />
|63||INT||MP<br />
|-<br />
|64||INT||Strength<br />
|-<br />
|65||INT||Accuracy<br />
|-<br />
|66||INT||Defense<br />
|-<br />
|67||INT||Dodge<br />
|-<br />
|68||INT||Magic<br />
|-<br />
|69||INT||Will<br />
|-<br />
|70||INT||Speed<br />
|-<br />
|71||INT||Counter<br />
|-<br />
|72||INT||MP~<br />
|-<br />
|73||INT||Extra Hits<br />
|-<br />
| rowspan="18" |74-78 Enemy Bitsets||BIT (8)||0 - 7: Weak to Elemental 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||8 - 15: Strong to Elemental 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||16 - 23: Absorbs Elemental 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||24 - 31: Is Enemytype 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (22)||32 - 53: Unused<br />
|-<br />
|BIT||54: Harmed by Cure<br />
|-<br />
|BIT||55: MP Idiot<br />
|-<br />
|BIT||56: Boss<br />
|-<br />
|BIT||57: Unescapable<br />
|-<br />
|BIT||58: Die Without Boss<br />
|-<br />
|BIT||59: Flee instead of Die<br />
|-<br />
|BIT||60: Untargetable by Enemies<br />
|-<br />
|BIT||61: Untargetable by Heros<br />
|-<br />
|BIT||62: Win battle even if left alive<br />
|-<br />
|BIT||63: Never flinch when hit<br />
|-<br />
|BIT||64: Ignored for "Alone" AI<br />
|-<br />
|BIT||65: Give rewards even if left alive {{WIP|inline}}<br />
|-<br />
|BIT||66: Controlled by the player {{WIP|inline}}<br />
|-<br />
|BIT (14)||67 - 79: Unused<br />
|-<br />
|79||INT||Enemy to Spawn on death + 1<br />
|-<br />
|80||INT||Enemy to Spawn on Non-Elemental Death + 1<br />
|-<br />
|81||INT||Enemy to Spawn when alone + 1<br />
|-<br />
|82||INT||Enemy to Spawn on Non-Elemental Hit + 1<br />
|-<br />
|83-90||INT (8)||Enemy to Spawn on Elemental 1 - 8 Hit + 1<br />
|-<br />
|91||INT||Number of enemy copies to spawn on spawn trigger<br />
|-<br />
|92-96||INT (5)||Regular attacks + 1, 0 if unused<br />
|-<br />
|97-101||INT (5)||Desperation attacks + 1, 0 if unused<br />
|-<br />
|102-106||INT (5)||Alone attacks + 1, 0 if unused<br />
|-<br />
|107-114||INT (8)||Counter attack to elementals 0-7. atk_id + 1, 0=none<br />
|-<br />
|115-126||INT (12)||Counter attack damage to stats. atk_id + 1, 0=none<br />
|-<br />
|127-182||INT (56)||Counter attack to elementals 8-63. atk_id + 1, 0=none<br />
|-<br />
|183-238||INT (56)||Enemy to Spawn on Elemental 9-64 Hit + 1<br />
|-<br />
|239-366||FLOAT (64)||Damage taken from elemental 1-64 (1.0 is 100%) [[#Note 1]]<br />
|-<br />
|367||INT||On-death bequest attack. Attack ID+1 or 0 for none.<br />
|-<br />
|368||INT||Counter attack to non-elemental attack. atk_id + 1, 0=none<br />
|-<br />
|369||INT||Dissolve-in animation at battle start, or when spawned<br><br />
0=No dissolve, appear instantly<br><br />
1=Random pixels<br><br />
2=Crossfade<br><br />
3=Diagonal vanish<br><br />
4=Sink into ground<br><br />
5=Squash<br><br />
6=Melt<br><br />
7=Vapourise<br><br />
8=Phase out<br><br />
9=Squeeze<br><br />
10=Shrink<br><br />
11=Flicker<br><br />
|-<br />
|370||INT||Dissolve-in animation length in ticks (0=default: Squash,Vapourise,Phase out use sprite width/5, others use sprite width/2)<br />
|-<br />
|371||INT||On a multi-element hit:<br> 0: only use first matching spawn condition<br> 1: process all conditions <br />
|}<br />
<br />
==Note 1==<br />
The old elemental and enemytype bits should only be used to load the enemy's elemental resists if fixEnemyElementals is OFF. (Default to 1.0. For elements 1 to 8: multiply by -1.0 for absorb, 2.0 for weak, 0.12 for strong. For elements 9 to 16: Set to 1.8 if the 'is enemytype i-8' is set.)<br />
<br />
If fixEnemyElementals is ON, load elemental resists from the new data; the old bits contain garbage.<br />
<br />
==Note 2==<br />
<br />
Before 2002, offsets 17-52 used to be an FVSTR containing a death message, which was never implemented, but which could be edited in Custom, and a number of people did. It is blanked out by the engine if attack.bin does not exist.<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Stealable/Rare Stealable item||[[ITM]]<br />
|-<br />
|Death sound effect||(sound file)<br />
|-<br />
|Picture||[[PT1]],[[PT2]] or [[PT3]], according to Picture Size field<br />
|-<br />
|Palette||[[PAL]]<br />
|-<br />
|Enemy to spawn on/when *||DT1 (this lump)<br />
|-<br />
|*attack*||[[DT6]]<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34292DT62022-01-16T00:13:04Z<p>Bob the Hamster: rephrase</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="27" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Block actions when used as a counterattack in active mode {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (49)||31-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34291DT62022-01-15T22:52:33Z<p>Bob the Hamster: </p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="27" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Counterattack allowed to block actions in active mode {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (49)||31-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34290DT62022-01-15T22:45:06Z<p>Bob the Hamster: counterattack blocking</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="27" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unhide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||30: Delay blocks attacker even when used as a counterattack {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (49)||31-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34289DT62022-01-15T13:37:04Z<p>Bob the Hamster: </p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Unhide (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="27" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (56)||30-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34288DT62022-01-15T13:35:47Z<p>Bob the Hamster: Run in and Unhide</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land (unhides attacker)<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
11 = Run In (unhides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="27" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|BIT (1)||29: Unide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (56)||30-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34287DT62022-01-15T04:17:26Z<p>Bob the Hamster: add some missing bits</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="27" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: attack is not usable inside battle<br />
|-<br />
|BIT (1)||26: don't display miss<br />
|-<br />
|BIT (1)||27: don't display fail<br />
|-<br />
|BIT (1)||28: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (56)||29-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=DT6&diff=34286DT62022-01-15T04:09:05Z<p>Bob the Hamster: run and hide</p>
<hr />
<div>This lump is one of two containing attack data. Each attack is treated as a single block of data. The first 40 INTs of each record are stored in .DT6, the remainder are stored in records [[ATTACK.BIN]], which is resizeable using [[BINSIZE.BIN]]<br />
<br />
In the loadattackdata sub in loading.bas, the attack data is combined into a single INT array. The complete specification combining data from both lumps follows. Offsets are in INTs from the start of the combined attack data.<br />
<br />
{| border="1" cellpadding="1"<br />
|bgcolor="#D0D0D0"|Grey fields are obsolete or unused.<br />
|}<br />
<br />
== Complete Attack Data Formal Specs ==<br />
[[About Formal Specs]]<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Offset || Data || Meaning<br />
|-<br />
|0||INT (1)||Animation picture<br />
|-<br />
|1||INT (1)||Animation palette, or -1 for default<br />
|-<br />
|2||INT (1)||Animation pattern:<br />
0 = Cycle forward<br>1 = Cycle backward<br>2 = Oscillate<br>3 = Random<br />
|-<br />
|3||INT (1)||Target Class:<br />
0 = Enemy<br><br />
1 = Ally excluding dead<br><br />
2 = Self<br><br />
3 = All<br><br />
4 = Ally including dead<br><br />
5 = Ally excluding self<br><br />
6 = Revenge (last to hurt attacker)<br><br />
7 = Revenge (whole battle)<br><br />
8 = Previous target<br><br />
9 = Recorded target<br><br />
10 = Dead allies (heroes only)<br><br />
11 = Thankvenge (last to cure attacker)<br><br />
12 = Thankvenge (whole battle)<br><br />
13 = Counter (last to hit attacker)<br />
|-<br />
|4||INT (1)||Target Setting:<br />
0 = Focused<br>1 = Spread<br>2 = Optional spread<br>3 = Random focus<br>4 = First target<br><br />
|-<br />
|5||INT (1)||Damage Equation:<br />
0 = Normal: Atk - Def*.5<br><br />
1 = Blunt: Atk*.8 - Def*.1<br><br />
2 = Sharp: Atk*1.3 - Def<br><br />
3 = Pure Damage<br><br />
4 = No Damage<br><br />
5 = Set target stat to (100+extra damage)% of Max<br><br />
6 = Set target stat to (100+extra damage)% of Current<br><br />
7 = Custom: Atk * ''Attack_multiplier'' - Def * ''Defense_multiplier''<br><br />
|-<br />
|6||INT (1)||Aim Math:<br />
(In the following, 'Aim', 'Dog', 'Mag', 'Wil' refer to those stats, while ''AccStat''<br />
and ''DogStat'' refer to "Base Accuracy Stat" and "Base Dodge Stat", ''AimMult'' and ''DogMult''<br />
are the ''Accuracy multiplier'' and ''Dodge multiplier'' data, and ''Extra'' is ''Aim Math extra value'')<br />
<br />
0 = Normal: Aim*4 vs Dog<br><br />
1 = Poor: Aim*2 vs Dog<br><br />
2 = Bad: Aim vs Dog<br><br />
3 = Never misses<br><br />
4 = Magic: Mag vs Wil*1.25<br><br />
5 = Percentage: Aim% * (100 - Dog)%<br><br />
6 = Percentage: Aim%<br><br />
7 = Percentage: Mag% * (100 - Wil)%<br><br />
8 = Percentage: Mag%<br><br />
9 = Custom: ''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat''<br><br />
10 = Custom Percentage: ''Extra'' + ''AccMult'' * ''AccStat''% * (100 - ''DogMult'' * ''DogStat'')%<br><br />
11 = Custom Gaussian: F(''Extra'' + ''AccMult'' * ''AccStat'' vs ''DogMult'' * ''DogStat'') where F is the cumulative distrib. of Normal(0, sqrt(2))<br><br />
12 = Custom Percentage (capped defense): (''Extra'' + ''AccMult'' * ''AccStat'')% * (100 - ''DogMult'' * ''DogStat'')%<br />
|-<br />
|7||INT (1)||Base Attack Stat:<br />
0 = Atk (attacker)<br><br />
1 = Mag (attacker)<br><br />
2 = HP (attacker)<br><br />
3 = Lost HP (attacker)<br><br />
4 = Random (0 to 999)<br><br />
5 = 100<br><br />
6 = HP (attacker)<br><br />
7 = MP (attacker)<br><br />
8 = Atk (attacker)<br><br />
9 = Aim (attacker)<br><br />
10 = Def (attacker)<br><br />
11 = Dog (attacker)<br><br />
12 = Mag (attacker)<br><br />
13 = Wil (attacker)<br><br />
14 = Spd (attacker)<br><br />
15 = Ctr (attacker)<br><br />
16 = Focus (attacker)<br><br />
17 = Extra Hits (attacker)<br><br />
18 = Last damage by attacker<br><br />
19 = Last damage to attacker<br><br />
20 = Last damage to target<br><br />
21 = Last cure to attacker<br><br />
22 = Last cure to target<br><br />
23 = HP (target)<br><br />
24 = MP (target)<br><br />
25 = Atk (target)<br><br />
26 = Aim (target)<br><br />
27 = Def (target)<br><br />
28 = Dog (target)<br><br />
29 = Mag (target)<br><br />
30 = Wil (target)<br><br />
31 = Spd (target)<br><br />
32 = Ctr (target)<br><br />
33 = Focus (target)<br><br />
34 = Extra Hits (target)<br><br />
35 = Max HP (attacker)<br><br />
36 = Max MP (attacker)<br><br />
37 = Max Atk (attacker)<br><br />
38 = Max Aim (attacker)<br><br />
39 = Max Def (attacker)<br><br />
40 = Max Dog (attacker)<br><br />
41 = Max Mag (attacker)<br><br />
42 = Max Wil (attacker)<br><br />
43 = Max Spd (attacker)<br><br />
44 = Max Ctr (attacker)<br><br />
45 = Max Focus (attacker)<br><br />
46 = Max extra Hits (attacker)<br><br />
47 = Max HP (target)<br><br />
48 = Max MP (target)<br><br />
49 = Max Atk (target)<br><br />
50 = Max Aim (target)<br><br />
51 = Max Def (target)<br><br />
52 = Max Dog (target)<br><br />
53 = Max Mag (target)<br><br />
54 = Max Wil (target)<br><br />
55 = Max Spd (target)<br><br />
56 = Max Ctr (target)<br><br />
57 = Max Focus (target)<br><br />
58 = Max extra Hits (target)<br><br />
59 = 100 times number of targets<br><br />
60 = Lost MP (attacker)<br><br />
61 = Lost MP (target)<br><br />
62 = Lost HP (target)<br><br />
|-<br />
|8||INT (1)||MP Cost<br />
|-<br />
|9||INT (1)||HP Cost<br />
|-<br />
|10||INT (1)||Money Cost<br />
|-<br />
|11||INT (1)||Extra Damage %<br />
|-<br />
|12||INT (1)||Chain-to attack number + 1, 0 for none<br />
|-<br />
|13||INT (1)||Chain Rate % (0-100)<br />
|-<br />
|14||INT (1)||Attacker Animation:<br />
0 = Strike (shows weapon)<br><br />
1 = Cast<br><br />
2 = Dash In (shows weapon)<br><br />
3 = SpinStrike (shows weapon)<br><br />
4 = Jump (hides attacker)<br><br />
5 = Land<br><br />
6 = Null<br><br />
7 = Standing Cast<br><br />
8 = Teleport (shows weapon)<br><br />
9 = Standing Strike<br><br />
10 = Run and Hide (hides attacker) {{WIP|inline}}<br><br />
|-<br />
|15||INT (1)||Attack Animation:<br />
0 = Normal<br><br />
1 = Projectile<br><br />
2 = Reverse projectile<br><br />
3 = Drop<br><br />
4 = Ring<br><br />
5 = Wave<br><br />
6 = Scatter<br><br />
7 = Sequential Projectile<br><br />
8 = Meteor<br><br />
9 = Driveby<br><br />
10 = Null<br><br />
11 = Screen Center<br><br />
|-<br />
|16||INT (1)||Attack Delay (ticks)<br />
|-<br />
|17||INT (1)||Number of hits (range 1 to 20)<br />
|-<br />
|18||INT (1)||Target Stat:<br />
0 = HP<br><br />
1 = MP<br><br />
2 = Atk<br><br />
3 = Aim<br><br />
4 = Def<br><br />
5 = Dog<br><br />
6 = Mag<br><br />
7 = Wil<br><br />
8 = Spd<br><br />
9 = Ctr<br><br />
10 = Focus<br><br />
11 = Extra Hits<br><br />
12 = Poison register<br><br />
13 = Regen register<br><br />
14 = Stun register<br><br />
15 = Mute register<br />
|-<br />
|19||INT (1)||Preferred target:<br>0 = default<br>1 = first<br>2 = closest<br>3 = farthest<br>4 = random<br>5 = weakest<br>6 = strongest<br>7 = weakest%<br>8 = strongest%<br />
|-<br />
|rowspan="26" valign="top"|20 - 23:<br>Attack Bitsets 1 (64)||BIT (1)||0: Cure Instead of Harm<br />
|-<br />
|BIT (1)||1: Divide Spread Damage<br />
|-<br />
|BIT (1)||2: Absorb Damage<br />
|-<br />
|BIT (1)||3: Unreversable Picture<br />
|-<br />
|BIT (1)||4: Steal Item<br />
|-<br />
|BIT (8)||5 - 12: Elementary 1 - 8 Damage<br />
|-<br />
|BIT (8)||13 - 20: Bonus vs. Monster Type 1 - 8 (aka. Elemental 9 - 16 damage)<br />
|-<br />
|BIT (8)||21 - 28: Fail vs. Elementary 1 - 8 Resistance (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||29 - 36: Fail vs. Monster Type 1 - 8 (Obsolete, see [[#Note 1]])<br />
|-<br />
|BIT (8)||37: Cannot target enemy slot 0 - 7<br />
|-<br />
|BIT (4)||45: Cannot target hero slot 0 - 3<br />
|-<br />
|BIT (1)||49: Ignore attacker's extra hits<br />
|-<br />
|BIT (1)||50: Erase rewards (enemy target only)<br />
|-<br />
|BIT (1)||51: Show damage without inflicting<br />
|-<br />
|BIT (1)||52: Store Target<br />
|-<br />
|BIT (1)||53: Delete Stored Targets<br />
|-<br />
|BIT (1)||54: Automatically choose target<br />
|-<br />
|BIT (1)||55: Show attack name<br />
|-<br />
|BIT (1)||56: Do not display Damage<br />
|-<br />
|BIT (1)||57: Reset target stat to max before hit<br />
|-<br />
|BIT (1)||58: Allow Cure to exceed maximum<br />
|-<br />
|BIT (1)||59: Useable Outside of Battle<br />
|-<br />
|BIT (1)||60: Damage MP (obsolete, but still supported)<br />
|-<br />
|BIT (1)||61: Do not randomize (obsolete, ignored if [[FIXBITS.BIN|fixAttackMultipliers]] is on)<br />
|-<br />
|BIT (1)||62: Damage can be Zero<br />
|-<br />
|BIT (1)||63: Cause heroes to run away<br />
|-<br />
|24 - 35||FVSTR (1i+1i+10i=12i)||Attack Name, 10 characters max:<br>First INT contains length, the second is unused<br />
|-<br />
|36||INT (1)||Caption Display Time:<br />
-1 = Do not display<br>0 = Full duration of attack<br>>=1 = Number of ticks to display<br />
|-<br />
|37 - 56||FVSTR (1i+38b=40b)||Attack Caption, 38 characters max (note that the length INT ant first 4 chars are stored in DT6 and the remainder of the caption is stored in ATTACK.BIN)<br />
|-<br />
|57||INT (1)||Caption Delay (range 0 to 16383)<br />
|-<br />
|58||INT (1)||Base Defense Stat:<br />
0 = Default (Wil if base attack stat is Mag, Def otherwise)<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br />
|-<br />
|59||INT (1)||Tag to Set<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|60||INT (1)||Tag Condition<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|61||INT (1)||Tag Check<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br />
|-<br />
|62||INT (1)||Tag to Set #2<br><br />
0 - none<br><br />
> 0 - set tag<br><br />
< 0 - unset tag<br />
|-<br />
|63||INT (1)||Tag Condition #2<br><br />
0 - Never<br><br />
1 - Always<br><br />
2 - Hit<br><br />
3 - Miss<br><br />
4 - Kill<br />
|-<br />
|64||INT (1)||Tag Check #2<br><br />
0 - none<br><br />
> 0 - tag must be on<br><br />
< 0 - tag must be off<br><br />
|-<br />
|rowspan="27" valign="top"|65 - 72:<br>Bitsets 2 (128)||BIT (1)||0: Mutable<br />
|-<br />
|BIT (1)||1: Fail if target is Poisoned<br />
|-<br />
|BIT (1)||2: Fail if target is Regened<br />
|-<br />
|BIT (1)||3: Fail if target is Stunned<br />
|-<br />
|BIT (1)||4: Fail if target is Muted<br />
|-<br />
|BIT (1)||5: % based attacks damage instead of set ([[#Note 2]])<br />
|-<br />
|BIT (1)||6: Check costs when used as a weapon<br />
|-<br />
|BIT (1)||7: Do not chain if attack fails<br />
|-<br />
|BIT (1)||8: Reset Poisoned register<br />
|-<br />
|BIT (1)||9: Reset Regened register<br />
|-<br />
|BIT (1)||10: Reset Stun Register<br />
|-<br />
|BIT (1)||11: Reset Mute Register<br />
|-<br />
|BIT (1)||12: Cancel target's attack<br />
|-<br />
|BIT (1)||13: Can't be canceled by other attacks<br />
|-<br />
|BIT (1)||14: Do not trigger spawning on attack<br />
|-<br />
|BIT (1)||15: Do not trigger spawning on death<br />
|-<br />
|BIT (1)||16: Check costs when used as an item in battle<br />
|-<br />
|BIT (1)||17: Re-check costs after attack delay<br />
|-<br />
|BIT (1)||18: Does not cause target to flinch<br />
|-<br />
|BIT (1)||19: Don't allow damage to exceed target stat<br />
|-<br />
|BIT (1)||20: Delay doesn't block further actions<br />
|-<br />
|BIT (1)||21: Force victory<br />
|-<br />
|BIT (1)||22: Force battle exit<br />
|-<br />
|BIT (1)||23: Never trigger counterattacks<br />
|-<br />
|BIT (1)||24: Healing poison register past max becomes regen and vice versa<br />
|-<br />
|BIT (1)||25: Hide attacker regardless of attacker animation {{WIP|inline}}<br />
|-<br />
|bgcolor="#D0D0D0"|BIT (56)||26-79: Unused<br />
|-<br />
|BIT (48)||80 - 127: Element 17 - 64 Damage<br />
|-<br />
|73 - 92||VSTR (1i+38b = 40b)||Spell description<br />
|-<br />
|93, 95, 97||INT (1) x 3||Item ID+1 to be consumed (or given) or 0 for none (x3)<br />
|-<br />
|94, 96, 98||INT (1) x 3||Number of items to be consumed (or given) (x3)<br />
|-<br />
|99||INT (1)||Sound effect to be played on a hit + 1 (0 for none)<br />
|-<br />
|100||INT (1)||Stat for preferred target weakest/strongest<br>0 = same as target stat<br>1 = HP<br>2 = MP<br>3 = Atk<br>4 = Aim<br>5 = Def<br>6 = Dog<br>7 = Mag<br>8 = Wil<br>9 = Spd<br>10 = Ctr<br>11 = Focus<br>12 = extra Hits<br>13 = Poison register<br>14 = Regen register<br>15 = Stun register<br>16 = Mute register<br />
|-<br />
|101||INT(1)||Chain condition type<br><br />
0: No special conditions<br><br />
1: both val1 and val2 are tags to check<br><br />
2: attacker stat val1 greater than val2<br><br />
3: attacker stat val1 less than than val2<br><br />
4: attacker stat val1 greater than val2%<br><br />
5: attacker stat val1 less than than val2%<br><br />
6: any target stat val1 greater than val2<br><br />
7: any target stat val1 less than val2<br><br />
8: any target stat val1 greater than val2%<br><br />
9: any target stat val1 less than val2%<br><br />
10: all target stat val1 greater than val2<br><br />
11: all target stat val1 less than val2<br><br />
12: all target stat val1 greater than val2%<br><br />
13: all target stat val1 less than val2%<br><br />
14: all target stat val1 greater than attacker stat val2<br><br />
15: all target stat val1 less than attacker stat val2<br><br />
16: attacker stat val1 less than attacker stat val2<br><br />
17: chain with scaled chance, attacker stat val1 divided by val2<br><br />
18: chain with scaled chance, (max any target) stat val1 divided by val2<br><br />
19: chain with scaled chance, (min all targets) stat val1 divided by val2<br><br />
|-<br />
|102||INT(1)||Chain condition primary value (''val1'') (meaning varies depending on Chain type)<br />
|-<br />
|103||INT(1)||Chain condition secondary value (''val2'') (meaning varies depending on Chain type)<br />
|-<br />
|bgcolor="#FFC8C8" valign="top"|104|| || Chain bits<br><br />
0: Attacker must know the chained attack also<br><br />
1: Chained attack ignores delay<br><br />
2: Chain delay doesn't block actions<br><br />
3: Don't retarget if target is lost<br><br />
4: Invert condition<br><br />
|-<br />
|105||INT (1)||Else-Chain-to attack number + 1, 0 for none<br />
|-<br />
|106||INT(1)||Else-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|107||INT (1)||Else-Chain Rate % (0-100)<br />
|-<br />
|108||INT (1)||Else-Chain condition value (meaning varies depending on Else-Chain type)<br />
|-<br />
|109||INT(1)||Else-Chain condition secondary value (meaning varies depending on Else-Chain type)<br />
|-<br />
|110||BIT(16)||Else-chain bits (see chain bits)<br />
|-<br />
|111||INT (1)||Instead-Chain-to attack number + 1, 0 for none<br />
|-<br />
|112||INT(1)||Instead-Chain condition type (see chain condition type for valid values)<br />
|-<br />
|113||INT (1)||Instead-Chain Rate % (0-100)<br />
|-<br />
|114||INT (1)||Instead-Chain condition value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|115||INT(1)||Instead-Chain condition secondary value (meaning varies depending on Instead-Chain type)<br />
|-<br />
|116||BIT(16)||Instead-chain bits (see chain bits)<br />
|-<br />
|117||INT (1)||Sound effect when learned from item or levelup + 1 (0 for none)<br />
|-<br />
|118||INT (1)||Transmogrify enemy. new Enemy ID + 1 or 0 for no change<br />
|-<br />
|119||INT (1)||What to do with HP when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|120||INT (1)||What to do with other stats when transmogrifying<br><br />
0=keep current<br><br />
1=restore to new max<br><br />
2=preserve % of max<br><br />
3=keep current, cap to new max<br><br />
|-<br />
|121-312||AttackElementCondition (64)<br>(6 bytes each)||Conditions for attack failure if the target takes beyond some threshold of damage from some element. [[#Note 1]]<br><br />
Note: if the 'Simulate old fail vs. element resist bit' general bitset is ON, then consider the absolute value of the<br />
amount of damage taken by a target from the element (for Types 3 and 4 only!),<br />
simulating the way in which the old fail bits ignored whether the Absorb bit was on.<br><br />
Each condition has format:<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
|Type||INT||A value from 0-6 plus some possible bits<br><br />
0: No condition<br><br />
3: Target takes < ''Value'' damage from this element<br><br />
4: Target takes <= ''Value'' damage from this element<br><br />
5: Target takes > ''Value'' damage from this element<br><br />
6: Target takes >= ''Value'' damage from this element<br><br />
+16: Compare against the absolute value of the target's resistance<br><br />
+32: Display "miss" instead of "fail"<br><br />
+64: Randomize, multiplying threshold by a value from 0.0 to 1.0<br><br />
|-<br />
|Value||FLOAT||Percentage threshold (1.0 is 100%)<br />
|}<br />
|-<br />
|313||INT (1)||Weapon picture override. 0=use hero's weapon picture. >= is the weapon picture id +1<br />
|-<br />
|314||INT (1)||Weapon palette override. -1 is default, >=0 is the palette number. This value is completely ignored if weapon picture override is 0. It is not possible to override palette without also overriding picture.<br />
|-<br />
|315||INT (1)||Weapon picture frame 0 handle X (only applies to wep picture override)<br />
|-<br />
|316||INT (1)||Weapon picture frame 0 handle Y (only applies to wep picture override)<br />
|-<br />
|317||INT (1)||Weapon picture frame 1 handle X (only applies to wep picture override)<br />
|-<br />
|318||INT (1)||Weapon picture frame 1 handle Y (only applies to wep picture override)<br />
|-<br />
|319||INT (1)||Attack delay (turns)<br />
|-<br />
|320||INT (1)||Dramatic Pause: number of ticks. This pause is part of the attack animation, and happens after the (undelayed) caption displays but before the visible animation happens.<br />
|-<br />
|321||INT (1)||Stat cost: index of stat + 1 {{Future|inline}}<br />
|-<br />
|322||INT (1)||Stat cost: amount to decrement {{Future|inline}}<br />
|-<br />
|323||INT (1)||Base Accuracy Stat (only used for Aim Math 9-12):<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
statid + 512: Attacker's stat divided by number of targets<br><br />
|-<br />
|324||INT (1)||Base Dodge Stat (only used for Aim Math 9-12):<br><br />
Same as above, but dividing by number of targets is not available.<br><br />
-1 = Constant (value 1)<br><br />
statid + 0: Attacker's stat<br><br />
statid + 256: Target's stat<br><br />
|-<br />
|325||FLOAT||Accuracy multiplier [[#note 3]]<br />
|-<br />
|327||FLOAT||Dodge multiplier [[#note 3]]<br />
|-<br />
|329||FLOAT||Attack multiplier [[#note 3]]<br />
|-<br />
|331||FLOAT||Defense multiplier [[#note 3]]<br />
|-<br />
|333||FLOAT||Aim math extra value<br />
|-<br />
|335||FLOAT||Absorb rate [[#note 3]]<br />
|-<br />
|337||INT (1)||Damage +/- randomization percentage (0 - 100)<br><br />
If [[FIXBITS.BIN|fixAttackMultipliers]] is off, initialize to 20 unless "Do not randomize" was set<br />
|-<br />
|338||INT (1)||Damage display color override (0=default, >=1 is master palette index (color 0 not available))<br />
|-<br />
|339||INT (1)||What to do with rewards when transmogrifying<br />
0=Don't give rewards from old enemy<br><br />
1=Give rewards from old enemy<br />
|-<br />
|340||INT (1)||Whether to provoke counter attacks:<br />
0=Default (use global setting gen(genDefCounterProvoke))<br><br />
1=Always<br><br />
2=Never<br><br />
3=If attack hits<br><br />
4=If attack fails<br><br />
5=If attack misses<br><br />
6=If attack doesn't hit<br><br />
7=If attack doesn't fail<br><br />
8=If attack doesn't miss<br />
|-<br />
|341||INT (1)||Sound effect to be played on Miss + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|342||INT (1)||Sound effect to be played on Fail + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|343||INT (1)||Sound effect to be played on Hit, but steal failure + 1; 0 for same as Hit sound effect; -1 for none {{future|inline}}<br />
|-<br />
|344||INT (1)|| X-offset of attack relative to target<br />
|-<br />
|345||INT (1)|| Y-offset of attack relative to target<br />
|-<br />
|346||INT (1)|| horizontal anchor&align of attack to target; -1=align left edges, 0=center, 1=align right edges<br />
|-<br />
|347||INT (1)|| vertical anchor&align of attack to target; -1=align top edges, 0=center, 1=align bottom edges<br />
|}<br />
<br />
==Note 1==<br />
If fixAttackElementFails is OFF, then elemental fail thresholds should be read from the "fail vs. ..." bits:<br />
<br />
* All conditions default to "None".<br />
* If 'fail vs. elemental ''n'' resistance' is set, the element ''n'' condition is "If < 100% damage"<br />
* If 'fail vs. enemytype ''n'' ' is set, the element ''n+8'' condition is "If > 100% damage"<br />
<br />
If fixAttackElementFails is ON, the old bits contain garbage.<br />
<br />
==Note 2==<br />
"% based attacks damage instead of set" is a very messy bitset.<br />
We planned to get rid of it,<br />
replacing Damage Equation = 5 or 6 with Damage Equation = 7 or 8<br />
if this bitset is on (adding a new fix bit, "fixPercentageAttacks"),<br />
but this was never done.<br />
<br />
==Note 3==<br />
The marked multipliers are initialised to 1.0 when the [[FIXBITS.BIN|fixAttackMultipliers]] upgrade is applied.<br />
<br />
==Note 4==<br />
Implementation not merged: https://bitbucket.org/rbv/ohrrpgce/commits/branch/attacksounds<br />
<br />
==References to other lumps==<br />
<br />
{| border="1" cellpadding="1" style="font-family:Courier New"<br />
! Field || Indicating record in lump:<br />
|-<br />
|Animation picture||[[PT6]]<br />
|-<br />
|Animation palette||[[PAL]]<br />
|-<br />
|Chain-to,Instead-chain-to,else-chain-to||DT6 (this lump)<br />
|-<br />
|Sound effect||(sound file)<br />
|-<br />
|Miss sound effect||(sound file)<br />
|-<br />
|Fail sound effect||(sound file)<br />
|-<br />
|'Learned' sound effect||(sound file)<br />
|-<br />
<br />
|}<br />
<br />
{{LumpSpec}}</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=OHRRPGCE_Licensing&diff=34255OHRRPGCE Licensing2021-12-13T16:37:09Z<p>Bob the Hamster: add a WIP section</p>
<hr />
<div>Starting with the next stable release, the OHRRPGCE will be changing license to Dual GPLv2 & MIT License. This is being done with the unanimous consent of all OHRRPGCE developers. [Contributors/Relicensing]<br />
<br />
This change facilitates special-case porting to closed platforms like consoles, while also publicly demonstrating our respect for the copyleft principles of the GPL. We intend to continue sharing the source code in the same spirit we always have.<br />
<br />
{{WIP}}<br />
<br />
----<br />
<br />
The GNU GPL (General Public License) is a "copyleft" license. The [[OHRRPGCE]]'s source code is released under this license, either version 2, or (at your<br />
option) any later version.<br />
<br />
Basically it means that not only can you freely use and redistribute the source, you are also allowed to make changes to it, as long as you promise to make your changes available to everyone else with all the same freedoms that have been promised to you. (In other words, any derived works must also be released under the terms of the GPL.)<br />
<br />
The games you make with the OHRRPGCE do not have to be under the GPL license. You can distribute them any way you like, including selling them. If you include a copy of the [[Game]] player with your game (as you should!), you should be sure to also include a copy of LICENSE-binary.txt.<br />
<br />
==See Also==<br />
*[http://www.gnu.org/copyleft/gpl.html The full text of the GPL]<br />
*[http://www.fsf.org/licensing/licenses/gpl-faq.html The GPL FAQ]<br />
<br />
[[Category:OHRRPGCE Internals]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Talk:GPL_license&diff=34254Talk:GPL license2021-12-13T16:32:23Z<p>Bob the Hamster: Bob the Hamster moved page Talk:GPL license to Talk:OHRRPGCE Licensing: change in licensing in the next release</p>
<hr />
<div>#REDIRECT [[Talk:OHRRPGCE Licensing]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=Talk:OHRRPGCE_Licensing&diff=34253Talk:OHRRPGCE Licensing2021-12-13T16:32:23Z<p>Bob the Hamster: Bob the Hamster moved page Talk:GPL license to Talk:OHRRPGCE Licensing: change in licensing in the next release</p>
<hr />
<div>[[User:Sorlok reaves|S&#39;orlok Reaves]]: Question: I know that OHR games need not be GPL'd. But, does the GPL apply to games that '''DON'T''' specify a license? What about resources? <br />
I ask this because I want to use some of the enemy graphics from Wandering Hamster in one of my classes, for use with some "palette swapping" code... can I do this?<br />
<br />
[[User:Bob the Hamster|Bob the Hamster]]: Games that do not specify a license are assumed to be plain ol' copyright. No OHR game can ever be automatically GPLed just because the OHR is GPL (just like your thesis can't be assumed to be GPL just because you typed it in OpenOffice).<br />
<br />
As for Wandering Hamster, yes, you can use the sprites. I haven't gotten around to re-licensing formally because I was waiting on music issues, but I give you permission to use the sprites as if they were GPL. (The final license for WH will probably end up being dual GPL+CC-Attrib-Sharealike which are the same in spirit, but not automatically compatible for fiddly legalistic reasons)<br />
<br />
<br />
[[User:Sorlok reaves|S&#39;orlok Reaves]]: Ah, legalese.... anyways, thanks for your permission. I don't have a JSP world-enabled server (it's all intra-netty over here) so here's a snapshot of the palette swap utility in action:<br />
<br />
[[http://www.comp.nus.edu.sg/~sethhetu/segments/palleteSwapDemo.PNG Demo Pic]]<br />
<br />
It's quite fun in that each "base color" (e.g., "Plip Green") is represented in RGB, while the various shades used for the Plip's contours are represented in HSB.</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=GPL_license&diff=34252GPL license2021-12-13T16:32:23Z<p>Bob the Hamster: Bob the Hamster moved page GPL license to OHRRPGCE Licensing: change in licensing in the next release</p>
<hr />
<div>#REDIRECT [[OHRRPGCE Licensing]]</div>Bob the Hamsterhttps://rpg.hamsterrepublic.com/ohrrpgce/index.php?title=OHRRPGCE_Licensing&diff=34251OHRRPGCE Licensing2021-12-13T16:32:23Z<p>Bob the Hamster: Bob the Hamster moved page GPL license to OHRRPGCE Licensing: change in licensing in the next release</p>
<hr />
<div>The GNU GPL (General Public License) is a "copyleft" license. The [[OHRRPGCE]]'s source code is released under this license, either version 2, or (at your<br />
option) any later version.<br />
<br />
Basically it means that not only can you freely use and redistribute the source, you are also allowed to make changes to it, as long as you promise to make your changes available to everyone else with all the same freedoms that have been promised to you. (In other words, any derived works must also be released under the terms of the GPL.)<br />
<br />
The games you make with the OHRRPGCE do not have to be under the GPL license. You can distribute them any way you like, including selling them. If you include a copy of the [[Game]] player with your game (as you should!), you should be sure to also include a copy of LICENSE-binary.txt.<br />
<br />
==See Also==<br />
*[http://www.gnu.org/copyleft/gpl.html The full text of the GPL]<br />
*[http://www.fsf.org/licensing/licenses/gpl-faq.html The GPL FAQ]<br />
<br />
[[Category:OHRRPGCE Internals]]</div>Bob the Hamster