Page 1 of 6 12345 ... LastLast
Results 1 to 10 of 56

  Click here to go to the first Developer post in this thread.  

Thread: [] exec "script.sqs"

  1. #1

    [] exec "script.sqs"

    To be honest I am very embarassed by this post.

    But It's over 1 hour and I am get tired of this problem.

    The question is: Does'nt Arma2 recognize anymore the following command line:

    [parameter1, parameter2 and so on] exec "script.sqs" (or "/scripts/nameofscript.sqs")?

    I did a mission.

    A c130, sincronized with a trigger, fly toward the Trigger.

    On trigger activation there is this line:

    [player, c130] exec "/scripts/eject.sqs"

    where:

    c130 is the name of the airplane in the editor.

    The script is not executed, although the trigger is properly activated


    -- --

    This is the code:


    ***

    player sideChat "script activated"

    _pl = _this select 0

    _airplane = _this select 1

    _t = 3
    #cd
    (name driver _airplane) sidechat format ["%1 TO %2: %3", name driver _airplane, name player, _t]
    ~1
    ? _t != 0 : _t = _t - 1; goto "cd"

    _units = units group _pl; _i = count _units

    #Lp
    ~.5
    (_units select _i) action [ "eject", _airplane];
    (_units select _i) setspeedmode [0,0,0];
    [_units select _i] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs"
    ? _i != 0 : _i = _i - 1; goto "Lp"

    Exit

    ****

    please note: neither the first line is displayed in the game (player sideChat "script activated") which bring me to the question of this post.

  2. #2
    "/scripts/eject.sqs" -> "scripts\eject.sqs"

  3. #3
    First Sergeant cobra4v320's Avatar
    Join Date
    Mar 10 2009
    Location
    Seattle Washington
    Posts
    841
    You should stop using .sqs and use .sqf instead.

    Execute with: _nil = [groupnamehere] execVM "scripts\halo.sqf"
    Code:
    if (isServer) then 
    {
    
    _grp = _this select 0;
    
    	{
        		unassignVehicle (_x);
       		 (_x) action [ "eject", vehicle _x];
        		_x setvelocity [0,0,0];
        		[_x] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs";
       		 sleep 0.4;
    
    	} foreach units _grp;
    
    };
    Last edited by cobra4v320; Aug 15 2011 at 03:48.

  4. #4
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    the problem is this:
    Code:
    [player, c130] exec "/scripts/eject.sqs"
    in any editor item, (unit, object, trigger etc) you need to have a handle on all exec, execVM, spawn, call lines.

    placing this in your trigger should fix alot.
    Code:
    _null = [player, c130] exec "/scripts/eject.sqs";
    Edit: and your / is wrong, should be \
    Not sure if it matters though.
    Last edited by Demonized; Aug 15 2011 at 03:35.
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  5. #5
    First Sergeant cobra4v320's Avatar
    Join Date
    Mar 10 2009
    Location
    Seattle Washington
    Posts
    841
    Here you go try this one.

    Code:
    if (isServer) then 
    {
    
    _grp = _this select 0;
    
    _t = 5;
    
        while {_t != 0} do {
            hint format ["HALO JUMP in:\n%1", _t];	
    	_t = _t - 1;
    	sleep 1;
        };
    
    hint "";
    	
    {
    	unassignVehicle (_x);
       	(_x) action [ "eject", vehicle _x];
        	_x setvelocity [0,0,0];
        	[_x] exec "ca\air2\halo\data\Scripts\HALO_getout.sqs";
       	sleep 0.1;
    
        } foreach units _grp;
    
    };

  6. #6
    Quote Originally Posted by Demonized View Post
    the problem is this:
    Code:
    [player, c130] exec "/scripts/eject.sqs"
    in any editor item, (unit, object, trigger etc) you need to have a handle on all exec, execVM, spawn, call lines.

    placing this in your trigger should fix alot.
    Code:
    _null = [player, c130] exec "/scripts/eject.sqs";
    Edit: and your / is wrong, should be \
    Not sure if it matters though.
    Thanks you all for your kind answers.

    Two shorts considerations:

    1) isn't "_null = code line" a local var in a global space? At least that was in opf and arma1.

    2) why sqs is so obsolete? I have read a .sqs guide by cheeta on opfec and he also was saying that sqs and sqf differes by the goal aimed by the scripter.
    In short, if i am not mistaken, Sqs should be preferred in easy script (like this) while sqf is preferable in complex script.

  7. #7
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    1: _null works just fine without local variable in global space error, why i cant tell you since i dont really know why.
    i always use _null and it always works.

    2: sqs is slower, sqf is faster.
    http://community.bistudio.com/wiki?t...:EG#SQF_vs_SQS
    look through that exxelent page, it explains alot of different stuff.

    I myself started out with sqs and learned from Mr Murrays exxelent guide, once i wanted more i had to learn sqf, and now i never really use sqs anymore, its like the lada VS the Batmobile, both can drive on the road, but Batmobile can do so much more.

    Highly recomend you start learning some sqf, its not that different from sqs really, just if instead of ? and then instead of : and sleep instead of ~ etc, ofc there is much more but it all makes sense after a short while.
    Look up other peoples sqf scripts, start small and youll get a hang of it.
    Also do a few searches and im sure there is several sqf guides out there.

  8. #8
    sqs is just fine. If your script does what you need it to do, you don't have to think about it. It does seem to be a pet peeve with many of the members here though, they see red when someone uses sqs and then try to convert him to use sqf.

    Quote Originally Posted by Demonized View Post
    the problem is this:
    Code:
    [player, c130] exec "/scripts/eject.sqs"
    in any editor item, (unit, object, trigger etc) you need to have a handle on all exec, execVM, spawn, call lines.

    placing this in your trigger should fix alot.
    Code:
    _null = [player, c130] exec "/scripts/eject.sqs";
    Edit: and your / is wrong, should be \
    Not sure if it matters though.
    You don't need a script handle with exec.

  9. #9
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    You don't need a script handle with exec.
    my bad, Celery is right indeed, was the error then \ / or do you still have error?

    On the sqs VS sqf matter, most scripts ever released in newer times is in sqf, when you only know sqs youll end up short somewhere, unless you ofc only plan on using sqs scripts and/or create your own sqs scripts.

    So learning and using sqf is a big advantage, no matter if sqs works for its purposes or not.

  10. #10
    Besides, when you do something stupid and come to the forums to ask for help, it is much easier for more people to help you if you use sqf.

Page 1 of 6 12345 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •