Page 1 of 1

[DECORATE] SXF_SETMASTER and A_KillChildren not working with players?

Posted: Sat Apr 22, 2017 7:27 pm
by FranckyFox2468
I heard they actually work on players summoning monsters but if so i guess i am doing something wrong cause i made an item that makes it so automatically executes A_KillChildren if the item is used again to avoid duplicates but it doesn't appear to be working whatsoever, here's my code:

Code: Select all

ACTOR NootTurretD : CustomInventory 12011
{
  +COUNTITEM
  +INVENTORY.INVBAR
  Inventory.MaxAmount 3
  Inventory.Icon "TURET1"
  Inventory.PickupMessage "Got a deployable turret"
  States
  {
  Spawn:
    GGND A -1
    Stop
  Use:
    TNT1 A 0 A_JumpIfInventory("GrenadeCooldown", 1, "Cooldown")
	TNT1 A 0 A_GiveInventory ("GrenadeCooldown", 1)
	TNT1 A 1 A_SpawnItemEx ("NootSummonCheck", 0, 0, 5, 56, 0, 0, 0, 1)
	TNT1 A 0 ACS_NamedExecute("GrenadeCooldown", 0)
    Fail
	Cooldown:
	TNT1 A 1
	Fail
  }
}

ACTOR NootSummonCheck
{
  Radius 10
  Height 36
  Speed 56
  Damage 0
  Projectile
  RenderStyle Add
  Alpha 0.75
  DeathSound "weapons/plasmax"
  States
  {
  Spawn:
    NOOT C 1 Bright
	NOOT C 0 A_Takefromtarget("NootTurretD", 1)
	NOOT C 0 A_givetotarget("NootSummonConfirm", 1)
    stop
  Death:
    PLSE ABCDE 4 Bright
    Stop
  }
}
ACTOR NootSummonConfirm : CustomInventory
{
+INVENTORY.ALWAYSPICKUP
+INVENTORY.AUTOACTIVATE
  States
  {
  Spawn:
    TNT1 A -1
    Loop
	Use:
	TNT1 A 1
	TNT1 A 0 A_KillChildren
	TNT1 A 0 A_SpawnItemEx ("NootTurret", 56, 0, 5, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION|SXF_SETMASTER)
	stop
  }
}
Before you ask, "Grenade cooldown" is a code i made so there is a delay between item uses so people doesn't just spam them at will.

[DECORATE] Re: SXF_SETMASTER and A_KillChildren not working with players?

Posted: Sat Apr 22, 2017 10:53 pm
by Empyre
My guess is that it is specifically KillChildren that is not working for players. The usual way to do turrets is to have it used up when the player uses it, so he has to find another one. Another idea that I have seen used before (in RO) would be to let a player pick up a turret that has been deployed so he could deploy it again. Finally, you could just rely on the cooldown to limit the rate the player can deploy turrets, even if the number of turrets is not limited.

The purpose of the setmaster is to give the player credit for the turret's kills.

[DECORATE] Re: SXF_SETMASTER and A_KillChildren not working with players?

Posted: Sat Apr 22, 2017 11:06 pm
by FranckyFox2468
Oh darn, looks like i will have to remain with limited timed turrets, heroes of the storm style. i wanted to put this to avoid spams concidering i have co-op in mind but looks like giving turrets a limited time to exist will have to do.