by TDRR » Tue Sep 17, 2019 9:09 pm
Void Weaver wrote:I absolutely have no idea which logic causes game crash (but can assume that game consider initiator of A_GiveInventory as Null, since giver will instntly removes by "Unmorpher" itself), but it can be fixed by calling your "Unmorpher" from external source, smth. like as:
Code: Select all
ACTOR DoomPlayerExceptItIsAMorph : DoomPlayer
{
Player.DisplayName "Doom Player except it's a morph"
Player.MorphWeapon "ChainsawForTesting"
Translation Ice
States
{
Spawn:
TNT1 A 0 NoDelay A_SpawnItemEx("UnmorpherOperator",0,0,0,0,0,0,0,SXF_SETMASTER) //Call external actor which will monitoring for unmorphing condition
Idle:
PLAY A 1
Loop
}
}
ACTOR UnmorpherOperator
{
+NOINTERACTION
States
{
Spawn:
POSS A 1 NoDelay
{
A_Warp(AAPTR_MASTER,0,0,0,0,0,"",0.5); //Just for visualization
If(GetPlayerInput(MODINPUT_BUTTONS,AAPTR_MASTER)&BT_ALTATTACK){A_GiveInventory("Unmorpher",1,AAPTR_MASTER);Return state("Null");} //Any condition; current one: "If my MASTER did press Alt-fire, then give to him "Unmorpher" and self-remove, otherwise return to cycle"
Else{Return state("");}
}
Loop
}
}
I can't use that, because GetPlayerInput can't be used in Zandronum, not from DECORATE. Also adding an external actor to the mix is probably going to stir up the clientside predictor.
So i'm thinking maybe an ACS script could be done instead and that gives the player the unmorpher item.
Tested it and... YES IT WORKED! Awesome! Thanks for the help Weaver.
[quote="Void Weaver"]I absolutely have no idea which logic causes game crash (but can assume that game consider initiator of A_GiveInventory as Null, since giver will instntly removes by "Unmorpher" itself), but it can be fixed by calling your "Unmorpher" from external source, smth. like as:
[code]ACTOR DoomPlayerExceptItIsAMorph : DoomPlayer
{
Player.DisplayName "Doom Player except it's a morph"
Player.MorphWeapon "ChainsawForTesting"
Translation Ice
States
{
Spawn:
TNT1 A 0 NoDelay A_SpawnItemEx("UnmorpherOperator",0,0,0,0,0,0,0,SXF_SETMASTER) //Call external actor which will monitoring for unmorphing condition
Idle:
PLAY A 1
Loop
}
}
ACTOR UnmorpherOperator
{
+NOINTERACTION
States
{
Spawn:
POSS A 1 NoDelay
{
A_Warp(AAPTR_MASTER,0,0,0,0,0,"",0.5); //Just for visualization
If(GetPlayerInput(MODINPUT_BUTTONS,AAPTR_MASTER)&BT_ALTATTACK){A_GiveInventory("Unmorpher",1,AAPTR_MASTER);Return state("Null");} //Any condition; current one: "If my MASTER did press Alt-fire, then give to him "Unmorpher" and self-remove, otherwise return to cycle"
Else{Return state("");}
}
Loop
}
}[/code][/quote]
I can't use that, because GetPlayerInput can't be used in Zandronum, not from DECORATE. Also adding an external actor to the mix is probably going to stir up the clientside predictor.
So i'm thinking maybe an ACS script could be done instead and that gives the player the unmorpher item.
Tested it and... YES IT WORKED! Awesome! Thanks for the help Weaver.