Jump to content
Sign in to follow this  
dark_spectre

spawning and despawning in compositions via trigger, impossible?

Recommended Posts

Hello all,

I have spent 23+ hours now over the last 2 days trying to solve this problem for a new MP mission, but no matter what I try, or who's recommendations I implement, I simply cannot get this problem to go away. :mad:

Goal: Spawning in and despawning out compositions via trigger, "repeatedly".

current mission on filedropper:

http://www.filedropper.com/functionstriggersmodulesaltis_2

Very simple, A BLU_F Soldier and two triggers! What could be easier, right?! :P

1pe651.jpg

So, basically I have a composition, placed in an .sqf file, created by ARES that I've called Islandbase.sqf.

What I'm trying to accomplish with this is that I would like to spawn that composition whenever BLU_F occupies the trigger area for a set amount of time, and then de-spawn the composition if BLU_F is absent for a set amount of time, "repeatedly". And therein lies the rub, repeatedly, as the first trigger locks permanently after firing, preventing it from ever being used again.

this is the contents of Islandbase.sqf

if (isServer) then
{
   _newObject = createVehicle ['Box_FIA_Ammo_F', [13578.4,12190.5,0.00541496], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13578.4,12190.5,15.291]; _newObject setVectorDirAndUp [[0.00141401,0.998976,-0.045232], [-0.0439142,0.0452504,0.99801]];_newObject = createVehicle ['B_supplyCrate_F', [13576.9,12188.4,-0.0215321], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13576.9,12188.4,15.2897]; _newObject setVectorDirAndUp [[0.882652,-0.466195,0.0599063], [-0.0438283,0.0452647,0.998013]];_newObject = createVehicle ['Box_FIA_Support_F', [13581.9,12189.1,0.0119114], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13581.9,12189.1,15.5697]; _newObject setVectorDirAndUp [[-0.00426426,0.999939,0.0102303], [-0.0995307,-0.010604,0.994978]];_newObject = createVehicle ['Box_FIA_Wps_F', [13580.1,12189.7,0.0172901], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13580.1,12189.7,15.4164]; _newObject setVectorDirAndUp [[-0.985569,0.138824,-0.096854], [-0.0908903,0.0486879,0.99467]];_newObject = createVehicle ['WaterPump_01_forest_F', [13575.2,12183.4,0.0117245], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13575.2,12183.4,15.4635]; _newObject setVectorDirAndUp [[0.0256026,0.998714,-0.0437667], [-0.0150303,0.0441606,0.998911]];_newObject = createVehicle ['CamoNet_BLUFOR_Curator_F', [13581.4,12185.8,0.00519753], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13581.4,12186,15.597]; _newObject setVectorDirAndUp [[-0.437365,-0.899277,0.00353759], [-0.0439434,0.0253007,0.998714]];_newObject = createVehicle ['Land_Cargo_House_V1_F', [13607.9,12205.7,0.592529], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13607.6,12204.8,16.1564]; _newObject setVectorDirAndUp [[0.376706,0.926333,0], [0,0,1]];_newObject = createVehicle ['Land_TTowerSmall_2_F', [13571.4,12190.3,0.0377045], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13571.4,12191.3,15.1526]; _newObject setVectorDirAndUp [[0.468967,0.883216,0], [0,0,1]];_newObject = createVehicle ['Land_PowerGenerator_F', [13605.3,12204.1,-4.19617e-005], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13605.4,12204.1,15.5588]; _newObject setVectorDirAndUp [[-0.93724,0.348671,-0.00296415], [-0.00266659,0.00133336,0.999996]];_newObject = createVehicle ['Land_PaperBox_open_full_F', [13571.4,12185.8,0.00140381], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13571.4,12185.8,15.3538]; _newObject setVectorDirAndUp [[0.49046,0.870615,-0.0384541], [0.00266417,0.0426277,0.999088]];_newObject = createVehicle ['Land_WoodenTable_small_F', [13579.6,12185.4,0.0011816], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13579.6,12185.4,15.5282]; _newObject setVectorDirAndUp [[-0.906257,0.41968,-0.0506624], [-0.044017,0.0255101,0.998705]];_newObject = createVehicle ['Land_ChairWood_F', [13580,12186.1,-1.81198e-005], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13580,12186.1,15.5267]; _newObject setVectorDirAndUp [[-0.717647,0.69466,-0.049293], [-0.0440825,0.0253269,0.998707]];_newObject = createVehicle ['Land_WaterBarrel_F', [13587.1,12204.6,0.000450134], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13587.1,12204.6,15.3403]; _newObject setVectorDirAndUp [[-0.0138505,0.999736,0.0183292], [-0.0239791,-0.0186577,0.999538]];_newObject = createVehicle ['Land_MetalBarrel_F', [13586.4,12205.2,0.000340462], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13586.4,12205.2,15.3339]; _newObject setVectorDirAndUp [[-0.00178121,0.999824,0.018666], [-0.0242851,-0.0187038,0.99953]];_newObject = createVehicle ['Land_MetalBarrel_F', [13587.2,12205.8,1.81198e-005], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13587.2,12205.8,15.3532]; _newObject setVectorDirAndUp [[0.0140824,0.999893,-0.00399099], [-0.0016192,0.00401418,0.999991]];_newObject = createVehicle ['Land_ChairWood_F', [13583.9,12184.5,-1.62125e-005], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13583.9,12184.5,15.7418]; _newObject setVectorDirAndUp [[0.908266,0.417074,0.0332113], [-0.0481298,0.0253011,0.998521]];_newObject = createVehicle ['Land_WoodenTable_large_F', [13582.8,12183.8,0.00276756], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13582.8,12183.8,15.7108]; _newObject setVectorDirAndUp [[0.96317,-0.26393,0.0514298], [-0.0464122,0.0252158,0.998604]];_newObject = createVehicle ['MapBoard_altis_F', [13585.6,12182.6,0.000553131], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13585.6,12182.6,15.8736]; _newObject setVectorDirAndUp [[0.129915,-0.991186,0.0259438], [-0.047333,0.0199361,0.99868]];_newObject = createVehicle ['Land_Tank_rust_F', [13584.1,12208.2,-0.00225258], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13584.1,12208.1,15.3303]; _newObject setVectorDirAndUp [[-0.320094,-0.947047,-0.0253605], [-0.023989,-0.0186581,0.999538]];_newObject = createVehicle ['Land_Tank_rust_F', [13582.9,12203.9,0.00124741], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13582.9,12203.8,15.2248]; _newObject setVectorDirAndUp [[-0.322527,-0.946219,-0.0254035], [-0.023989,-0.0186581,0.999538]];_newObject = createVehicle ['Land_LampShabby_F', [13588.1,12207.7,0], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13588,12207.4,15.3476]; _newObject setVectorDirAndUp [[-0.322874,-0.946442,0], [0,0,1]];_newObject = createVehicle ['Land_Communication_F', [13572.7,12192.3,0.0186539], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13572.9,12193.1,15.051]; _newObject setVectorDirAndUp [[0,1,0], [0,0,1]];_newObject = createVehicle ['Land_TTowerSmall_1_F', [13571,12188.6,0.00470352], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13571,12188.8,15.2426]; _newObject setVectorDirAndUp [[0,1,0], [0,0,1]];_newObject = createVehicle ['Land_SolarPanel_2_F', [13608.3,12206.7,-5.72205e-006], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13607.9,12206.2,19.2744]; _newObject setVectorDirAndUp [[-0.621485,-0.783426,-0.000612661], [-0.00266659,0.00133336,0.999996]];_newObject = createVehicle ['Land_FlatTV_01_F', [13579.5,12185.3,-0.0484886], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13579.5,12185.3,16.3418]; _newObject setVectorDirAndUp [[-0.503241,-0.864138,-0.00368814], [-0.0459079,0.0224726,0.998693]];_newObject = createVehicle ['Land_HelipadCircle_F', [13587.6,12165.5,0], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13587.6,12165.5,16.4221]; _newObject setVectorDirAndUp [[-0.000966614,0.999999,0], [0,0,1]];_newObject = createVehicle ['Windsock_01_F', [13585.1,12155,-0.0084362], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13585.2,12154.9,16.1325]; _newObject setVectorDirAndUp [[0.00360487,0.998587,-0.0530128], [-0.0677475,0.0531352,0.996287]];_newObject = createVehicle ['PortableHelipadLight_01_green_F', [13587.6,12165.5,0.000640869], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13587.6,12165.5,16.4217]; _newObject setVectorDirAndUp [[-0.0160782,0.998945,-0.0430193], [0.0233758,0.0433886,0.998785]];_newObject = createVehicle ['PortableHelipadLight_01_yellow_F', [13587.6,12158.4,0.000402451], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13587.6,12158.4,16.2673]; _newObject setVectorDirAndUp [[-0.0139348,0.99986,0.00922559], [0.0472667,-0.00855749,0.998846]];_newObject = createVehicle ['PortableHelipadLight_01_yellow_F', [13592.7,12160.5,0.000509262], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13592.7,12160.5,16.3719]; _newObject setVectorDirAndUp [[-0.00460743,0.999465,0.0323657], [-0.0478172,-0.0325492,0.998326]];_newObject = createVehicle ['PortableHelipadLight_01_yellow_F', [13592.7,12170.7,0.000656128], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13592.7,12170.7,16.4578]; _newObject setVectorDirAndUp [[-0.0187783,0.999695,-0.0160178], [-0.0533649,0.0149957,0.998462]];_newObject = createVehicle ['PortableHelipadLight_01_yellow_F', [13595.1,12165.5,0.000627518], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13595.1,12165.5,16.656]; _newObject setVectorDirAndUp [[-0.018907,0.999713,-0.0146906], [-0.0547394,0.0136361,0.998407]];_newObject = createVehicle ['PortableHelipadLight_01_yellow_F', [13582.5,12170.8,0.00276184], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13582.5,12170.8,16.315]; _newObject setVectorDirAndUp [[-0.0180728,0.998981,-0.0413655], [0.0440044,0.0421269,0.998143]];_newObject = createVehicle ['PortableHelipadLight_01_yellow_F', [13587.8,12172.9,0.000968933], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13587.8,12172.9,16.249]; _newObject setVectorDirAndUp [[-0.0168469,0.997978,-0.061289], [-0.00674962,0.0611828,0.998104]];_newObject = createVehicle ['PortableHelipadLight_01_yellow_F', [13582.2,12160.4,0.00131226], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13582.2,12160.4,16.5464]; _newObject setVectorDirAndUp [[-0.0165931,0.999818,0.00943024], [0.0821829,-0.00803583,0.996585]];_newObject = createVehicle ['PortableHelipadLight_01_yellow_F', [13580.2,12165.7,0.00201797], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13580.2,12165.7,16.7066]; _newObject setVectorDirAndUp [[-0.00276068,0.998616,-0.052517], [0.0818559,0.0525666,0.995257]];_newObject = createVehicle ['B_Boat_Armed_01_minigun_F', [13465.5,12149.2,-0.940157], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13465.5,12149.2,-0.911227]; _newObject setVectorDirAndUp [[-0.830201,0.557376,0.00995777], [0.00933895,-0.00395435,0.999949]];_newObject = createVehicle ['B_Boat_Armed_01_minigun_F', [13468.7,12153.7,-0.939567], [], 0, 'CAN_COLLIDE']; _newObject setPosASL [13468.7,12153.7,-0.910615]; _newObject setVectorDirAndUp [[-0.830183,0.557391,0.0105457], [0.0098291,-0.00427905,0.999942]];

};

this is the trigger I am using to pop the deposition trigger (trig1) and execute Islandbase.sqf, placing the composition down.

2dmifl0.jpg

This is the trigger I am using to despawn the units

2dadkwj.jpg

Here is the onAct in its entirety as its not all visible in the picture.

objs = nearestObjects [position trig1, [], 200]; { if (isplayer _x) then { hint "BLU_F units remaining in despawn zone not stripped of gear"} else { deleteVehicle _x}; }forEach objs;

Now this all works great...But only ONCE.

If I return after the despawn, trig1 will not fire again and re-exec the composition script. (my hint never pops either, so its dead)

Ive attempted to rectify this with help on reddit as well without success. I followed their advice, but the result is always the same or worse.

Figure I will place links here to be thorough.

https://www.reddit.com/r/armadev/comments/39tvc4/despawning_objects_in_a_radii_around_a_trigger/

https://www.reddit.com/r/armadev/comments/39x7h4/deactivating_a_locked_trigger/

=====================================================================================================

This all started in regards to this thread;

https://github.com/astruyk/Ares/issues/188#issuecomment-93023449

=====================================================================================================

PLEASE!!!! HELP!!!!!

:icon_wink:

Edited by Dark_Spectre

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×