Spring Object - Reverse Spring Effect?

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.

Spring Object - Reverse Spring Effect?

Postby Blackgaze » Sun Oct 29, 2017 11:06 am

Hi, I'm working on a Sonic the Hedgehog DOOM wad. I'm trying to recreate a similar "spring" bells that pushes targets away when overlapping.

My current code works, however... its based on the direction the player is looking.

So a player overlaps a spring bell, gets pushed back. This part works fine
But if it collides another spring bell while being pushed backed it does not reverse the effects, as the direction of the player it the same it keeps getting pushed back the same direction, instead of the opposite.

How do I solve this issue?

ACTOR StarBounce : CustomInventory 23463
Inventory.maxamount 1
SPRG A 4 Bright
SPRG B 0 A_Playsound ("StarPing")
SPRG B 2 ThrustThing(angle*256/360+128, 50, 1, 0)

Please note I don't want to turn the player 180' when pushing. This would solve it, buts it's not the way I want the springs to work.
User avatar
Joined: 24 Aug 2012

Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest