[DECORATE] SXF_SETMASTER and A_KillChildren not working with players?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
FranckyFox2468
Forum Regular
Posts: 180
Joined: Sat May 07, 2016 8:30 pm

[DECORATE] SXF_SETMASTER and A_KillChildren not working with players?

#1

Post by FranckyFox2468 » Sat Apr 22, 2017 7:27 pm

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.

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

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

#2

Post by Empyre » Sat Apr 22, 2017 10:53 pm

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.
"For the world is hollow, and I have touched the sky."

User avatar
FranckyFox2468
Forum Regular
Posts: 180
Joined: Sat May 07, 2016 8:30 pm

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

#3

Post by FranckyFox2468 » Sat Apr 22, 2017 11:06 pm

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.

Post Reply