Setting MaxHealth & MaxArmor for Custom Player Class?

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.
User avatar
ReX
Posts: 1584
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Setting MaxHealth & MaxArmor for Custom Player Class?

Post by ReX »

Now, neither the HEVBattery nor the scripted armor are working as intended. Here is the complete set of definitions for all 3 types of armor:
Spoiler:
And here's the script (slightly modified from Dark Fox's version above, to account for HEVSuit):
Spoiler:
So, first about the HEVBattery:
  • 1. In its current definition I can pick it up even when I have 100% armor (i.e., I have picked up the HEVSuit before picking up the HEVBattery). -ALWAYSPICKUP doesn't seem to solve the problem.
    2. I changed it from BasicArmorBonus to BasicArmorPickup. This only allowed me to pick it up if I did not already have the HEVSuit on. If I had the HEVSuit on, took damage, and tried to pickup up the HEVBattery I wouldn't be able to pick it up. This is obviously working like DooM's hierarchy for blue armor and green armor, but I don't know why.
Now, about the HEVCharge delivered via the script.
  • 1. No matter what I alter and vary, the device will continue to be "used" (i.e., wasted) in a similar fashion to the way the Medic Station would waste health when used by a player with 100% health.
    2. I tried the script verbatim from Dark Fox's script, above, but it did not make a difference.
    3. I tried changing the HEVCharge type from BasicArmorPickup to BasicArmorBonus, and it gave me 1 unit of armor, then wasted the rest.
Dark Fox, any chance you can work your magic again. [Or HotWax, Isle, and others - work your magic for the first time here.] Thanks.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: Setting MaxHealth & MaxArmor for Custom Player Class?

Post by Project Shadowcat »

Right now, I'm just sitting dumbfounded as to why shit's not working. O_o;;

I need to run some tests on my end and see what works and what doesn't. I work a bit better that way; the health station script was a fluke.
EDIT: I found some problems with the DECORATE but I need to confirm my fixes first before bringing it out here.
User avatar
ReX
Posts: 1584
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Setting MaxHealth & MaxArmor for Custom Player Class?

Post by ReX »

Project Dark Fox wrote:I need to run some tests on my end and see what works and what doesn't. I work a bit better that way; the health station script was a fluke.
EDIT: I found some problems with the DECORATE but I need to confirm my fixes first before bringing it out here.
Very good. I'll stand by.

Menawhile, I was thinking that such a (IMO) simple thing ought not to require so much trial and error. I am still learning the ropes of DECORATE definitions, but I'm generally not a slow learner and this thing has been plaguing me for a while. Maybe it is meant to be a matter of finding the solution by a fluke. Heh.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: Setting MaxHealth & MaxArmor for Custom Player Class?

Post by Project Shadowcat »

Everything is fixed up, changes are in //Comments.

DECORATE:
Spoiler:
Suit Charger Script:
Spoiler:
ReX wrote:I was thinking that such a (IMO) simple thing ought not to require so much trial and error.
I test the shit out of everything I do. With me around, ANYTHING can break!
EDIT: Changed the script. With the max amounts working properly, the spill-over removal was no longer necessary (And I think that portion of the script wasn't working in the first place!).
EDIT2: Even I learned something out of this. When checking your player's inventory for armor, it's simply CheckInventory("Armor"). :lol:
User avatar
ReX
Posts: 1584
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Setting MaxHealth & MaxArmor for Custom Player Class?

Post by ReX »

One minor point. In my code for the HEVBattery I have a Spawn state for a model, and I notice you've set up HEVCharge to inherit from the HEVBattery (and deleted the TNT1 reference). I'm guessing that this shouldn't make a difference. I'm off to try it out both ways.

Incidentally, I did originally have armor.maxsaveamount 100 in the HEVBattery definition, but when I changed the actor's type from BasicArmorBonus to BasicArmorPickup GZDooM gave me an error message for armor.maxsaveamount so I deleted the line. Then I either forgot to put it back in when I changed the type, or didn't think it was important.

EDIT: Yessss!!!! It workssssss! (Okay, I'll cut out the Gollum-speak now.) But many, many thanks to you, Dark Fox.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: Setting MaxHealth & MaxArmor for Custom Player Class?

Post by Project Shadowcat »

ReX wrote:One minor point. In my code for the HEVBattery I have a Spawn state for a model, and I notice you've set up HEVCharge to inherit from the HEVBattery (and deleted the TNT1 reference). I'm guessing that this shouldn't make a difference. I'm off to try it out both ways.
It will not make a difference if it won't be seen. I did take this into account, hence the minimalist approach to the inheritance.
Incidentally, I did originally have armor.maxsaveamount 100 in the HEVBattery definition, but when I changed the actor's type from BasicArmorBonus to BasicArmorPickup GZDooM gave me an error message for armor.maxsaveamount so I deleted the line. Then I either forgot to put it back in when I changed the type, or didn't think it was important.
That explains that...
EDIT: Yessss!!!! It workssssss! (Okay, I'll cut out the Gollum-speak now.) But many, many thanks to you, Dark Fox.
Huzzah! I'm just glad to be there to help, man! :D
Locked

Return to “Editing (Archive)”