[LUS] Multi-weapon unit script erroring out

[LUS] Multi-weapon unit script erroring out

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

[LUS] Multi-weapon unit script erroring out

Post by Forboding Angel »

11:35:31 PM] <[Evo]Forboding_Angel> http://pastebin.com/LfNGWtgy
[11:35:56 PM] Can someone please tell me what I'm doing wrong with the weapons?
[11:36:16 PM] I got this: [f=0010830] [unit_script.lua] Error: [string "scripts/eheavytank_t3_lus.lua"]:52: attempt to perform arithmetic on local 'pitch' (a nil value)
[11:37:25 PM] [f=0010830] Error: LuaRules::RunCallIn: error = 1, CLuaUnitScript::AimWeapon, [Internal Lua error: Call failure] [string "LuaGadgets/Gadgets/unit_script.lua"]:259: attempt to index global 'debug' (a nil value)
[11:39:14 PM] I don't understand why pitch would be nil

Asked in moddev, but figured might actually get a faster answer here. For reference, I'm using this: https://springrts.com/wiki/Animation-LuaCallins

It looks to me like i am doing it correctly, but apparently not (also, why is pitch inverted in LUS?).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: [LUS] Multi-weapon unit script erroring out

Post by Forboding Angel »

Figured it out. I was sending too many params to aimweapon, cause weaponID is superflous there.

The reason that only one weapon would fire at a time, is that in LUS unlike cob, each weapon needs a different signal.
sprunk
Posts: 100
Joined: 29 Jun 2015, 07:36

Re: [LUS] Multi-weapon unit script erroring out

Post by sprunk »

in LUS unlike cob, each weapon needs a different signal
As far as I know that's also the case in COB.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: [LUS] Multi-weapon unit script erroring out

Post by FLOZi »

Yes, there shouldn't be any difference in signal behaviour between lua and cob, beyond the fact that lua can use any object and cob is limited only to integers.
Post Reply

Return to “Lua Scripts”