ZDaemon Forum Index ZDaemon
Client/Server DOOM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Script activator is lost after morphing

 
Post new topic   Reply to topic    ZDaemon Forum Index -> Fixed Bugs
View previous topic :: View next topic  
Author Message
Body-Guard
Spamming!


Joined: 08 Jan 2006
Location: Hungary

PostPosted: Fri Jan 11, 2013 3:49 pm    Post subject: Script activator is lost after morphing Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
phenex2
Spamming!


Joined: 10 Jan 2008

PostPosted: Mon Jan 14, 2013 4:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Body-Guard
Spamming!


Joined: 08 Jan 2006
Location: Hungary

PostPosted: Mon Jan 14, 2013 10:19 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
phenex2
Spamming!


Joined: 10 Jan 2008

PostPosted: Mon Jan 14, 2013 1:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
Body-Guard
Spamming!


Joined: 08 Jan 2006
Location: Hungary

PostPosted: Mon Jan 14, 2013 2:11 pm    Post subject: Reply with quote

Well it is a pretty straightforward test wad, so I don't think there is anything wrong with that.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Body-Guard
Spamming!


Joined: 08 Jan 2006
Location: Hungary

PostPosted: Sun Apr 07, 2013 10:33 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Krawa
Spamming!


Joined: 23 Nov 2008
Location: #SDA

PostPosted: Sun Feb 11, 2018 11:09 pm    Post subject: Reply with quote

Demo wad: morph_test_2
Back to top
View user's profile Send private message Send e-mail
UberGewei
Spamming!


Joined: 01 Sep 2010
Location: The Netherlands

PostPosted: Sun Feb 11, 2018 11:19 pm    Post subject: Reply with quote

Krawa wrote:
Demo wad: morph_test_2


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
View user's profile Send private message Visit poster's website
Krawa
Spamming!


Joined: 23 Nov 2008
Location: #SDA

PostPosted: Tue Feb 13, 2018 8:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Kilgore
Air Cavalry


Joined: 17 Jun 2003
Location: Up the river

PostPosted: Wed Feb 14, 2018 1:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
UberGewei
Spamming!


Joined: 01 Sep 2010
Location: The Netherlands

PostPosted: Mon Apr 09, 2018 11:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
UberGewei
Spamming!


Joined: 01 Sep 2010
Location: The Netherlands

PostPosted: Sun Jun 24, 2018 1:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Krawa
Spamming!


Joined: 23 Nov 2008
Location: #SDA

PostPosted: Mon Jul 16, 2018 6:49 pm    Post subject: Reply with quote

Fixed for 1.10.05.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    ZDaemon Forum Index -> Fixed Bugs All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group