Jump to content
Sign in to follow this  
frosties

Trigger existence of vehicles?

Recommended Posts

Hello,

Was wondering if it would be possible to create a trigger that will spawn vehicles and ammo in a location?

the idea is that in my mission, the user will start in a boat outside an island and will have to choose an insertion point.

When the soldiers hit the beaches they will get a bunch of ammo boxes and a few vehicles that simulates an "beach landing"

Would it be possible?

And also the same with a respawn point.

Planning on using Norrins revive script with multiple respawns.

:yay::yay:

Share this post


Link to post
Share on other sites

titleText ["(Left click) on the map where you want to insert.", "PLAIN"];

// Creates the marker. 
_mk1 = createMarker ["Insert_Marker", [0,0,0]];
_mk1 setMarkerShape "ICON";
_mk1 setMarkerType "hd_destroy";
_mk1 setMarkerColor "ColorRed";
_mk1 setMarkerText "Insertion Point";

// When you click on the map it will place the new marker at that location.
onMapSingleClick {'Insert_Marker' setMarkerPos _pos, dropclick = true}; 
waitUntil {dropclick}; 
onMapSingleClick {}; 
dropclick = false;
_insertPos = getmarkerpos "Insert_Marker";

// spawn all your crap at the new location 

Then all you need to do is spawn your stuff at that marker location. You dont have to use the marker if you dont want to, you can just use the onmapsingleclick command.

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Can i connect that with a trigger that states "BLUFOR PRESENT" or something?

And how do i connect the stuff and vehicles i want to spawn?

Edited by Frosties

Share this post


Link to post
Share on other sites
the idea is that in my mission, the user will start in a boat outside an island and will have to choose an insertion point.

Im assuming you want to select your insert area, you click on the map and it will create the marker where you clicked. After that it can spawn all of your gear.

You could use a Blufor present trigger. On activation you would execute that script.

---------- Post added at 06:14 AM ---------- Previous post was at 06:07 AM ----------

[/color]//  Wait until Functions Module is ready.
waituntil {!isnil "bis_fnc_init"};

// Some bling bling for your screen
titleText ["(Left click) on the map where you want to insert.", "PLAIN"];

// Creates the marker. 
_mk1 = createMarker ["Insert_Marker", [0,0,0]];
_mk1 setMarkerShape "ICON";
_mk1 setMarkerType "hd_destroy";
_mk1 setMarkerColor "ColorRed";
_mk1 setMarkerText "Insertion Point";

// When you click on the map it will place the new marker at that location.
onMapSingleClick {'Insert_Marker' setMarkerPos _pos, dropclick = true}; 
waitUntil {dropclick}; 
onMapSingleClick {}; 
dropclick = false;

// Now we have a location to spawn the gear.
[color="Red"]_insertPos = getmarkerpos "Insert_Marker";[/color]

// spawn all your gear at the new location
[[color="Red"]_insertPos[/color], 180, "BMP3", EAST] call bis_fnc_spawnvehicle;

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Okey i will try this as soon as possible.

Will the stuff spawn when i press the map, or when i enter the trigger area then?

[_insertPos, 180, "BMP3", EAST] call bis_fnc_spawnvehicle;

Is this where i put the classnames to spawn vehicles i guess?

Can i use it to spawn ammoboxes as well?

My idea is to spawn ammoboxes and 1-2 humvees at the insertion location.

Share this post


Link to post
Share on other sites

If you are using a trigger then the script will only start when that condition is met in the trigger. When the script starts it will tell you to click on the map to select an insertion area and then will wait until you click on the map. After you click on the map all of your items would spawn in.

I just used bis_fnc_spawnvehicle as an example.

Share this post


Link to post
Share on other sites

Okey.

Would i be able to do something similar with a spawn point?

Im sitting here and planning a mission for my squad.

And boat insertion or a parajump insertion is something where are considering. But its not fun to do that each time you die...

thats why i would like it so that when a trigger is triggered a respawn location will be selectable (with the help of norrins script).

You know what i mean?

Share this post


Link to post
Share on other sites

I have played missions using norrins script but I have never played around with it in the editor.

Share this post


Link to post
Share on other sites

what i meant is, if you understand what i mean with the insertions to trigger a insertion marker.

Like:

When BLUEFOR is present, then a respawn marker called "insertion point" is created.

I just havent understood how i can make a marker show up when a trigger condition is met

Share this post


Link to post
Share on other sites

Like:

When BLUEFOR is present, then a respawn marker called "insertion point" is created.

I just havent understood how i can make a marker show up when a trigger condition is met

I'm pretty sure the only way to do this is to basically re-execute all of the revive stuff. You can't "Activate" a spawn point. So below is the crude way to do it, still may be a bit buggy.

In your editor make a marker and name it whatever and give it a symbol and color. In this example it is named insertion.

In your init, put:

"insertion" setMarkerAlpha 0; 

Make a trigger in the editor

BLUFOR, Present   // for testing purposes I just used a Radio trigger
Condition: this
OnAct.: nul = server execVM "spawninsert.sqf";

Then create a file called spawninsert.sqf and put...

Copy and paste your revive_init.sqf into here, then change the _base_2 and _no_respawn_points variables to reflect that you have to spawns.
At the bottom put
"Respawn2" setMarkerAlpha 1;

I'll dig some more to see if there is a more efficient way to do this.

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  

×