Gianluco Posted February 1 Related to the last post. I was trying to fix the spawner "following" the player by making an ACS script that gets its coordinates in the Spawn State and another one that spawns the actual spawner in those coordinates. Problem is, I don't know how to do it. 1 Quote Share this post Link to post
1 smeghammer Posted February 1 For ACS you likely need a world or global scope variable: https://zdoom.org/wiki/Scope 1 Quote Share this post Link to post
0 TheEvilGrin Posted February 1 You need to declare your variables outside of a script, just in your SCRIPTS file and before the scripts that use them. 0 Quote Share this post Link to post
0 Gianluco Posted February 1 1 hour ago, TheEvilGrin said: You need to declare your variables outside of a script, just in your SCRIPTS file and before the scripts that use them. I just found out about user variables and thought it would be easier by doing this: ACTOR WeaponRespawner : CustomInventory { Inventory.PickupMessage " " Inventory.PickupSound "misc/p_pkup" Inventory.Maxamount 0 -COUNTITEM +INVENTORY.QUIET +INVENTORY.AUTOACTIVATE +INVENTORY.ALWAYSPICKUP var float user_X; var float user_Y; var float user_Z; States { Spawn: MEGA A 1 { A_SetUserVar("user_X", x); A_SetUserVar("user_Y", y); A_SetUserVar("user_Z", z); } Loop Pickup: TNT1 A 1 A_SpawnItemEx("WeaponSpawnerNew", user_X, user_Y, user_Z) //This is line 67 TNT1 A 0 Stop } } But it says this: Script warning, "AmoDoom.wad:DECORATE" line 67: Self pointer used in ambiguous context; VM execution may abort! Script warning, "AmoDoom.wad:DECORATE" line 67: Self pointer used in ambiguous context; VM execution may abort! Script warning, "AmoDoom.wad:DECORATE" line 67: Self pointer used in ambiguous context; VM execution may abort! Script error, "AmoDoom.wad:DECORATE" line 67: Unsafe state call in state <unknown> which accesses user variables, reached by WeaponRespawner.Pickup. 0 Quote Share this post Link to post
0 jaeden Posted February 1 (edited) Well, I think you cannot access user variables in Pickup (or Use) states, because those states are actually not executed normally from the item's context, but "hackily" executed by CallStateChain from context of the owner (player), and it does not see the variables. Edited February 1 by jaeden 0 Quote Share this post Link to post
0 Gianluco Posted February 2 8 hours ago, jaeden said: Well, I think you cannot access user variables in Pickup (or Use) states, because those states are actually not executed normally from the item's context, but "hackily" executed by CallStateChain from context of the owner (player), and it does not see the variables. Is there anything I can do about it? Or do I go back to using ACS? 0 Quote Share this post Link to post
Question
Gianluco
Related to the last post.
I was trying to fix the spawner "following" the player by making an ACS script that gets its coordinates in the Spawn State and another one that spawns the actual spawner in those coordinates. Problem is, I don't know how to do it.
Share this post
Link to post
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.