Home   Help Search Login Register  

Author Topic: [] exec "scriptname.sqs"  (Read 773 times)

0 Members and 1 Guest are viewing this topic.

gadolinite

  • Guest
[] exec "scriptname.sqs"
« on: 26 May 2004, 01:41:17 »
[what goes here?] exec "scriptname.sqs"
« Last Edit: 26 May 2004, 01:41:29 by gadolinite »

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:[] exec "scriptname.sqs"
« Reply #1 on: 26 May 2004, 01:58:51 »
[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
 
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

j-man

  • Guest
Re:[] exec "scriptname.sqs"
« Reply #2 on: 26 May 2004, 02:15:16 »
that's where your variable(s) go.
If your script has a line like this:

Code: [Select]
_varname = _this select 0
that what ever you put in between the "[]" will replace "_varname" in your script

eg.

Code: [Select]
[jman] exec "script.sqs"
and then...

Code: [Select]
_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.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:[] exec "scriptname.sqs"
« Reply #3 on: 26 May 2004, 03:33:59 »
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
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:[] exec "scriptname.sqs"
« Reply #4 on: 26 May 2004, 04:04:06 »
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.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

gadolinite

  • Guest
Re:[] exec "scriptname.sqs"
« Reply #5 on: 26 May 2004, 22:43:13 »
I see, thats the OFP game engine's way of passing parameters.

gadolinite

  • Guest
Re:[] exec "scriptname.sqs"
« Reply #6 on: 30 May 2004, 18:31:47 »
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

PsyWarrior

  • Guest
Re:[] exec "scriptname.sqs"
« Reply #7 on: 30 May 2004, 18:36:09 »
Greets,

Try this out:

Code: [Select]
_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