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

ai not moving :(

broken avatar :(
Created 11 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
1,912 views
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
anyone know why my ai is not moving

its goal is set to the players origin

quick image in game

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
Show the script your using for moving the AI.
Marked as best answer by Deleted User 7 months ago
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Show the script your using for moving the AI.
its basically a exact copy and condensed version of maps\_zombiemode_spawner (not all of it just parts i think i might need)
http://pastebin.com/4ZXjQm6G
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
its basically a exact copy and condensed version of maps\_zombiemode_spawner (not all of it just parts i think i might need)
http://pastebin.com/4ZXjQm6G

For creating a ai chain/roaming i would suggest just using structs that target each other that the ai will follow. Something like:

Code Snippet
Plaintext
sloth_pathing()
{
structs = getStructArray("sloth_pathing", "targetname");

if(!isdefined(structs))
return;

while(1)
{
if(level.special_item_taken && !level.sloth_hurt) // if the candy/booze has been taken from the spot by a player
{
        players = get_players();
for(k=0;k<players.size;k++)
{
if(players[k].has_booze || players[k].has_candy)
goal = players[k];
}
}
else if(!level.special_item_taken && !level.sloth_hurt)
{
for(i=0;i<structs.size;i++)
{
if(isdefined(structs[i].target) && structs[i].target > 1)
goal = random(structs[i].target);
                               else if(isdefined(structs[i]))
                                        goal = structs[i].target;
}
}
else if(!level.special_item_take && level.sloth_hurt)
goal = getstruct("sloth_cage_struct", "targetname");
                wait(1);
self setGoalEntity(goal);
}
}


Edit: SetGoalNode should be setGoalEntity. Hopefully it'll work fro structs.

Edit 2: if setGoalEntity doesn't work you can also just get the closest pathnode from the struct and set the goal that way too. Bit tired ATM, so sorry if i'm not being clear enough. lol

Last Edit: August 16, 2015, 08:36:48 am by daedra descent
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
For creating a ai chain/roaming i would suggest just using structs that target each other that the ai will follow. Something like:

Code Snippet
Plaintext
sloth_pathing()
{
structs = getStructArray("sloth_pathing", "targetname");

if(!isdefined(structs))
return;

while(1)
{
if(level.special_item_taken && !level.sloth_hurt) // if the candy/booze has been taken from the spot by a player
{
        players = get_players();
for(k=0;k<players.size;k++)
{
if(players[k].has_booze || players[k].has_candy)
goal = players[k];
}
}
else if(!level.special_item_taken && !level.sloth_hurt)
{
for(i=0;i<structs.size;i++)
{
if(isdefined(structs[i].target) && structs[i].target > 1)
goal = random(structs[i].target);
                               else if(isdefined(structs[i]))
                                        goal = structs[i].target;
}
}
else if(!level.special_item_take && level.sloth_hurt)
goal = getstruct("sloth_cage_struct", "targetname");
                wait(1);
self setGoalEntity(goal);
}
}


Edit: SetGoalNode should be setGoalEntity. Hopefully it'll work fro structs.

Edit 2: if setGoalEntity doesn't work you can also just get the closest pathnode from the struct and set the goal that way too. Bit tired ATM, so sorry if i'm not being clear enough. lol
sorry about the late reply, my power went out last night :(

ill give this a go but when i tried using SetGoalEntity it crashed saying it wasn't on a friendly chain or something like that

Double Post Merge: August 16, 2015, 03:45:22 pm
Thanks DD that helped a lot, i had to modify it abit to fit what i wanted but now it works :D

 
Loading ...