Jump to content
Sign in to follow this  
Meatball0311

At mission start randomly place POW's

Recommended Posts

Situation - I am wanting to build a POW rescue mission to where intel only gives an suspected area of possible POW location.

What I would like to happen - At mission start I would like the POW's to be randomly placed in one of 10 locations.

Any advice would be helpful.

Share this post


Link to post
Share on other sites

The only way I know how is calling createUnit array at the beginning of the mission. Just put a marker at each location that he might spawn at and throw their names into an array for use with this.

Share this post


Link to post
Share on other sites

Place ten GameLogics where you want to have the predefined positions, create a short script that randomly chooses one of the 10 locations and move the POW´s there.

Share this post


Link to post
Share on other sites

It's no need to use scripts - just connect POWs to these markers via F2 in editor and unit will be placed randomly on one of them or on default position.

More can be found on Biki, chapter Markers Mode (F6).

Share this post


Link to post
Share on other sites

Thanks Gaia!! I didnt know that you could do that. It is an easy way to randomly place units.

So I now know the easy way. How do I do the hard way. One thing I like about scripting, it makes everything cleaner on mission editor.

I understand that you have to createUnit:

group createUnit [type, position, markers, placement, special]

Questions:

1) group: I want the created unit to be on the East side not belonging to any certain group (what would I put here)

2) position: What do they mean when that ask "position" (how do you get that, I am wanting the unit to be placed at 1 of any 10 markers, not at a specific "position")

3) markers: I understand I will make an array of the ten possible locations

4)placement: is 0

5)special: can either be "NONE" or "FORM"

Share this post


Link to post
Share on other sites

1)Group: You can use createGroup to make a new group for the unit.

2)Position: This is a default position. Only if there is nothing in the marker array will it be used. You can use one of the markers you placed for this using getMarkerPos.

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  

×