Jump to content

rkemsley

Member
  • Content Count

    73
  • Joined

  • Last visited

  • Medals

Posts posted by rkemsley


  1. Hi all,

     

    I am currently making a map which requires a Curator Editing Area to follow the player around the map. I would like it so that if an enemy of the player enters the Curator Editing Area, the Curator Editing Area is disabled (to stop him spawning stuff on top of the enemy).

     

    I have managed to write a script which has the Curator Editing Area follow the player...

    //init.sqf
    
    [] spawn {
      while { alive t1 } do { myCurator addCuratorEditingArea [ 0, position t1, 50 ]; sleep 0.05; };
    };

    How this works is by creating a Curator Editing Area at the position of the player every 0.05 seconds. The interesting part is that you keep the ID of the Curator Editing Area, this means that it deletes the old Curator Editing Area when the new one is created. (Curator Editing Area ID being 0 in this case).

     

    The problem I have is temporarily disabling the creation of "new" Curator Editing Area 's while an enemy is within range. So I need to be able to temporarily disable the script (which I do not know how to do).


  2. Oh, after some testing, this method does not work properly if you are pre damaging a map building which isn't damaged (if that makes sense??)...
    For example, using the ModuleEditTerrainObject_F module.

    It basically damages the building when the map loads up. So you need to name the initial (undamaged) building, then get a trigger to name it again when it gets "damaged" (basically destroying the initial building). It a strange method, but it does make sense.

    • Like 2

  3. @ZaellixA
    Yes, of course!

    So, for simple buildings which only have a damaged state, then a ruined state, (e.g. Land_i_Stone_Shed_V1_F or Land_u_Addon_01_V1_F) you can use this method. (Probably a little ugly, but works consistently).

    Quote

    Sphere_StoneShedGrey1_1
    Init: StoneShedGrey1_1 = nearestObject [ this, "Land_i_Stone_Shed_V1_F" ];

    Trigger_1_1StoneShedGrey1_1
    Condition: !alive StoneShedGrey1_1;
    On Activation: StoneShedGrey1_2 = nearestObject [ Sphere_StoneShedGrey1_1, "Land_i_Stone_Shed_V1_dam_F" ];
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part01" select 0);
    { _x hideObjectGlobal false } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part02" select 0);

    Trigger_1_2StoneShedGrey1_1
    Condition: !alive StoneShedGrey1_2
    On Activation: { deleteVehicle _x } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part01" select 0);
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part02" select 0);
    { _x hideObjectGlobal false } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part03" select 0);


    For more complicated buildings, (e.g. Land_i_Stone_HouseSmall_V1_F or Land_i_House_Small_03_V1_F) you will have to use this method. (Similar to the first one, but with a few added stages).

    Quote

    Sphere_StoneHouseGrey1_1
    Init: StoneHouseGrey1_1 = nearestObject [ this, "Land_i_Stone_HouseSmall_V1_F" ];

    Trigger_1_1StoneHouseGrey1_1
    Condition: !alive StoneHouseGrey1_1;
    On Activation: StoneHouseGrey1_2 = nearestObject [ Sphere_StoneHouseGrey1_1, "Land_i_Stone_HouseSmall_V1_dam_F" ];

    Trigger_1_2StoneHouseGrey1_1
    Condition: StoneHouseGrey1_2 getHit "Dam_1" >= 1;
    On Activation: StoneHouseGrey1_2 = nearestObject [ Sphere_StoneHouseGrey1_1, "Land_i_Stone_HouseSmall_V1_dam_F" ];
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneHouseGrey1_1 - Part01" select 0);
    { _x hideObjectGlobal false } forEach (getMissionLayerEntities "StoneHouseGrey1_1 - Part02" select 0);

    Trigger_1_3StoneHouseGrey1_1
    Condition: StoneHouseGrey1_2 getHit "Dam_2" >= 1;
    On Activation: StoneHouseGrey1_2 = nearestObject [ Sphere_StoneHouseGrey1_1, "Land_i_Stone_HouseSmall_V1_dam_F" ];
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneHouseGrey1_1 - Part03" select 0);
    { _x hideObjectGlobal false } forEach (getMissionLayerEntities "StoneHouseGrey1_1 - Part04" select 0);

    Trigger_1_4StoneHouseGrey1_1
    Condition: !alive StoneHouseGrey1_2;
    On Activation: { deleteVehicle _x } forEach (getMissionLayerEntities "StoneHouseGrey1_1 - Part01" select 0);
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneHouseGrey1_1 - Part02" select 0);
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneHouseGrey1_1 - Part03" select 0);
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneHouseGrey1_1 - Part04" select 0);

     

    Could be tidied up somewhat, but it works consistently as a first draft.

     

     

    If you need any help understanding what is going on, feel free to ask :)

    • Like 2

  4. For more complicated buildings I've been trying to write a script which will detect which Hitzone has been destroyed, then remove the objects accordingly.

    Basically, I'm trying to make it so that when one side of the building it will be detected using getHitPointDamage. So it will only activate if getHitPointDamage gives a 1.

    Here's my trigger, but I am struggling to write a piece of code which actually works.

    { !alive StoneHouseGrey1_1 } && { ( StoneHouseGrey1_1 getHitPointDamage "Dam_1" ) < 1 };

    The theory should work, its just being able to put it down into a piece of code which actually works...


  5. Ok, I found a really simple solution which requires only two triggers and a 100cm sphere

    Sphere_StoneShedGrey1_1
    Init: StoneShedGrey1_1 = nearestObject [ this, "Land_i_Stone_Shed_V1_F" ];

    Trigger_1_1StoneShedGrey1_1
    Condition: !alive StoneShedGrey1_1;
    On Activation: StoneShedGrey1_2 = nearestObject [ Sphere_StoneShedGrey1_1, "Land_i_Stone_Shed_V1_dam_F" ];
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part01" select 0);
    { _x hideObjectGlobal false } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part02" select 0);

    Trigger_1_2StoneShedGrey1_1
    Condition: !alive StoneShedGrey1_2
    On Activation: { deleteVehicle _x } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part01" select 0);
    { deleteVehicle _x } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part02" select 0);
    { _x hideObjectGlobal false } forEach (getMissionLayerEntities "StoneShedGrey1_1 - Part03" select 0);

    Seems to have work consistently so far. However, untested in multiplayer.
    Thank Eden Editor for its obscure tricks!! 


  6. @Tankbuster
    Its about 4 building in a small area on a hill (small FIA stockpile/camp).
     

    Two of the buildings have about 20 - 40 prop objects in. They are mostly simple objects, so they don't move. It follows very heavily the (style?) of the Laws of War campaign, which has a lot of props in the buildings to make it seem more lived in.

    I just delete all of the objects in the specific building when it changes its state (destroyed).


  7. @Tankbuster

     

    On ‎8‎/‎12‎/‎2019 at 10:21 AM, Tankbuster said:

    In my example, _buildingdamaged is a variable that contains a reference to the damaged building object. It is created by the EH. You can't put your own data in there.

    I think you need to read up on what variables are and do in this game.

    I now realise what you mean. When the original building gets damage, it basically gets "deleted" and a new building is placed in its position with the damage/destroyed model. Obviously, that now means that the "new" building in its place is not called the same thing as the "deleted" building.

    I see now that you were showing me that I need to have a script which will name the "new" building which is now in the place of the "old" one.


  8. @Tankbuster
    Ok, I've given it a go.

    I have used the Edit Terrain Object Module to name the building which has the objects inside, because it is a map building.
    The building has been named FIA_StoneShedGrey1_1 in the Object Variable Name section.

     

    What I do not understand is that you have two names for the same building. (e.g. _mybuilding and _buildingdamaged)

    I have tried creating a simple .sqf which will delete the named objects within the building...

    //destroyProp.sqf
    
    { deleteVehicle _x } forEach [ P1, P2, P3, P4, P5 ];

    Then I added this line of code to the Object Init of FIA_StoneShedGrey1_1

    addmissioneventhandler [ "BuildingChanged", { params [ "_o", "FIA_StoneShedGrey1_1" ]; call "destroyProp.sqf" } ];

    This would just give me a "Local Variable in Global Space" error.


  9. @Tankbuster
    So I was trying to follow the BuildingChanged Mission Event Handler

    Condition: addMissionEventHandler [ "BuildingChanged",  {  "FIA_StoneShedGrey1_1",   <----------------------------- Here is where I get stuck, I don't understand how to use the addMissionEventHandler for BuildingChanged. (It shouldn't be a very complicated event)

    On Activation: { deleteVehicle _x } forEach [ Object1_1, Object1_2, Object1_3, Object1_4, Object1_5, Object1_6 ];


  10. [
    	this,
    	"Load.",
    	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    	"_this distance _target < 3",
    	"_caller distance _target < 3",
    	{},
    	{},
    	{ _this call 
    		{
    		_ZamakTrans = nearestObjects [ _this select 0, [ "Truck_02_transport_base_F" ], 25 ] select { alive _x };
    		
    		if  ( count _ZamakTrans > 0 ) then
    			{
    			target = ( _ZamakTrans select 0 );
    			_lockIndexes = [ 2, 3, 4, 5, 6, 7 ];
    			{ if ( ( _x select 2 ) in _lockIndexes ) then { moveOut ( _x select 0 ) }; } forEach fullCrew target;
    			{ target lockCargo [ _x, true ]; } forEach _lockIndexes;
    			box attachTo [ target, [ 0, 0.25, -0.15 ] ];
    			box setVectorDirAndUp [ [ 1, 0, 0], [0, 0, 1 ] ];
    			};
    		}
    	},
    	{},
    	[],
    	2,
    	Nil,
    	true,
    	false
    ] remoteExec [ "BIS_fnc_holdActionAdd", 0, this ];

    For anyone who is interested in recreating ^^


  11. I am currently trying to make it so that when a hold action is preformed on a crate, it will put the crate in the back of a non specific Zamak Truck.
    Currently, it will put the crate in the nearest Zamak Truck (destroyed or alive). I need it to only pick the closest alive Zamak Truck.

     

    I've tried loads of different methods, but I'm now quite stuck. Please help!

    This is my script so far, all working fine.

    [
    	this,
    	"Load.",
    	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    	"_this distance _target < 3",
    	"_caller distance _target < 3",
    	{},
    	{},
    	{ _this call 
    		{
    		_ZamakTrans = nearestObjects [ _this select 0, [ "Truck_02_transport_base_F" ], 25 ];
    		
    		if  ( count _ZamakTrans > 0 ) then
    			{
    			target = ( _ZamakTrans select 0 );
    			_lockIndexes = [ 2, 3, 4, 5, 6, 7 ];
    			{ if ( ( _x select 2 ) in _lockIndexes ) then { moveOut ( _x select 0 ) }; } forEach fullCrew target;
    			{ target lockCargo [ _x, true ]; } forEach _lockIndexes;
    			box attachTo [ target, [ 0, 0.25, -0.15 ] ];
    			box setVectorDirAndUp [ [ 1, 0, 0], [0, 0, 1 ] ];
    			};
    		}
    	},
    	{},
    	[],
    	2,
    	Nil,
    	true,
    	false
    ] remoteExec [ "BIS_fnc_holdActionAdd", 0, this ];

    What I need is to pick the closest alive Zamak Truck, not just the closest one.

     

    (any advice/criticism on my script will be greatly appreciated.)


  12. @Sgt. Dennenboom

    Thank you very much!

    _ZamakTrans = nearestObjects [ _this select 0,["Truck_02_transport_base_F"],25];
    if (count _ZamakTrans > 0) then {
    	target = _ZamakTrans select 0;
    	
    	// Kick units from cargo slots and lock them
    	_lockIndexes = [2,3,4,5,6,7];
    	{if ((_x select 2) in _lockIndexes) then {moveOut (_x select 0)};} forEach fullCrew target;
    	{target lockCargo [_x,true];} forEach _lockIndexes
    	
    	// Attach box
    	box attachTo [target,[0,0.25,-0.15]];
    	box setVectorDirAndUp [[1,0,0],[0,0,1]];
    };

    This was perfect! Just had to make one minor change to the code so it would work.

    [
    	this,
    	"Load.",
    	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    	"_this distance _target < 3",
    	"_caller distance _target < 3",
    	{},
    	{},
    	{ _this call 
    		{
    		_ZamakTrans = nearestObjects [ _this select 0, [ "Truck_02_transport_base_F" ], 25 ];
    		if ( count _ZamakTrans > 0 ) then
    			{
    			target = _ZamakTrans select 0;
    			_lockIndexes = [ 2, 3, 4, 5, 6, 7 ];
    			{ if ( ( _x select 2 ) in _lockIndexes ) then { moveOut ( _x select 0 ) }; } forEach fullCrew target;
    			{ target lockCargo [ _x, true ]; } forEach _lockIndexes;
    			box attachTo [ target, [ 0, 0.25, -0.15 ] ];
    			box setVectorDirAndUp [ [ 1, 0, 0], [0, 0, 1 ] ];
    			};
    		}
    	},
    	{},
    	[],
    	2,
    	Nil,
    	true,
    	false
    ] remoteExec [ "BIS_fnc_holdActionAdd", 0, this ];

     ^^ For anyone who would like to replicate what I've done.

    If the Zeus player is sitting in the position which gets locked while in Zeus mode, he will not be kicked out of the vehicle.

     

    • Like 1
    • Thanks 1

  13. I am currently trying to make it so that when a hold action is preformed on a crate, it will put the crate in the back of a non specific Zamak Truck.
    This would mean that the seats in the back of the truck would have to be locked and anyone sitting in the truck must be ejected from those seats.

    This is my script so far, all working fine.
     

    [
    	this,
    	"Load.",
    	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    	"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_loaddevice_ca.paa",
    	"_this distance _target < 3",
    	"_caller distance _target < 3",
    	{},
    	{},
    	{ _this call 
    		{
    		_ZamakTrans = nearestObjects [ _this select 0, [ "Truck_02_transport_base_F" ], 25 ];
    		if (count _ZamakTrans > 0) then
    			{
    			target = _ZamakTrans select 0;
    			{ target lockCargo [ _x,true ] } forEach [ 2, 3, 4, 5, 6, 7 ];
    			box attachTo [ target, [ 0, 0.25, -0.15 ] ];
    			box setVectorDirAndUp [ [ 1, 0, 0], [0, 0, 1 ] ];
    			};
    		}
    	},
    	{},
    	[],
    	2,
    	Nil,
    	true,
    	false
    ] remoteExec [ "BIS_fnc_holdActionAdd", 0, this ];


    All I need at the moment is to be able to eject people from the seats 2, 3 4, 5, 6 and 7.

    (any advice/criticism on my script will be greatly appreciated.)


  14. Just wondering when the Tac-Ops DLC missions files will be available to the people who have bought the DLC.

    For my own map creation, it would be nice to see how certain actions which are used in the Tac-Ops DLC were created.

    It was done for the LoW DLC which I found very useful.

    Thanks :)


  15. I am trying to put together a trigger which gives Zeus points every time a truck goes between two points on the map (Like a supply line).

    If one Zeus is playing as the OPFOR team, they must spawn a Tempest Ammo truck and tell it to Cycle between two points (Point A and Point B). If the truck is spawned at Point A, the Zeus must order it to go to Point B, once it reaches Point B it must then be ordered to turn around and go back to Point A before Zeus points are added to that team. The Zeus can have multiple trucks going back and forth to add up Zeus points more quickly.

     

    I have managed to work out how to make the triggers active when a certain Vehicle type has entered the trigger, but I am having trouble working out how to get the supply point triggers working properly.


  16. I've now managed to get it working

     

    This is the code I'm using in my init.sqf

     

    [BLUFOR_Zeus_Module,

    ['ModuleRemoteControl_F',0,
    'B_Soldier_SL_F',2,
    'B_soldier_LAT_F',2.6,
    'B_soldier_M_F',2,
    'B_Soldier_TL_F',1.6,
    'B_soldier_AR_F',2,
    'B_Soldier_A_F',1.4,
    'B_medic_F',2,
    'B_Soldier_F',1,
    'B_Soldier_GL_F',1.4,
    'B_sniper_F',4,
    'B_spotter_F',2,
    'B_engineer_F',2.6,
    'B_soldier_repair_F',2.4,
    'B_soldier_exp_F',2.6,
    'B_recon_TL_F',1.2,
    'B_recon_medic_F',1.6,
    'B_recon_LAT_F',2.2,
    'B_recon_JTAC_F',2,
    'B_recon_exp_F',2.2,
    'B_recon_M_F',1.6,
    'B_recon_F',0.6,

    'B_Quadbike_01_F',3,
    'B_MRAP_01_F',5,

    'B_HMG_01_F',2,
    'B_HMG_01_high_F',2,
    'B_GMG_01_F',3,
    'B_GMG_01_high_F',3]]

    call bis_fnc_curatorObjectRegisteredTable;

     

    This seems to do the trick (for anyone else who is still having problems)


  17. On ‎2‎/‎15‎/‎2018 at 7:16 PM, 7erra said:

    Alright I've found a solution on my own: Using BIS_fnc_curatorObjectRegisteredTable you can only add the classnames of the objects that you want. If you want to place an unlimited amount of objects just set the cost to 0. The Zeus module has to have all addons unlocked beforehand, otherwise the objects won't be added. Example:

    
    [curatorObj,[
    	"Land_HBarrier_01_line_1_green_F", 0,
    	"Land_HBarrier_01_wall_corridor_green_F", 0
    ]] call BIS_fnc_curatorObjectRegisteredTable;

    This will only unlock the Hesco barriers.

     

    As to what I want to achieve after all is a building system and it just got a lot better ;) I may make a guide for this at some point.

     

    I am very new to scripting with Arma 3, and I am having trouble getting this to work (currently trying to test what you have done).

     

    It keeps coming up with an error when I load from the Eden Editor into a multiplayer game to test the map.

     

    This is what I put into my "init.sqf".

     

    [curatorObj,[
     "Land_HBarrier_01_line_1_green_F", 0,
     "Land_HBarrier_01_wall_corridor_green_F", 0]] call

    BIS_fnc_curatorObjectRegisteredTable;

     

    It does not seem to like this at all. Just wondering what I am doing wrong.

×