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

Members Online

»
0 Active | 12 Guests
Online:

LATEST FORUM THREADS

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

Tutorials

»
SOF2 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Goal Scripting Tutorial
Versions: You must be logged in to view history.
This tutorial will show how to move a group of marines toward a specific area while attacking the enemy.
Goal Scripting Tutorial, by narc

This tutorial will show how to move a group of marines toward a specific area while attacking the enemy. i have provided an incomplete map for you to follow along with, if you get stuck look at the fully completed example files to see how things work.

file list:

(incomplete folder)
squadtut.map -- incomplete map for you to do the tutorial with

(completed folder)
squadmove.IBI -- compiled icarus script
squadtut.bsp -- compiled .map file
squadtut.nav -- areapoint definition file, opens in wordpad
squadmove.txt -- uncompiled icarus script, opens in behavEd
squadtut.map -- uncompiled .map, opens in SPRadiant


before you begin, lets see what you will be making, put these 3 files from the completed folder into the specified game directories and run the map from the console:

.bsp file -- base/maps
.nav file -- base/maps
.ibi file -- base/scripts


pretty cool eh? ok, delete those 3 completed files and continue -- you will start fresh.


SETTING UP THE MAP ENTITIES

open your incomplete squadtut.map in SPRadiant

#1 insert an NPC_Marine_Sergeant -- give him the following properties.

classname NPC_Marine_Sergeant
ICARUSname sarge

#2 now insert 2 or 3 NPC_Marine_Soldier -- you dont need to give them any properties, but its a good idea to put them in front of the sarge or to the side of him.

#3 now insert an NPC_Marine_Scout -- you dont need to give him any properties, but its a good idea to put him in front of the squad.

#4 now insert a script_runner -- give it the following properties.

classname script_runner
script squadmove
targetname sr_1

#5 now insert a trigger_multiple -- give it the following properties.

classname trigger_multiple
target sr_1
(check the boxes o­nce_only and player_only)

note: when you walk through the trigger it will cause the script_runner to run a script named squadmove. o­nce that script is running it will make the team move toward an areapoint.

MAKING AN AREAPOINT

#1 in spradiant open your map, as you move your mouse cusor around in the 2d view windows you will see the xyz coordinates of that location in the lower statusbar area. the idea is to pick a few spots o­n the map where you will want the group to go and make notes of the coordinates for them.

#2 create a text file, you will define the coordinate information in it. these coordinates will be refrenced by your script so that you can make someone walk area to area -- ap1 to ap2 to ap3 for instance. (for our tutorial we o­nly will be using ap1 but you can define as many as you want in the same file)
AreaPoint
{
name "ap1"
x 768.000000
y 128.000000
z 320.000000
}
AreaPoint
{
name "ap2"
x -64.000000
y 128.000000
z 192.000000
}
AreaPoint
{
name "ap3"
x -64.000000
y -256.000000
z 64.000000
}

#3 save the text file as squadtut.nav and put it into base/maps of the sdk, you will also put this file into base/maps of the game folder.

note: its important that your map and navfile are named the exact same.

#4 save your map and close radiant, now when you open your map again in radiant the areapoints will appear as blue X's, if you dont see them try pressing shift+n -- that is the shortcut to hide/show them.

MAKING A NAVPOINT GRID

in order for your NPC's to use their artificial intelligence they must have a gridwork of nodes that define paths o­n which they may travel. to do this you place info_NPCnav points in the map. -- in oddly shaped areas it will require more nav points to create useable paths. you can refer to the example map to see how they should be placed. i have spared you the trouble of placing these many nodes so you can skip this step in the tutorial, but when you do need to do it for your maps here are tips:

place them evenly, 128 to 256 units apart.

place them near the ground, 64 units is good. when you put them high in the sky sometimes they dont work properly.

at corners -- place 3 in a triangle shape to keep npcs from getting stuck there.

on stairways -- place 4 in a diamond shape in the middle to allow npcs to pass o­ne another

at doorways -- put 1 in the center and 2 o­n either side to keep npcs from getting stuck there.

useful debugging console commands are listed at the end of base/docs/Nav Point System.doc -- they will allow you to see and add navpoints and areapoints ingame.

MAKING AN ICARUS SCRIPT

open behavEd

#1 from events menu o­n the left, double click "affect" it will place that item o­n the right.

#2 o­n the right side in the script flow, select the "affect" item and doubleclick it twice -- the event editor window should pop up.

#3 where it says AFFECT you should type the ICARUSname of the entity that you wish to manipulate -- type sarge -- for the affect type you can choose FLUSH or INSERT.

FLUSH will erase all previous tasks.
INSERT allows you to run more than o­ne task simutaneously.

most of the time you want to use FLUSH. so choose it and click OK

#4 under script flow o­n the right, select the "affect sarge" item. -- dont open the event editor window just highlight the item.

#5 from events menu o­n the left, double click "task" it will place that item o­n the right. nested under the "affect sarge" item.

#6 open the item you just created in the event editor, where it says TASK type a short descriptive name name for your task -- type go_to_ap1 and click OK

#7 under script flow o­n the right, select the "task go_to_ap1" item. -- dont open the event editor window just highlight the item.

#8 from events menu o­n the left, double click "set set_types" it will place that item o­n the right. nested under the "task go_to_ap1" item.

#9 open the item you just created in the event editor, where it says SET choose "SET_TASK_SPEED" then click the RE-EVALUATE button. for the type choose "3 - TakeYourTime" then click OK

note: the RE-EVALUATE button updates the information in the event editor so that the proper choices will be shown.

#10 from events menu o­n the left, double click "set set_types" it will place that item o­n the right. nested under the "SET_TASK_SPEED" item.

#11 open the item you just created in the event editor, where it says SET choose "SET_GOAL" then click the RE-EVALUATE button. for the goal type choose "HoldArea" then click OK

#12 from events menu o­n the left, double click "set set_types" it will place that item o­n the right nested under the "SET_GOAL" item.

#13 open the item you just created in the event editor, where it says SET choose "SET_AREAGOAL" then click the RE-EVALUATE button. where it says NULL you will type the name of an areapoint. type ap1 and click OK

#14 from events menu o­n the left, double click "dowait" it will place that item o­n the right -- what you want to do is drag this item so that it is nested under the "affect sarge" item and after the task.


#15 open the item you just created in the event editor, where it says "DEFAULT" you will type the name of your task. type go_to_ap1 then click OK.

note: the dowait item will run this task, and wait until it is finished before executing any more of the script. -- there are seperate do and wait items if you want to run several tasks from the same script simutaneously.

#16 now under script flow o­n the right, double click the rem item. you can type in a description of what this script does. type: this script will make a squad advance to ap1 and click OK.

#17 under file choose Save As and save your script as squadmove

#18 click the compile button and hopefully it will give you no errors and say OK 7 blocks compiled.

#19 in SoF2SDK\base\scripts you will find your compiled script. its named squadmove.IBI -- put it in Program Files\Soldier of Fortune II - Double Helix\base\scripts.

you should now have these 3 items created and placed into the game directories:

.bsp file -- base/maps
.nav file -- base/maps
.ibi file -- base/scripts

now all you have to do is run the map to test it, if you got stuck or it doesnt work remember you can look at my completed example files to see what you did wrong. that concludes this tutorial, if you have any scripting questions ask them in the forum :)

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

»