[all] "UpgradeStamina" amount is always 1

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

[all] "UpgradeStamina" amount is always 1

Post by Tormentor667 »

This is how the decorate looks for my MaxHealthBonus (just like the one from Skulltag):

Code: Select all

ACTOR MaxHealthBonus2 : UpgradeStamina 12797
{
//$Category Stronghold_Items
Radius 20
Height 16
Inventory.Pickupmessage "Picked up a max health bonus."
Inventory.Amount 5
Inventory.MaxAmount 300
+COUNTITEM
+INVENTORY.ALWAYSPICKUP
states
  {
  Spawn:
    BON3 ABCDCB 6 BRIGHT
    loop
  }
}
Now the problem is, even though the "Inventory.Amount" is set to 5, picking up the item still gives you only 1 unit. Why do I consider this as a bug? Quite easy, the following MaxArmorBonus actor works perfect as intended:

Code: Select all

ACTOR MaxArmorBonus2 : BasicArmorBonus 12796
{
//$Category Stronghold_Items
    Radius 20
    Height 16
    Inventory.Pickupmessage "Picked up a max armor bonus."
    Armor.Savepercent 33.33333
    Armor.Saveamount 5
    Armor.Maxsaveamount 200
    Armor.MaxBonus 5
    Armor.MaxBonusMax 50
    +COUNTITEM
    +INVENTORY.ALWAYSPICKUP
    states
    {
    Spawn:
        BON4 ABCDCB 6 BRIGHT
        loop
    }
}
You do indeed get 5 units by picking up the single item.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: [all] "UpgradeStamina" amount is always 1

Post by Tormentor667 »

Sorry for pushing this, but has this already been adressed?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [all] "UpgradeStamina" amount is always 1

Post by Graf Zahl »

Obviously not.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

Re: [all] "UpgradeStamina" amount is always 1

Post by Mikk- »

I'm sure UpgradeStamina was a dummy item, nothing else.
I've had issues with UpgradeStamina a while back.
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: [all] "UpgradeStamina" amount is always 1

Post by Tormentor667 »

Graf Zahl wrote:Obviously not.
Then, is it really an engine bug or something I have to fix in my code?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [all] "UpgradeStamina" amount is always 1

Post by Graf Zahl »

It's definitely your problem. The item gives me 5 added health points when being picked up.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: [all] "UpgradeStamina" amount is always 1

Post by Jimmy »

The problem actually occurs when the item is given with a script. Let me knock up a really quick example map.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [all] "UpgradeStamina" amount is always 1

Post by Graf Zahl »

When using in a script you must specify the actual amount of stamina points, i.e. 5 if you want to give 5. It's just like ammo.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: [all] "UpgradeStamina" amount is always 1

Post by Jimmy »

Ah. So this is perfectly intentional behavior? Hmm, makes sense. That's alright, then - I'll just have to make a tweak to the shop system. :P
stronghold_healthbug.wad
(27.89 KiB) Downloaded 29 times
(Well, there's the example map anyhow. :geek: )
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [all] "UpgradeStamina" amount is always 1

Post by Graf Zahl »

The armors are different because they do not use the default 'Inventory.Amount' value so they are excluded from the code that modifies it. Yes, it's inconsistent but it's a bit late to change it...
User avatar
Tormentor667
Posts: 13556
Joined: Wed Jul 16, 2003 3:52 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)
Location: Germany
Contact:

Re: [all] "UpgradeStamina" amount is always 1

Post by Tormentor667 »

Okay, now I at least understood the problem, though having this more consistent would be better :-( Any chance of a similar item?
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: [all] "UpgradeStamina" amount is always 1

Post by Jimmy »

From a developer's standpoint, it's probably not the most efficient way, but honestly, I think it's fine for the modders. :P Just a little clarification was all that was needed, really.

No issue here, Torm. :P
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [all] "UpgradeStamina" amount is always 1

Post by Graf Zahl »

The issue here is that the armor bonus was badly implemented. Instead of adding a SavePercent property it should have used Amount, too. Then everything would have been logical and consistent. But it's too late for that. That stuff is 6 years old now.
Post Reply

Return to “Closed Bugs [GZDoom]”