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

my elevator zombie handeling

broken avatar :(
Created 12 years ago
by jei9363
0 Members and 1 Guest are viewing this topic.
2,501 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 4 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
Signature
Hey if you had tons of fun on playing my maps please DONATE :)

play ESTATE now, and claim your mansion back from the undead!
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
jei9363's Contact & Social Linksjayingardiajei9363jei9363
I will be doing testing but until then, if anyone want to critic this code segment, its what determines if zombies should set their interest in the mainframe and not players.

Code Snippet
Plaintext
zombies_should_go_to_mainframe()
{

level.numNotOfInterest = 0;

players = get_players();

for(i=0;i<players.size;i++)
{
players[i].is_in_pap = false; //assume false

for(k=0;k<level.in_pap_room_trig.size;k++)
{
if(players[i] isTouching(level.in_pap_room_trig[k])) //is player in PAP basement?
players[i].is_in_pap = true; //player is in PAP basement
}

if(players[i].is_in_pap == true || players[i] in_revive_trigger() || (isDefined(players[i].being_revived) && players[i].being_revived) || !isalive(players[i])) //other reasons zombie should go to mainframe
level.numNotOfInterest++;

}

players[0] iprintln(level.numNotOfInterest + " : " + players.size);

if(level.numNotOfInterest == players.size) //if no one is of interest, send zombies to mainframe, otherwise chase who is left
return true;
else
return false;

}
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
The AI wouldn't go to the goal for me, even after setting both return statements to true and setting both goals to the entity.

Code:

Code Snippet
Plaintext
test_function()
{
level.in_pap_room_trig = getEntarray("pap_trig", "targetname");
stay_here = getEnt("test_ent", "targetname");

while(1)
{

        zombies = getaiarray( "axis" );

        players = get_players();
should_go = zombies_should_go_to_mainframe();

for(i=0;i<zombies.size;i++)
{
for(k=0;k<players.size;k++)
{
if(should_go == true)
{
zombies[i] SetGoalPos( stay_here.origin );
}
else if(should_go == false)
{
zombies[i] SetGoalPos( players[i].origin );
}
}
}
wait(1);
}
}
Last Edit: March 24, 2014, 05:56:28 pm by daedra descent
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 4 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
jei9363's Contact & Social Linksjayingardiajei9363jei9363
oh well I was just asking about the logic...

this is what it returns to

Code Snippet
Plaintext
elevator_zombie_control()
{

while(1)
{

if(zombies_should_go_to_mainframe())
level.elevator_zombie_point create_zombie_point_of_interest( 15360, 960, 100000, true );
else
level.elevator_zombie_point create_zombie_point_of_interest( 0, 0, 0, true );

wait .5;
}
}



did you make a pap zone?

Post Merge: March 24, 2014, 06:05:57 pm
it works perfect in solo, but in coop when people can die/ be downed, I came to realize I have to account for that
Last Edit: March 24, 2014, 06:06:25 pm by jei9363
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
oh well I was just asking about the logic...

this is what it returns to

Code Snippet
Plaintext
elevator_zombie_control()
{

while(1)
{

if(zombies_should_go_to_mainframe())
level.elevator_zombie_point create_zombie_point_of_interest( 15360, 960, 100000, true );
else
level.elevator_zombie_point create_zombie_point_of_interest( 0, 0, 0, true );

wait .5;
}
}



did you make a pap zone?

Yeah i did. The istouching check says that i'm in the trigger but the AI don't go to the goal. SetGoalPos() should work, shouldn't it?

 
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 4 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
jei9363's Contact & Social Linksjayingardiajei9363jei9363
what does
Code Snippet
Plaintext
players[0] iprintln(level.numNotOfInterest + " : " + players.size);
output? 1 : 1 (or 2 : 2, 3 : 3...) means zombies should be going to mainframe
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
what does
Code Snippet
Plaintext
players[0] iprintln(level.numNotOfInterest + " : " + players.size);
output? 1 : 1 (or 2 : 2, 3 : 3...) means zombies should be going to mainframe

1:1
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 16 June 2013
Last active: 4 years ago
Posts
1,005
Respect
Forum Rank
Zombie Colossus
Primary Group
Mapper
My Groups
More
My Contact & Social Links
More
×
jei9363's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Mapper Has released one or more maps to the UGX-Mods community.
jei9363's Contact & Social Linksjayingardiajei9363jei9363
then setgoal must be weird.. what Im more interested in is 2 : 2 s. can I pm you my map and we can test? my steam is jei9363
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
then setgoal must be weird.. what Im more interested in is 2 : 2 s. can I pm you my map and we can test? my steam is jei9363

yeah sure, sent request.

 
Loading ...