another lame lua question

another lame lua question

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

Moderator: Moderators

Post Reply
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

another lame lua question

Post by bobthedinosaur »

i was wondering if any one has been working on lua concepts that would allow for multiple model or multiple units stacked to work?
ie: a soldier unit with no weapons who can pick up an assortment of weapons to use. just one example i can think of...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: another lame lua question

Post by KDR_11k »

That would still be limited by the actual weapon code, you can draw a gun but you can't add an actual gun.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: another lame lua question

Post by lurker »

But if you want him to pick up a gun, you're better off making the gun a unit already.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: another lame lua question

Post by Argh »

Probably the easiest way to do this would be to model the gun, have the soldier have all possible models of gun built into its model, then have the soldier's LUA interact with the gun Unit, thereby activating that gun, then use BOS to activate or deactivate said gun. If all weapon calls went to a common call-script with branches for the specifics of aiming, it'd even run pretty fast.

The big problem then would be the weird movement behaviors that would result from the Unit logic. Unless PressureLine's attempt to fuse .S3Os eventually reaches fruition, that's probably the single fastest way to go here.

Hmm. Can we rewrite OnlyTargetCategory on the fly, or is that strictly read-only? That'd take care of quite a lot of bork, in that area...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: another lame lua question

Post by KDR_11k »

It'd be better to have one unit per weapon and just "morph".
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: another lame lua question

Post by bobthedinosaur »

i think kdr has the best idea, now what about making pilot units jump in a vehicle and maybe able to dismount/ eject?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: another lame lua question

Post by trepan »

fwiw, LuaRules/unsynced can easily swap out model
piece display lists using the UnitRendering interface ;-)
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: another lame lua question

Post by bobthedinosaur »

im thinking of a mod thats based around the infantry concept, and is more about modding the regular infantry guy with what ever weapons/ vehicles are for the mission design. how ever spring is kind of a tank big robot and bombe type platform, maybe i should look at another engine?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: another lame lua question

Post by KDR_11k »

trepan wrote:fwiw, LuaRules/unsynced can easily swap out model
piece display lists using the UnitRendering interface ;-)
Yeah but not the weapon or the unit's behaviour (e.g. moving in range).
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: another lame lua question

Post by Argh »

fwiw, LuaRules/unsynced can easily swap out model
piece display lists using the UnitRendering interface

Can you, maybe, write an example, showing a one-time swap? I'd very, very gladly use this for a few things, it'd save a lot of trouble for a few things I'd like to try out.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: another lame lua question

Post by bobthedinosaur »

ideas for making a weapon pick up? maybe have empty base soldiers be a transport and pick up a weapon which depending on the type morphs it into that "soldier with that weapon" and could possibly drop them to go back to base soldier, how ever, while morphing how does one go about transferring the health of the old unit to the new one?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: another lame lua question

Post by KDR_11k »

Transferring health is easy, just use SetUnitHealth. Transporting stuff would be more problematic because the soldiers wouldn't know they're armed.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: another lame lua question

Post by bobthedinosaur »

hmm so detection radius?
Post Reply

Return to “Lua Scripts”