Health pickups

Discuss all aspects related to modding Zandronum here.
Post Reply
Faad3e_
New User
Posts: 18
Joined: Wed Sep 12, 2012 9:32 pm

Health pickups

#1

Post by Faad3e_ » Mon Dec 23, 2013 11:25 pm

Is there anyway for a health pickup to act as a % instead of a constant?

Example:
I have 9 classes in my mod, each class with diferent HP, can i make a pickup that restores 50% of the HP? so for a class that haves 125 maxHP it restores 62.5HP and for a class that haves 200 maxHP it restores 100HP?

User avatar
agaures
Forum Regular
Posts: 591
Joined: Mon Dec 10, 2012 6:34 am
Location: New Zealand

RE: Health pickups

#2

Post by agaures » Mon Dec 23, 2013 11:53 pm

Something like:

Code: Select all

Health Player.MaxHealth / 2
<agaures> I'm guessing you haven't played many doom mods before huh? :p
<Zuplin> i have played master of puppets zombies doom center and a couple more
<agaures> so not many
<Zuplin> i thought that was everything

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Health pickups

#3

Post by Ijon Tichy » Tue Dec 24, 2013 12:26 am

health only accepts a numerical value
I hope you like acs, because you'll need it for this

also is this perchance a tf2 mod

edit: I figured him out and now he won't return
Last edited by Ijon Tichy on Wed Dec 25, 2013 6:16 pm, edited 1 time in total.

Faad3e_
New User
Posts: 18
Joined: Wed Sep 12, 2012 9:32 pm

RE: Health pickups

#4

Post by Faad3e_ » Fri Dec 27, 2013 7:19 pm

Ijon Tichy wrote: health only accepts a numerical value
I hope you like acs, because you'll need it for this

also is this perchance a tf2 mod

edit: I figured him out and now he won't return
Hmm, quite clever are you, yeah, i wanna do sth like a mix between TF2 and a modern FPS (with Aim down scope and that stuff)

Lollipop
Zandrone
Posts: 1124
Joined: Tue Jul 24, 2012 10:34 am
Location: Denmark

RE: Health pickups

#5

Post by Lollipop » Tue Dec 31, 2013 11:39 am

If you know the percentage each class will obtain from the pickup (if you know that the scout will get x amount of hp and the spy will get the y amount), then you can make a "fake" health item, like so:
Spoiler: code (Open)
actor fakemedikit : pickup
(stuffs here)
states:
pickup:
ASDF 0 A_JumpIfInventory("is_spy", 1, "spyhealth")
ASDF 0 A_JumpIfInventory("is_scout", 1, "scouthealth")

spyhealth:
ASDF 0 A_GiveInventory ("health", 15)

scouthealth:
ASDF 0 A_GiveInventory ("health", 25)
When you are making something like a tf2 thingy, I take it for granted you already know DECORATE to such an extent, that you actually understand the code I have spoilered for you.
Combinebobnt wrote:i can see the forum league is taking off much better than the ctf ones
GalactusToday at 1:07 PM
are you getting uncomfortable jap
feeling something happen down there

Faad3e_
New User
Posts: 18
Joined: Wed Sep 12, 2012 9:32 pm

RE: Health pickups

#6

Post by Faad3e_ » Tue Dec 31, 2013 11:03 pm

Lollipop wrote: If you know the percentage each class will obtain from the pickup (if you know that the scout will get x amount of hp and the spy will get the y amount), then you can make a "fake" health item, like so:
Spoiler: code (Open)
actor fakemedikit : pickup
(stuffs here)
states:
pickup:
ASDF 0 A_JumpIfInventory("is_spy", 1, "spyhealth")
ASDF 0 A_JumpIfInventory("is_scout", 1, "scouthealth")

spyhealth:
ASDF 0 A_GiveInventory ("health", 15)

scouthealth:
ASDF 0 A_GiveInventory ("health", 25)
When you are making something like a tf2 thingy, I take it for granted you already know DECORATE to such an extent, that you actually understand the code I have spoilered for you.
Whoa, havent though about that, and yeah, i know decorate :P, thanks a lot sir, you really helped me out

EDIT: In case anyone needs it, i made the code here
Spoiler: code (Open)
actor IS_Soldier : Inventory
{
inventory.maxamount 1
}

actor IS_Scout : Inventory
{
inventory.maxamount 1
}

ACTOR SmallHealthkit : CustomInventory
{
Inventory.PickupMessage "Picked up a health kit"
States
{
Spawn:
STIM A -1
Stop
Pickup:
ASDF A 0 A_JumpIfInventory("is_scout",1,"scouthealth")
ASDF A 0 A_JumpIfInventory("is_soldier",1,"soldierhealth")

ScoutHealth:
ASDF A 0 A_GiveInventory("healthbonus2", 31)
stop
SoldierHealth:
ASDF A 0 A_GiveInventory("healthbonus2", 50)
stop
}
}

In order for this to work, you have to give the "IS_Soldier" item or "Is_Scout" item for your class

Hope this helps someone
Last edited by Faad3e_ on Wed Jan 01, 2014 1:52 am, edited 1 time in total.

Post Reply