Looking for a gadget

Looking for a gadget

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

Moderator: Moderators

Post Reply
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Looking for a gadget

Post by oksnoop2 »

I'm pretty sure at one time i saw units that could "sprint". I assume that's a gadget but i can't seem to find it. Anyone still have it or know what i'm talking about?
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Looking for a gadget

Post by CarRepairer »

This is the gadget:

name = "CobButton",
desc = "Easy cob button Creation",

http://trac.caspring.org/browser/trunk/ ... button.lua

+

This is the unit script for the Zipper (no longer in ZK). Zipper's script defines what to do when sprinting and the gadget makes the button.

http://trac.caspring.org/browser/trunk/ ... rmfast.bos

I don't recommend using this. Use LUS instead.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Looking for a gadget

Post by bobthedinosaur »

now do a version for lus...
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: Looking for a gadget

Post by oksnoop2 »

What he said..... please?
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Looking for a gadget

Post by CarRepairer »

I was wanting to convert it to LUS eventually. I'll give it a shot.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Looking for a gadget

Post by FLOZi »

I'm personally not a fan of the cobbuttons gadget.

If you're going to have the Sprint ability for multiple units, what are you intending to implement LUS side?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Looking for a gadget

Post by knorke »

animation like speeding up movement of legs, wheels etc?
do i understand correctly that

Code: Select all

143	              Spring.CallCOBScript(unitID, cmd.endcob, 0)
calls the function in the unit script? (when button is pressed and again when sprint has ended or something)

wouldnt that just have to be replaced with

Code: Select all

env = Spring.UnitScript.GetScriptEnv(unitID)
			if (env) then Spring.UnitScript.CallAsUnit(unitID, env.sprintstart) end
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Looking for a gadget

Post by FLOZi »

Yes. Which is why I was wondering what else he'd do LUS side, as otherwise you can use the same gadget but just replace the COB anim call with a LUS one.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: Looking for a gadget

Post by CarRepairer »

Sorry. Replace
CarRepairer wrote:I don't recommend using this. Use LUS instead.
with
CarRepairer should have said wrote:I don't recommend using this gadget as-is. Use a converted version of it that uses LUS instead.
Post Reply

Return to “Lua Scripts”