A_Teleport

Moderator: GZDoom Developers

Post Reply
User avatar
DavidPH
Posts: 382
Joined: Fri Aug 28, 2009 1:46 pm

A_Teleport

Post by DavidPH »

A_Teleport(state teleportstate = "Teleport", string targettype = "BossSpot", string fogtype = "TeleportFog", int flags = 0, float mindist = 128, float maxdist = 0)

Attempts to teleport the actor to a SpecialSpot-derived actor that is at least mindist away and at most maxdist away. If maxdist is 0, no limit. If successful, an actor of type fogtype is spawned at the old location and calling actor is placed in the state indicated by teleportstate.

Note that despite requiring an actor at the target location, this function can be used in a monster without a specially prepared field. It should be possible, for instance, for that monster to drop SpecialSpot-derived actors around (possibly with a timed life) to teleport to later.

TF_TELEFRAG - Allow telefrag in order to teleport.
TF_RANDOMDECIDE - Randomly fail to teleport like A_Srcr2Decide.

EDIT: Removed TF_TELEPORTSOUND because it was terrible and wrong. I think TF_RANDOMDECIDE is justified, in that it's based on health in a non-linear fashion which is both useful and non-trivial to do in DECORATE.
Attachments
A_Teleport_2.patch.7z
new patch for r2324
(2.25 KiB) Downloaded 40 times
Last edited by DavidPH on Sun May 16, 2010 6:27 pm, edited 1 time in total.
User avatar
Major Cooke
Posts: 8212
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_Teleport

Post by Major Cooke »

You are like a fuckin' GENIUS!

Please include this.

DavidPH for a cacoward plz.
User avatar
DavidPH
Posts: 382
Joined: Fri Aug 28, 2009 1:46 pm

Re: A_Teleport

Post by DavidPH »

I thought you would like this one.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_Teleport

Post by Graf Zahl »

The sound implementation is rather bad. Better pass a sound name as parameter instead of hard coding to the default teleport sound.
User avatar
DavidPH
Posts: 382
Joined: Fri Aug 28, 2009 1:46 pm

Re: A_Teleport

Post by DavidPH »

Like I said, I only added the sound flag for completeness. Since you can play a sound from fogtype and in teleportstate, adding sound parameters would be redundant without being any more convenient. If the flag gets removed if the function is implemented, that would be fine.

Basically, the implementation is really bad because it's for a very obscure use. In retrospect, it was probably a case of, "Right, I can perfectly emulate the original... except for the sound. ...What will one more flag hurt?"

On the other hand, I certainly could add a sound parameter if you (or Randy) thinks it would be a good idea.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_Teleport

Post by Graf Zahl »

Either do it right or don't do it at all. Such half-assed features are not necessary.
User avatar
DavidPH
Posts: 382
Joined: Fri Aug 28, 2009 1:46 pm

Re: A_Teleport

Post by DavidPH »

Right. I'm going to drop the flag, since it's so blatantly useless the more I think about it. I added it right at the end, and should have stopped and asked myself, "How does this benefit the user?" I apologize for forgetting such an important step in development. Oh, and I thank you for pointing it out. Otherwise I may have faced a terrible fate: constantly being reminded of how much of an idiot I was adding that flag.
User avatar
ZDG
Posts: 918
Joined: Sat Jan 02, 2010 12:01 pm
Location: in SlumpEd

Re: A_Teleport

Post by ZDG »

Good coding!
User avatar
Shadelight
Posts: 5113
Joined: Fri May 20, 2005 11:16 am
Location: Labrynna

Re: A_Teleport

Post by Shadelight »

Has a Devoloper noticed this at all?
User avatar
ZDG
Posts: 918
Joined: Sat Jan 02, 2010 12:01 pm
Location: in SlumpEd

Re: A_Teleport

Post by ZDG »

Graf, of course, he's nearly on every of his CSF threads.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: A_Teleport

Post by Gez »

BlazingPhoenix wrote:Has a Devoloper noticed this at all?
Look up three and five posts above yours.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A_Teleport

Post by Graf Zahl »

added
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”