Quick 'is it possible with lua (or otherwise)' Question

Quick 'is it possible with lua (or otherwise)' Question

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

Moderator: Moderators

Post Reply
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Quick 'is it possible with lua (or otherwise)' Question

Post by Warlord Zsinj »

Okay, so, I have a very important building. Let's call it building X. ;)

Building X is a very complicated and essential part of my design. It needs to look big and evil, so I want to position a bunch of guards around the building, which don't only look cool, but also act as a defensive mechanism when it comes under attack.

Now, I could just make these infantry models child pieces of the building X model, and then mount them as turrets.

However, I would prefer if these units were actually spawned units, because:
- They have individual health, and can be killed individually
- They can be respawned individually
- They don't eat up UVmap space for texturing Building X
- Numerous advantages by having an actual unit be present with it's own personal AI and weapon ID's rather then just being a faked unit that is really a turret attached to a building

The problem with this is that it is essential that these guards:
1) Stand guard at designated positions around the building. Like, two outside doors, etc. This is more complicated then it seems; they need to stand straight at attention, and be facing the right direction.
2) When the building comes under attack, they need to move to designated areas on the model (eg: sandbagged areas), from where they can fire at the enemy. Preferably I'd want them to occupy these positions, though simply keeping them rooted where they are is an acceptable alternative which I can design around.
3) If the building is no longer under attack, the units need to move back to their original positions in number 1)
4) When a unit is killed, and the building respawns him (probably on say, a 45 second timer), that new unit needs to move to an unoccupied position (ie: the position of the previously killed unit), not to a position that is random or already taken.

Most of the numbered points I can accomplish through a complex animation sequence (except for the killing/replacing of units, which would take a zwzsg-esque script), but this removes all the advantages I noted in the dashed points, which are really cool, and allow me a lot more flexibility in the design.

The infantry units are not standard infantry troops employed in regular use, and can have their own private scripts attached that don't need to work for general combat-unit usage.

... So, scripting gurus, can the dashed points and the numbered points be resolved to accomplish what I need through LUA?

Presume (more or less correctly) that I have no foreknowledge of LUA methods or implications.

Other ideas as to how I might resolve this concept in a similar way to what I need are always welcome.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

WZ, I'm inclined to say yes, because LUA pretty much owns at this point in time in terms of implementation.

And if you're talking about implementing this for the IMP HQ, i hope to god this is last on the list of stuff to do. It'll tie a perfectly good scripter up for a week or two...
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

I pretty much need a yes or no answer from someone who knows how LUA works, because I need to commit to a certain design now, rather then later when I have the potential to waste time on something that cannot work.

And I said it was building X ;)
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

I think it's possible thanks to the GiveOrderToUnit, CreateUnit, and RemoveUnitCmdDesc LuaRules commands. Only trepan, however, can give you the final answer, I'm definitely not a Lua Guru.

The good news is that once you know how to use LuaRules, I think your plans are quick and easy to implement. The bad news is that there is no documentation yet.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

And the other good news is that when you figure out how to do this we can steal it and use the same principles to make functional carriers (either StarCraftian or Just Aircraft Carriers)
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Could I perhaps then encourage us to get together and pull the code together mutually, which would then be released freely for everyone to use (ie: no GPL etc)?

Otherwise I'm going to have to try and hunt out a talented scriptor, or hope that one of the bos scripters I have on-hand can work it out, and that might unfortunately mean waiting for the documentation to appear...

Looking forward to hearing from trepan about this too.
Lippy
Posts: 327
Joined: 16 Jul 2006, 00:24

Post by Lippy »

Warlord Zsinj wrote:Could I perhaps then encourage us to get together and pull the code together mutually, which would then be released freely for everyone to use (ie: no GPL etc)?
GNU GPL stands for General Public Licence; I think you wanted to say "i.e. like GPL"
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

GPL is different from "Public Domain" which is what he wants.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

creative commons eats your petty gpl.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Arr, the point being that I need to get this done, and I'd love some help in this regard, which would not only be fairly attributed in the credits of SWS (uh... not that it's for SWS... >_> <_< ), but also be released freely for any mod to use, so that it's a collective effort to improve a number of mods through this lua stuff. Essentially, we're all pretty new here, and don't know what we're doing, so I think it'd be a useful thing to work through some of the stuff together.

It doesn't really have to building X either, it could be an aircraft carrier, like sinbad says. The point is that we get our feet wet with this lua stuff together, rather then on our own, so that all of our mods can benefit.
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

quantum wrote:I think it's possible thanks to the GiveOrderToUnit, CreateUnit, and RemoveUnitCmdDesc LuaRules commands.
I missed the "SetUnitNoSelect" command which might be used instead of "RemoveUnitCmdDesc".

#lua is probably the best place to find help.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

For some reason, quakenet keeps telling me I have been klined from the server, though I've never tried to join it before...
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

Oh, I forgot to mention I'm talking about #lua in the lobby.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

ah, thanks, I'll check that out.

Still though, timezones being what they are, some discussion in here would be nice. Having the permanent record is good too. I'll have to see if any of SWS's scripters want to get the ball rolling...
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Warlord Zsinj wrote:For some reason, quakenet keeps telling me I have been klined from the server, though I've never tried to join it before...
What's your ISP?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

optusnet.
Post Reply

Return to “Lua Scripts”