View previous topic :: View next topic |
Author |
Message |
Body-Guard Unstoppable!
Joined: 08 Jan 2006 Location: Hungary
|
Posted: Fri Jan 11, 2013 3:49 pm Post subject: Script activator is lost after morphing |
|
|
This bug is separated from this topic to conform the bug report "one bug-one topic" rule and it actually may get a chance getting looked into...
The following bug was encountered while morphing the player in Doom to chicken player.
When the player is morphed after activating a script, he is no longer going to be the activator, so the script activator is lost. There is no way to reference to the player in the script afterwards. |
|
Back to top |
|
|
phenex2 Unstoppable!
Joined: 10 Jan 2008
|
Posted: Mon Jan 14, 2013 4:50 am Post subject: |
|
|
does zdoom remember the activator?
if TIDs are transfered during morphing would you be able to reference the actor through TIDs instead? |
|
Back to top |
|
|
Body-Guard Unstoppable!
Joined: 08 Jan 2006 Location: Hungary
|
Posted: Mon Jan 14, 2013 10:19 am Post subject: |
|
|
ZDoom does remember the activator, although it turned out that Zdoom doesn't transfer the TIDs between forms, so it is not needed to change that, only make it remember the activator. I've made this test wad, the switch on the right prints your current TID, and the one on the left morphs you into chicken.
http://speedy.sh/k5yGD/tidlose.zip |
|
Back to top |
|
|
phenex2 Unstoppable!
Joined: 10 Jan 2008
|
Posted: Mon Jan 14, 2013 1:29 pm Post subject: |
|
|
when you check a_morph.cpp from zdoom you'll see that the P_MorphPlayer and P_UndoPlayerMorph functions actually explicitly transfer the TID. Either the demo wad you use to test is not working right or the zdoom implementation doesnt work. |
|
Back to top |
|
|
Body-Guard Unstoppable!
Joined: 08 Jan 2006 Location: Hungary
|
Posted: Mon Jan 14, 2013 2:11 pm Post subject: |
|
|
Well it is a pretty straightforward test wad, so I don't think there is anything wrong with that. |
|
Back to top |
|
|
Body-Guard Unstoppable!
Joined: 08 Jan 2006 Location: Hungary
|
Posted: Sun Apr 07, 2013 10:33 am Post subject: |
|
|
Any more thoughts on this? Just as well as TID inheriting, I don't see any reason why shouldn't be the script activatorness inherited as well after morphing. It's just makes sense. |
|
Back to top |
|
|
Krawa There is a limit
Joined: 23 Nov 2008 Location: #SDA
|
Posted: Sun Feb 11, 2018 11:09 pm Post subject: |
|
|
Demo wad: morph_test_2 |
|
Back to top |
|
|
UberGewei SuperAntler
Joined: 01 Sep 2010 Location: The Netherlands
|
Posted: Sun Feb 11, 2018 11:19 pm Post subject: |
|
|
Thanks for the upload Krawa, appreciated.
First switch: Tags you with a TID (PlayerNumber + PLAYERTIDBASE).
Second switch: A for loop that checks if your TID is present in Activator[MAXPLAYERS], second time you press it, it saves your TID.
Third switch: Morphs you into a chicken.
Fourth switch: Starts a while loop (you shouldn't be able to activate it twice since you are the activator, even after being morphed).
Fifth switch: Starts a delay (20*35) ( you shouldn't be able to activate it again until the delay has ended (even after being morhped).
Krawa and I will do some more testing tomorrow.
We didn't run into any problems today.
My project depends heavily on player TIDs, since it has a database attached to it etc.
Morphing players into dopefishes is one of its key features and never ran into this problem myself.
Atleast, not in one of ZDs' recent releases. |
|
Back to top |
|
|
Krawa There is a limit
Joined: 23 Nov 2008 Location: #SDA
|
Posted: Tue Feb 13, 2018 8:33 pm Post subject: |
|
|
Tested and it's fixed. Maybe it was fixed during some Hexen work.
Thanks to UberGewei for helping.
Edit: not fixed yet.
Last edited by Krawa on Sun Jun 24, 2018 1:47 pm; edited 1 time in total |
|
Back to top |
|
|
Kilgore Air Cavalry
Joined: 17 Jun 2003 Location: Up the river
|
Posted: Wed Feb 14, 2018 1:33 pm Post subject: |
|
|
Are you sure it's fixed? you guys are talking about TIDs (which DO work), but I think Body-Guard complains about the activator: not the TIDs. Can you please check that guys? TIA. |
|
Back to top |
|
|
UberGewei SuperAntler
Joined: 01 Sep 2010 Location: The Netherlands
|
Posted: Mon Apr 09, 2018 11:24 pm Post subject: |
|
|
Kilgore wrote: | Are you sure it's fixed? you guys are talking about TIDs (which DO work), but I think Body-Guard complains about the activator: not the TIDs. Can you please check that guys? TIA. |
There's two buttons in the wad that don't assign TIDS, but run a script for the activator instead. We've tried to reproduce the problem Body-Guard describes through these. But that didn't work.
However, I was messing around with enter scripts and player morphing lately and actually managed to reproduce the problem accidentally (meaning that this bug is NOT fixed).
Working on a demo wad. |
|
Back to top |
|
|
UberGewei SuperAntler
Joined: 01 Sep 2010 Location: The Netherlands
|
Posted: Sun Jun 24, 2018 1:44 pm Post subject: |
|
|
Here's a new test wad.
http://85.214.149.120/demowads/morph_test_26618.wad
How to reproduce?
Press the first switch on the left, it runs a script for the player.
It prints the player's name. Then press the switch on the right. You can see that after morphing the activator is lost as it prints "DoomPlayer".
Tested with zdoom 2.8.1 aswell and the activator stays.
https://www.dropbox.com/s/q2u11n0myv9o4jr/morph_test_26618.zip?dl=1
Code: | #define SEC 35
Script 1 (void)
{
int player = playernumber();
while(true)
{
delay(1*SEC);
print(s:"Script activated by: ", n:player);
}
} | [/url] |
|
Back to top |
|
|
Krawa There is a limit
Joined: 23 Nov 2008 Location: #SDA
|
Posted: Mon Jul 16, 2018 6:49 pm Post subject: |
|
|
Fixed for 1.10.05. |
|
Back to top |
|
|
|