Page 2 of 2

Re: Squad Stuff

Posted: 06 Jan 2008, 15:11
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.

Re: Squad Stuff

Posted: 06 Jan 2008, 15:40
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 ;(

Re: Squad Stuff

Posted: 06 Jan 2008, 16:51
by imbaczek
http://www.htdp.org/2002-09-22/Book/cur ... -H-2.html#%_sec_Temp_5 - a generic book about programming.

Re: Squad Stuff

Posted: 06 Jan 2008, 22:09
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 ;)

Re: Squad Stuff

Posted: 06 Jan 2008, 22:15
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...

Re: Squad Stuff

Posted: 06 Jan 2008, 22:20
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.

Re: Squad Stuff

Posted: 07 Jan 2008, 03:12
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.

Re: Squad Stuff

Posted: 07 Jan 2008, 03:51
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?

Re: Squad Stuff

Posted: 07 Jan 2008, 09:55
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.