Jump to content

logi

Member
  • Content Count

    6
  • Joined

  • Last visited

  • Medals

Posts posted by logi


  1. I don't know mate.... it seems the script does not work with spawned markers for some reason. I've been trying for an hour or so and can't figure it out.

    Works well with placed markers.... but not if they are created by code. Tried both createMarker and createMarkerLocal.... nothing doing.

    Here mate.... it does work. I added rotation to the created markers and the script didn't like it. Removed it and everything is fine now. Demo here.

    you sir .... you are my hero!

    thank you very much!


  2. your example mission works fine. but i still got a problem.

    i placed a marker on the map called M1.

    in my init.:

    call compile preprocessfile "SHK_pos\shk_pos_init.sqf";

    test.sqf.:

    	_spawn = createMarker["spawn", [0, 0]];
    _spawn = "spawn" setMarkerShape "RECTANGLE";
    "spawn" setMarkerAlpha 1;
    "spawn" setMarkerSize [2000, 2000];
    "spawn" setMarkerType "SOLID";
    "spawn" setMarkerPos getMarkerPos "m1";
    
    
    
    _NOspawn = createMarker["NOspawn", [0, 0]];
    _NOspawn = "NOspawn" setMarkerShape "RECTANGLE";
    "NOspawn" setMarkerAlpha 1;
    "NOspawn" setMarkerSize [1500, 1500];
    "NOspawn" setMarkerType "SOLID";
    "NOspawn" setMarkerPos getMarkerPos "m1";
    
    _pos = ["spawn",false,["NOspawn"]] call SHK_pos;  
    
    { _x setpos ("spawn" call SHK_pos) } foreach [Mr1, mr2, mr3 ....];
    

    It works fine if i place this code into the test sqf.:

    for "_i" from 0 to 100 do {
    
    _pos = ["mkr_Base",false,["mkr_bl1","mkr_bl2"]] call SHK_pos;
    
    _mkr = format ["%1", diag_ticktime];
    _m = createMarkerLocal [_mkr, _pos];
    _m setMarkerColorLocal "colorBLUE";
    _m setMarkerTypeLocal "mil_dot";
    _m setMarkerSizeLocal [1,1];
    _m setMarkerAlphaLocal 1;
    
    sleep 0.01;
    
    };

    but the units "Mr1, Mr2, Mr3" use the whole spawn marker.

    help and ideas would be appreciated.


  3. From the looks of the readme, you can't use road placement if you're using a marker area mode.

    So this will give you a point within a marker since you just gave it the name (string) of a marker.

    _pos = ["myMarker"] call SHK_pos;

    To use the road mode you need to give it the position based selection parameters:

    _pos = [[color="#FF8C00"]getMarkerPos "mrk_center"[/color], [color="#FF0000"]random 800[/color], [color="#008000"]random 359[/color], [color="#0000FF"]false[/color], [color="#800080"][1, 800][/color]] call SHK_pos;

    The orange value is either an object (a unit or preplaced vehicle/flagpole or something) or a position (ie, position player to center on the player). This is the center point of where the location will be searched for from.

    The red value is an array or a number. In this case it's a random number from 0 to 799 (random 800) so the point will be 0-800 meters from the center position.

    The green value is also an array or a number. In this case a random number from 0 to 359 which is going to be the direction from the center to place the position.

    The blue value is a boolean (true or false). If it's false you allow water position placement, otherwise you want it on land. I left it as false since we'll be on a road anyway so no need to check in this case.

    The violet values is an array of two numbers. This is the road position setting. The 1 means you want to find a location on a road position but if you can't give a random position. The 800 is how far to search for a road from the position.

    So you'll want to use this and change the three highlighted values:

    _pos = [[b][color="#FF0000"]myObject[/color][/b], random [color="#FF0000"][b]800[/b][/color], random 359, false, [1, [color="#FF0000"][b]800[/b][/color]]] call SHK_pos;

    Setting myObject to be the name of the object at the center of your area and the 800s to be whatever range you want from where that object or position is.

    first of all... thanks for the great script shuko!

    kylania you made a great explanation of how the script gets called. It would be awesome if you could do the same thing with the blacklist.

×