Page 1 of 1
Whats wrong with my AI?
Posted: Wed Sep 15, 2004 8:38 am
by Mj
Again, i dabble in scripting, and again i am left pulling my hair out, and grinding my teeth
I have a basic script, to try and make 6 freindly AI, to go to 6 different waypoints.
main:
waittill prespawn
waittill spawn
*give $player guns and whatnot*
thread mate
end
mate:
level.friendly1 runto $f1
level.friendly2 runto $f2
level.friendly3 runto $f3
level.friendly4 runto $f4
level.friendly5 runto $f5
level.friendly6 runto $f6
end
All my targetnames are correct (i quadruple checked), so its not that.
All friendlys are #fnum 1
Here is what happens:
Ingame, with no thread mate, i get the guns and whatnot. with the thread mate included, the whole .scr seems to die, and it gives me no guns, and my AI still dont move
Any help for a blundering mapper?
Mj
Posted: Wed Sep 15, 2004 10:16 am
by jv_map
Give your friendlies differing #fnums (1 up to 6), add exec global/friendly.scr below waittill prespawn and add 'level ' before waittill (pre)spawn

Posted: Wed Sep 15, 2004 10:52 am
by Mj
Ahar! Different #fnums i need

I'll check it out, thanks jv

Posted: Wed Sep 15, 2004 4:04 pm
by Mj
No luck i am afraid
all the friendlys now have thier own #fnums, but it still dont like it
can someone write me a short 'AI move there' script, so i can see where i am going wrong?
Thanks, Mj
Posted: Wed Sep 15, 2004 5:24 pm
by lizardkid
1, level.xxx is a variable, i never saw any variables decalred. make your AI targetnames friendly1 friendly2 etc, and add these lines.
Code: Select all
level.friendly1 = $friendly1
level.friendly2 = $friendly2
level.friendly3 = $friendly3
level.friendly4 = $friendly4
level.friendly5 = $friendly5
level.friendly6 = $friendly6
Posted: Wed Sep 15, 2004 8:16 pm
by Mj
Oooooh
weird
I'll give it a go
Thanks again
Posted: Thu Sep 16, 2004 8:18 am
by Mj
Nope, still got retarded AI

I would post my script, but i am using the school comps, and they took teh floppy drives out of those

Posted: Thu Sep 16, 2004 8:58 am
by lizardkid
alright, heres how i'd do it...
Code: Select all
main:
waittill prespawn
waittill spawn
level.friendly1 = $friendly1 /* in fact, unless you need this friendly level. thingie, you can rename them to something easier to remeber. otherwise theres not much point in using the level.thing */
level.friendly2 = $friendly2
level.friendly3 = $friendly3
level.friendly4 = $friendly4
level.friendly5 = $friendly5
level.friendly6 = $friendly6
$player item weapon/colt45.tik
$player ammo pistol 200
thread mate
end
mate:
level.friendly1 runto f1
level.friendly2 runto f2
level.friendly3 runto f3
level.friendly4 runto f4
level.friendly5 runto f5
level.friendly6 runto f6
end
Posted: Thu Sep 16, 2004 11:37 am
by bdbodger
I used this with pathnodes
level.friendly1.friendtype = -1
level.friendly2.friendtype = -1
level.friendly3.friendtype = -1
wait 1
level.friendly1 exec global/disable_ai.scr // makes ai ignore enemies
level.friendly2 exec global/disable_ai.scr
level.friendly3 exec global/disable_ai.scr
level.friendly1 exec global/crouchrunto.scr $landing_guy1_path2
level.friendly2 exec global/crouchrunto.scr $landing_guy2_path2
level.friendly3 exec global/crouchrunto.scr $landing_guy3_path2
level.friendly1 exec global/enable_ai.scr
level.friendly2 exec global/enable_ai.scr
level.friendly3 exec global/enable_ai.scr
Posted: Thu Sep 16, 2004 12:52 pm
by Mj
You guys are the best
I will try both of these ASAP

Posted: Thu Sep 16, 2004 4:34 pm
by jv_map
lizardkid wrote:1, level.xxx is a variable, i never saw any variables decalred. make your AI targetnames friendly1 friendly2 etc, and add these lines.
the global/friendly.scr does it... that also uses the #fnums... using different targetnames might be just as easy though

Posted: Fri Sep 17, 2004 10:56 am
by Mj

Fixed, thanks guys
