Jump to content
Panta

Assigning random events

Recommended Posts

The situation is as follows: I am in the mission editor and want a unit to embark on a route under randomic curcumstances. Let's say that I want it to have 50% possibilities to embark on path "A"and another 50 on path "B".

In Options, what is the right sintaxis for it? :eek2:

I know how to do it in several programming languages but not here.

Please advise.

Cheers,

Panta

Share this post


Link to post
Share on other sites

OK, drop a waypoint on the map, then make two routes starting from from that waypoint. Use the "Embark on route if" option by left clicking on your two different routes.

Near the bottom, select random variable. Leave the first number at 0, click on "New" to make it "X1", and make the last number 50. On your second route, do the same thing, but the first number will be 50, keep X1, and the last number 100.

This way, when a unit reaches your waypoint, it will have a 50/50 chance of going on either new route.

Share this post


Link to post
Share on other sites

in a 50 - 50 route split you only have to put the condition on one of the two routes. If you say on the first "embark if new random is between 0 and 50" as tacbat says. the other route needs no logic.

Share this post


Link to post
Share on other sites

Technically you can always leave the last route without any condition as long as the waypoint has no tactics assigned. Routes with conditions will be checked first, and only if no condition applies the route will be taken that has no conditions assigned. If there are more than one route without embark conditions, the last one that was created will be taken. But of course that's something one can't see, so better not rely on that.

Share this post


Link to post
Share on other sites

Panta, don't be confused by one thing Tacbat said. He said to use the X1 instead of the "new" random.

The Xx (X1,X2,X3 etc) numbers are random numbers created at mission start and remain the same throughout the mission.

This is important if you want to have more than one action based off a random number.

For example if you have a company of 3 platoons each of which have a route to a waypoint (so 3 waypoints in total). At each of the waypoints you have 2 possible routes one left and one right. If you want all the platoons to go the same direction based on a random then you use one of the X numbers. If you want each platoon to pick a random route separately use the "new" random.

Share this post


Link to post
Share on other sites

Yeah. Think of coordinated random behavior (like "Plan A" and "Plan B" for the computer-controlled force) as opposed to totally randomized behavior.

Usually coordinated random behavior is the method of choice, with a possible exception for gunnery range type scenarios, and "random freak" events to confuse the player by breaking the routine of a force template.

Share this post


Link to post
Share on other sites

Yes, good point Dark.

Here you can see what he means.

In the top example, X1 was between 0 & 50, so all units will travel on that route.

In the bottom example, a new number is generated each time a platoon gets to that waypoint (5). In this case, when 10/A got there, the number was between 0 & 50, so away he went on the top route. When 11/A and 12/A got there, the number wasn't between 0 & 50, so they went on the bottom route.

Using the "New" variable can give you some extra randomness.

Route.jpg.311d2bc47f6e8914e3d9abe77d894d

Route.jpg.311d2bc47f6e8914e3d9abe77d894d

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...