Members Online»
0 Active | 30 Guests
Online:
|
LATEST FORUM THREADS»
by StrYdeR
Posts: 3 / 166 The Future of MODSonline
In The News by KAZAM3766
Posts: 1 / 516 CoD: Battle Royale
CoD+UO Map + Mod Releases by morgawr
Posts: 1 / 2588 Damaged .pk3's
CoD Mapping by lazygit
Posts: 1 / 3101 heli to attack ai
CoD4 SP Mapping by DrBiggzz
Posts: 11 / 992 New Cod UO Rifle Mod.
CoD Mapping |
Polls»
|
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 only 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 only 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 on 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 on the badguy, then spin round and zoom in on 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 on 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 on the badguys face. Note the camera always points at the target, we can move either one or both to get the desired effect.
Lastly we hold the camera on 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 on 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»
Comments: 5
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which... Comments: 5
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ... Comments: 5
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead?
... Comments: 5
Codutility.com up and runn...
It seems to me the like the site is completely dead? Comments: 5
Codutility.com up and runn...
Yeeaahhhh.........
|
Latest Downloads»
OHMY Don Quixote
Call of Duty 2: Maps: Multiplayer (5.76Mb) OHMY Neuburg
Call of Duty 2: Maps: Multiplayer (6.84Mb) OHMY Tebessa
Call of Duty 2: Maps: Multiplayer (7.36Mb) OHMY POW Camp
Call of Duty 2: Maps: Multiplayer (2.15Mb) OHMY Valley
Call of Duty 2: Maps: Multiplayer (5.7Mb) |
Partners & Friends»
|
Site Links and Information
|
Partners
|
Friends
|
Copyright © MODSonline LLC
Tresware Content Management System © 2011
Website Designed by LKFX and Developed by Tresware