OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: einssi 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.
-
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.
-
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!
-
Did you save the file as YourFile.sqf or YourFile.sqs?
-
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.
-
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
{
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.
-
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?
-
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:
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.
-
Ooo, thanks! I'm sure I can handle it with these instructions! Thanks again for all the trouble too. :)
-
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.