PDA

View Full Version : NPC Question


Blaster
10-09-2002, 02:26 PM
Is it possible to somehow make an NPC open a door but ony if they're health reaches a certain damage amount.

alanuk
10-09-2002, 04:51 PM
you probly can but u will have to do alot of scripting!!

Blaster
10-09-2002, 04:57 PM
Well any tips on where to start would be handy.

dvader28
10-09-2002, 04:57 PM
do u mean they're only able to open the door if they're health is at a certain amount, or when it gets to an amount, they run and open a door?

Blaster
10-09-2002, 04:58 PM
I mean say a reborn gets to 60 health out of a possible 200 hitpoints. Then at 60 points the door will automatically open.

dvader28
10-09-2002, 05:08 PM
hmmm

MilesTeg
10-09-2002, 05:19 PM
donīt know if this helps, but I did a little research on this and found this:

from yavin_final.bsp:
"classname" "NPC_Desann"
"angle" "270"
"NPC_targetname" "real_desann"
"targetname" "real_desann"
"origin" "-4776 4548 -1544"
"spawnscript" "yavin_final/setupdesann"
"NPC_target" "run_cin35_spawner"
}


in setupdesann.ibi you will find the line
set ( /*@SET_TYPES*/ "SET_PAINSCRIPT", "yavin_final/desann_hurt" );


wich leads to desann_hurt.ibi:
rem ( "comment" );

if ( $get( FLOAT, "SET_HEALTH") < 200$ )
{
set ( /*@SET_TYPES*/ "SET_PAINSCRIPT", "NULL" );
set ( /*@SET_TYPES*/ "SET_MUSIC_STATE", /*@MUSIC_STATES*/ "DM_BOSS" );
}


This means: If Desanns health goes below 200 points the DM_BOSS music will be played. Should be easy for you now to replace a few lines ;)

dvader28
10-09-2002, 05:23 PM
nice one...yeah, if you replace the music bit with a simple go to waypoint_navgoal script, you've got it made.

Blaster
10-09-2002, 05:24 PM
Thanks for the feedback I'll give it a go! :)