| Author |
Topic: Patrolling AI and Color Groups |
| 3st0nian |
 |
General Member Since: Jan 14, 2008 Posts: 291 Last: Dec 4, 2017 [view latest posts] |
|
|
 |
|
Category: CoD4 SP Mapping Posted: Monday, Jul. 22, 2013 05:56 pm |
 |
Create a spawner, give him key/value
"script_patroller" "1"
without quotation marks of course.
Make a loop out of path nodes. Select first node, press N, and tick NOT_CHAIN box. Then connect spawner with that node, that node with next and so on. Last node connect with first node and you have a looping patroller.
In your gsc add this line at the top
Code: #include maps\_patrol;
In your anim file put
Code:
level.scr_anim[ "generic" ][ "patrol_walk" ] = %patrol_bored_patrolwalk;
level.scr_anim[ "generic" ][ "patrol_walk_twitch" ] = %patrol_bored_patrolwalk_twitch;
level.scr_anim[ "generic" ][ "patrol_stop" ] = %patrol_bored_walk_2_bored;
level.scr_anim[ "generic" ][ "patrol_start" ] = %patrol_bored_2_walk;
level.scr_anim[ "generic" ][ "patrol_turn180" ] = %patrol_bored_2_walk_180turn;
level.scr_anim[ "generic" ][ "patrol_idle_1" ] = %patrol_bored_idle;
level.scr_anim[ "generic" ][ "patrol_idle_2" ] = %patrol_bored_idle_smoke;
level.scr_anim[ "generic" ][ "patrol_idle_3" ] = %patrol_bored_idle_cellphone;
level.scr_anim[ "generic" ][ "patrol_idle_4" ] = %patrol_bored_twitch_bug;
level.scr_anim[ "generic" ][ "patrol_idle_5" ] = %patrol_bored_twitch_checkphone;
level.scr_anim[ "generic" ][ "patrol_idle_6" ] = %patrol_bored_twitch_stretch;
level.scr_anim[ "generic" ][ "patrol_idle_smoke" ] = %patrol_bored_idle_smoke;
level.scr_anim[ "generic" ][ "patrol_idle_checkphone" ] = %patrol_bored_twitch_checkphone;
level.scr_anim[ "generic" ][ "patrol_idle_stretch" ] = %patrol_bored_twitch_stretch;
level.scr_anim[ "generic" ][ "patrol_idle_phone" ] = %patrol_bored_idle_cellphone;
edited on Jul. 22, 2013 10:56 am by 3st0nian |
 |
|
|
| golgo13 |
 |
General Member Since: Mar 18, 2013 Posts: 18 Last: Sep 19, 2013 [view latest posts] |
|
|
|
|
| 3st0nian |
 |
General Member Since: Jan 14, 2008 Posts: 291 Last: Dec 4, 2017 [view latest posts] |
|
|
 |
|
Category: CoD4 SP Mapping Posted: Monday, Jul. 22, 2013 06:15 pm |
 |
golgo13 writes...Quote: Does adding that K/V assign those anims to the AI that comes out of the spawner?
Basically yes.
Quote: What does NOT_CHAIN do?
Dont know exactly, but without it you cant make a loop out of nodes, as game will give an error. |
 |
|
|
| golgo13 |
 |
General Member Since: Mar 18, 2013 Posts: 18 Last: Sep 19, 2013 [view latest posts] |
|
|
|
|
| golgo13 |
 |
General Member Since: Mar 18, 2013 Posts: 18 Last: Sep 19, 2013 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Wednesday, Jul. 24, 2013 06:05 am |
 |
So I tried this, but I'm getting this error:
******* script runtime error *******
undefined is not an array, string, or vector: (file 'maps/_utility.gsc', line 6328)
assertEx( isdefined( level.scr_anim[ "generic" ][ anime ] ), "Tried to set generic run anim but the anim was not defined in the maps _anim file" );
*
Error: called from:
(file 'maps/_patrol.gsc', line 56)
self set_generic_run_anim( walkanim, true );
*
Error: called from:
(file 'maps/_spawner.gsc', line 1189)
self thread maps\_patrol::patrol();
*
Error: called from:
(file 'maps/_spawner.gsc', line 800)
spawn_think_action( targetname );
*
Error: called from:
(file 'common_scripts/utility.gsc', line 586)
entities[ keys[ i ] ] thread [[ process ]]();
*
Error: called from:
(file 'maps/_spawner.gsc', line 120)
array_thread( ai, ::spawn_think );
*
Error: called from:
(file 'maps/_load.gsc', line 452)
maps\_spawner::main();
*
Error: called from:
(file 'maps/noah_test.gsc', line 76)
maps\_load::main();
*
Error: started from:
(file 'maps/noah_test.gsc', line 8)
main() |
 |
|
|
| golgo13 |
 |
General Member Since: Mar 18, 2013 Posts: 18 Last: Sep 19, 2013 [view latest posts] |
|
|
|
|
| golgo13 |
 |
General Member Since: Mar 18, 2013 Posts: 18 Last: Sep 19, 2013 [view latest posts] |
|
|
|
|
| golgo13 |
 |
General Member Since: Mar 18, 2013 Posts: 18 Last: Sep 19, 2013 [view latest posts] |
|
|
|
Category: CoD4 SP Mapping Posted: Friday, Jul. 26, 2013 12:38 am |
 |
Turned out I had path nodes overlapping.
Has anyone ever seen this error?
******* script runtime error *******
RandomInt parm must be positive integer.
: (file 'maps/_utility.gsc', line 1994)
return array [ randomint( array.size ) ];
*
Error: called from:
(file 'maps/_patrol.gsc', line 88)
currentgoal = random( nodes );
*
Error: called from:
(file 'maps/_spawner.gsc', line 1189)
self thread maps\_patrol::patrol();
*
Error: called from:
(file 'maps/_spawner.gsc', line 800)
spawn_think_action( targetname );
*
Error: called from:
(file 'common_scripts/utility.gsc', line 586)
entities[ keys[ i ] ] thread [[ process ]]();
*
Error: called from:
(file 'maps/_spawner.gsc', line 120)
array_thread( ai, ::spawn_think );
*
Error: called from:
(file 'maps/_load.gsc', line 452)
maps\_spawner::main();
*
Error: called from:
(file 'maps/noah_test.gsc', line 77)
maps\_load::main();
*
Error: started from:
(file 'maps/my_map.gsc', line 8)
main()
* |
 |
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|