Teleport Gun

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.

Teleport Gun

Postby Hell-met » Mon Oct 04, 2021 4:46 pm

Hello

I was wondering if such a thing was possible, a player gun sequence that just teleports you where you shoot/aim at.

Do I have to create a new action? Is this possible with decorate? I don't know where to start at this is probably too advanced for my level
Hell-met
 
Joined: 28 Oct 2019

Re: Teleport Gun

Postby Virathas » Tue Oct 05, 2021 2:11 am

It is most definately possible, although might be somewhat hacky if you want to do this with decorate. I don't have the time to create actual working code for that, but it should follow something along this lines:
First, you perform a hitscan attack (or perhaps railgun with +ripper flag, to pass through enemies. If you don't want to, it is actually slightly easier). The attack must create a new puff, and the puff needs to have a few flags set - +PUFFGETSOWNER. +ALWAYSPUFF (and +HITTRACER and +PUFFONACTORS if you want it to collide with enemies). The puff is where magic will happen, using the Target field in the puff you should be able to access the player that shot. The puff should be at the place where you hit the wall/monster. Now you'd have to move the puff slightly back and call the A_WARP with Target as the parameter and with the WARPF_MOVEPTR flag.

Like i said, this is more of a rough guideline how to achieve this effect, and it is somehat hacky.

Using Zscript it would be far easier, and it would mostly follow the same pattern. A fake line attack, move the target point slightly back and then move the player to the point.
User avatar
Virathas
 
Joined: 10 Aug 2017

Re: Teleport Gun

Postby Hell-met » Tue Oct 05, 2021 6:19 am

Thanks man (or mam) I'll check this out, experiment and report back

i'm only starting out with decorate and like many users I don't feel good enough for zscript yet
Hell-met
 
Joined: 28 Oct 2019


Return to Scripting

Who is online

Users browsing this forum: Matt and 0 guests