character health
character health
Is it possible to adjust an NPC's health? I have an NPC I wan't to have be almost dead. How would I do that I just can't seem to figure it out. Thanks for the help.
- Max-Violence
- Wandering Hero
- Posts: 1221
- Joined: Thu Apr 18, 2002 4:15 am
- Location: In my own personal vault
- Contact:
Well, it depends on what you want to do.
Do you want the NPC to start almost dead, or become almost dead in the map?
To make the NPC start almost dead, open up the NPC's .ent file and scroll down till you see the Actor Status tab. Click on it, and change the number in the Current Hitpoints box, and save the entity.
If you want to make the NPC become almost dead in the map (and therefore using a trigger), you'll need to use the "clone swapping" method, as there's no Action to adjust the health of an actor.
Clone swapping:
Make 2 version of your NPC, a normal one and one with low HP (using the above method), and place the normal NPC's entity in the map. Next, place both entities in the map, and make sure they both are overlapping each other. Set the normal's player index to, say, 2, and the almost dead NPC's PI to, say, 3. For PI 2, set the control to Computer and the controller to Stationary. For PI 3, set the control to Disabled.
Next, make the trigger:
CONDITION:
Whatever you want
ACTION:
Deactivate player 2
Set player 3 to stationary at Anywhere
That's all there is to it!
You might have to put a Wait action between the two actions, as the game might crash if you don't. If you do it without the Wait in there, and it crashes, put the Wait in there and it should work. Just remember to check/tick Blocking when you make the Wait action.
Obviously, if your NPC is mobile (i.e. he/she doesn't just stand there), you're gonna have a lot of work to do if you want the almost dead NPC to swap with the normal NPC wherever the normal NPC is at when the Condition(s) are met.[/u]
Do you want the NPC to start almost dead, or become almost dead in the map?
To make the NPC start almost dead, open up the NPC's .ent file and scroll down till you see the Actor Status tab. Click on it, and change the number in the Current Hitpoints box, and save the entity.
If you want to make the NPC become almost dead in the map (and therefore using a trigger), you'll need to use the "clone swapping" method, as there's no Action to adjust the health of an actor.
Clone swapping:
Make 2 version of your NPC, a normal one and one with low HP (using the above method), and place the normal NPC's entity in the map. Next, place both entities in the map, and make sure they both are overlapping each other. Set the normal's player index to, say, 2, and the almost dead NPC's PI to, say, 3. For PI 2, set the control to Computer and the controller to Stationary. For PI 3, set the control to Disabled.
Next, make the trigger:
CONDITION:
Whatever you want
ACTION:
Deactivate player 2
Set player 3 to stationary at Anywhere
That's all there is to it!
You might have to put a Wait action between the two actions, as the game might crash if you don't. If you do it without the Wait in there, and it crashes, put the Wait in there and it should work. Just remember to check/tick Blocking when you make the Wait action.
Obviously, if your NPC is mobile (i.e. he/she doesn't just stand there), you're gonna have a lot of work to do if you want the almost dead NPC to swap with the normal NPC wherever the normal NPC is at when the Condition(s) are met.[/u]
Closing our eyes forces us to look
At the darkness inside.
Our emotions always find us
Regardless of where we hide.
maxviolence@hotmail.com
http://mvmaphub.duckandcover.cx <--- Updated July 10th, 2006
At the darkness inside.
Our emotions always find us
Regardless of where we hide.
maxviolence@hotmail.com
http://mvmaphub.duckandcover.cx <--- Updated July 10th, 2006