A_Teleport
Moderator: GZDoom Developers
A_Teleport
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.
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.
- 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
You are like a fuckin' GENIUS!
Please include this.
DavidPH for a cacoward plz.
Please include this.
DavidPH for a cacoward plz.
Re: A_Teleport
I thought you would like this one.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_Teleport
The sound implementation is rather bad. Better pass a sound name as parameter instead of hard coding to the default teleport sound.
Re: A_Teleport
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.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_Teleport
Either do it right or don't do it at all. Such half-assed features are not necessary.
Re: A_Teleport
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.
Re: A_Teleport
Good coding!
- Shadelight
- Posts: 5113
- Joined: Fri May 20, 2005 11:16 am
- Location: Labrynna
Re: A_Teleport
Has a Devoloper noticed this at all?
Re: A_Teleport
Graf, of course, he's nearly on every of his CSF threads.
Re: A_Teleport
Look up three and five posts above yours.BlazingPhoenix wrote:Has a Devoloper noticed this at all?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49234
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_Teleport
added