Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Mewdoom

zdoom SpawnItemEx with JumpIfInventory ?

Recommended Posts

Hello guys,
I have an actor that spawnitem, I want to know if the item spawned correctly so I use JumpIfInventory, but it look like the A_GiveInventory doesnt work because it doesnt jump to "Stuck2" ..it always jump to stuck1 ...


calling actor:
SUC1 A 0 Bright A_SpawnItemEx("WalkFire1",0,0,0,1,0,0,0,SXF_SETTARGET )
TNT1 A 0 A_JumpIfInventory("Ammo", 1, "Stuck2")
Goto Stuck1


ACTOR WalkFire1
{

+MISSILE
+NODROPOFF
+RANDOMIZE
//+PAINLESS
+RIPPER // ajouté
+NOTELEPORT // ajouté
Scale 1.5
Speed 1
Damage 1 // ajouté
Damagetype "HellFire" // ajouté
Obituary "%o was scorched by a Succubus" // ajouté

RENDERSTYLE ADD
ALPHA 0.67
States
{
Spawn:
TNT1 A 1
FRTF A 3 Bright
FRTF A 0
FRTF B 3 Bright
FRTF B 0
FRTF C 3 Bright
FRTF C 0
FRTF C 0
TNT1 A 0 A_SpawnItemEx("DropFire")
FRTF DEFGHIJKLMNO 3 Bright
TNT1 A 0 A_GiveInventory("Ammo", 1, AAPTR_TARGET)

Stop
Death:
FRTF C 0 A_CheckFloor("Spawn")
Stop

}
}

Share this post


Link to post

Your A_Jump depends in inventory type "Ammo".
Ammo is a base class for all ammunition types which you should never own. You should try this with an inventory item you define yourself somewhere.

But I think the real problem is that you check the inventory long before the spawned actor hands out the item, but its hard to tell because you posted only a fragment of your calling actor.

Can you explain in more detail what you intend to do?

Share this post


Link to post

Thanks for your help, I found the bug :) it is because the spawnitem doest have enough time to give the item before check for the item in the master actor :)

I use this method to check if the fire appear, because ifnot that mean the actor is stuck on wall :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×