Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 38

Thread: Markers and JIP persistancy...with CBA_fnc_setMarkerPersistant

  1. #11
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    667
    Author of the Thread

    Function:

    Just for info:

    I couldn't not make your function to work. I set it up on init.sqf like this:

    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 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
    };
    
    
    // To create a marker:
    ["MarkerOne", (getmarkerpos "mkrpos"), "icon", "mil_warning", [0.5,0.5], "ColorGreen"] call TEX_fnc_createMarker;
    No errors, no nothing, diag_log shows nothing wrong in RPT but marker is never created. It would be nice to have this function working but i won't cry for it.
    Arma 3 and xAItment.

    1 Sentence. 1 Erection. 1 Jizz.

    Please vote for this:

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

  2. #12
    Does the "mkrpos" marker exist, and diag_log
    (getmarkerpos "mkrpos") shows correct value?
    A.C.E. Advanced Combat Environment

    Dev-Heaven.net Free Project Hosting | A2 Community Issue Tracker Help BIS, Help yourself!

  3. #13
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    667
    Author of the Thread
    Yes it is editor place. And diag_log (getmarkerpos "mkrpos") returns as well.

  4. #14
    I suppose the main problem is that you do not use
    Code:
    _marker setMarkerType _type;

  5. #15
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    667
    Author of the Thread
    OMG!!!!

  6. #16
    Haha, love the smiley No worries, happens to us all :P

  7. #17
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    667
    Author of the Thread
    BTW, how beneficial do you consider if i decide to precompile it, since i'm probably gonna call it quite a few times during the mission?

  8. #18
    Quote Originally Posted by CarlosTex View Post
    BTW, how beneficial do you consider if i decide to precompile it, since i'm probably gonna call it quite a few times during the mission?
    It already is precompiled.

    ---------- Post added at 12:21 ---------- Previous post was at 12:15 ----------

    The diff is in:

    A) Not precompiled
    Init: Nothing
    Call:
    Code:
    [someParam, someParam2] call compile preProcessFileLineNumbers "functionName.sqf";
    vs

    B) Precompiled
    Init:
    Code:
    TEX_functionName = { .... function content ... };
    Which could also have been (no real difference other than directory structure):
    Code:
    TEX_functionName = compile preProcessFileLineNumbers "functionName.sqf"
    Call:
    Code:
    [someParam, someParam2] call TEX_functionName;
    Last edited by Sickboy; Apr 24 2012 at 10:21.

  9. #19
    Master Sergeant CarlosTex's Avatar
    Join Date
    Aug 23 2010
    Location
    Portugal
    Posts
    667
    Author of the Thread
    OK, i wrote the function in a separate script called "fn_createMarkers.sqf".

    So in the init.sqf i have:

    Code:
    call compile preProcessFileLineNumbers "functions\fn_createMarkers.sqf".
    So this would be getting the same result because it is already precompiled?:

    Code:
    execVM "functions\fn_createMarkers.sqf"

    I thought that preCompiling meant something like when you write a program in C# language and then compile it with GCC, ICC or Open64 compilers makes it faster because you're not running raw data (and obviously compiler also translates it into machine language). (Probably now you'll get that i understand 0 about programming).

    So basically doing:
    Code:
    global or local variable = {code here};
    already precompiles it?


    EDIT: BTW when i tested my mission precompiling the function in the init.sqf and creating the markers using the function everything is working fine. But with your explanation i understand now that i also could have execVM "functions\fn_CreateMarkers.sqf" and it would be the same.

    So what's the point of having the command if you can preCompile in the scripts instead?
    Last edited by CarlosTex; Apr 24 2012 at 10:55.

  10. #20
    Nope you misunderstood me.

    As said you already precompiled the function from the beginning by specifying it as TEX_name = { ... }, there is nothing more you need to do.
    TEX_name = { ... }; comes down to the same as putting the code in a sqf and then using TEX_name = compile preProcessFileLineNumbers "file.sqf";

    Especially don't use execVM if you are going to use it over and over, besides that it is to run scripts, and not to call functions that return anything.

Page 2 of 4 FirstFirst 1234 LastLast

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
  •