Panta Posted September 23, 2009 Share Posted September 23, 2009 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 0 Quote Link to comment Share on other sites More sharing options...
Tacbat Posted September 23, 2009 Share Posted September 23, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
DarkAngel Posted September 23, 2009 Share Posted September 23, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
Panta Posted September 23, 2009 Author Share Posted September 23, 2009 Thank you chaps! Cheers, Panta 0 Quote Link to comment Share on other sites More sharing options...
Tacbat Posted September 23, 2009 Share Posted September 23, 2009 in a 50 - 50 route split you only have to put the condition on one of the two routes. Damn, I've been making work for myself. 0 Quote Link to comment Share on other sites More sharing options...
Members Ssnake Posted September 24, 2009 Members Share Posted September 24, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
DarkAngel Posted September 24, 2009 Share Posted September 24, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
Members Ssnake Posted September 24, 2009 Members Share Posted September 24, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
Tacbat Posted September 24, 2009 Share Posted September 24, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.