Selecting a weapon hangs GZdoom

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Selecting a weapon hangs GZdoom

Post by chopkinsca »

I have a axe that can be leveled up. It works fine for the most part. The exception is at axe level 3, selecting the axe while you already have it selected will cause GZdoom to hang.

The acs/decorate is here: http://zdoom.pastebin.com/m22a73c74

and my keyconf:
weaponsection Phocas2
setslot 1 handaxe handaxe0 handaxe1 handaxe2 handaxe3 handaxe4 handaxe5 handaxe6 handaxe7 handaxe8 handaxe9 SmokeFist
And script 440

Code: Select all

// 1 = take, 2 = give
script 440 (int takeorgive){
	print(d: takeorgive);
	if(takeorgive ==  1) {
		TakeActorInventory(255, "haveaxe", 1);
	}
	
	if(takeorgive == 2) {
		GiveActorInventory(255, "haveaxe", 1);
	}
}
I don't understand why it works fine until it gets to level 3.
User avatar
Cherepoc
Posts: 14
Joined: Tue Jul 14, 2009 22:31
Contact:

Re: Selecting a weapon hangs GZdoom

Post by Cherepoc »

I don't understand why it works fine until it gets to level 3.
So do I :D . From the code you posted here I understand only one thing - your code isn't looking good :D .
Use inheritance in decorate. Your axes have same properties and states, exept Fire states. So something like this

Code: Select all

ACTOR handaxe0 : Weapon 
{
   
   Weapon.AmmoUse 0 
   weapon.kickback 130  
   Weapon.SelectionOrder 1000
   +noalert 
   DamageType Axe
   
   States
   {
   Ready:
      MYAX A 1 A_WeaponReady
      Loop
   Deselect: 
          NULL A 0 acs_executealways(440, 0, 1) 
      MYAX A 1 A_Lower
      goto deselect +1
   Select: 
      NULL A 0 acs_executealways(440, 0, 2)
      MYAX A 1 A_Raise
      goto select +1
   Fire:
      MYAX B 5
      MYAX C 5 
      MYAX D 1 A_PlayWeaponSound("axswing")  //axswing
      MYAX D 1 A_CustomPunch(2, 0, 0, "MyAxePuff", 75)  //MyAxePuff sickfogpuff
      MYAX D 3 
      MYAX E 6
      MYAX A 1 A_ReFire
      MYAX A 4
      Goto Ready
   }
}

ACTOR handaxe1 : handaxe0
{
   States
   {
   Fire:
      MYAX B 5
      MYAX C 4 
      MYAX D 1 A_PlayWeaponSound("axswing")  //axswing
      MYAX D 1 A_CustomPunch(2, 0, 0, "MyAxePuff", 75)  //MyAxePuff sickfogpuff
      MYAX D 1 
      MYAX E 6
      MYAX A 1 A_ReFire
      MYAX A 4
      Goto Ready
   }
}
looks better :D
Also, why are you using 1 and 2 as give and take for script 440? You can use true/false where 0 - false, and non-zero - true.

Code: Select all

//0 - take, 1 - give
script 440 (int give)
{
   print(d: give);
   if(give)
      TakeActorInventory(255, "haveaxe", 1);
   else
      GiveActorInventory(255, "haveaxe", 1);
}
About subj - what you posted here isn't enough (well, for me :D ). Can't you post the wad here?
Ahaha oh wow!
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Re: Selecting a weapon hangs GZdoom

Post by chopkinsca »

Yeah, I was lazy when I didn't inherit the axes. Also no idea why I used 1 and 2 when I usually use 1 and 0. The wad is kind of big and would rather now give it to random people.
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Re: Selecting a weapon hangs GZdoom

Post by chopkinsca »

Hmm, nobody seems to care. I suppose I could give someone the .wad, but it'd have to be someone I can trust. Not that my project is important in anyway. The only problem is the time it takes to get to the game hang.
User avatar
Cherepoc
Posts: 14
Joined: Tue Jul 14, 2009 22:31
Contact:

Re: Selecting a weapon hangs GZdoom

Post by Cherepoc »

I suppose I could give someone the .wad, but it'd have to be someone I can trust.
You should have done that from the beginning. :D
Hmm, nobody seems to care.
Using the code you gave I made a zip (well, it's pk3 actually). Axe is gainnig exp when you press "b". And it doesn't hang. Thats all I can do with the info you gave.
Attachments
blahblah.zip
blahblah
(2.34 KiB) Downloaded 70 times
Ahaha oh wow!
User avatar
Firebrand
Dev Builds Team
Posts: 126
Joined: Mon Aug 10, 2009 21:00
Location: Mexico
Contact:

Re: Selecting a weapon hangs GZdoom

Post by Firebrand »

Doing a quick check of this... I didn't found any apparent problems, maybe the problem is somewhere else... more deep on the engine.
I'm the ruler of the Fire Power.....
User avatar
chopkinsca
Posts: 183
Joined: Thu Dec 29, 2005 8:09

Re: Selecting a weapon hangs GZdoom

Post by chopkinsca »

Okay, whatever it was, it's fixed in the newest SVN.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Selecting a weapon hangs GZdoom

Post by Graf Zahl »

Good to know. There was a bugfix in the weapon selection code recently that could cause it to hang.
Locked

Return to “GZDoom”