Chaosforge Forum

DoomRL => Modding => Topic started by: Rabinowitz on March 30, 2012, 03:41

Title: ALT_WHIRLWIND - doesnt work.
Post by: Rabinowitz on March 30, 2012, 03:41
When trying to create melee weapon with alternatiwe whirlwind fire i get error message:

Error message : modules\crazydoom.module\crazy_items.lua:14: attempt to read undeclared variable ALT_WHIRLWIND

Overriding altfire for existing items like 'items.knife.altfire = ALT_WHIRLWIND' causes the same error.
Overriding like 'items.knife.altfire = items.udragon.altfire' doesnt cause error, but has no real effect at all.

What did i miss then?
Title: Re: ALT_WHIRLWIND - doesnt work.
Post by: shark20061 on March 30, 2012, 04:18
ALT_WHIRLWIND apparently doesn't exist.

items.udragon.altfire is bound to the value 3, which is ALT_SCRIPT.  To get whirlwind's effect, you'd also have to copy the OnAltFire function.

Code: [Select]
items.youritemidhere.altfire = ALT_SCRIPT
items.youritemidhere.OnAltFire = items.udragon.OnAltFire

Try this and see if it works.
Title: Re: ALT_WHIRLWIND - doesnt work.
Post by: Rabinowitz on March 30, 2012, 05:13
Yes, it works with OnAltFire well.