Results 1 to 3 of 3

Thread: Adding marker of something with addAction

  1. #1
    Private First Class zukas3's Avatar
    Join Date
    May 23 2012
    Location
    Lithuania, Vilnius
    Posts
    34

    Adding marker of something with addAction

    Hello everyone, As I got deeper into SQF scripting I thinked il try out to make something more with addAction, and I seem to fail with making a marker to appear on location where addAction has been used.
    For example I made stash that spawns in random places and when you find it you can come to it and do addAction (locate) which will make a marker on map so everyone could see on the map but I seem to fail,
    here is what SQF looks like, please ignore everything else I made in the script but note me what I did wrong, Thank you for your time.

    Code:
    _actHad = _this select 0;
    _actUsed = _this select 1;
    _actID = _this select 2;
    _myXpos = (getPos _actUsed) select 3;
    _myYpos = (getPos _actUsed) select 4;
    _actHad removeaction _actID;
    _actUsed sidechat "I found the stash!";
    titleText ["Stash has been found!","PLAIN DOWN"];
    _markerstr = createMarker["stashHere",[_Xpos,_Ypos]];
    _markerstr setMarkerShape "ICON";
    "stashHere" setMarkerType "DOT";

  2. #2
    Code:
    _myXpos = (getPos _actUsed) select 3;
    _myYpos = (getPos _actUsed) select 4;
    This isn't valid. getPos returns [xPos,yPos,zPos] so you can't select 3 and 4. That's outside the array size.
    To get the xpos/ypos use this
    Code:
    _myXpos = (getPos _actUsed) select 0;
    _myYpos = (getPos _actUsed) select 1;
    And you're not using the variables that you declared above down here:

    Code:
    _markerstr = createMarker["stashHere",[_Xpos,_Ypos]];
    You can also use _markerstr instead of using the actual marker name.

    Code:
    //"stashHere" setMarkerType "DOT";
    _markerstr setMarkerType "DOT";
    Look at this:
    http://forums.bistudio.com/showthrea...rors-parameter!
    Last edited by cuel; Jul 9 2012 at 10:43.

  3. #3
    Private First Class zukas3's Avatar
    Join Date
    May 23 2012
    Location
    Lithuania, Vilnius
    Posts
    34
    Author of the Thread
    Thanks for the response il try this out and say how it turned out, also I have tried -showScriptErrors before but it made my game crash on bad scripts

    Edit: Thanks it all worked, just -showScriptErrors still becomes unknown reason.. Thanks again!
    Last edited by zukas3; Jul 9 2012 at 11:32.

Similar Threads

  1. adding addAction if player has item (bribe function)
    By Frosties in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: Sep 22 2011, 12:52
  2. Server,jip + addaction et marker = :(
    By Cool=Azroul13 in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: Jun 29 2011, 16:45
  3. Createvehicle (server) then adding addaction for all players
    By CodeRedFox in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: May 9 2011, 08:14
  4. Laser marker + PMC unit == unable to see marker as target
    By cobracmndr in forum ARMA 2 & OA - TROUBLESHOOTING
    Replies: 1
    Last Post: Apr 3 2011, 15:24
  5. Help with addAction and create marker/task/task hint script
    By AndresCL in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 0
    Last Post: Oct 23 2009, 21:05

Posting Permissions

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