Here is a weird one. I've got a character that calls thrusthtingz in its see state. The funny thing in in opengl mode he hops one and never again, despise the sequence being looped. In software mode, it behaves normally. Weird huh.
Here is an example of the problem. Tested with the latest zdoom and gzdoom confirms the problem is still there.
It won't hop
Moderator: Graf Zahl
-
- Posts: 66
- Joined: Wed Jul 13, 2005 9:39
- Location: Lancaster PA
It won't hop
You do not have the required permissions to view the files attached to this post.
-
- Developer
- Posts: 4753
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
Re: It won't hop
Actually, I don't find that it works properly in software (Zdoom) either. For me, it jumps once, as you said, then every subsequent time he vibrates slightly as ThrustThingZ is called, but it's certainly not a jump.
However, I found 2 solutions:
1) Giving the jumping frame a duration that is long enough for the jump to complete (I used 8, but it was just a quick test (3 wasn't long enough)) seems to make the actor behave as you want.
2) if you want the actor to animate during the jump, this worked quite nicely.
Obviously durations etc would need to be tweaked.
As for the actual problem, it would seem that A_Wander is cancelling (or semi cancelling) the thrust. Quite why that doesn't happen the first time, I have no idea.
However, I found 2 solutions:
1) Giving the jumping frame a duration that is long enough for the jump to complete (I used 8, but it was just a quick test (3 wasn't long enough)) seems to make the actor behave as you want.
2) if you want the actor to animate during the jump, this worked quite nicely.
Code: Select all
POSS A 8
POSS CC 2
POSS C 0 ThrustThingZ(Tid, 24, 0, 0)
POSS EEEDDBB 2
POSS EEEDDBB 2 A_Wander
loop
As for the actual problem, it would seem that A_Wander is cancelling (or semi cancelling) the thrust. Quite why that doesn't happen the first time, I have no idea.
-
- Posts: 66
- Joined: Wed Jul 13, 2005 9:39
- Location: Lancaster PA
Re: It won't hop
I'd like to have the character moving forward while (or shortly after he leaves the ground) in the air, so I'll have to play with how long its going to take to get him at a good point in the arc before he can start moving and mucking things up.
-
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
Re: It won't hop
It doesn't happen the first time because the 'reactiontime' counter has not counted down to zero yet.
In any case, any monster movement functions (A_Wander, A_Chase, etc) call an internal function (P_Move) to do the actual movement which contains this code to keep walkoing monsters on the floor:
and this clearly interferes with what you are doing here. The only chance you have is setting MaxStepHeight to 0 but then your hopping monster won't be able to climb stairs (except for hopping, of course.)
In any case, any monster movement functions (A_Wander, A_Chase, etc) call an internal function (P_Move) to do the actual movement which contains this code to keep walkoing monsters on the floor:
Code: Select all
// [RH] Instead of yanking non-floating monsters to the ground,
// let gravity drop them down, unless they're moving down a step.
if (!(actor->flags & MF_NOGRAVITY) && actor->z > actor->floorz
&& !(actor->flags2 & MF2_ONMOBJ))
{
if (actor->z > actor->floorz + actor->MaxStepHeight)
{
return false;
}
else
{
actor->z = actor->floorz;
}
}