I could use some help creating a lua script,but there's some things I just don't get.I've looked at the lua script guide and was wondering what the two numbers in AddHog("Hedgehog", 0, 1, "NoHat") meant.What Does it mean?
I checked it and the second number is hedgehog's health. The first number seems to be a CPU flag. 0 is player's hog, 1 is CPU.
Couldn't you figure it yourself?
[quote=KoBeWi]
I checked it and the second number is hedgehog's health. The first number seems to be a CPU flag. 0 is player's hog, 1 is CPU.
Couldn't you figure it yourself?
[/quote]
Thanks,that really helped.
Just one more problem,I'm trying to test my script,but when I try playing it it says Some parameters not set (flags=0).What does that mean and how can I fix it?
Send me your script and I'll see if I can sort you out.
Chances are you did some kind of basic error like no closing parentheses or wrong number of parameters etc.
You have... a lot... of problems, assuming this is the actual script. :P
What I would advise you to do is, don't try make everything at once. Start simple, small, and build your way up to a fully finished script. Verify first that you can add ONE hog to the level and that map, theme, etc. details are working correctly.
Then try get your ammo working. Test the map, make sure it works.
Then fill out custom things like stuff happening every turn, victory/failure conditions etc.
Test at each stage you add something, this will reduce the work you have when you're looking for errors. Where possible, look at the scripts that have already been coded to get a feel for how other script-writers have done the things and use those as examples for how your script should be laid out and what you can/can not do.
For instance, you seem to be missing a lot of parentheses, or just not putting things in parentheses at all. Often you have the wrong number of parameters and you are also calling a lot of functions without actually saying "function", e.g.
onGameStart()
ShowMission loc("Save the World!"), loc(by doomy), loc("Ultimate Practice"), loc("Eliminate all robots before they elimiante you!")
end
should be something like:
[color=red]function[/color] onGameStart()
ShowMission[color=red]([/color] loc("Save the World!"), loc([color=red]"[/color]by doomy[color=red]"[/color]), loc("Ultimate Practice")[color=red], 0, 0 )[/color]
end
http://code.google.com/p/hedgewars/wiki/LuaAPI#AddHog_(hogname,_botlevel,_health,_hat)
Are you aware of this page?