Scripting: How to make hedgehogs look like winners?
Mon, 2015-07-27 17:21
How can I make hedgehogs look like winners (the "awesome" face, like after they have won a normal match) with Lua scripting only?
I have already tried to use this code:
SetState(myHedgehog, gstWinner)
And this:
SetState(myHedgehog, bor(GetState(myHedgehog), gstWinner))
Both won't work. The hedgehog just looks like a normal hedgehog.
I noticed that sometimes the "awesome" face appears when the hedgehog is also moving/flying around (but never when the hedgehog stands on the ground). I have no idea why.
Hi, I am a Hedgewars developer.
Unfortunately gstWinner clears itself once you are done falling, 'cause it was intended to be a cute little effect, not really manipulated by lua which didn't even exist at the time.
if (not isFalling)
and (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _3) then
begin Gear^.State:= Gear^.State and (not gstWinner);
If a gear is active, it is gonna get the state cleared pretty much the instant you set it, unless it has a dY or the hog isn't touching the ground.
You could keep the hog hovering above the ground by manipulating Y or dY, but that's not really a good idea in terms of not freezing up the game state, sorry.
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev
While this isn't going to work with every hog, I assume your intention is to use this in your single hog TargetPractice missions that you were editing earlier today. If so, you can simply use:
ParseCommand("taunt " .. string.char(3))
mikade
Hedgewars Developer