help on scripting bounce pads inspired by a quake mod

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
naturd93
Posts: 7
Joined: Thu Nov 28, 2024 9:43 pm
Operating System Version (Optional): windows 11

help on scripting bounce pads inspired by a quake mod

Post by naturd93 »

Recently I played a quake mod called remobilized. It uses these bounce pads that bounce you back up to the height you jumped from. I've tried to use acs scripting to put something like this in my maps, but I can't get anything I try to work. How could I get what I'm trying to do to work?
User avatar
Player701
 
 
Posts: 1707
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: help on scripting bounce pads inspired by a quake mod

Post by Player701 »

Haven't played the Quake mod, but the easiest option to create a bounce pad is to use a sector action in combination with ThrustThingZ. Here's an example map:

bounce_pad.wad
(4.56 KiB) Downloaded 14 times

You can also call ThrustThingZ from an ACS script and do something else there (e.g. play a sound effect).
User avatar
axredneck
Posts: 424
Joined: Mon Dec 11, 2017 2:09 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Arch
Graphics Processor: nVidia with Vulkan support
Location: Russia
Contact:

Re: help on scripting bounce pads inspired by a quake mod

Post by axredneck »

Also afaik "Hunter's Moon" wad has many features from Quake 3.
naturd93
Posts: 7
Joined: Thu Nov 28, 2024 9:43 pm
Operating System Version (Optional): windows 11

Re: help on scripting bounce pads inspired by a quake mod

Post by naturd93 »

yeah but to make the bounce pads like the ones in the mod, you have to get bounced back up accordingly to the height you were previously at. Like if I fell from a 256 unit heigh ledge, it would bounce me back up to that specific ledge. but if I fell from a 128 unit heigh ledge, it bounces me up to there. I'll send a video of gameplay to explain it better.
naturd93
Posts: 7
Joined: Thu Nov 28, 2024 9:43 pm
Operating System Version (Optional): windows 11

Re: help on scripting bounce pads inspired by a quake mod

Post by naturd93 »

User avatar
Player701
 
 
Posts: 1707
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: help on scripting bounce pads inspired by a quake mod

Post by Player701 »

naturd93 wrote: Sat Nov 30, 2024 9:37 pm you have to get bounced back up accordingly to the height you were previously at
I see. Then you need to use a script to store either the height the player last fell from, or, better yet, the thrust force to apply when they touch the floor and bounce. Here is a proof of concept using the latter method. The first script runs when the player walks over any of the four ledges - it stores the received argument value (the force) in a map variable. The second script, triggered when walking over the bounce pad, reads the stored value from the variable to apply the thrust force.
Attachments
bounce_pad_v2.wad
(19.62 KiB) Downloaded 11 times
naturd93
Posts: 7
Joined: Thu Nov 28, 2024 9:43 pm
Operating System Version (Optional): windows 11

Re: help on scripting bounce pads inspired by a quake mod

Post by naturd93 »

thanks for the help. never knew it had to do with the player count. I originally make a script where it gets the player's height distance from the floor and used that as the thrust. But when I used that script it did nothing when I hit the bounce pad
User avatar
Player701
 
 
Posts: 1707
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: help on scripting bounce pads inspired by a quake mod

Post by Player701 »

naturd93 wrote: Mon Dec 02, 2024 9:01 pm thanks for the help. never knew it had to do with the player count.
The player count is there to ensure multiplayer support. If you don't want it, you can remove all PlayerNumber() indexing and replace the array with a scalar variable. I try to always consider multiplayer when possible, though.
naturd93 wrote: Mon Dec 02, 2024 9:01 pm I originally make a script where it gets the player's height distance from the floor and used that as the thrust. But when I used that script it did nothing when I hit the bounce pad
Not that simple, unfortunately. First, the player needs to be in the air at the time you read the distance. And while the thrust force does of course correlate with it, the dependency seems to be non-linear and definitely not 1:1. In the example map, I had to adjust the force for each ledge manually after some experimentation.
Post Reply

Return to “Scripting”