Long story short, I needed to make coins chase the player when he gets in specific range. After lots of head banging I realised that sometimes the answer is very, very simple. As promised, here's the code which makes coins follow you.
Code: Select all
Actor DRCoinPickup : CustomInventory
{
Height 15
Radius 20
Speed 5 //Change that for faster coins.
+INVENTORY.NOSCREENFLASH
Inventory.PickupSound "Cash/CoinPickup"
States
{
Spawn:
COIN A 0 A_CheckProximity("ISeeYou", "DoomPlayer", 256, 1, CPXF_ANCESTOR)
COIN ABCDEF 2
Loop
ISeeYou:
COIN ABCDEF 2 A_Chase
Goto Spawn
Pickup:
TNT1 A 0 A_GiveInventory("DRCash")
Stop
}
}