Page 4 of 4 FirstFirst 1234
Results 31 to 38 of 38

Thread: Markers and JIP persistancy...with CBA_fnc_setMarkerPersistant

  1. #31
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    745
    Author of the Thread
    Where did you pre placed the marker? On the editor?

    psvialli, don't forget that everything that you put in the editor runs again when JIP players connect. So everything goes back to its original position.

    save this as "init_createMarkers.sqf";
    Code:
    if (isServer) then {
       // Setup eventHandler
       ["TEX_markers", 
    	{ 
    	_marker = _this select 0; //String
    	_pos = _this select 1; //Array
    	_shape = _this select 2; //String
    	_type = _this select 3; //String
    	_size = _this select 4; //Array 
    	_color = _this select 5; //String
    	_mkr = createMarker [_marker, _pos];
    	_marker setMarkerShape _shape;
    	_marker setMarkerType _type;
    	_marker setMarkerSize _size;
    	_marker setMarkerColor _color;
    	}] call CBA_fnc_addEventHandler; //EventHandler	
    	
       // Helper function
       TEX_fnc_createMarker = { ["TEX_markers", _this] call CBA_fnc_localEvent }; // no need to broadcast, we're already on the server
    } else {
       // Helper function
       TEX_fnc_createMarker = { ["TEX_markers", _this] call CBA_fnc_globalEvent }; // broadcast to execute on server
    };
    and this in the init.sqf of your mission:

    Code:
    call compile preProcessFileLineNumbers "init_CreateMarkers.sqf";
    Then make sure you create the marker ONLY on the server:

    Code:
    if (isServer) then {
    ["markerxxx", [5835.1426,3076.4465], "ICON", "mil_objective", [0.5,0.5], "ColorRed"] call TEX_fnc_createMarker;
    };
    And finally one line below make it persistant:

    Code:
    ["markerxxx", true] call CBA_fnc_setMarkerPersistent;
    Last edited by CarlosTex; Apr 28 2012 at 16:33.
    Arma 3 and xAItment.

    1 Sentence. 1 Erection. 1 Jizz.

    Please vote for this:

    http://dev-heaven.net/issues/13606

  2. #32
    Nice going there Tex!

    Once bug in code:
    Code:
    "markerxxx", [5835.1426,3076.4465], "ICON", "mil_objective", [0.5,0.5], "ColorRed"] call TEX_fnc_createMarker;
    lacks initial '[':
    Code:
    ["markerxxx", [5835.1426,3076.4465], "ICON", "mil_objective", [0.5,0.5], "ColorRed"] call TEX_fnc_createMarker;

  3. #33
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    745
    Author of the Thread
    Right i usually make copy and paste errors. Thanks Sickboy.

    Sickboy BTW, do you have any idea why AI groups do out of path planning errors in the RPT? I noticed that some of the AI groups in my mission were stopping to a dead halt, and when i checked the RPT's there were out of path planning errors... This is killing me... Those groups are being spawned by BIS_fnc_spawnGroup BTW....

  4. #34
    Many thanks for the Example / explanation however i am still having an issue not sure if it is because it is on a dedi server or because i am using it through an add action ?

    my add action calls the script that has this

    Code:
    if (isServer) then {
    ["rallym", getpos playerss1_object, "ICON", "mil_objective", [0.5,0.5], "ColorRed"] call TEX_fnc_createMarker;
    ["rallym", true] call CBA_fnc_setMarkerPersistent;
    };
    When i test on hosted it works but when i try on Dedi it does not even create the marker? is it because of the add action ?

  5. #35
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    745
    Author of the Thread
    Try this:

    Code:
    [-0, {["rallym", getpos playerss1_object, "ICON", "mil_objective", [0.5,0.5], "ColorRed"] call TEX_fnc_createMarker;
    ["rallym", true] call CBA_fnc_setMarkerPersistent;}] call CBA_fnc_globalExecute;

    Also make sure you have initialised the eventhandler

  6. #36
    Actually you should just drop the isServer check, because the client is not a server, and the action is triggered on the player's machine.

    Additionally, usage of CBA_fnc_globalExecute other than for debugging is not recommended.
    In case you need to trigger remote events, better use CBA_fnc_addEventHandler and CBA_fnc_globalEvent,
    this only sends parameters over the network, as opposed to globalExecute which also sends the code.
    Last edited by Sickboy; Apr 28 2012 at 20:05.

  7. #37
    I just tested it again but using a radio trigger this time and it worked as expected. but when using add action - no go ?!

    Ill test it again with the above code , but it looks like it must be the add action ?

  8. #38
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    745
    Author of the Thread
    What i gave you should work, but it would be better to follow Sickboy's advice. You can also use MP framework for the addaction.

Page 4 of 4 FirstFirst 1234

Similar Threads

  1. Markers, triggers and JIP
    By Wiggum in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 47
    Last Post: Jan 11 2012, 08:18
  2. Need JIP Help
    By A-SUICIDAL in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 23
    Last Post: Aug 10 2011, 22:35
  3. Markers and JIP
    By psvialli in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 8
    Last Post: Mar 16 2011, 15:10
  4. Synchronising markers with JIP clients
    By [ZSU]Preacher in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Nov 28 2009, 10:27
  5. What can we do with JIP?
    By KeyCat in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 1
    Last Post: May 22 2005, 21:17

Posting Permissions

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