K_Doom Posted October 27, 2022 (edited) My question is exactly like the title. I want to know if it's possible, and if so, what ways to make an object (health bonus in this case) reappear infinitely at the same location on the map when first picked up. I thought of some code maybe involving "while True", but I didn't know how to develop it, or maybe make the items dragged by conveyor, so I would have a linedef that would teleport them to the location of the previous collected item, but the objects are not affected by the floor defined as conveyor.. I'm making the map in UDMF format. Does anyone have any suggestions? Edited October 28, 2022 by K_Doom [solved] 0 Quote Share this post Link to post
SMG_Man Posted October 27, 2022 Here is some sample ACS that will try to spawn a health bonus (and teleport fog for good measure) at a given mapspot every two seconds. If there is already a healthbonus there, it will not spawn another until it is taken. Take a look: #include "zcommon.acs" script ____ OPEN //you should name or number the script yourself { while (ThingCount(T_NONE, <Perpetual Healthbonus ID>)) { Delay(70); } SpawnSpotForced("TeleportFog", <Mapspot ID>, 0, 0); SpawnSpotForced("HealthBonus", <Mapspot ID>, <Perpetual Healthbonus ID>, 0); Delay(70); Restart; } To see this idea in action, here is a map making use of the same script for a health bonus and an armor bonus, with the armor bonus on a longer delay: scripting_example.zip Hope this helps. 2 Quote Share this post Link to post
Aurelius Posted October 27, 2022 You can also do it directly via Decorate by adding the +INVENTORY.ALWAYSRESPAWN flag and adjusting the respawn time using Inventory.RespawnTics property. More info in the Wiki: https://zdoom.org/wiki/Actor_flags#Inventoryhttps://zdoom.org/wiki/Classes:Inventory 1 Quote Share this post Link to post
K_Doom Posted October 28, 2022 On 10/27/2022 at 6:38 AM, SMG_Man said: Here is some sample ACS that will try to spawn a health bonus (and teleport fog for good measure) at a given mapspot every two seconds. If there is already a healthbonus there, it will not spawn another until it is taken. Take a look: #include "zcommon.acs" script ____ OPEN //you should name or number the script yourself { while (ThingCount(T_NONE, <Perpetual Healthbonus ID>)) { Delay(70); } SpawnSpotForced("TeleportFog", <Mapspot ID>, 0, 0); SpawnSpotForced("HealthBonus", <Mapspot ID>, <Perpetual Healthbonus ID>, 0); Delay(70); Restart; } To see this idea in action, here is a map making use of the same script for a health bonus and an armor bonus, with the armor bonus on a longer delay: scripting_example.zip Hope this helps. Thank you very much, it worked perfectly. 1 Quote Share this post Link to post
K_Doom Posted October 28, 2022 On 10/27/2022 at 11:07 AM, Aurelius said: You can also do it directly via Decorate by adding the +INVENTORY.ALWAYSRESPAWN flag and adjusting the respawn time using Inventory.RespawnTics property. More info in the Wiki: https://zdoom.org/wiki/Actor_flags#Inventoryhttps://zdoom.org/wiki/Classes:Inventory It's an interesting option, thanks for showing. 0 Quote Share this post Link to post
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.