Jump to content
Mirek

Marker randomly spawned at one of several predetermined possitions

Recommended Posts

Hi

I want an area marker to randomly spawn at one of several  predetermined positions. I know that for objects i can place an object and few markers, connect them and then the object will randomly spawn at one of the marker possition. 

I tired to do the same but with area marker 350x400, but it doesnt seem to work. i get the "Random start" option, but when i try to connect it with the random start markers, i cant. 

 

Share this post


Link to post
Share on other sites

What markers do you use for the spawn locations? The empty ones?

 

Share this post


Link to post
Share on other sites

Use an invisible object like the helipad and then in the init of the object, use some code to set the marker position to the position of the object.

Share this post


Link to post
Share on other sites

You might be able to use selectRandom
something like
_marker setMarkerPos selectRandom [pos1, pos2, etc..];

unsure though, been out of it for a while :p

Share this post


Link to post
Share on other sites
8 hours ago, Mirek said:

What markers do you use for the spawn locations? The empty ones?

 

That doesn't matter. Any of them (empty or else, even ellipse)

Share this post


Link to post
Share on other sites
8 hours ago, Mirek said:

What markers do you use for the spawn locations? The empty ones?

 

That doesn't matter. Any of them (empty or else, even ellipse)

Share this post


Link to post
Share on other sites

I tried it and it doesnt work. You cant use the "random start" option with markers. tested in both wanila and moded.

When i place object, like soldier or car, and then "random start" sinchronise it with markers, it works the sinchronise lines appear. but when i try to "random start" sinchronise marker with markers, nothing happends.

 

Share this post


Link to post
Share on other sites
// For example, we have in our mission:
// - marker we want to shift, named MyMarker
// - number of markers with predefined positions named SpawnLocation_01, SpawnLocation_02, ..., SpawnLocation_XX

// Execute somewhere after mission initialization:
"MyMarker" setMarkerPos getMarkerPos selectRandom (allMapMarkers select { _x find "SpawnLocation_" == 0});

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks that should do the trick.

 

Share this post


Link to post
Share on other sites
9 hours ago, Mirek said:

I tried it and it doesnt work. You cant use the "random start" option with markers. tested in both wanila and moded.

When i place object, like soldier or car, and then "random start" sinchronise it with markers, it works the sinchronise lines appear. but when i try to "random start" sinchronise marker with markers, nothing happends.

 

I didn't catch you are trying to sync marker with markers!

Share this post


Link to post
Share on other sites

Didnt express myself properly i gues.

 

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

×