Jump to content

riouken

Member
  • Content Count

    570
  • Joined

  • Last visited

  • Medals

Posts posted by riouken


  1. You can either pass the local reference to the script directly:

    [color=#3E3E3E]_car = "jeep" createVehicle (getpos location);
    [/color]
    0 = [[color=#3E3E3E]_car] execVM "movecar.sqf";[/color]
    

    Or if your move script will not run until later you could save the reference into an array to pull out later:

    [color=#3E3E3E]_car = "jeep" createVehicle (getpos location);
    [/color]
    mylistofcars = [[color=#3E3E3E]_car];[/color]
    

    then later:

    _car = mylistofcars select 0;
    
    _car setPos _newpos
    


  2. No answer to my question on artillery yet but I have another.

    A friend and i were testing my 2.60 server and I was putting markers on the map but he could not see them. Is there a setting to fix this? Thanks.

    You have to when you place a marker down on the map, it is dependent on what chat channel you are in as to who can see it.

    Ie. If you are in group chat(or you typed last in group chat) then only people in your group can see your markers.

    Its a "feature" in arma, has nothing to do with domination.


  3. First I would not use "control" as a var name. It is reserved, it is used in arma as a ui object , I am astonished it works at all like that.

    Second you will be creating the elevator on the server, but it you have the controls to move the elevator in this: "LHD\elevdown.sqf" that will not work, you are calling that script locally from an addaction. That means that the vehicle(the elevator) is local to the server and the script you called is local to that player, there is no way for the script to interact with the elevator. Your addaction should call a function to send a command to the server to execute



    "LHD\elevdown.sqf" on the server.


  4. What I'd like to see is an example of CBA and not-CBA for a situation like this: Tasks given to do something at a randomly placed marker which will be marked as completed when done along with text feedback or task hints and a new marker set for the next in a series of tasks part of which is playing a sound on a unit at the location that nearby players will hear. Tasks, markers and sounds are all complicated and stupid in MP, so... how would the experts do them? :)

    Here is some working code that I am working on for a random mission system, similar to side missions in domi. It is still a work in progress and I have not commented it to well, but you should get the picture.(Im sure sickboy or xeno could provide some better examples, as I am still a little new to scripting with CBA events.) I have done some things with MPF in the past, addactions, messages and markers. But I find the CBA events to be much more powerful and easier to work with. To top if off they create less net traffic.

    The only downside to the way im doing JIP is that it is sending the the array of data for each mission twice over the network, once from the cba event and once for the PV. But I don't know of a better way to do this, and I have tried to limit the amount of data being sent.

    I have three init's one for the server, one for the player, and one for jip.

    server init:

    sidemissioncomplete = true;
    sd_mission_cleanup_done = true;
    sd_mission_cleanup_array = [];
    [] execVM "s_server\spawnRandomMissions.sqf";
    
    
    
    // This takes the events and saves them into an array and pv them so that jips can get it when they join.
    if (isServer) then 
    {
       ["SideMisnMkr", 
       { 
           sidemsnmkrary = [(_this select 0) ,(_this select 1) ,(_this select 2) ,(_this select 3) ,(_this select 4) ];
           publicVariable "sidemsnmkrary"; 
       }
       ] call CBA_fnc_addEventHandler;  
    
    
       ["SideMisnMkr2", 
       {     
          sidemsnmkrary2 = [(_this select 0) ,(_this select 1) ,(_this select 2) ,(_this select 3) ,(_this select 4) ];
          publicVariable "sidemsnmkrary2"; 
       }
       ] call CBA_fnc_addEventHandler;  
    
    
           ["SideMisnMkr3", 
       {
           sidemsnmkrary3 = [(_this select 0) ,(_this select 1) ,(_this select 2) ,(_this select 3) ,(_this select 4) ];
           publicVariable "sidemsnmkrary3"; 
       }
       ] call CBA_fnc_addEventHandler;  
    
       ["SideMisnTask", 
       { 
           sidemsntaskary = [(_this select 0) ,(_this select 1) ,(_this select 2) ,(_this select 3) ,(_this select 4) ];
           publicVariable "sidemsntaskary"; 
       }
       ] call CBA_fnc_addEventHandler;  
    
    };
    

    player init:

    
    // All the local commands that need to run for markers,tasks and messages. The dynamic data for each mission is passed in the array with the cba event.
    if (!isServer) then 
    {
       ["SideMisnMkr", 
       { 
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 1) ;
    
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "Ellipse";
           _marker setMarkerTypeLocal "mil_circle";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [200, 200];
    
    
       }
       ] call CBA_fnc_addEventHandler;  
    
    
       ["SideMisnMkr2", 
       { 
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 1) ;
    
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "icon";
           _marker setMarkerTypeLocal "start";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [1, 1];
    
    
       }
       ] call CBA_fnc_addEventHandler;  
    
    
           ["SideMisnMkr3", 
       { 
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 1) ;
    
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "icon";
           _marker setMarkerTypeLocal "end";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [1, 1];
    
    
       }
       ] call CBA_fnc_addEventHandler;  
    
       ["SideMisnTask", 
       { 
           tsk1 = player createSimpleTask [(_this select 0)];
           tsk1 setSimpleTaskDescription [(_this select 0), (_this select 1), (_this select 2)];
           tsk1 setSimpleTaskDestination (_this select 3);
           tsk1 setTaskState "Assigned";
           player setCurrentTask tsk1;
           taskhint [(_this select 0), [1, 1, 1, 1], "taskCurrent"]; 
    
    
       }
       ] call CBA_fnc_addEventHandler;  
    
    
    
    
       ["SideMisnDelTask", 
       { 
           tsk1 setTaskState "Succeeded";
           taskhint [(_this select 0), [0, 1, 0, 1], "taskDone"];
           deletemarker (_this select 1);
           player removesimpletask tsk1;
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 2) ;
       }
       ] call CBA_fnc_addEventHandler;  
    };
    
    
    playerinit = true;
    

    Player Jip:

    .

    
    // Make sure the commands don't run twice.
    if (playerinit) exitWith {};
    
    // Set up the events to get the Jip mission events.
    ["SideMisnMkrjip", 
       { 
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 1) ;
    
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "Ellipse";
           _marker setMarkerTypeLocal "mil_circle";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [200, 200];
       }
    ] call CBA_fnc_addEventHandler;
    
    
    
    
    ["SideMisnMkr2jip", 
       {        
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "icon";
           _marker setMarkerTypeLocal "start";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [1, 1];
    
    
       }
    ] call CBA_fnc_addEventHandler;
    
    
    
    
    ["SideMisnMkr3jip", 
       {         
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "icon";
           _marker setMarkerTypeLocal "end";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [1, 1];
    
    
       }
    ] call CBA_fnc_addEventHandler;
    
    
    
    
    ["SideMisnTaskjip", 
       { 
           tsk1 = player createSimpleTask [(_this select 0)];
           tsk1 setSimpleTaskDescription [(_this select 0), (_this select 1), (_this select 2)];
           tsk1 setSimpleTaskDestination (_this select 3);
           tsk1 setTaskState "Assigned";
           player setCurrentTask tsk1;
           taskhint [(_this select 0), [1, 1, 1, 1], "taskCurrent"]; 
    
    
       }
    ] call CBA_fnc_addEventHandler;
    
    // Raise the local jip events if they are active.
    if (count sidemsnmkrary > 0) then {
       _nop = ["SideMisnMkrjip",sidemsnmkrary] call CBA_fnc_localEvent;
    };
    
    
    if (count sidemsnmkrary2 > 0) then {
       _nop = ["SideMisnMkr2jip",sidemsnmkrary2] call CBA_fnc_localEvent;
    };
    
    
    if (count sidemsnmkrary3 > 0) then {
       _nop = ["SideMisnMkr3jip",sidemsnmkrary3] call CBA_fnc_localEvent;
    };
    
    
    
    
    if (count sidemsntaskary  > 0) then {
       _nop = ["SideMisnTaskjip",sidemsntaskary] call CBA_fnc_localEvent;
    };
    
    
    // Set up the normal events so the player can get any new missions after they can join.    
    if (!isServer) then 
    {
       ["SideMisnMkr", 
       { 
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 1) ;
    
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "Ellipse";
           _marker setMarkerTypeLocal "mil_circle";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [200, 200];
    
    
       }
       ] call CBA_fnc_addEventHandler;  
    
    
       ["SideMisnMkr2", 
       { 
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 1) ;
    
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "icon";
           _marker setMarkerTypeLocal "start";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [1, 1];
    
    
       }
       ] call CBA_fnc_addEventHandler;  
    
    
           ["SideMisnMkr3", 
       { 
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 1) ;
    
           _marker = createMarkerLocal[(_this select 2),(_this select 3)];
           _marker setMarkerShapeLocal "icon";
           _marker setMarkerTypeLocal "end";
           _marker setMarkerTextLocal (_this select 4);
           _marker setMarkerSizeLocal [1, 1];
    
    
       }
       ] call CBA_fnc_addEventHandler;  
    
       ["SideMisnTask", 
       { 
           tsk1 = player createSimpleTask [(_this select 0)];
           tsk1 setSimpleTaskDescription [(_this select 0), (_this select 1), (_this select 2)];
           tsk1 setSimpleTaskDestination (_this select 3);
           tsk1 setTaskState "Assigned";
           player setCurrentTask tsk1;
           taskhint [(_this select 0), [1, 1, 1, 1], "taskCurrent"]; 
    
    
       }
       ] call CBA_fnc_addEventHandler;  
    
    
    
    
       ["SideMisnDelTask", 
       { 
           tsk1 setTaskState "Succeeded";
           taskhint [(_this select 0), [0, 1, 0, 1], "taskDone"];
           deletemarker (_this select 1);
           player removesimpletask tsk1;
           COMMAND=[West,"HQ"];COMMAND sideChat (_this select 2) ;
       }
       ] call CBA_fnc_addEventHandler;  
    };  
    


  5. You can use multiple random spawn points:

    http://community.bistudio.com/wiki/description.ext#respawn

    Sets respawn type.Can be one of:

    • 0 or "NONE" - No respawn
    • 1 or "BIRD" - Respawn as a seagull
    • 2 or "INSTANT" - Respawn just where you died.
    • 3 or "BASE" - Respawn in base.
      • Requires a marker named:
        • respawn_west
        • respawn_east
        • respawn_guerrila
        • respawn_civilian

        [*]Add markers named with the prefix 'respawn_west' with any suffix (eg: respawn_westABC, respawn_west1, respawn_west_2, etc) for multiple random respawn points.

    That will respawn them at one of the points randomly.

    If you want to pick a specific location for each one you will need to use a script.

    Here is a very good easy to use vehicle respawn script: (I haven't tested it in TOH but it should work with out to much trouble.)

    http://forums.bistudio.com/showthread.php?76445-Simple-Vehicle-Respawn-Script


  6. No it wasn't that. Just checked my orginal triggers and I simply just made the typo when transferring it here to the forums, sorry :o

    But the trouble is this:

    wincon and (M1A2Acon or M1A2Bcon or LAV25Acon or infantrylosscon)

    and this:

    wincon

    It always seem to activate the second trigger and ignoring the first, even if one or more of the conditions are true. So I think maybe there's something wrong with the logic, that it simply ignores the OR statements as they are somehow invalid...

    Yes the first logic is not right, the (or) command can only evaluate two values.

    Your first code should look like this:

    wincon and ((M1A2Acon or M1A2Bcon) or (LAV25Acon or infantrylosscon))
    

    You have to break it down with () into sections of two that can be evaluated.


  7. Try it like this:

    OK, changed per your request and looking good, except....it ends at the 30 sec time I set, or ends immediately if I take the timers out...

    2nd Trigger

    None

    Present

    Name: mypubvariable1 mytrigname /// dont name objects the same as your variables this is probably your problem!

    Cond:

    taskState tskObj1 == "Succeed" && taskState tskObj2 == "Succeed" && taskState tskObj3 == "Succeed" && taskState tskOj4 == "Succeed" && taskState tskObj5 == "Succeed" 

    On Act:

    hintSilent "Game will end in 30 second";[color="Red"]mypubvariable1 = true;[/color]

    3rd Trigger

    Blufor

    Present

    Time Out: 30,30,30

    End #1

    Cond:

    mypubvariable1

    On Act:

    (No code written here. Do I need something here?)

    Thanks a lot for your help!


  8. P.S. -- How the heck can I convert a number to string?

    http://community.bistudio.com/wiki/toString

    http://community.bistudio.com/wiki/to

    http://community.bistudio.com/wiki/toArray

    http://community.bistudio.com/wiki/toLower

    http://community.bistudio.com/wiki/toUpper

    ---------- Post added at 09:12 AM ---------- Previous post was at 09:09 AM ----------

    You can also reformat it as a string:

    _myage = 100;
    _myagestring = format ["%1",_myage];
    hint _myagestring;
    

    http://community.bistudio.com/wiki/format

    you can also do it with str as Muzzleflash pointed out. lol I almost for got about str.


  9. Its in the config, you would need to make an addon that overwrote the games(or ACE's) config values. More info: http://www.armaholic.com/forums.php?m=posts&id=101207

    But I think it would be a lot easier to just provide a boat or set up a script to "stow" their gear in their ruck and then ford the river, then have them unstow their gear.

    You could just save their gear to a variable and add it back when they get to the other side.


  10. Greetings, all.

    I wish to make a trigger using the function 'stop'. Currently I use this in the On Act:

    unitname stop true

    That works perfectly, but also requires lots of effort when creating a battalion-strength HC mission! I would prefer it if the player could just select an HC group using the usual F2, F3 etc. keys and then activating the trigger!

    This must be possible, as the HC functions that were built by BIS pretty much require it to work at all.

    I would appreciate any assistance. I am no great hand at this sort of thing, and I am stumped, and have been so since last February!

    P.S. Last Feb., Shuko very kindly provided...

    {_x stop true} foreach groupselectedunits player

    ...which does not do the trick, alas.

    Sorry I cant test it right now, but this should work, Just select the highcommand groups from your hc bar like normal(f1,f2,etc) then activate this sqf with an addaction or trigger. It will work even if you select multiple hc groups.

    hcstopfnc.sqf

    _myselectedhcgroups = hcSelected player;
    
    _selectedhccount = (count _myselectedhcgroups) - 1;
    
    for "_i" from 0 to _selectedhccount do
    {
       private ["_tempgrp"];
       _tempgrp = _myselectedhcgroups select _i;
       {_x stop true;} foreach _tempgrp;
    };
    

×