Jump to content

ShinShin

Member
  • Content Count

    67
  • Joined

  • Last visited

  • Medals

Posts posted by ShinShin


  1. Okay...

    Firstly...

    How do I Go about Making any Script of Mine, executed from the Missions folder && or In the Editor Inside an Units/Objects Initilization Field.

    I'd Like to Make these Scripts continue to Work and Run Whenever a Unit(Player) Dies & Respawns.

    So the Script does not Go InActive when they Die.

    e.x. an addAction that Gives a Unit an Action to Execute a Script.

    Secondly...

    How Would I Go about adding Commands Such as thee Above, to Units/Objects through my

    "Init.sqf"
    && NOT the Editor?

    e.x. a Command that you'd Normally Place into a Units/Objects Init Field. But Instead do it through the

    "Init.sqf"
    .

    :bounce3: ¿¿Anyone?? :bounce3:

    EDIT: Sorry if I Asked this in the Wrong Area :(


  2. Okay Demonized

    Gotcha...

    Now...

    If you wouldn't mind... Correct & tell Me what is Wrong with this? :butbut:

    Script...

    _bSandBarrier.sqf

    // Call: pAction = this addAction ["Place SandBarrier", "Kays_Scripts\bSandBarrier.sqf"];

    _pos = getPos _player; // position of reference.

    _dist = 1; //Distance from position of reference.

    _offdir = 0; //Relative direction from position of reference 0 - 360. (0 = forward, 180 = backwards).

    player playMove "AinvPknlMstpSlayWrflDnon_medic";

    sleep 3.0;

    _bSandBarrier = "Land_HBarrier1" createVehicle (position player);

    //Find compass direction to spawn from position of reference.

    _compassDir = ((getDir _player)+_offdir) mod 360;

    //Find absolute coordinates by adding relative to position of reference.

    _newX = (_pos select 0) + (sin _compassDir * _dist);

    _newY = (_pos select 1) + (cos _compassDir * _dist);

    _newPos = [_newX, _newY, 0]; // position found

    _bSandBarrier setDir (getDir _player); // set objects direction to same as player, add + 90 to turn it sideways etc...

    _bSandBarrier setPos _newPos; // place object of choice on new pos.

    _dSandBarrier = _bSandBarrier addAction ["Remove Sand Barrier", "Kays_Scripts\dSandBarrier.sqf"];

    _bSandBarrier setDir (getDir player);

    sleep 3.0;

    exit;

    _dSandBarrier.sqf

    //Remove Barrier Place by the bSandBarrier Script.

    private ["_bSandBarrier","_dSandBarrier"];

    _bSandBarrier = _this select 0;

    player playMove "AinvPknlMstpSlayWrflDnon_medic";

    sleep 3.0;

    deleteVehicle _bSandBarrier;

    exit;


  3. Wow... Thanks man!

    Will try this out Shuko :yay:

    Thank you Both, Shuko & Colosso :D

    I Will return with feedback on its useability.....

    EDIT: Okay... Shuko, It's Working. But Now... Say I Wanted the Marker to have that Players Name as the Marker Name on Map when used.

    How would I Go about Doing/Integrating that In?

    So when the Action is Executed by the Player... His Marker will have HIS Name on it.


  4. Okay...

    I'm trying to Figure out How to Make an addAction via Script...

    Which would give the player thee Ability to Simply Click this Action & Without going to the Map, It'll Mark his Location for Everyone to See.

    I've become confused at this Point & I feel alot is Wrong.

    So someone please have a Look and Help me out here :)

    Thanks! :D

    lOL

    (S.N. I'm trying my Best to Learn and Understand the Arma Scripting World)

    Script...

    // Call: nul = this addAction ["Mark-Location" ["pMarker",player,1,1] execVM "UnitLocs.sqf"
    
    _addAction = _this select 0;
    _mName = _this select 1;
    _pos = this select 2;
    _x = _this select 3;
    _y = _this select 4;
    
    _addAction = this addAction [_addAction];
    _mName = createMarker [_mName, position _pos];
    _mName setMarkerShape "ICON";
    _mName setMarkerType "DOT";
    _mName setMarkerColor "ColorBlue";
    _mName setMarkerSize [_x, _y];
    
    exit;


  5. Thanks Demonized! :D

    It Worked! :yay:

    Now Only problem is...

    the Object Does not Spawn Directly where my Cursor or Player is Pointing.

    Any Ideas?

    Plus id Like to Get rid of, Not being able to Build another Object in its same area e.g. Side by Side.

    They Aren't Placeable Side to Side. they're Spaced out automaticly (i think.)

    Scripts...

    SandBarrierInit.sqf

    Sleep 2;

    waituntil {!isnil "bis_fnc_init"};

    [] spawn

    {

    private ["_addObjectAction"];

    waituntil {!isnull player};

    barrier_active = false;

    if (!isnull player) then

    {

    if (player==player) then

    {

    while {true} do

    {

    waitUntil {!barrier_active &&(alive player) && 5 > 0};

    __addObjectAction = player addAction [("<t color=""#66FFFF"">" + ("Place Sand Barrier") +"</t>"), "Kays_Scripts\bSandBarrier.sqf", [], 1, false, true];

    waitUntil {barrier_active || (!alive player)};

    player removeAction _addObjectAction;

    };

    }; // type of player

    }; // if !isnull

    // [] spawn

    bSandBarrier.sqf

    //Place in Init Field of Editor Unit/Object//

    //action_3 = this addAction ["Place SandBarrier", "Kays_Scripts\bSandBarrier.sqf"];

    //delete_3 = this addAction ["Remove SandBarrier", "Kays_Scripts\dSandBarrier.sqf"];

    private ["_bSandBarrier","_dSandBarrier"];

    waitUntil { !isNil "BIS_fnc_init" };

    if (count (nearestObjects [player, ["Land_HBarrier1"], 5]) == 0) then //5 meteres

    {

    barrier_active = true;

    player playMove "AinvPknlMstpSlayWrflDnon_medic";

    sleep 5.0;

    _bSandBarrier = "Land_HBarrier1" createVehicle (position player),

    _dSandBarrier = _bSandBarrier addAction ["Remove Sand Barrier", "Kays_Scripts\dSandBarrier.sqf",[],6];

    _bSandBarrier setdir getdir player;

    sleep 10;

    barrier_active = false;

    }

    else

    {

    hintsilent "Barrier Within 5 Meters Already!";

    sleep 2;

    };

    dSandBarrier.sqf

    //Place in Init Field of Editor Unit/Object//

    //action_3 = this addAction ["Place SandBarrier", "Kays_Scripts\bSandBarrier.sqf"];

    //delete_3 = this addAction ["Remove SandBarrier", "Kays_Scripts\dSandBarrier.sqf"];

    private ["_bSandBarrier","_dSandBarrier"];

    _bSandBarrier = _this select 0;

    player playMove "AinvPknlMstpSlayWrflDnon_medic";

    sleep 5.0;

    deletevehicle _bSandBarrier;


  6. Yes, i'm Running Combined Operations...

    and this is for Multiplayer.

    I have Show Script Errors. But it's kinda hard to Read if it only shows for 2 or 3 seconds and Goes away. Not only that... Mine is all Chopped up and shit. Half shows and Sometimes half doesn't :/

    the Object am trying to Use is

    "Land_HBarrier1"

    e.g.

    if (!isserver) then 
    
    {
    private ["_bSandBarrier","_dSandBarrier"];
    waitUntil { !isNil "BIS_fnc_init" };
    
    if (count (nearestObjects [player, ["Land_HBarrier1"], 5]) == 0) then  //5 meteres
    
    {
    	barrier_active = true;
    	player playMove  "AinvPknlMstpSlayWrflDnon_medic";
    	sleep 5.0;
    	_bSandBarrier = "Land_HBarrier1" createVehicle (position player), 
    	_dSandBarrier = _bSandBarrier addAction ["Remove Sand Barrier", "Kays_Scripts\dSandBarrier.sqf",[],6];
    	_bSandBarrier setdir getdir player;
    	sleep 10; 
    	barrier_active = false;
    }
    else
    {
    	hintsilent "Barrier Within 5 Meters Already!";
    	sleep 2;	
    };
    
    };


  7. Okay, So I Managed to Create an Object Spawning Script by Manipulating

    Kylanias "Set Flag/Object" Example Script & Something else.

    ( http://www.kylania.com/ex/?p=60 )

    What I Would Like to Know is...

    1: The Objects sometimes do not Spawn Perfectly infront of the Player as I Wish they would.

    2: I'd Like to know How to Make the Use of this Action Disappear after 3 or 4 Uses(Clicks).

    3: I Need to Get the Script Compatible with Respawns... Script becomes inactive if a Player Dies & Respawns.

    4: I Would ALSO Like to Know... How the Hell to give THAT player who placed THAT object... Thee Ability to Remove it if needed & he gains 1 Use (as he removed the Object).

    Here is the Script sofar...

    //Place in Init Field of Editor Unit or Object//
    //action_1 = this addAction ["Place SteelHedge", "Kays_Scripts\bHedge.sqf"];
    
    //Build Object//
    private ["_obj"];
    
    _obj = [player, 5, getdir player] call BIS_fnc_relPos; myObject = "Hedgehog" createVehicle _obj;
    
    exit;

    I'm VERY VERY VERY New to Scripting... though ive taken Quite alot of time to myself to Read through lots of Scripts and I Think I Can Say... I Understand but Still very unSure of How to Go about Createing Such a Script.

×