MODSonline
  Welcome Guest to MODSonline Home | Forums | Register | Login
Main-Menu
Home
Login
Register
Add Download
Add News
Add Tutorial *
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
Wiki *
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoDWW 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
general99 [Forum]
Blade13127 [Polls]

2 Members and 14 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Monday, Dec. 1st
A message from foyleman
Sunday, Nov. 30th
MODSonair 156 Live
Friday, Nov. 28th
MODSonair Episode 155
Wednesday, Nov. 26th
MODSonair Forum Buttons
Monday, Nov. 24th
Holiday Gift Guide 2008 - PC
Latest Poll
Single or Multiplayer maps for World at War?
Single-Player 30.12%
Multiplayer 61.45%
WHAT!? The tools are out? 8.43%
Read More...
10 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
Weird texture problem
HL2 Level Design.. Posts: (5) Views: (30) by cz_squishy
FX help
CoD:WW Scripting.. Posts: (8) Views: (121) by ROTCGuy
A message from foyleman
In The News.. Posts: (7) Views: (73) by ROTCGuy
Elevator Help
CoD 2 Level Desi.. Posts: (2) Views: (19) by luke0777
Art of War Central Half-Life 2 Mods for Dummies
CoDWW Download
Tutorials: SOF1 Mapping
Mapping and modding for Soldier of Fortune.
Add your tutorial (registered users)

Rating:
Awful Rating Poor Rating Average Rating Good Rating Excellent Rating
Versions: You must be logged in to view history.
Scripting : Simple Animations
2003-11-23 10:25:05
In this script we will make a bad guy kick open a door, kill a hostage and then come after you.
Simple Animations

Ok in our first script we will make a simple animated sequence, first download the script example map here. Save it in your "sof\base\maps" folder.

In this script we will make a bad guy kick open a door, kill a hostage and then come after you.

So firstly open up the blank script, fire up SofRadiant and load the example map. (scriptex.map).

For single player maps there are 2 ways to run a script, you can add the key "script" to the worldspawn entity with a value of the script path or you can target a "Script_Runner". For DM maps you can o­nly target a "Script_Runner".

The "Script_Runner" entity is very easy to use and there are o­nly 2 main keys to worry about. The first is "targetname" and second is "script", the value for script is simply the path to the script we want to run, in our case "test/test". This path is taken from the "ds" folder being the root directory, so this part isn't needed.

If you look at the map you will see several entities, for the moment look at the "m_nyc_mpunk" (punk1), notice in the entity properties that "Trigger_Spawn" is checked. This is just to demonstrate how it works, we would be better in this case if our enemy started off visible in our map. So "Trigger_Spawn" just means that the enemy wont appear until triggered or mentioned in a script.

So first we need to declare our variables, add the following lines to the script under the declare section.

local entity badguy

local entity bumguy

local entity door

These are the names that we will refer to in our script, now we need to assign the entities to the variables. Add the following lines under assign.

badguy = find entity with targetname "punk"

bumguyguy = find entity with targetname "bum"

door = find entity with targetname "stall_door"

This is pretty self explanatory, we are simply setting our variables to point to the relevant entities.

Now time for action, so under the action section add

use entity badguy

Compile the script, and the map and run it to test it out. When you step o­n the target and press the use key, the badguy should appear in the toilet. The hostage should appear right from the start, as he is not trigger spawned.

Now we'll get him to kick open the door, so add the next 4 lines

wait 1 seconds

animate entity badguy performing action STD_XKICKDOOR_N_A_A

use entity door

play sound "impact/door/kickdoor.wav" for entity door at volume 0.9

The 1st line just makes the script wait for 1 second.

The 2nd line plays the kickdoor animation for our badguy entity. There is a list of animations included in the docs folder of the sdk. Not sure if they all work, and which enemies they apply to. I haven't played with it too much, all I can suggest is that you experiment with them.

The next line simply triggers our door, the same as if the player had used it or if we had used a trigger in our map.

The 3rd line plays the appropriate sound for the door kicking animation.

Compile the script and run the map again, (there is no need to compile the map again, o­nly the script has changed).

Now our badguy should appear and kick open the door.

Now time for the kill, add the following

animate entity badguy performing action RUN by moving [96, 0, 0]

animate entity bumguy performing action STD_XAFRAIDSHAKE_N_N_N

animate entity badguy performing action STD_F_FWD_S_2 targeting entity bumguy

The 1st line moves the badguy by 96 units in the x plane (x,y,z), making him run.

2nd line makes the hostage shake, like a scared baby.

3rd line makes the badguy shoot the bum. STD_F_FWD_S_2= fire shot gun

Compile and test it, notice that after the badguy shoots the hostage he just stands there like a lemon. This is because he is still tied to the script. To release him add the following line.

animate entity badguy performing action SCRIPT_RELEASE

Now if you compile and test it he should start shooting at you after he has killed the hostage

Ok if it all works ok move o­n to tutorial 3.


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 can be found News.php.
Intergi
Partners
XoXide
Frag Universe
The Firing Box
Battle for Europe COD2
modbase.be
Call of Duty Headquarters
CODAddicts - Call of Duty News & Downloads
Ask About
Advertising
Friends
SOF2 Files and Downloads
Volcano
MODS Reloaded
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 155
MODSonair Episode 154
MODSonair Episode 153
MODSonair Episode 152
MODSonair Episode 151
Next Show
The next MODSonair show will air LIVE on:

Time remaining:
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware