+forward
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.
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.
- Galaxy_Stranger
- Posts: 1326
- Joined: Sat Aug 16, 2003 11:42 pm
- Location: Shropshire
- Contact:
+forward
A while back I experimented with using the +forward console command to impose player behavior. This was ok, but obviously not the best solution.
Is there an equivalent Decorate Actor property to the +forward console command?
Is there an equivalent Decorate Actor property to the +forward console command?
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: +forward
[wiki]A_SetAngle[/wiki]
[wiki]A_SetPitch[/wiki]
[wiki]A_ChangeVelocity[/wiki]
[wiki]A_ScaleVelocity[/wiki]
[wiki]A_Recoil[/wiki] (though A_ChangeVelocity is needed to do anything on the Z axis - but without the Z axis A_Recoil may be the closest direct equivalent to +forward/backward)
[wiki]A_CheckFloor[/wiki]
[wiki]A_SetPitch[/wiki]
[wiki]A_ChangeVelocity[/wiki]
[wiki]A_ScaleVelocity[/wiki]
[wiki]A_Recoil[/wiki] (though A_ChangeVelocity is needed to do anything on the Z axis - but without the Z axis A_Recoil may be the closest direct equivalent to +forward/backward)
[wiki]A_CheckFloor[/wiki]
- Galaxy_Stranger
- Posts: 1326
- Joined: Sat Aug 16, 2003 11:42 pm
- Location: Shropshire
- Contact:
Re: +forward
Thanks!
After playing with this for a bit, I'm using A_Recoil with a negative value - which does exactly what I want:
As you mentioned, it doesn't affect the Z-axis at all. I can turn left and right, but not up or down. Using A_ChangeVelocity simply shoves the player up or down, ignoring the mouse.
Can I invoke the +forward console command via decorate?
After playing with this for a bit, I'm using A_Recoil with a negative value - which does exactly what I want:
Code: Select all
Spawn:
POSS A 1 A_PlaySound ("fly", 1, 1.0, 1)
POSS A 1 A_Recoil(-4)
POSS A 1 A_ChangeVelocity (0, 0, 1, CVF_RELATIVE)
Loop
Can I invoke the +forward console command via decorate?
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: +forward
No.
- Galaxy_Stranger
- Posts: 1326
- Joined: Sat Aug 16, 2003 11:42 pm
- Location: Shropshire
- Contact:
Re: +forward
Finally figured it out with the help TheMisterCat on the Zandronum IRC. I'm not a math person...
This is my solution:
And VOYLAY! YOUR OWN JET TO PILOT!
This is my solution:
Code: Select all
// Actor properties to limit player control:
Player.ForwardMove 0.00, 0.00
Player.SideMove 0.00, 0.00
Code: Select all
States
{
POSS A 1 A_PlaySound ("jetengine", 1, 1.0, 1) // Play engine/flight sound.
POSS A 1 SetPlayerProperty(0, 1, 3) // Set fly property.
POSS A 1 A_Recoil(-4) // Set player movement.
POSS A 1 A_ChangeVelocity(0, 0, -sin(pitch)*5, CVF_RELATIVE) // Affect the z-height based on pitch.
LOOP
}
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: +forward
Now that you're using A_ChangeVelocity, you don't even need A_Recoil any more.
- Galaxy_Stranger
- Posts: 1326
- Joined: Sat Aug 16, 2003 11:42 pm
- Location: Shropshire
- Contact:
Re: +forward
I tried that first and couldn't get it to move straight forward - it would always slide to the side.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: +forward
Works fine for me. (*Plug plug*)
- Galaxy_Stranger
- Posts: 1326
- Joined: Sat Aug 16, 2003 11:42 pm
- Location: Shropshire
- Contact:
Re: +forward
You're absolutely right!
Code: Select all
A_ChangeVelocity (-Cos(Pitch) * -10, 0, -Sin(Pitch) * 10, 1)