Is ThrustThing a DECORATE function?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
bleant
Posts: 224
Joined: Thu Jan 20, 2011 9:37 am

Is ThrustThing a DECORATE function?

Post by bleant »

I want to use this in my mod to make realistic sprinting. But I don't know if it's ACS or DECORATE
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Is ThrustThing a DECORATE function?

Post by FDARI »

[wiki]Action_functions[/wiki] lists most or all action functions (decorate). It also tells you that "You may also use any action special in place of an action function".
[wiki]Action_specials[/wiki] lists most or all action specials (can be used in decorate, acs and in thingspecials and linespecials in map editor).

[wiki]ThrustThing[/wiki] is an action special, which you could use; but decorate offers a better solution.
[wiki]A_ScaleVelocity[/wiki] is an action function (decorate) which you can use to increase the actor's current velocity, whatever its present course (strafing, falling, being pushed back by explosion).
[wiki]A_ChangeVelocity[/wiki] is an action function which you can use to set a new speed for the actor, or modify its current speed, using either the actor's angle, or absolute directions.

I normally don't ask, but: Did you try finding this information on your own?
User avatar
bleant
Posts: 224
Joined: Thu Jan 20, 2011 9:37 am

Re: Is ThrustThing a DECORATE function?

Post by bleant »

... Yes i did, but i did in the simpliest way possible, because i had this thought in my head:

"In order to make sprinting, when the player enters the sprint state, he'll have to be thrusted forward"

So i just went to the wiki and searched "thrust", since i found something, i stopped searching :P

I'm a simple person.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Is ThrustThing a DECORATE function?

Post by FDARI »

I suppose that's the difference between searching and researching.

Regarding your wish for a sprint state: Be aware that player states are not easy to work with. Firing guns, taking hits, moving about and stopping can all happen in various orders and with overlap, and there may be state changes triggered by such events. You will not have a single state available that is in effect whenever the player is running.

It might be easier to achieve this using ACS.

Relatively simple ACS script flow:

Script stage 1: Check player input (delay 1 or more between each check, 5 is probably good enough). Repeat until RUN is pressed.
Script stage 2: Scale up player speed.
Script stage 3: Wait for a little while. Check continously (delay 1 between each check) that RUN is still pressed. When time is up or RUN is released, move on.
Script stage 4: Scale player speed back to 1.0 (100%).
Script stage 5: Wait a fixed amount of time before resetting the script to stage 1, allowing the player to sprint again.

(Without modification, the above flow will have the player bursting into sprint several times during a long run; but it is still a good way to start, if it works.)

[wiki]SetActorProperty[/wiki] (allows you to make changes to a player's speed)
[wiki]GetPlayerInput[/wiki]
User avatar
bleant
Posts: 224
Joined: Thu Jan 20, 2011 9:37 am

Re: Is ThrustThing a DECORATE function?

Post by bleant »

I guess learning ACS will help me in big ways, out i go, to learn it.

However, the problem is, i want the player to sprint ONLY forward, not backwards, not sideways, forward, so that's why i wanted to use thrust.

About overlapping and that stuff, i can do it, dummy inventory items are useful, you know.
Locked

Return to “Editing (Archive)”