UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Make the zombies ignore you?

HOT
broken avatar :(
Created 7 years ago
by Wolfilms
0 Members and 1 Guest are viewing this topic.
7,139 views
broken avatar :(
×
broken avatar :(
Location: usSouth Florida
Date Registered: 10 July 2016
Last active: 12 months ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
Signature
Let he who has not sinned cast the first stone.
×
Archaicvirus's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Archaicvirus's Contact & Social Links
Code Snippet
Plaintext
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

Thanks for the correction man.

He's right, this is where the problem is.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 28 June 2015
Last active: 4 years ago
Posts
72
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Wolfilms's Groups
Wolfilms's Contact & Social Links
Ok, thanks guys! I’ll test it on Monday when I get home!
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 28 June 2015
Last active: 4 years ago
Posts
72
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Wolfilms's Groups
Wolfilms's Contact & Social Links
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.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
remove the line
Code Snippet
Plaintext
poi.trig waittill("trigger", player);
if(player IsTouching(poi.trig)){
and replace it with
Code Snippet
Plaintext
if(isPlayer(player) &&  player IsTouching(poi.trig)){
if you keep the code the same as the original expect for this change it should work
broken avatar :(
×
broken avatar :(
Location: usSouth Florida
Date Registered: 10 July 2016
Last active: 12 months ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
×
Archaicvirus's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Archaicvirus's Contact & Social Links
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;
}
}
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
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 ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
doing this will break on co-op

everyone will be safe as long as one person is in the POI
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 28 June 2015
Last active: 4 years ago
Posts
72
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Wolfilms's Groups
Wolfilms's Contact & Social Links
doing this will break on co-op

everyone will be safe as long as one person is in the POI

Is it possible to have it so that every player in the game has to hit a trigger?
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
not using POI no
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 28 June 2015
Last active: 4 years ago
Posts
72
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Wolfilms's Groups
Wolfilms's Contact & Social Links
Ok thanks
broken avatar :(
×
broken avatar :(
Location: usSouth Florida
Date Registered: 10 July 2016
Last active: 12 months ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
×
Archaicvirus's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Archaicvirus's Contact & Social Links
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
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 28 June 2015
Last active: 4 years ago
Posts
72
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
Wolfilms's Groups
Wolfilms's Contact & Social Links
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!
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
does the
Code Snippet
Plaintext
player.ignoreme 
variable still exist in bo3?
if it does you could just do something like this
Code Snippet
Plaintext
function poi_test(){
        level flag::wait_till("all_players_connected"); //edit
trig = GetEnt("trig_name", "targetname"); //change trig_name to whatever
trig SetCursorHint("HINT_NOICON");
trig SetHintString("Zombie exclusion volume");
while(1){
players = GetPlayers();
for(i = 0; i < players.size(); i++)
{
players[i].ignoreme = players[i] isTouching(poi.trig);
}
wait(.05);
}
}

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
broken avatar :(
×
broken avatar :(
Location: usSouth Florida
Date Registered: 10 July 2016
Last active: 12 months ago
Posts
106
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Donator ♥
My Groups
More
×
Archaicvirus's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Archaicvirus's Contact & Social Links
does the
Code Snippet
Plaintext
player.ignoreme 
variable still exist in bo3?
if it does you could just do something like this
Code Snippet
Plaintext
function poi_test(){
        level flag::wait_till("all_players_connected"); //edit
trig = GetEnt("trig_name", "targetname"); //change trig_name to whatever
trig SetCursorHint("HINT_NOICON");
trig SetHintString("Zombie exclusion volume");
while(1){
players = GetPlayers();
for(i = 0; i < players.size(); i++)
{
players[i].ignoreme = players[i] isTouching(poi.trig);
}
wait(.05);
}
}

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

 
Loading ...