Max Health (UPDATE: ACS questions)

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.
Locked
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Max Health (UPDATE: ACS questions)

Post by Captain Ventris »

I have several player classes, a couple of which have different player.maxhealth values. Most are at 300, while one is at 5000, and another at 2000.

In the wad there is also a script that repeatedly gives all players a one health point item:

Code: Select all

ACTOR Healthregen : Health 3103
{
  inventory.pickupmessage "You have healed a Health point."
  inventory.amount 1
  inventory.maxamount 10000
  inventory.icon "PTN2A0"
  states
  {
  Spawn:
    TNT1 A 4
    loop
  }
}
How do I make this item so that it will get players up to the desired maximum health, but not over, depending on the Player Class?
Last edited by Captain Ventris on Fri Aug 01, 2008 11:25 am, edited 1 time in total.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: Max Health

Post by HotWax »

The solution is to do a check wherever you're giving the item. Since you said you're using an ACS script, have the script check the player's max health property and don't give them a health pickup if they've already reached it.

This would look something like this:

Code: Select all

script 1 ENTER
{
     if (GetActorProperty(0, APROP_SpawnHealth) > GetActorProperty(0, APROP_Health))
          GiveInventory("Healthregen", 1);

     delay(35);

     restart;
}
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Max Health

Post by Captain Ventris »

HotWax wrote:The solution is to do a check wherever you're giving the item. Since you said you're using an ACS script, have the script check the player's max health property and don't give them a health pickup if they've already reached it.

This would look something like this:

Code: Select all

script 1 ENTER
{
     if (GetActorProperty(0, APROP_SpawnHealth) > GetActorProperty(0, APROP_Health))
          GiveInventory("Healthregen", 1);

     delay(35);

     restart;
}
Oh, alright. That's not hard. Thanks. And it's an Enter script, so there is one for each player. Does a tid of 0 always indicate a player?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: Max Health

Post by HotWax »

A TID of 0 indicates the activator, who will always be a player in an ENTER script.
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Max Health

Post by Captain Ventris »

HotWax wrote:A TID of 0 indicates the activator, who will always be a player in an ENTER script.
Ah, I see.

I understand how to do a Dynamic TID assigner, but I need something a little more specific.

I need to be able to set a goal as a certain, singular thing placed by a player. However, I need only the monsters summoned by that player to react and proceed to that goal.

I need a similar situation, but with toggling a Player's monsters to be frightened of the object.

Lastly, I need a certain, SINGLE type of monster to Thing_Hate an object placed by the player.

So, how would I use TID to indicate or control types of monsters, or by affiliation?



Also, I would love to Set_Translation for critters summoned by a player to be the same color as them (the recolorable bits, anyway). Would just making a translation script in the monster's spawn state work? But then, how would I make it work for every monster that is summoned? What would I put for the TID? The monster would be the activator, so 0, correct?
Locked

Return to “Editing (Archive)”