[B]Dramatic Scripted Sequence Script
What is this?[/B]
You can play scripted sequence with this script. but you have to know what you're doing and what is scripted sequence.
as you can see, Rappel is one of scripted sequence. jumping zombie, leaping combine, some of special scenes.. they are scripted sequence too! and you can play it with single script.
and If you're gonna use this, just leave credit.
[B]Media[/B]
[media]http://www.youtube.com/watch?v=oU5H_0v5-JA&context=C35eeb24ADOEgsToPDskLUddmkSgVk5jIDgR8LxKP5[/media]
[media]http://www.youtube.com/watch?v=XwEZWvwT3sA[/media]
[B]
Code[/B]
This code contains example of rappel sequence and the main code of DSSS.
you can run this example in gm_construct.
[lua]
SCENE_MOVE_NOPE = 0
SCENE_MOVE_WALK = 1
SCENE_MOVE_RUN = 2
SCENE_MOVE_CUSTOM = 3
SCENE_MOVE_INSTA = 4
SCENE_MOVE_TURN = 5
local nScene = {
classname = "npc_combine_s",
model = "models/Combine_Soldier.mdl",
weapon = "ai_weapon_smg1",
pos = Vector( -293.32766723633, -2350.1477050781, 256.03125 ),
ang = Angle( 0, 0, 0 ),
addon = function( npc )
npc.beginevent = function( npc )
npc:EmitSound("npc/combine_soldier/zipline_clip2.wav")
npc.rs = CreateSound( npc, "npc/combine_soldier/zipline2.wav" )
npc.rs:Play()
npc.zip2:SetParent( npc )
npc.zip2:Fire( "SetParentAttachment", "zipline", 0.5 )
end
end,
}
local sScene = {
pos = Vector( -266.17498779297, -1924.0921630859, 256.03125 ),
ang = Angle( 0, 90, 0 ),
idleseq = "rappel_a_preIdle",
playseq = "rappel_e",
dradius = 800,
move = SCENE_MOVE_RUN,
interruptable = false,
movedelay = 0,
dodelay = 1,
plus = function( ss, npc )
npc.endevent = function( npc )
npc:EmitSound("npc/combine_soldier/zipline_hitground"..math.random(1,2)..".wav")
npc.rs:Stop()
npc.zip:Remove()
npc.zip2:Remove()
end
// Zipline
npc.zip = ents.Create("keyframe_rope")
npc.zip:SetPos( ss:GetPos() - ss:GetAngles():Forward() * 10 )
npc.zip:SetKeyValue( "MoveSpeed", "200" )
npc.zip:SetKeyValue( "Type", "0" )
npc.zip:SetKeyValue( "Slack", "-2500" )
npc.zip:SetKeyValue( "Subdiv", "5" )
npc.zip:SetKeyValue( "Width", "1.5" )
npc.zip:SetKeyValue( "TextureScale", "1" )
npc.zip:SetKeyValue( "Collide", "1" )
npc.zip:SetKeyValue( "RopeMaterial", "cable/cable2.vmt" )
npc.zip:SetKeyValue( "targetname", npc:EntIndex() .. "_rappel" )
npc.zip:Spawn()
npc.zip:Activate()
npc.zip2 = ents.Create("move_rope")
npc.zip2:SetPos( ss:GetPos() - ss:GetAngles():Forward() * 1 )
npc.zip2:SetKeyValue( "MoveSpeed", "200" )
npc.zip2:SetKeyValue( "Type", "0" )
npc.zip2:SetKeyValue( "Slack", "-2500" )
npc.zip2:SetKeyValue( "Subdiv", "5" )
npc.zip2:SetKeyValue( "Width", "1.5" )
npc.zip2:SetKeyValue( "TextureScale", "1" )
npc.zip2:SetKeyValue( "Collide", "1" )
npc.zip2:SetKeyValue( "PositionInterpolator", "2" )
npc.zip2:SetKeyValue( "RopeMaterial", "cable/cable2.vmt" )
npc.zip2:SetKeyValue( "NextKey", npc:EntIndex() .. "_rappel" )
npc.zip2:SetKeyValue( "targetname", npc:EntIndex() .. "_rappel2" )
npc.zip2:Spawn()
npc.zip2:Activate()
end
}
function CActorScriptedSequence( ndata, sdata )
local c = ents.Create( ndata.classname )
c:SetName( "actor_".. c:EntIndex() )
c:SetPos( ndata.pos )
c:SetModel( ndata.model )
c:SetAngles( ndata.ang )
c:Give( ndata.weapon )
c:Spawn()
c:Activate()
ndata.addon( c )
local sc = ents.Create( "scripted_sequence" )
sc:SetPos( sdata.pos )
sc:SetAngles( sdata.ang )
sc:SetSaveValue( "m_iszEntity", "actor_".. c:EntIndex() )
sc:SetSaveValue( "m_iszIdle", sdata.idleseq )
sc:SetSaveValue( "m_iszPlay", sdata.playseq )
sc:SetSaveValue( "m_flRadius", sdata.dradius )
sc:SetSaveValue( "m_interruptable", true )
sc:SetSaveValue( "m_fMoveTo", sdata.move )
sc.actor = c
c.acting = sc
sc:Spawn()
timer.Create( "actor_ft_".. c:EntIndex(), 0.1, 0, function()
if not c:IsValid() or not sc:IsValid()then
timer.Destroy( "actor_ft_".. c:EntIndex() )
end
if sc:GetSaveTable().m_sequenceStarted == true then
DoBeginsEvents( c )
timer.Destroy( "actor_ft_".. c:EntIndex() )
end
end )
sc:Fire( "MoveToPosition", "", sdata.movedelay )
sc:Fire( "BeginSequence", "", sdata.dodelay )
sdata.plus( sc, c )
end
function DoBeginsEvents( npc )
if npc.beginevent then
npc.beginevent( npc )
end
end
function DoEndsEvents( npc )
if npc.endevent then
npc.endevent( npc )
end
end
function FiresSeqOutput(ent)
if ent:GetClass() == "scripted_sequence" then
DoEndsEvents( ent.actor )
end
end
hook.Add("EntityRemoved", "FiresSeqOutput", FiresSeqOutput)
CActorScriptedSequence( nScene, sScene )
[/lua]
So this is only for machinimas?
[QUOTE=aurum481;34729838]So this is only for machinimas?[/QUOTE]
If you making co-op or some npc war thingy, you can use this.
I see the potential for this, could you perhaps write some documentation documenting the different area's of the script so people can have a shot at making their own?
and could we get the hl2 fast zombie building climb? :D
[QUOTE=Dorkslayz;34738852]I see the potential for this, could you perhaps write some documentation documenting the different area's of the script so people can have a shot at making their own?[/QUOTE]
if you open the model in source sdk's Model Viewer and look sequence list then you can get what is the scripted sequence.
[B]example :[/B]
zombie/Zombie.mdl
Breakthrough
> zombie is entering indoor and breaking the door.
Police.mdl
Dropship_Deploy
> Metropolice is jumping to the front
Combine_Super_Soldier.mdl
leanwall_corner_right_exit ( idle : leanwall_corner_right_idle )
> Combine appears from the wall.
like this.
Just tested it out, very nice.
[QUOTE=Dorkslayz;34757597]Just tested it out, very nice.[/QUOTE]
I'm glad to this can help you :)
that first vid is awsome, ive never seen that before
what weapon pack in video #2 plz answer
Sorry, you need to Log In to post a reply to this thread.