Scratch: Difference between revisions

From Eternity Wiki
Jump to navigationJump to search
(New page: Type: Monster attack, parameterized Parameter Information: *Unknown 1 = Amount of damage to inflict (default of 0 = 0) *Unknown 2 = DeHackEd number of sound to play (default of 0 = no ...)
 
(r1608 new args0 value)
Line 1: Line 1:
Type: Monster attack, parameterized
Parameterized melee monster attack. Useful for custom damage values, unlike codepointers like [[SargAttack]] which act similarly but with fixed damage formulae.
===Parameter Information===
*'''misc1''' = (if ''Args0'' = '''usemisc1''') Amount of damage to inflict (default of 0 = 0)
*'''misc2''' = Mnemonic of sound to play (default of '''null''' = no sound will be played)
*''Args0'' = Special mode toggle (default of 0 = 0)
**0 or '''usemisc1''' = Compatibility mode (Use value in "Unknown 1")
**1 or '''usedamage''' = Use object damage field
**2 or '''usecounter''' = Use value in counter specified in ''Args1''
**3 or '''useconstant''' = Use constant value specified in ''Args1''
*''Args1'' = (if ''Args0'' = '''useconstant''') constant value or (if ''Args0'' = '''usecounter''') counter number, 0 to 7, holding the value


Parameter Information:
===Remarks===
*Unknown 1 = Amount of damage to inflict (default of 0 = 0)
If the object's target is valid and is within melee range (64 units), it will damage the target for the indicated amount. If the '''misc2''' parameter is non-zero and is a valid sound name, the indicated sound will played along with the attack.
*Unknown 2 = DeHackEd number of sound to play (default of 0 = no sound will be played)
*Args1 = Special mode toggle (default of 0 = 0)
**0 = Compatibility mode (Use value in "Unknown 1" as normal)  
**1 = Use object damage field
**2 = Use counter specified in Args2
*Args2 = Counter field number for special mode 2 (default of 0 = 0)
**0 = Counter 0
**1 = Counter 1
**2 = Counter 2


Purpose: If the object's target is valid and is within melee range (64 units), it will damage the target for the indicated amount. If the Unknown 2 parameter is non-zero and is a valid sound DeHacked number, the indicated sound will played along with the attack. New to MBF.
Parameters Args0 and Args1 allow getting a damage value from other sources. If Args0 is '''usedamage''', the object's damage value will be used. If Args0 is '''usecounter''', the value of the counter specified in Args1 will be used. Finally, if Args0 is '''useconstant''', it will use the constant value in Args1. This has a similar effect to using '''usemisc1''' and the '''misc1''' parameter, but without the side effects caused by the "misc" parameters. When Args0 = '''usecounter''' and the state is combined with others that use [[SetCounter]] or [[CounterOp]], this allows you to perform your own custom damage calculations. The Args0 default value is '''usemisc1''', ensuring compatibility with MBF.


Notes: As of Eternity Engine v3.31 public beta 3, this codepointer will no longer crash the game if an invalid sound number is provided. No sound will be played if the number is invalid.
[[Category:Codepointers]]
 
Parameters Args1 and Args2 are new to Eternity Engine v3.31 Delta, and allow getting a damage value from other sources. If Args1 is 1, the object's damage value will be used. If Args1 is 2, the value of the counter specified in Args2 will be used. When combined with SetCounter or CounterOp, this allows you to perform your own custom damage calculations. This change does not break compatibility, as the Args1 default value is 0.
 
Thunk: Yes.

Revision as of 18:37, 3 November 2011

Parameterized melee monster attack. Useful for custom damage values, unlike codepointers like SargAttack which act similarly but with fixed damage formulae.

Parameter Information

  • misc1 = (if Args0 = usemisc1) Amount of damage to inflict (default of 0 = 0)
  • misc2 = Mnemonic of sound to play (default of null = no sound will be played)
  • Args0 = Special mode toggle (default of 0 = 0)
    • 0 or usemisc1 = Compatibility mode (Use value in "Unknown 1")
    • 1 or usedamage = Use object damage field
    • 2 or usecounter = Use value in counter specified in Args1
    • 3 or useconstant = Use constant value specified in Args1
  • Args1 = (if Args0 = useconstant) constant value or (if Args0 = usecounter) counter number, 0 to 7, holding the value

Remarks

If the object's target is valid and is within melee range (64 units), it will damage the target for the indicated amount. If the misc2 parameter is non-zero and is a valid sound name, the indicated sound will played along with the attack.

Parameters Args0 and Args1 allow getting a damage value from other sources. If Args0 is usedamage, the object's damage value will be used. If Args0 is usecounter, the value of the counter specified in Args1 will be used. Finally, if Args0 is useconstant, it will use the constant value in Args1. This has a similar effect to using usemisc1 and the misc1 parameter, but without the side effects caused by the "misc" parameters. When Args0 = usecounter and the state is combined with others that use SetCounter or CounterOp, this allows you to perform your own custom damage calculations. The Args0 default value is usemisc1, ensuring compatibility with MBF.