Home   Help Search Login Register  

Author Topic: Trouble with the script delay mark "~x"  (Read 2018 times)

0 Members and 1 Guest are viewing this topic.

Offline einssi

  • Members
  • *
Trouble with the script delay mark "~x"
« on: 28 Feb 2007, 19:35:29 »
Alright, first of all, I'm honestly sorry if there's a solution to this on this forum or in the guides. I just spend 30 minutes trying to search for an answer but couldn't find anything. If this is the case however please point me to the solution and feel free to stamp me with "stupid noob" stamp.

Okey, the problem. I'm trying to create a simple parachute drop from a helicopter in ArMa. I'm trying using the following commandline for the drop:
unassignvehicle  Soldier1;Soldier1 Action ["eject", heli1];
~2
unassignvehicle Soldier2;Soldier2 Action ["eject", heli1];
etc ["eject", heli1];


Now the ejecting works just fine if I leave the ~2 delay command away, but with it I simply get the "Invalid number in expression" error. Reading through different scripts the delay command seems to be totally standard procedure, but I just can't get it to work at all. Any way to work around this and get the troopers to jump with few seconds delay? I've tried pasting the ~mark as well as typing it myself, but seems there's something the game can't recognize.

Offline Cheetah

  • Former Staff
  • ****
Re: Trouble with the script delay mark "~x"
« Reply #1 on: 28 Feb 2007, 19:44:14 »
Just to be sure, you're using a .sqs file right? If you use the sqf syntax, which most prefer / I prefer in ArmA use: sleep 2;
Going to test it as sqs syntax now.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline einssi

  • Members
  • *
Re: Trouble with the script delay mark "~x"
« Reply #2 on: 28 Feb 2007, 19:45:30 »
Fear I have no idea what syntax I'm using. :o I'll test the sleep command myself now too, then. Thanks for the quick reply!

Offline Cheetah

  • Former Staff
  • ****
Re: Trouble with the script delay mark "~x"
« Reply #3 on: 28 Feb 2007, 19:48:25 »
Did you save the file as YourFile.sqf or YourFile.sqs?
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline einssi

  • Members
  • *
Re: Trouble with the script delay mark "~x"
« Reply #4 on: 28 Feb 2007, 19:58:55 »
Ah, think the topic is actually bit misleading. What I've been doing is simply creating a waypoint and writing the commands in the "On Activation" field.

Offline Cheetah

  • Former Staff
  • ****
Re: Trouble with the script delay mark "~x"
« Reply #5 on: 28 Feb 2007, 20:13:28 »
As far as I know, you cannot add something like ~2 or sleep 2 in the "on activation" of a trigger, so I suggest that you use a script.
I'll attach the little script I made for you and explain how to use it.

jump.sqf
Code: [Select]
{
unassignVehicle _x;
_x action ["eject",heli1];
sleep 2;
} forEach [Soldier1,Soldier2,Soldier3,Soldier4];

Then open up a unit and paste the following into the "initialization" field:
call = [] execVM "jump.sqf";

Should work, but if you don't want to use any scripts, it could be a bit more complicated.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline einssi

  • Members
  • *
Re: Trouble with the script delay mark "~x"
« Reply #6 on: 28 Feb 2007, 20:57:22 »
Hmm, alright, I don't mind using scripts at all if they work.  :)

So pasting the command line in the initialization field enables the script for the unit, or what? Should I also paste the same line to the waypoint, or use a trigger or sorts?

Offline Cheetah

  • Former Staff
  • ****
Re: Trouble with the script delay mark "~x"
« Reply #7 on: 28 Feb 2007, 21:17:33 »
 The script contains all the game needs in order to let the men eject. But, you need to let the game know that you have a script which you want to become active. In order to achieve this, you tell the game with that line (simply put): "execute this script, it's located here".


If you want to start the script immediatly when the mission begins use the following.
(attachment: initialization.jpg)

Or

If you don't want to activate it immediatly at the start of a mission, don't add the line (which activates the script) to the init. of a unit, but add it to the "On Activation" of a trigger. Do it like I did in the attached picture. (attachment: trigger.jpg)

Or

If you want the script to be come active after the variable soldiersDisembark has been set to true take a look at the third attachment. Note that I also selected "Timeout" and set "Min,Max,Mid" to "5". What does this do? After you execute this code:
Code: [Select]
soldiersDisembark=true;almost anywhere (On Activation Field, Initialization Field, in a script) it activates the trigger after 5 seconds (which has been set in "Min,Max,Mid"). (attachment: trigger1.jpg)

Good luck, just reply if you don't understand it.

Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline einssi

  • Members
  • *
Re: Trouble with the script delay mark "~x"
« Reply #8 on: 28 Feb 2007, 21:51:50 »
Ooo, thanks! I'm sure I can handle it with these instructions! Thanks again for all the trouble too.  :)

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: Trouble with the script delay mark "~x"
« Reply #9 on: 01 Mar 2007, 00:21:04 »
Just as an fyi  call= can be anything and perhaps call= is not a good example because there is a command call. I use often dummy= but it can be anything to your liking.
Xbox Rocks