Jump to content
Sign in to follow this  
keimosabe

random location for downed helo

Recommended Posts

I know that you can sync a person or AI with markers and he will randomly spawn at one of them AND I know about the RANDOM POSITION module for GL4 but neither of those will work with a WRECK.

I went in and tried to just make several GAME LOGIC "locations" and I COULD sync the wreck with them but it doesn't seem to be randomly picking one. The wreck always spawns in the same location and I've tried it now like 6 times and I figure with odds, it would change starting location at least ONCE out of those six but it hasn't.

I haven't named the game logics, but I didn't see a need. Am I missing something stupid here? As usual... thanks in advance for the help guys.

Share this post


Link to post
Share on other sites

How about placing several markers where you would like the wreck to show up and link the wreck to all the markers so when the mission starts the wreck is randomly placed at one of the markers?

Just a thought. Good luck! :D

Best, Splicer.

Share this post


Link to post
Share on other sites

yeah, I tried that like you can with a player or AI but it wouldn't let me sync them. Am I missing something on syncing a WRECK with a marker? I thought it'd be that simple too....

Share this post


Link to post
Share on other sites

how about spawning a new chopper, not a wreck, on the ground at a random marker. Set vehicle health set to 0 and it will explode about 5 seconds after the map loads. I have done it with other equipment to simulate the aftermath of a battle. OR you could get an empty chopper to spawn at a random location and use <this setpos [(getpos this select 0), (getpos this select 1), 200];> It falls out of the sky and splodes nicely :)

good luck

Share this post


Link to post
Share on other sites

Another way:

  1. Create the wreck of the helicopter, name it 'heli'.
  2. Create 5 Game Logic (Locations) and name them: pos1, pos2, pos3, pos4 & pos5.
  3. In your init.sqf put this line:
    call compile format ["heli setPos [(getPos pos%1 select 0),(getPos pos%1 select 1),0]",ceil(random 5)];


This will make it randomly appear at any one of the Game Logic's positions at ground level, you can also make it look like its burning to find out how check here: http://forums.bistudio.com/showpost.php?p=1323644&postcount=3.

Share this post


Link to post
Share on other sites
how about spawning a new chopper, not a wreck, on the ground at a random marker. Set vehicle health set to 0 and it will explode about 5 seconds after the map loads. I have done it with other equipment to simulate the aftermath of a battle.

I like this! Another nice way to skin this cat. :D

OR you could get an empty chopper to spawn at a random location and use <this setpos [(getpos this select 0), (getpos this select 1), 200];> It falls out of the sky and splodes nicely :)

good luck

This actually may not work. I've set objects up in the air to place them on top of buildings, etc, and and they do not fall down. They just stayed floating up in thin air! :confused:

I must also bring to you attention that this does not happen with AI units (e.g, soldiers), they do fall to the ground. :cool:

My 2 cents. I hope this helps. :D

Best, Splicer.

Share this post


Link to post
Share on other sites

hey thanks a LOT guys for the help. I'm gonna try Andy's advice and see if it works. yeah, I already ahve it on fire and burning. I have several fires going around the city and I've attached the fire and smoke to the wreck itself.

In fact, in the mission, there is no initial task other than to find and inspect the downed helo for survivors and the only help players get is to follow the smoke. I wanted it to randomly place so that every time it's played, players wouldn't know exactly where it was and would have to fight all over town to get to it :)

---------- Post added at 05:07 PM ---------- Previous post was at 04:39 PM ----------

Andy55... that's working like a CHAMP man! Thanks again for the help guys.:yay:

Share this post


Link to post
Share on other sites

Is there a way to do this with a group of AI around a wreckage? IE) A CSAR mission that has a c130 wreck with friendly (health at 0) guys, and OPFOR guys, a trigger and some static objects.

Share this post


Link to post
Share on other sites

That seems to only go where I tell it to go. I want it to follow where my AI guys go.

I grouped my AI guys to 3 separate empty markers to be randomly placed. I'd like my objects to go with them, to whichever empty marker they go to.

Share this post


Link to post
Share on other sites

You're either going to have to adapt how you place your AI, or how you use that script...

Maybe place your AI and the whole setup somewhere, then randomly choose one of the markers and use it's POS as the pos_new in that script?

Share this post


Link to post
Share on other sites

I found a really good way of ensuring an open flat area for spawning randomly over a huge area.

By placing a marker and calling an sqf script

null=["markername",500]execVM "randomloc.sqf";

_marker = _this select 0;
_radius = _this select 1;
_pos = getmarkerpos _marker;

_exp = [_pos, 1, _radius, 5, 0, 5 * (pi / 180), 0] call BIS_fnc_findSafePos;
while {surfaceisWater _exp} do {_exp = [_pos, 1, _radius, 5, 0, 5 * (pi / 180), 0] call BIS_fnc_findSafePos;};

_name = "UAZ_RU" createVehicle _exp;

The 'while' command was necessary almost certainly, on Rahmadi, as the position always spawned in the water NW of the island

By making the script search for land, it finally placed it on open terrain.

The script I found somewhere, but the tweak works really well.

Share this post


Link to post
Share on other sites

Great find Palyamerc and welcome to the forums. :)

Remember you'll need the Functions module on the map for that to work.

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  

×