Fletcher` Posted April 9, 2004 Something is wrong here. I wanted a certain part of this script to run or not depending on if a player died while the script is running. Unfortunately it doesn't do that. It runs everything else except for the extra bit that only occurs if the player is still alive. Any questions on why that part never works? script 1 OPEN { Thing_ChangeTid (17, 99); //player is set at tid 17 } script 14 (void) { //eat me if(getactorproperty(99, aprop_health) >= 1) { exit_normal(0); } else if(getactorproperty(99, aprop_health) <= 0) { terminate; //If the player is dead, terminate the script. } Delay (1); restart; //Checks player's health every tic. } 0 Share this post Link to post
Graf Zahl Posted April 9, 2004 THat cannot work. You can't assign a tid to a player in an OPEN script. For that you have to use an ENTER script and use 0 as the source tid. This is the only way how you can assign a tid to a player for the first time in a level. Second, this script cannot loop. If the player is alive it will exit immediately otherwise it will terminate immediately. 0 Share this post Link to post
Fletcher` Posted April 10, 2004 Would this work?script 14 (void) { stuff(); acs_execute(15,0,0,0,0); //run script 15 at the end of all of this } script 15 (void) //this is to keep the level from ending even if you are dead { if(getactorproperty(0, aprop_health) >= 1) { exit_normal(0); } else if(getactorproperty(0, aprop_health) <= 0) { terminate; } delay(1); restart; } 0 Share this post Link to post
cyber-menace Posted April 10, 2004 I think ravage read my example wrong. I had the enter script and I explained everything pretty well. The ChangeTID command is WAY off though... Thing_ChangeTID (#1, #2); #1 - The ACTUAL THING NUMBER of the thing in the editor. Your script currently makes it change Thing Number 17's TID to 99, not the other way around. #2 - This is the new TID of this thing. That should fix that up. EDIT: And no that certainly would not work. This is saying that TID 0 (This is a whole lot of things) is what the GetActorProp is getting. This means any player/enemy/object, etc. will contribute to the HP count. I gave you a working example. I tested it myself. http://dtca.2webh.com/player_health_script.txt If you don't believe me, copy the script entirely and add the appropriate information. If done properly it will work. 0 Share this post Link to post