OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: DJ_WarDog on 26 Jan 2003, 10:25:16

Title: how do u launch a scud ?????
Post by: DJ_WarDog on 26 Jan 2003, 10:25:16
i dont no how to launch a scud HELP!!!!!!! ??? ???
Title: Re:how do u launch a scud ?????
Post by: KTottE on 26 Jan 2003, 10:35:27
If you would have checked the main page of OFPEC (http://www.ofpec.com/) you would have seen the link to this (http://www.ofpec.com/editors/resource_view.php?id=142) tutorial.

It really helps if you try before asking a question. And you should always try in the Editors Depot (http://www.ofpec.com/editors/index.php) first.
Title: Re:how do u launch a scud ?????
Post by: Respined on 26 Jan 2003, 16:24:10
;pre-launch preproccessing of SQF file
GetOut = preprocessFile "getout.sqf"
Launch1 = preprocessFile "launch1.sqf"
Launch2 = preprocessFile "launch2.sqf"

;forces scud operator to move to scud and act like he is activating the scud
#operate
scudman SetBehaviour "CARELESS"
?(driverdead): Goto "scudmanboard"
?(abortscud): Goto "end"
scudman DoMove GetPos cpanel
?(driverdead): Goto "scudmanboard"
?(abortscud): Goto "end"
@ unitready scudman
?(driverdead): Goto "scudmanboard"
?(abortscud): Goto "end"
scudman SetDir 0
?(driverdead): Goto "scudmanboard"
?(abortscud): Goto "end"
;seperate animation script that allows this script to run while animations take place
[] exec "animation.sqs"
?(driverdead): Goto "scudmanboard"
?(abortscud): Goto "end"

;default driver of scud begins and finishes launch sequence
#launchscud
~5
?(driverdead): Goto "scudmanboard"
?(abortscud): Goto "end"
;tells scud to position missile
iscud action ["SCUD Launch"]
~10
prepared = true
?(driverdead): Goto "scudmanboard"
?(abortscud): Goto "end"
;tells scud to activate and lift off
iscud action ["SCUD Start"]
scudlaunch = true
Goto "end"

;this part is run if scud driver is dead and tells scudman to get in the scud
#scudmanboard
;ejects dead driver and deletes him
_driver = driver iscud
_driver Call GetOut
~0.5
DeleteVehicle _driver
;assigns scudman as driver
scudman MoveInDriver iscud
scudman AssignAsDriver iscud
?(abortscud): Goto "end"
;tells scudman to get in
~0.1
[scudman] orderGetIn true
?(abortscud): Goto "end"
@ Unitready scudman
?(abortscud): Goto "end"
Goto "scudmanlaunchscud"

;this is second part for scudman to launch the scud himself and it tells scudman to activate and launch the scud
#scudmanlaunchscud

?(prepared): Goto "LaunchIT"
~10
;tells scud to position missile
iscud action ["SCUD Launch"]
~10
;tells scud to activate and lift off
iscud action ["SCUD Start"]
scudlaunch = true
~10
scudman Call GetOut
Goto "end"

#LaunchIT
~10
;tells scud to activate and lift off
iscud action ["SCUD Start"]
scudlaunch = true
~10
scudman Call GetOut
Goto "end"

;exit the script
#end
exit
Title: Re:how do u launch a scud ?????
Post by: Wolfsbane on 26 Jan 2003, 20:17:21
Respined, I think that whilst your help is appreciated, if the chap in question is asking how to launch a scud, I doubt hitting him with a load of code which will probably mean nothing to him, will be helpful.

Next time, please put in a detailed synopsis of what you have to do with that code, or direct them to the tutorial / script which does the required task.

This will prevent the new Member from simply giving up and walking away after seeing all of that. :D

Thanks!
Title: Re:how do u launch a scud ?????
Post by: Tomb on 26 Jan 2003, 22:37:02
 :wave: Welcome to the sewers of editing, DJ_WarDog  :cheers:


 :o Guess ya want the AI to do the job, oy?!  :D :thumbsup:

 Well, here's a couple of spells m8 :

===============================================
Place the SCUD vehicle on the map where you want it to be. Name it scud1 in the NAME field when created.
 
 Then create two triggers with the following stuff as content:
 
 Trigger 1:
 
 Activation - (whatever, could be RadioAlpha if you wanna be in control though not a driver) :

 On Activation - scud1 action ["scud launch"]
 
 
 Trigger 2:
 
 Activation - same stuff, yer choise!

 On Activation - scud1 action ["scud start"]
 
 Where Scud1 is the name of the vehicle (you can use whatever name, doesn't matter).  
 
And then, if you use RadioAlpha, when ya press  001 on yer keyboard, trigg-1 will fire (raise missile ramp to vertical pos)
 
and if you press 002 trigg-2 will launch the missile  :-*


...or use the snippet that KTottExtacy was referring to, it's right HERE (http://www.ofpec.com/editors/resource_view.php?id=142)  :-* 8) ;D


Have a neat stay, matey!  ;)

L8r

[mod] Oh, and don't worry about not getting a pin of the hardbutt-code that was posted up there;
I don't get it neither  ::) ;D ...still use these basics after 1/½ years of editing  :-X ;D