Home   Help Search Login Register  

Author Topic: How to use stand.sqs  (Read 1331 times)

0 Members and 1 Guest are viewing this topic.

Offline DiehardmaxNL

  • Members
  • *
How to use stand.sqs
« on: 18 May 2010, 14:43:57 »
well i got a mod where OPF is turned in the american civil war and there are some sqs's that i want to use to make it more realistic like stand up and dont lay down and fire there were some sqs's like stand so they only stand and dont lay down here is the file:

_squad=_this select 0
_leader=_this select 1

{_x setUnitPos "UP";_x SwitchMove "Combat";_x allowFleeing 0} forEach units _squad

and his name: stand.sqs

im a newbie :dry: and i dont get it to work properly so if you could tell me how to use it i will be very grateful

thanks in forward

Offline gezegond

  • Members
  • *
Re: How to use stand.sqs
« Reply #1 on: 18 May 2010, 14:56:37 »
I'm not sure if this is what you want, but here it goes anyway:

(In the in-game editor) choose the unit you don't want to lay down, in it's init field type this:

this setUnitPos "UP"

I think the code you have is for making several units stand up, but since I'm not exactly a pro (I'm also a newbie) I'll let someone else explain it to you.

Hope that helps...

Offline RKurtzDmitriyev

  • Former Staff
  • ****
Re: How to use stand.sqs
« Reply #2 on: 18 May 2010, 15:07:39 »
gezegond is right. To make one unit stand up, use the code he suggested. Your script is just an easy tool to make a group stand up.

The most newbie-friendly way I can think of to execute the script properly is to enter the following code in a unit's initialization field:

Code: [Select]
[group this, leader group this] exec "stand.sqs"

You only need to do this to one unit in every group.

If you're serious about mission editing, consider using one of OFPEC's many fine tutorials to learn the OFP scripting language. Try this one for starters. Good luck. :good:
The OFP Editing Center wishes to remind you that the faithful COMREF will never threaten to stab you and, in fact, cannot speak.
However, in the event that it does speak, you are encouraged to heed its advice. ;)

Offline DiehardmaxNL

  • Members
  • *
Re: How to use stand.sqs
« Reply #3 on: 18 May 2010, 16:20:01 »
Hey thx :cool2: got it to work

but a real quick question how do you combine two sqs. so you got two like stand and then hold at the same time :scratch:

Offline RKurtzDmitriyev

  • Former Staff
  • ****
Re: How to use stand.sqs
« Reply #4 on: 18 May 2010, 16:56:17 »
An sqs file is just a text file written in a format that OFP recognizes. It can be edited with windows notepad. You can just copy and paste code from one script to the other. Of course, the code may clash.

EDIT: Or maybe you're asking how to execute two separate scripts at once. In that case, all you've got to do is put two exec commands, one after the other, separated by semicolons, in an initialization, trigger "on activation" field, or other executed script. Example:

Code: [Select]
[group this, leader group this] exec "stand.sqs"; [parameters] exec "hold.sqs"

Where parameters is the appropriate parameters for hold.sqs. Without knowing what the script is I don't know what those are. :D
« Last Edit: 18 May 2010, 16:59:13 by RKurtzDmitriyev »
The OFP Editing Center wishes to remind you that the faithful COMREF will never threaten to stab you and, in fact, cannot speak.
However, in the event that it does speak, you are encouraged to heed its advice. ;)