Squad Stuff - Page 2

Squad Stuff

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

Moderator: Moderators

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Squad Stuff

Post by Tobi »

The book "Programming in Lua" is good IMHO.
(by Roberto Ierusalimschy, Lua developer; ISBN: 85-903798-2-5)

There's still nothing that goes above a book for learning a new language IMHO.
tombom
Posts: 1933
Joined: 18 Dec 2005, 20:21

Re: Squad Stuff

Post by tombom »

imbaczek wrote:Well, Argh doesn't hide that he's not a programming guru, but a newbie; treating him bad for asking questions isn't proper.
Yeah reading it back it was really out of order - sorry Argh ;(
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Squad Stuff

Post by imbaczek »

http://www.htdp.org/2002-09-22/Book/cur ... -H-2.html#%_sec_Temp_5 - a generic book about programming.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Squad Stuff

Post by Argh »

:roll:

Look, this isn't about me. This is just a programming problem. Call me an idiot, if it makes you feel better, but in the end, this is just a problem that needs solving- I want to make squad-based spawning a normal option in Spring game designs. Nobody has been willing to put up the time to make this happen, so I've been trying to figure it out- it feeds directly into my work with map manipulation, among other areas- I need this stuff before I can make independent Gaia actors that wander maps randomly, among other things.

I'm probably the person least-equipped to make any headway on this problem, as my programming skills aren't exactly legendary, but my requests to everybody else have been met with, "program it yourself, we're not interested".

So, I'm trying.

If you have something actually useful to show me, like Mael's example code, or a better explanation for how to move stuff around from table to table than the LUA 5.1 reference guide, which I have open all the time, but am not finding particularly enlightening, you're perfectly welcome to do so. If you just want to take a poke at my admittedly-huge ego for not being entirely omnicompetant, that's fine, too, but it's a cheap thrill, tbh- picking on my programming prowess is like kicking a stupid kid under the table ;)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Squad Stuff

Post by Argh »

Oh, and Mael... you can probably solve your specific problem with Factories by calling the create-a-squad LUA via LuaCOB a frame after Create() finishes. At least, that's my working theory, I'm going to test it now...
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Squad Stuff

Post by imbaczek »

The problem with programming problems is that you won't be able to tackle them without learning to properly program... I know that time is a scarce resource and because of that I suggest an online book about programming, because this forum can only get you so far.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Squad Stuff

Post by Argh »

Success, at last. I have squads that reliably act with the initial unit. There are a couple of wrinkles, if I want it to be as nice as possible, but they're side issues, now that I understand the root causes of the problem.
User avatar
kiki
Posts: 859
Joined: 05 Nov 2007, 03:06

Re: Squad Stuff

Post by kiki »

Late to post, but the root causes seem to be basic programming concepts. Imagine using a machine that accepts boxes of apples. If you give it one apple, it wont work. However, if you give it a box of 5 apples, it will work. If you only want to give one apple, give is a box with just 1 apple in it. Does that help?
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Re: Squad Stuff

Post by Maelstrom »

Argh wrote:Oh, and Mael... you can probably solve your specific problem with Factories by calling the create-a-squad LUA via LuaCOB a frame after Create() finishes. At least, that's my working theory, I'm going to test it now...
Oh no, i have already solved it, don't worry. I was just pointing out a potential pitfall to you, cause I know it annoyed me for a while. What I ended up doing, as I mentioned in the post, was store each newly squad spawning unit in an array when they are built, and at the next GameFrame spawn the rest of the squad. I didnt want to go in to LuaCob, cause its unneeded. I know that the unit has spawned in Lua, I don't need COB to tell me that. Using LuaCOB would be introducing an extra, unneeded and, to be honest, stupid step to the whole process.
Post Reply

Return to “Lua Scripts”