Whats wrong with my AI?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Whats wrong with my AI?

Post by Mj »

Again, i dabble in scripting, and again i am left pulling my hair out, and grinding my teeth :P

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
ImageImage
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 ;)
Image
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post by Mj »

Ahar! Different #fnums i need :) I'll check it out, thanks jv 8-)
ImageImage
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post 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? :oops:

Thanks, Mj
ImageImage
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post by Mj »

Oooooh :?

weird 8-)

I'll give it a go :)

Thanks again
ImageImage
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post 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 :evil:
ImageImage
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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 
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post 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
Image
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post by Mj »

You guys are the best :)

I will try both of these ASAP :P
ImageImage
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :)
Image
User avatar
Mj
Map Reviewer
Posts: 1394
Joined: Sun Apr 25, 2004 3:36 pm
Location: England

Post by Mj »

:D Fixed, thanks guys :wink:
ImageImage
Post Reply