DLDC_Sims_guy Posted November 20, 2013 Share Posted November 20, 2013 What is the best way to randomize the "Embark If" command to set a unit off on variable routes? I understand the explanation in the SB Wiki, just wondering what those with the most experience here have found to work best.Thanks!Curt 0 Quote Link to comment Share on other sites More sharing options...
stormrider_sp Posted November 20, 2013 Share Posted November 20, 2013 What is the best way to randomize the "Embark If" command to set a unit off on variable routes? I understand the explanation in the SB Wiki, just wondering what those with the most experience here have found to work best.Thanks!CurtRandom variable!For example, you have 2 waypoints that you want the AI to choose randomly:Wp 1Embark if0 > random X1 < 50Wp 2Embark if50 < random X1 < 100At the start of the scenario, 63 random X#s are rolled. So, for every random check point, you assign the condition above for each X# (X1, X2, ...X63) 0 Quote Link to comment Share on other sites More sharing options...
Tacbat Posted November 20, 2013 Share Posted November 20, 2013 It all depends on what exactly you are trying to accomplish, and if you want to script coordinated random movement. 0 Quote Link to comment Share on other sites More sharing options...
DLDC_Sims_guy Posted November 20, 2013 Author Share Posted November 20, 2013 I want to use it, in conjunction with other variables, to script possible reactions to direct and indirect fire. I think I've got it now.Thanks to all! 0 Quote Link to comment Share on other sites More sharing options...
Flying Penguin Posted November 20, 2013 Share Posted November 20, 2013 On a related note, how would you use the 'New' random variable? Presumably there for when genuinely random movement is needed?So if I have two paths, each with 0 < New ≤ 50, will it do both or neither, or does it check each in turn at a 50% chance? And if the latter, does it recheck if neither are chosen on the first go or will the unit sit there like a lemon for all eternity?Cheers, Jamie 0 Quote Link to comment Share on other sites More sharing options...
Members Ssnake Posted November 20, 2013 Members Share Posted November 20, 2013 On a related note, how would you use the 'New' random variable? Presumably there for when genuinely random movement is needed?Correct. The numbered random variables are for coordinated random behavior. Like, an entire formation of units going left or right (the company commander would make that decision for everyone).The random variable "New" gets a new value whenever a unit queries a condition that includes it, so you can no longer coordinate that behavior with other units. 0 Quote Link to comment Share on other sites More sharing options...
Members Ssnake Posted November 20, 2013 Members Share Posted November 20, 2013 So if I have two paths, each with 0 < New ≤ 50, will it do both or neither, or does it check each in turn at a 50% chance? And if the latter, does it recheck if neither are chosen on the first go or will the unit sit there like a lemon for all eternity? Ah, the second part of the question. Yes, it could happen that for both paths XNew is outside of the 50% quartile that you defined. To avoid that, add the random embark condition to only ONE path. That way the random condition will be evaluated first, and if it is isn't true, the other path will be taken. 0 Quote Link to comment Share on other sites More sharing options...
Flying Penguin Posted November 20, 2013 Share Posted November 20, 2013 (edited) Ah, the second part of the question. Yes, it could happen that for both paths XNew is outside of the 50% quartile that you defined. To avoid that, add the random embark condition to only ONE path. That way the random condition will be evaluated first, and if it is isn't true, the other path will be taken. But are conditions re-evaluated with new random numbers each time? I am assuming that conditions are evaluated periodically as, to take a semi-related example, if I say embark if unit X is in zone Y, and X isn't in Y at the start but it later enters Y, my assumption is that the condition would then become true and the unit would embark, albeit with a little delay corresponding to the re-evaluation interval... Edited November 20, 2013 by Flying Penguin 0 Quote Link to comment Share on other sites More sharing options...
MAJ_Fubar Posted November 20, 2013 Share Posted November 20, 2013 A new variable is created and then checked each time a unit arrives at the given check point. 0 Quote Link to comment Share on other sites More sharing options...
stormrider_sp Posted November 20, 2013 Share Posted November 20, 2013 Ah, the second part of the question. Yes, it could happen that for both paths XNew is outside of the 50% quartile that you defined. To avoid that, add the random embark condition to only ONE path. That way the random condition will be evaluated first, and if it is isn't true, the other path will be taken. Oh, thanks! 0 Quote Link to comment Share on other sites More sharing options...
stormrider_sp Posted November 20, 2013 Share Posted November 20, 2013 But are conditions re-evaluated with new random numbers each time? I am assuming that conditions are evaluated periodically as, to take a semi-related example, if I say embark if unit X is in zone Y, and X isn't in Y at the start but it later enters Y, my assumption is that the condition would then become true and the unit would embark, albeit with a little delay corresponding to the re-evaluation interval...I assume that in this case it wont check again, since it only checks when it is in the checkpoint, not en route, and will continue towards the next checkpoint. 0 Quote Link to comment Share on other sites More sharing options...
Flying Penguin Posted November 21, 2013 Share Posted November 21, 2013 A new variable is created and then checked each time a unit arrives at the given check point. Thanks, that seems consistent with the test I just did. It appears that the new random is created on arrival (and is not refreshed each evaluation), but the conditions are repeatedly evaluated as long as the unit is at the waypoint. In the attached scenario, each Hummer (except for the north most one) has a single route with a 10% chance of setting off at the start, but when the northern Hummer reaches the trigger, the rest of them set off. Random Test.zip 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.