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

Members Online

»
0 Active | 30 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
SOF1 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Scripting : Remote Cameras
Versions: You must be logged in to view history.
For this tutorial we are going to make our animation a little more dramatic by using a func_romote_camera, and we are going to move this around the scene.
Using Remote Cameras

For this tutorial we are going to make our animation a little more dramatic by using a "func_romote_camera", and we are going to move this around the scene.

First of all the basics of "func_remote_camera", there are o­nly 5 main keys we need to set up. These are already done in the example map but I will run through them. It needs a "targetname" and a "target", the "target" is what the camera is pointing at and the is an "info_notnull". The last main key is "volume" and sets the camera style, we will use "2" which is letterbox mode.

The other keys to check are "Scripted" and "No_Delete". "Scripted" puts player in godmode while camera is running and makes player non-solid. "No_Delete" stops the camera from being deleted so we can reuse it if we want.

Also if you are making a camera for a DM map and o­nly want the player who activated the camera to see it, make sure that "Activator_Only" is checked or every player will see the camera view.

Ok o­n with the show.

First we need to add some lines to the declare section.

local entity camera

local entity camera_target

local int sig1

The sig1 variable is used for signaling, this will be set when a particular action has been completed. So we can wait for it to set before continuing.

Now under the assign section add

camera=find entity with targetname "camera1"

camera_target=find entity with targetname "camera1_target"

We also need to set how the objects move, we want are camera and camera target to move through walls so we add the following lines under the assign section. Note the variable "MOVETYPE_NOCLIP" is defined in the "header.ds" file in the "common" directory.

camera.movetype=MOVETYPE_NOCLIP

camera_target.movetype=MOVETYPE_NOCLIP

Ok here's the basic plan, we will move the camera from behind the player to the toilet, and zoom in o­n the badguy, then spin round and zoom in o­n the kill.

Time for action so add the following lines under the action section between the "use entity badguy" and "animate entity badguy performing action STD_XKICKDOOR_N_A_A" lines

use entity camera

move entity camera by [-404,0,0] at 50 speed signaling sig1

wait for all clearing sig1

move entity camera by [0,0,-128] at 50 speed signaling sig1

wait for all clearing sig1

move entity camera by [0,-8,0] at 50 speed

move entity camera_target by [0,-8,0] at 50 speed signaling sig1

wait 2 seconds

The 1st line turns o­n the camera.

The 2nd line moves the camera 404 units to the left, at speed 50 and signals sig1 when it is completed.

The next line, halts the script until sig1 is set and then clears it, ready for reuse.

We then move the camera down 128 units, and then move then camera and target to center o­n the badguys face. Note the camera always points at the target, we can move either o­ne or both to get the desired effect.

Lastly we hold the camera o­n the badguys face for 2 seconds.

Now after the "animate entity badguy performing action RUN by moving [96, 0, 0]" line add thee 3 lines.

move entity camera by [64,-48,-32] at 100 speed

move entity camera_target by [124,0,-32] at 100 speed signaling sig1

wait for all clearing sig1

This will spin the camera round to face the hostage.

Finally add the following 2 lines after the "animate entity badguy performing action STD_F_FWD_S_2 targeting entity bumguy" line.

wait 5 seconds

use entity camera

This holds the last position for 5 seconds and then turns the camera off.

Note that all units can be calculated by using SofRadiant, when you drag an entity around the distance is shown at the very bottom of the window, next to the Origin box. These units are in x,y,z format.

Ok the finished script should look like .

#include "../common/header.ds"

output "C:/games/sof/base/ds/test"

////////////

// declare

///////////

local entity badguy

local entity bumguy

local entity door

local entity camera

local entity camera_target

local int sig1

////////////

// assign

///////////

badguy = find entity with targetname "punk"

bumguy = find entity with targetname "bumguy"

door = find entity with targetname "stall_door"

camera=find entity with targetname "camera1"

camera_target=find entity with targetname "camera1_target"

camera.movetype=MOVETYPE_NOCLIP

camera_target.movetype=MOVETYPE_NOCLIPn

////////////

// action

////////////

use entity badguy

use entity camera

move entity camera by [-404,0,0] at 50 speed signaling sig1

wait for all clearing sig1

move entity camera by [0,0,-128] at 50 speed signaling sig1

wait for all clearing sig1

move entity camera by [0,-8,0] at 50 speed

move entity camera_target by [0,-8,0] at 50 speed signaling sig1

wait 2 seconds

move entity camera by [64,0,0] at 50 speed signaling sig1

wait for all clearing sig1

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

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

move entity camera by [64,-48,-32] at 100 speed

move entity camera_target by [124,0,-32] at 100 speed signaling sig1

wait for all clearing sig1

animate entity bumguy performing action STD_XAFRAIDSHAKE_N_N_N

animate entity badguy performing action STD_F_FWD_S_2 targeting entity bumguy

wait 5 seconds

use entity camera

animate entity badguy performing action SCRIPT_RELEASE

Note you can add comments be using "//" at the beginning of the comment.

Ok now compile the script and run the map. Step o­n the target, press the use key and watch the action.

This is a very simple demonstration of what can be done, and it is up to your imagination to get the best out of cameras and scripting.

Note the move commands can be applied to other entities, such as "func_wall" and "func_train". As will be demonstrated in tutorial 4.

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

»