Jump to content
Mordred C

Spawning in FOB after trigger.

Recommended Posts

Hello, I'm relatively new to Arma 3 scripting and the such, but I've been theorizing on something for my mission which I am constructing in Alive (Along with a bunch other mods)

 

Anyways, everything's going in stutters but getting done none the less, limited arsenal... Cinematic first launch.... Etc...

BUT

I am getting consistently and frustratingly stuck on one issue, and I can't seem to find a solution through the internet.

Basically, the idea is that after the players reach a certain point the mission evolves so originally players only have what they have at the beginning including loadouts and some stored gear in vehicles but after this 'First Phase' then a Field HQ/FOB will spawn, with accompanying Hide Terrain Object modules, respawn points and arsenal.

 

What I need, if possible, is to create a trigger or a script that removes objects on the map and places a base composition of my design. I originally looked into experimenting with object presence and its probability, if there was a script to switch 0 to 100 and vice versa, but apparently this is only checked before/at mission start and thus was a dead end.

 

Anyways, if anyone knows a way to bulldoze an area and develop it into a FOB mid-mission then I would appreciate the help.

Thanks

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3:

- nearestObjects

- nearestTerrainObjects

 

Plus:

- hideObjectGlobal

- disableSimulationGlobal

or

- deleteVehicle

 

That's a good start if you want to look at clearing an area of objects to spawn your own creation in. Then you could look at this for spawning in compositions:

 

Edit: If you come up with something and it's not working, be sure to post your code.

Share this post


Link to post
Share on other sites
15 hours ago, Mordred C said:

Hello, I'm relatively new to Arma 3 scripting and the such, but I've been theorizing on something for my mission which I am constructing in Alive (Along with a bunch other mods)

 

Anyways, everything's going in stutters but getting done none the less, limited arsenal... Cinematic first launch.... Etc...

BUT

I am getting consistently and frustratingly stuck on one issue, and I can't seem to find a solution through the internet.

Basically, the idea is that after the players reach a certain point the mission evolves so originally players only have what they have at the beginning including loadouts and some stored gear in vehicles but after this 'First Phase' then a Field HQ/FOB will spawn, with accompanying Hide Terrain Object modules, respawn points and arsenal.

 

What I need, if possible, is to create a trigger or a script that removes objects on the map and places a base composition of my design. I originally looked into experimenting with object presence and its probability, if there was a script to switch 0 to 100 and vice versa, but apparently this is only checked before/at mission start and thus was a dead end.

 

Anyways, if anyone knows a way to bulldoze an area and develop it into a FOB mid-mission then I would appreciate the help.

Thanks

 

You can delete everything within a radius of a given object. 

 

Place an object in the middle of the area you want to delete, name the object, "object1".  

 

Then use this to delete every object within a 100 meter radius. You can make the radius as big as you want, just change the 100, to whatever you need. 

 

{deleteVehicle _x} forEach nearestObjects [object1, ["all"], 100];

 

 

You can do the same thing with show, and hide objects, for your FOB.

 

This will hide every object within 100 meter of object2.

 

{hideobject _x} forEach nearestObjects [object2, ["all"], 100];

 

 

To show the objects.

 

{_x hideobject false} forEach nearestObjects [object2, ["all"], 100];

 

 

 

Place your FOB in the editor, and at the start of the mission hide, and disable the simulation.

 

Put this into your mission init.sqf file.

 

{hideobject _x} forEach nearestObjects [object2, ["all"], 100];

 

{_x enableSimulation false} forEach nearestObjects [object2, ["all"], 100];

 

 

Then when you want to delete the all objects, and show the FOB.

 

{deleteVehicle _x} forEach nearestObjects [object1, ["all"], 100];

 

{_x hideobject false} forEach nearestObjects [object2, ["all"], 100];

 

{_x enableSimulation true} forEach nearestObjects [object2, ["all"], 100];

 

 

 

 

 

Share this post


Link to post
Share on other sites

Thank you very much guys, I'll update when I get back to working on it.

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

×