if(player IsTouching(poi.trig)){ while(player IsTouching(poi.trig)){ poi.poi_active = true;//Turns point of interest on IPrintLnBold("Inside"); wait(1); } }else poi.poi_active = false;//Turns point of interest off IPrintLnBold("Outside!"); wait(1);
don tuse the else-statement here, the if-statement was allready true so it wont execute the code under the else-statement
So all I did was take out the else statement, but nothing changed in the game. The zombies still always go to the POI even after I leave the trigger.
You could always do some type of cooldown. That's how I have mine set up and it's working fine. I'm using a trigger_use though, and it just waits 60 seconds then sets poi.poi_active to false then waits for trigger input again. That might be a better way to do it. Although it is possible to do it the way you're doing it, for some reason poi.poi_active isn't getting set to false. You could do something like this
Code Snippet
Plaintext
function poi_test(){ level flag::wait_till("all_players_connected"); //edit poi = struct::get("custom_poi", "targetname"); poi.trig = GetEnt(poi.target, "targetname"); poi.trig SetCursorHint("HINT_NOICON"); poi.trig SetHintString(""); // attract_dist, num_attractors, added_poi_value, start_turned_on, initial_attract_func, arrival_attract_func, poi_team poi zm_utility::create_zombie_point_of_interest(100000, 99, 25, false); // num_attract_dists, attract_dist poi thread zm_utility::create_zombie_point_of_interest_attractor_positions(5, 100); poi thread zm_utility::wait_for_attractor_positions_complete(); coolDown = 5; //Change coolDown to whatever time you want while(1){ poi.trig waittill("trigger", player); poi.poi_active = true; wait(coolDown); poi.poi_active = false; } }
If you want scripts / features made for you, then contact me by PM or email / skype etc it will cost you tho so if you have no intention of reciprocating don't even waste my time
Is it possible to have it so that every player in the game has to hit a trigger?
Like I said before it's probably a lot easier just to make the trig a trigger_use, I have it working fine this way. This is the exact script I'm using with only minor changes to take out some of my checks.
Code Snippet
Plaintext
//Put these three in your main() function at the bottom level flag::wait_till("all_players_connected"); poi = poi_setup(); poi thread poi_test();
//These are the two functions I'm using function poi_setup(){ poi = struct::get("custom_poi", "targetname"); poi.trig = GetEnt(poi.target, "targetname"); poi.trig SetCursorHint("HINT_NOICON"); poi.hint = "Press &&1 to distract zombies"; //Or whatever hint you want poi.trig SetHintString(poi.hint); //poi.poi_active = false; *Edit - not needed, is set to false by default in create_zombie_point_of_interest(100000, 99, 25, false);<-here // attract_dist, num_attractors, added_poi_value, start_turned_on, initial_attract_func, arrival_attract_func, poi_team poi zm_utility::create_zombie_point_of_interest(100000, 99, 25, false); // num_attract_dists, attract_dist poi thread zm_utility::create_zombie_point_of_interest_attractor_positions(5, 100); poi thread zm_utility::wait_for_attractor_positions_complete(); return poi; }
function poi_test(){ while(1){ self.trig waittill("trigger"); self.poi_active = true; cooldown = 15; //Change to time desired - I'm using 15 for testing while(1){ if(cooldown > 0){ cooldown--; self.trig SetHintString("Cooling down in ["+cooldown+"]..."); //This updates the trig with time left wait(1); }else break; } self.poi_active = false; self.trig SetHintString(self.hint); } }
Also this is just a proof of concept script that I made, so you should think about a way to limit this so players can't just keep using it over and over again. The cooldown in the script really should be called "poi active time" or something like that, because cooldown makes more sense to be the time after the poi expires, and before it can be triggered again. You can use a simple wait(time) or some other check. Here's a short vid demonstrating how I'm using it with the script I provided you.
Last Edit: June 20, 2017, 07:14:47 pm by Archaicvirus
Like I said before it's probably a lot easier just to make the trig a trigger_use, I have it working fine this way. This is the exact script I'm using with only minor changes to take out some of my checks.
Code Snippet
Plaintext
//Put these three in your main() function at the bottom level flag::wait_till("all_players_connected"); poi = poi_setup(); poi thread poi_test();
//These are the two functions I'm using function poi_setup(){ poi = struct::get("custom_poi", "targetname"); poi.trig = GetEnt(poi.target, "targetname"); poi.trig SetCursorHint("HINT_NOICON"); poi.hint = "Press &&1 to distract zombies"; //Or whatever hint you want poi.trig SetHintString(poi.hint); poi.poi_active = false; // attract_dist, num_attractors, added_poi_value, start_turned_on, initial_attract_func, arrival_attract_func, poi_team poi zm_utility::create_zombie_point_of_interest(100000, 99, 25, false); // num_attract_dists, attract_dist poi thread zm_utility::create_zombie_point_of_interest_attractor_positions(5, 100); poi thread zm_utility::wait_for_attractor_positions_complete(); return poi; }
function poi_test(){ while(1){ self.trig waittill("trigger"); self.poi_active = true; cooldown = 15; //Change to time desired - I'm using 15 for testing while(1){ if(cooldown > 0){ cooldown--; self.trig SetHintString("Cooling down in ["+cooldown+"]..."); //This updates the trig with time left wait(1); }else break; } self.poi_active = false; self.trig SetHintString(self.hint); } }
Also this is just a proof of concept script that I made, so you should think about a way to limit this so players can't just keep using it over and over again. The cooldown in the script really should be called "poi active time" or something like that, because cooldown makes more sense to be the time after the poi expires, and before it can be triggered again. You can use a simple wait(time) or some other check. Here's a short vid demonstrating how I'm using it with the script I provided you.
(Content removed from quote.)
Ok, thanks. I planned on making this just like a cool, hidden feature in my map so in no way do I intend to make it OP. Thanks everyone!
this can also be done with a volume instead of a trigger
PS:this is a quick example you want to do other checks before setting the .ignoreme variable such as if the player is in laststand because if you dont its possible they would become a target if they are downed and not in the trigger zone
this can also be done with a volume instead of a trigger
PS:this is a quick example you want to do other checks before setting the .ignoreme variable such as if the player is in laststand because if you dont its possible they would become a target if they are downed and not in the trigger zone
That's a really good idea.
I appreciate everyone else's input too, that's why I always come here to ugx. That and I'm always having problems myself lol
Last Edit: June 20, 2017, 07:26:43 pm by Archaicvirus