How many different gears are there?

3 replies [Last post]
mikade
mikade's picture
User offline. Last seen 45 weeks 4 days ago. Offline
Joined: 2010-10-22
Posts: 355

So I got myself lua, started looking at Smaxx's unfinished Hedgewars Lua API documentation and some of the scripts from the training missions.

My questions are: How many gears are there in .13?
And .14?
What are their names?

I assume that barrels and mines are also gears? I read somewhere that .13 doesn't have case (crate) gears. For now that's a pity, but I look forward to it in the next version!

Is there a list somewhere of the public/global variables and functions like FindPlace, GetGearType, SetGearPosition etc?

Thanks in advance! Smile

mikade
Hedgewars Developer

mikade
mikade's picture
User offline. Last seen 45 weeks 4 days ago. Offline
Joined: 2010-10-22
Posts: 355

update: Spent about 5 hours playing around in Lua. I have a much better idea as to what's going on, now and have achieved some pretty interesting results. With a properly working "Using a Weapon Doesn't End Your Turn" mode I reckon I could make some pretttty cool missions. I'm tempted to try update my windows version to experimental .14 but I don't know how. :S
Maybe I'll just wait and work on what I've got so far.

Think I've worked out (most / a lot) of the gears, too.

Between Cairo and I we seem to have worked out every weapon code except for that darned Hellish Hand-grenade! Smile

Is there a variable I can change to control wind speed / direction?
edit: I'm told not in .13. Maybe in the future release? Would allow for some awesome missions.

mikade
Hedgewars Developer

Henek
Henek's picture
User offline. Last seen 6 years 23 weeks ago. Offline
Joined: 2010-04-06
Posts: 55

Actually you can change wind speed by adding the gear gtATSmoothWindCh and setting the tag like this:

Quote:
local gear = AddGear(0, 0, gtATSmoothWindCh, 0, 0, 0, 1)
SetTag(gear, 72)

this is max speed towards right, left is negative and 0 is no wind
note: wind will still change every turn

you can write it in a single line to if you want to:

Quote:
SetTag(AddGear(0, 0, gtATSmoothWindCh, 0, 0, 0, 1), 72)

same goes for water rise:

Quote:
SetTag(AddGear(0, 0, gtWaterUp, 0, 0, 0, 0), 47)

where the tag must be higher then 0

maybe there will be a nicer solution next release, but that isn't really needed, hope this helps
by the way: http://code.google.com/p/hedgewars/wiki/LuaAPI

One of those hedgewars developers. I am specially knowledgeable in lua scripting, and the father of gameplay scripts.

mikade
mikade's picture
User offline. Last seen 45 weeks 4 days ago. Offline
Joined: 2010-10-22
Posts: 355

Brilliant work! (And nice work with the water, too). Thanks for the post. I wish I had had that API two weeks ago when I still knew nothing. But sitting there for hours puzzling things out was an interesting learning experience, I guess :P

Now I just need 0.9.14 and I can start making things happen Smile

mikade
Hedgewars Developer

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]