Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 11 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page
subscribe
Author Topic: Patrolling AI and Color Groups
3st0nian
General Member
Since: Jan 14, 2008
Posts: 291
Last: Dec 4, 2017
[view latest posts]
Level 5
Im a fan of MODSonair
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
Share |
golgo13
General Member
Since: Mar 18, 2013
Posts: 18
Last: Sep 19, 2013
[view latest posts]
Level 1
Category: CoD4 SP Mapping
Posted: Monday, Jul. 22, 2013 06:07 pm
Awesome, thanks!

Does adding that K/V assign those anims to the AI that comes out of the spawner?

What does NOT_CHAIN do?
Share |
3st0nian
General Member
Since: Jan 14, 2008
Posts: 291
Last: Dec 4, 2017
[view latest posts]
Level 5
Im a fan of MODSonair
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.
Share |
golgo13
General Member
Since: Mar 18, 2013
Posts: 18
Last: Sep 19, 2013
[view latest posts]
Level 1
Category: CoD4 SP Mapping
Posted: Monday, Jul. 22, 2013 06:19 pm
Thanks for all of the help, I really appreciate it.

I look forward to getting this working tonight.

This was the last major piece of heavy lifting I needed to get my map finished before I start a lighting and polish pass on it.

Anyone have any decent script for getting AI to go to the last known player position after a weapon is fired by the player?

Basically going to a radius around the last location the player fired their weapon?
Share |
golgo13
General Member
Since: Mar 18, 2013
Posts: 18
Last: Sep 19, 2013
[view latest posts]
Level 1
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()
Share |
golgo13
General Member
Since: Mar 18, 2013
Posts: 18
Last: Sep 19, 2013
[view latest posts]
Level 1
Category: CoD4 SP Mapping
Posted: Wednesday, Jul. 24, 2013 06:29 am
Actually, I got it to work by reversing the order in which they load:

maps\my_map_anim::main();
maps\_load::main();
Share |
golgo13
General Member
Since: Mar 18, 2013
Posts: 18
Last: Sep 19, 2013
[view latest posts]
Level 1
Category: CoD4 SP Mapping
Posted: Wednesday, Jul. 24, 2013 06:53 am
Now I'm seeing this:

Error: AI 740's goal node at (-3927, -5000, 475) does not have any path links

[duh]
Share |
golgo13
General Member
Since: Mar 18, 2013
Posts: 18
Last: Sep 19, 2013
[view latest posts]
Level 1
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()
*
Share |
Restricted Access Topic is Locked
Page
Previous Page
subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»