04-04-2012, 10:29 PM
Here is my script:
void scare(string &in asParent, string &in asChild, int alState) {
AddLocalVarInt("arm", 1);
if(GetLocalVarInt("arm") == 10){
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
GiveSanityDamage(10.0f, true);
SetSwingDoorClosed("door2", true, true);
SetEntityActive("grunt2", true);
AddEnemyPatrolNode("grunt2", "PathNodeArea_17", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_18", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_19", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_20", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_21", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_22", 0, "idle");
AddTimer("monster1", 30.0f, "gleave");
}
}
Is there any way to loop the script so that even if the script has been used, it can be reset/reused? The script works fine in game, however it is a one time deal and I would like it to be reusable multiple times.
void scare(string &in asParent, string &in asChild, int alState) {
AddLocalVarInt("arm", 1);
if(GetLocalVarInt("arm") == 10){
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
GiveSanityDamage(10.0f, true);
SetSwingDoorClosed("door2", true, true);
SetEntityActive("grunt2", true);
AddEnemyPatrolNode("grunt2", "PathNodeArea_17", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_18", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_19", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_20", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_21", 0, "idle");
AddEnemyPatrolNode("grunt2", "PathNodeArea_22", 0, "idle");
AddTimer("monster1", 30.0f, "gleave");
}
}
Is there any way to loop the script so that even if the script has been used, it can be reset/reused? The script works fine in game, however it is a one time deal and I would like it to be reusable multiple times.