Welcome New User Home | Forums | Register | Login | Larger Font
Main-Menu
Home
Login
Register
Add Download
Add News
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
dvsdeadman [Forum]
CoDLiNK [Forum]
tlj1968 [Today]
ghostriderjr [Downl]

4 Members and 13 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Friday, May. 16th
Video games 'do not' encourage violence
Friday, May. 16th
Site update
Friday, May. 16th
MODSonair Episode 127
Tuesday, May. 13th
Web hosting, you need?
Sunday, May. 11th
MODSonair 127 Live
Latest Poll
Would you subscribe for a maps/projects backup utility and service?
I'd pay just about anything for that. 2.06%
If it was cheap enough I would. 4.12%
Only if it came with my MODSonline subscription. 6.19%
I can backup my own files. 82.47%
Why would I backup my files? 5.15%
Read More...
8 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
[TUTORIAL] How to get rid of the wait time
CoD 4 Level Desi.. Posts: (5) Views: (108) by CoDLiNK
SP_Help!
CoD Level Design.. Posts: (2) Views: (8) by Sparks.
Kill3r's K3 MOD is DANGEROUS TO YOU AND YOUR S...
CoD4 General Gam.. Posts: (17) Views: (196) by 4mori_rabbit
train
CoD 4 Level Desi.. Posts: (1) Views: (7) by navysealsniper
Treyarch SPLITREASON.COM - Gear for Geeks and GamersBuy geek and gamer themed T-Shirts and Hats @ SplitReason.com!
Tutorials: CoD2 Mapping
Mapping and modding for Call of Duty 2.

Rating:
Aweful Rating Poor Rating Average Rating Good Rating Excellent Rating
Basic enemy AI
2006-12-07 16:06:01
In this tutorial I’m going to explain you the basics of enemy AI.
Preparation:
First you need to download my example map. It can be found here.

Oke lets get started. Open up my map and place an info_player_start at the begin of the map (see screenshot). To find the info_player_start just right click on you’re 2d-grid and select info>playerstart.



Now we place the enemy where it needs to be spawned. In this example were going to set it behind the wall. Now this is what you need to remember: Never place an actor (the enemy) in sight of the player itself. To get an enemy right click on you’re 2d grid and select actor>axis_nrmdy_wehr_reg_mp44 (it can be any actor, just pick on that you want) and place it behind the wall. Do the same for the other actor.



Now select the actors and press ‘’N’’ and a new window will pop-up. Now check the spawner box and press ‘’N’’ again.



Now we need to make the path of the enemy and what it will do when its reaches his point. In this example were making the enemy staying behind the wall. So first we need to lay down a path for the enemy where it can walk. To do this right click on you’re 2d-grid and select: node> pathnode , now place the pathnode in front of the actor, now place another one like 30 units further than the previous one. Do the same with the other one.



Now were only had make a path so the enemy can move but that’s a little bit boring so were going to make it shoot on you. To make an AI actor do something you need to make a kind of node, cover_stand, cover_prone etc. There all self explaining. So one actor gets a cover left and the other actor gets a cover right. Just place it where you want that the enemy needs to take shoot from. In this example the sides of the wall, and remember to turn the action nodes ( cover_stand etc.) the way it need to do its action otherwise they will turn you’re back to you. But still the actor isn’t doing anything. You need to link the actor to the cover node to make it actually run to the cover node and start shooting. To do this select the actor and then select the cover node and press ‘’W’’ and you see that a yellow line connects the actor to the node. Do the same with the other one. If it all was a bit to confusing just look to the screen below.



Now we need to choose at what certain point the enemy AI needs to spawn and then needs to do its thing what me make before. So we are going to place a trigger. What the trigger does is really simple. When you walk trough it you’re enemy will spawn and do it thing. So we are going to place a trigger between the two walls. To make a trigger you first need to find the trigger texture, that can be found in the usage>tools. Now drag a brush between the two walls. Right click on it in the 2d grid and select: trigger>multiple. Now the last thing we need to do is link the trigger to the AI. So link in this order: Select the trigger, select enemy 1 and press ‘’W’’, you’ll see that a yellow line is linking the two together. Now do the same for the second actor. Look on the screen and see if you did it right.



Now you’re almost finished. You only need to make a really easy script. Most tutorials say you don’t need a script but trust me, you need it. So make a text file and put this code in it:


#include maps\_utility;
main() {
maps\_load::main();
level.player takeallweapons();
level.player giveWeapon ("thompson");
level.player giveWeapon ("colt");
level.player giveWeapon ("fraggrenade");
level.player switchToWeapon ("thompson");
}


Now save it as youremapname.gsc (in this tutorial I named my map aimapenemy) you need to have the .bsp file and the .gsc file the same name, otherwise it wont work.

The last thing you need to do know is add a line to you’re shortcut on the desktop. Otherwise you’re AI don’t move. So right click on you’re shortcut and select the tab ‘’shortcut’’ and then by target you have this line "C:\Program Files\Activision\Call of Duty 2\CoD2SP_s.exe" and you need to change it to this: "C:\Program Files\Activision\Call of Duty 2\CoD2SP_s.exe" + set g_connectpaths 1

Now you have finished your own first Single Player map with AI in it. Well done! If you get stuck at one point just open the .map. You can download it here. To run you’re map open CoD2SP and type in console /map youremapname (for my example /map aimapenemy).

-----------------------------------------------------------------------------------------------------------------------------

I made this tutorial because there wasn't really a good tutorial how to make AI in your map. There are some tutorials but most of them are so short you cant get any information out it. So im hoping some people can use it. If there are any suggestions what can be better just tell me. And i read on a topic that foyleman it can put it under the tutorial list so please do that!

All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline.com can be found News.php.
MODSonline Subscriptions
Partners
Quake 4 Mods for Dummies
Half-Life 2 Mods for Dummies
Call of Duty Headquarters
Frag Universe
Battle for Europe COD2
mp_carpark
The Firing Box
modbase.be
Ask About
Advertising
Friends
After Life Gaming
CoD 4 Base
SOF2 Files and Downloads
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 127
MODSonair Episode 126
MODSonair Episode 125
MODSonair Episode 124
MODSonair Episode 123
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware