OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: gadolinite on 26 May 2004, 01:41:17
-
[what goes here?] exec "scriptname.sqs"
-
[whatever_you_want] exec "scriptname.sqs"
http://www.ofpec.com/editors/browse.php?category=1_3
check out the link step by step - and you should find alot of
answers to your question ;)
~S~ CD
-
that's where your variable(s) go.
If your script has a line like this:
_varname = _this select 0
that what ever you put in between the "[]" will replace "_varname" in your script
eg.
[jman] exec "script.sqs"
and then...
_man = _this select 0
_man setdammage 0
exit
In that script, the soldier named "jman" would have his dammage set to 0. But if you replace "jman" with something else when you execute the script, then who ever you replace "jman" with, would have there dammage set to 0.
-
j-man - soz, but i don't think it make much sense to go into
deatail about passing unitnames or anything else at this point
of the questions here.
Maybe this one makes more sense (don't think so without
having read a tut about scripts or arrays, but however):
[] exec "sriptname.sqs"
[] = an array of any kind
inside script an array can be accessed as a whole by:
_this
or by individual elements e.g:
_this select 0
_this select 1
_this select etc.
let's say the array = [whateva1,whateva2,whateva3]
then:
_this = [whateva1,whateva2,whateva3]
or:
_this select 0 = whateva1
_this select 1 = whateva2
_this select 2 = whateva3
:note - again all i can suggest you is to have a read thru some
scripting tutorials to get some more knowledge about what
i'm talking here.
~S~ CD
-
Not to make things too complicated for you here, but you can also pass other things besides arrays:
unit1 exec "blah.sqs"
then in your script, "blah.sqs", you will have access to a variable called "_this". Since you passed the script unit1, _this will refer to unit1 in that particular copy of the script that you just now ran.
-
I see, thats the OFP game engine's way of passing parameters.
-
How would set this up?
trigger condition 1 pseudocode:
[partone] exec "domove.sqs"
trigger condition 2 pseudocode:
[parttwo] exec "domove.sqs"
#partone
chop domove getpos a
exit
#parttwo
chop domove getpos b
exit
:)Thanks
-
Greets,
Try this out:
_Place = _this select 0
goto _place
hint "Error! _place must be Part1 or Part2!"
exit
#Part1
;code
exit
#Part2
;code
exit
Exec it with
["Part1"] exec "Script.sqs
You must use the speech marks in the execution.
That should do it ;).
-Supr. Cmdr. PsyWarrior
-Psychic Productions