Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripts
Part 2 [message #19660] Fri, 09 May 2003 15:33 Go to previous messageGo to previous message
Dante
Messages: 1039
Registered: February 2003
Karma:
General (1 Star)
Now.. you have a good idea of what each one does, lets examine an example script, and what it does.

We will create a basic drop off, with a letterbox camera watching it happen.
Here is the resources used in this example, all found in always.dat

Presets Used in this Example Scipt:
Objects:
GDI_Transport_Helicopter
GDI_MiniGunner_0
Sounds:
OnYourFeet
Door_Open
Rope_Out
Door_Close
Rope_Retract

W3D Animations Used:
XG_TransprtBone.w3d
BN_Trajectory.w3d
XG_RT_rope.w3d
XG_RT_TroopBone.w3d
XG_RT_AudioA.w3d
XG_RT_AudioZ.w3d

Scripts Used:
WS Scripts.dll:
M00_Base_Defense
Custom Scripts.dll:
n/a

ok, on to the scripting:

First, lets do the camera stuff, as it is the most important to get right.

-0 Enable_Letterbox, 1, 1
-0 Control_Camera, 0
-0 Set_Screen_Fade_Color, 0, 0, 0, 0
-0 Set_Screen_Fade_Opacity, 1, 0
-10 Set_Screen_Fade_Opacity, 0, 0
-760 Set_Screen_Fade_Opacity, 0, 2
-800 Set_Screen_Fade_Opacity, 0, 0
-800 Control_Camera, -1
-800 Enable_Letterbox, 0, 1

now, what did we just do there, simple, first we turned on letterbox and enabled the control of the camera.
next we set the fade color and started a fade in effect
now, after a full 760 frames of our cinematic plays, we will begin the fade out a little bit slower than the fade in
then finally disable camera control, and take away the letterbox effect.

next, lets create some real stuff to look at (*note, by adding the above to a cinematic, you may not be able to view the next items without a custom camera view)

first the path, which is named XG_TransprtBone.w3d and is in always.dat
-0 Create_Object, 1, "XG_TransprtBone",
-0 Play_Animation, 1, "XG_TransprtBone.XG_RT_TrajA", 0
-401 Play_Animation, 1, "XG_TransprtBone.XG_RT_TrajL", 1
-1000 destroy_object, 1

now, you are wondering what THAT did?, simple, it created a path definition (bones only w3d) and played a couple of the internal animations for it at certain times

next, we create3 a chinook that can be killed
-0 Create_Real_Object, 2, "GDI_Transport_Helicopter", 1, "BN_Trajectory"
-0 Attach_to_Bone, 2,1,"BN_Trajectory"
-0 Play_Animation, 2, "v_GDI_trnspt.XG_RT_trnsptA",0
-401 Play_Animation, 2, "v_GDI_trnspt.XG_RT_trnsptL",1
-1000 destroy_object, 2

there, we hae created a visual item, attached it to a path, and played the specified internal animations at the same time as our path is happening
basically, the first animation is the flying, the second animation is the troop information


now to create a rope for the soldier to go down

-0 Create_Object, 3, "XG_RT_rope", 0, 0, 0, 0
-0 Play_Animation, 3, "XG_RT_rope.XG_RT_ropeA", 0
-401 Play_Animation, 3, "XG_RT_rope.XG_RT_ropeL", 1
-760 destroy_object, 3

the animations in this part are simply having the rope wiggle around a bit from at the time the troop is on it, and unrooling and rolling up at the specified times

next, make a troop bone, why you ask, so the troop moved DOWN the rope instead of just sitting in the chinook

-401 Create_Object, 4, "XG_RT_TroopBone", 0, 0, 0, 0,
-401 Play_Animation, 4, "XG_RT_TroopBone.XG_RT_TroopBone",0
-490 destroy_object, 4

now there is a bone in place, and ready to "slide" down the rope when the troop drops

now lets create a character that will drop out of the chinook

-401 Create_Real_Object, 5, "GDI_MiniGunner_0", 2, "SPAWNER"
-401 Play_Animation, 5, "S_A_Human.H_A_TroopDrop", 0
-401 Attach_to_Bone, 5,4,"Troop_L"
-490 Attach_to_Bone, 5,-1,"Troop_L"
-690 Attach_Script, 5, "M00_Base_Defense","300,10,2"

now, notice here, that it has a bone that it creates at, and an id specified, that means that it will create where the spawner bone is on the transport helicopter.
then, at the specified time, it plays the rope animation, attaches to the rope (because of the troop bone it slides down) then removes from the rope.
and finally, we gave it a basic base defense script that will enable a bit of AI in the unit.

finally, we do basic cleanups for our objects

1000000 Destroy_Object, 1
1000000 Destroy_Object, 2
1000000 Destroy_Object, 3
1000000 Destroy_Object, 4

the 1000000 is a standard time amount in all the westwood text cinematics, i personally would just use 800

oh wait you ask, what about adding some sound to this cinematic????

you don't want a boring silent chinook coming and and not making any sound do you?

ok, here we go, lets do the sound section now. im not going to get too exact, but you will get the idea

-0 Play_Audio, "OnYourFeet"
-280 Create_Object, 6, "XG_RT_AudioA"
-280 Play_Animation, 6, "XG_RT_AdioA.XG_RT_AudioA", 0
-280 Play_Audio, "Door_Open", 6, "BN_CH_Dooropen"
-281 Play_Audio, "Rope_Out", 6, "BN_Rope"
-668 Create_Object, 7, "XG_RT_AudioZ"
-668 Play_Animation, 7, "XG_RT_AudioZ.XG_RT_AudioZ", 0
-668 Play_Audio, "Door_Close", 7, "BN_CH_Doorclose"
-668 Play_Audio, "Rope_Retract", 7, "BN_Rope"
1000000 Destroy_Object, 6
1000000 Destroy_Object, 7


wow, thats alot of sound effect no? simply explained, first, play some background music to set your mood
next, create audio bones to attach the 3d sound effects to
then, at the correct times, play the door open sound effect, the rope rolling out sound effect, the play the door close and the rope retract sfx

wait... what about the chinook sound effect, how will i hear that???
well some items have the built in sound effect, the chinook for example uses the engine run sound effect while an animation is playing.

if you are wondering, how do you find out how long animations are, simply open up the w3d in w3d viewer, and then select the animation, in the status bar, it will show you the total number of frames for that animation.
as far as bone names, you can open the w3d up in wdump and check out the bone names from there.

now, there you have it, that is how you can create all types of cinematics, and you have the use of them throughout the entire level.
by creating test_cinematic objects, or attaching the poke_and_play_cinematic you can add some really kewl effects to your mod.




mirrored on http://Modx.RenEvo.Com


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Revamped Stealth Generators
Next Topic: Ceiling guns in CnC mode
Goto Forum:
  


Current Time: Tue Dec 24 12:13:20 MST 2024

Total time taken to generate the page: 0.01185 seconds