A_JumpIfInventory not working!

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

A_JumpIfInventory not working!

Post by XASSASSINX »

So i'm making a special imp that after doing certains actions, he simply faint. I tried using A_JumpifInventory (Like the wiki say's) but for some reason, nothing happens! He don't faint at all! Here's the code:

Code: Select all

ACTOR TiredImp : DoomImp
{
 Obituary "%o was burned by a tired imp. Then he slept."
 Health 45
 Speed 6
 States
 {
 See:
  TROO ABCD 6 A_Chase
  TROO A 0 A_GiveInventory("SleepTimer", 1) 
  TROO A 0 A_JumpIfInventory("SleepTimer", 5, "Faint") 
  Loop
  Melee:
  Missile:
  TROO EF 10 A_FaceTarget
  TROO G 8 A_TroopAttack
  TROO A 0 A_GiveInventory("SleepTimer", 1) 
  TROO A 0 A_JumpIfInventory("SleepTimer", 5, "Faint")
  Goto See
  Faint:
  TROO HAHAHAHA 3 A_FaceTarget
  TROO A 0 A_SpawnItemEx("FaintedImp")
  Stop
 }
}
D3X1K AXYZ
Posts: 29
Joined: Wed Mar 22, 2017 1:40 pm

Re: A_JumpIfInventory not working!

Post by D3X1K AXYZ »

Here are a few things you can try:
>Move the jump above the give line (if that don't work try moving them to the top of the state)
>Check the imps inventory while in game
>Use A_Log to debug each condition
>Check the Startup log in the console
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: A_JumpIfInventory not working!

Post by XASSASSINX »

How do i check the "Sleep timer"?
D3X1K AXYZ
Posts: 29
Joined: Wed Mar 22, 2017 1:40 pm

Re: A_JumpIfInventory not working!

Post by D3X1K AXYZ »

I assume you are referring to the second item on the list.
Type targetinv into the console while aiming at the tiredimp
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: A_JumpIfInventory not working!

Post by XASSASSINX »

It says that he has no "List Count" weird.
D3X1K AXYZ
Posts: 29
Joined: Wed Mar 22, 2017 1:40 pm

Re: A_JumpIfInventory not working!

Post by D3X1K AXYZ »

TROO ABCD 6 A_Chase
TROO A 0 A_GiveInventory("SleepTimer", 1)
TROO A 0 {IF(countinv("SleepTimer") ==1){A_log("SLEEP TIMER +1");}ELSE{A_log("SLEEP TIMER ERROR");}
Loop

be sure that you have defined the actor SleepTimer correctly
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: A_JumpIfInventory not working!

Post by XASSASSINX »

How exactly i define it?
D3X1K AXYZ
Posts: 29
Joined: Wed Mar 22, 2017 1:40 pm

Re: A_JumpIfInventory not working!

Post by D3X1K AXYZ »

Code: Select all

Actor SleepTimer: Inventory
{
Inventory.MaxAmount 5
}
Insert this above the TiredImp
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: A_JumpIfInventory not working!

Post by XASSASSINX »

Thank you! Now it's working! (Except that A_SpawnItemEx is not working. but i guess that's for another post.)
D3X1K AXYZ
Posts: 29
Joined: Wed Mar 22, 2017 1:40 pm

Re: A_JumpIfInventory not working!

Post by D3X1K AXYZ »

Did you define the FaintedImp actor
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: A_JumpIfInventory not working!

Post by XASSASSINX »

D3X1K AXYZ wrote:Did you define the FaintedImp actor
Yes.

Code: Select all

ACTOR FaintedImp : DoomImp
{
 Health 45
 Translation "176:191=64:79","16:47=64:79"
 PainSound "NoSound"
 ActiveSound "NoSound"
 SeeSound "NoSound" 
 States
 {
 See:
 Stop
 Pain:
 Stop
 Spawn:
 TNT1 A 0 NoDelay
 TROO I 3 A_Scream
 TROO JKLM 3
 TROO M 72
 TNT1 A 0 A_SpawnItemEx("WakingUpImp", 0, 0, 10)
 Stop
 Missile:
 Stop
 Melee:
 Stop
 Raise:
 Stop
 Death:
 TNT1 A 0 A_SpawnItemEx("DeadDoomImp", 0, 3, 10, 0, 0, 0, 0, 0, 0)
 TNT1 A 0 A_PlaySound("Imp/death")
 Stop
 }
}
D3X1K AXYZ
Posts: 29
Joined: Wed Mar 22, 2017 1:40 pm

Re: A_JumpIfInventory not working!

Post by D3X1K AXYZ »

Ok then, just wanted to make sure. Can't tell you how many times I've forgotten to define an actor.
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: A_JumpIfInventory not working!

Post by XASSASSINX »

Well. If it's defined, why it's not working? Any ideas?

EDIT: Tried to do this:

TROO A 0 A_SpawnItemEx("FaintedImp", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

Didn't work.
D3X1K AXYZ
Posts: 29
Joined: Wed Mar 22, 2017 1:40 pm

Re: A_JumpIfInventory not working!

Post by D3X1K AXYZ »

Not really.
Try manually summoning the Fainted Imp in game
XASSASSINX
Posts: 380
Joined: Tue Dec 20, 2016 4:53 pm
Location: MURICAA BROTHER! Just kidding, Brazil.

Re: A_JumpIfInventory not working!

Post by XASSASSINX »

Already tried. Working normal
Locked

Return to “Editing (Archive)”