Stratos Posted April 28, 2010 Posted April 28, 2010 I know in Armed Assault, is possible (using triggers) to make a group of units to appear at random locations each time you start a mission, so every time you play the enemy can be at different preplanned positions. Is possible to do the same on FC2.0? And If yes, how please. Thanks! I don't understand anything in russian except Davai Davai!
Case Posted April 28, 2010 Posted April 28, 2010 It is not possible to trigger units or groups of units to activate on a random spot. What you can do is to create, for example, 10 copies of the same unit or group of units and place them on different locations. Then at mission start you can randomly activate only one or more of them. You would then have to make 10 triggers like: MISSION START(Activate Unit 1) // RANDOM(10) // ACTIVATE GROUP(Unit 1) MISSION START(Activate Unit 2) // RANDOM(10) // ACTIVATE GROUP(Unit 2) etc... The RANDOM(10) condition has a 10% chance of being true and activating the unit. This means there is a probability that more than 1 unit is activated for each mission. To circumvent this you could randomly set flags, for example like this: MISSION START(Set Flag 1) // RANDOM(50) // SET FLAG(1) MISSION START(Set Flag 2) // RANDOM(50) // SET FLAG(2) ONCE(1 True, 2 True) // FLAG TRUE(1) && FLAG TRUE(2) // ACTIVATE GROUP (Unit 1) ONCE(1 True, 2 False) // FLAG TRUE(1) && FLAG FALSE(2) // ACTIVATE GROUP (Unit 2) ONCE(1 False, 2 True) // FLAG FALSE(1) && FLAG TRUE(2) // ACTIVATE GROUP (Unit 3) ONCE(1 False, 2 False) // FLAG FALSE(1) && FLAG FALSE(2) // ACTIVATE GROUP (Unit 4) So at mission start you randomly set two flags and then do tests to see which of the four outcomes is true to activate only a single unit or group of units out of four. You can add more random flags to get more options, but it goes as factors of 2 (2 flags for 4 possibilities, 3 flags for 8, 4 for 16 etc). There are only 10 types of people in the world: Those who understand binary, and those who don't.
The Beast Posted April 28, 2010 Posted April 28, 2010 Hey thats pretty cool! I never thought to use flags that way!
Grimes Posted April 29, 2010 Posted April 29, 2010 (edited) Its actually a pretty useful method as you can use the left over groups you created but didn't spawn initially as a form of reinforcements. With some additional triggers you can even randomize the reinforcements! I created some triggers that did it a while back in Black Shark. I'll see if I can find em and make a post. It requires several triggers and flags though... About 10 flags and 16 or so triggers. Edited April 29, 2010 by Grimes The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Stratos Posted April 29, 2010 Author Posted April 29, 2010 Interesting. Imagine a mission, If I use no flags, one mission I can get No flak, in the next get medium Flak or Sams... I don't understand anything in russian except Davai Davai!
sonic Posted April 29, 2010 Posted April 29, 2010 Following Grimes' post for DCS mission editor http://forums.eagle.ru/showpost.php?p=803600&postcount=18 i created a template for a continuous random miz The whole thread is a must read : http://forums.eagle.ru/showthread.php?t=47877_4conditions.miz [sIGPIC][/sIGPIC]
Grimes Posted April 29, 2010 Posted April 29, 2010 Its the same thing really. The only difference is how it is evaluated. Done at mission start it "rolls the dice" once for each flag. My method I posted over in DCS forums simply rolls the dice several times with a much much smaller individual chance of it becoming true. It also allows for you to reuse the randomization code a little later on in the mission. Continuous> Flag is True (10) & Random (5) > Set Flag 1 Continuous> Flag is True (10) & Random (5) > Set Flag 2 Switched Condition > Time Since Flag (10) [4 seconds] > Clear Flag (10) At any point in the mission you could Set Flag 10 to be true and they will be reevaluated. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
asparagin Posted May 1, 2010 Posted May 1, 2010 It is not possible to trigger units or groups of units to activate on a random spot. What you can do is to create, for example, 10 copies of the same unit or group of units and place them on different locations. Then at mission start you can randomly activate only one or more of them. You would then have to make 10 triggers like: MISSION START(Activate Unit 1) // RANDOM(10) // ACTIVATE GROUP(Unit 1) MISSION START(Activate Unit 2) // RANDOM(10) // ACTIVATE GROUP(Unit 2) etc... The RANDOM(10) condition has a 10% chance of being true and activating the unit. This means there is a probability that more than 1 unit is activated for each mission. To circumvent this you could randomly set flags, for example like this: MISSION START(Set Flag 1) // RANDOM(50) // SET FLAG(1) MISSION START(Set Flag 2) // RANDOM(50) // SET FLAG(2) ONCE(1 True, 2 True) // FLAG TRUE(1) && FLAG TRUE(2) // ACTIVATE GROUP (Unit 1) ONCE(1 True, 2 False) // FLAG TRUE(1) && FLAG FALSE(2) // ACTIVATE GROUP (Unit 2) ONCE(1 False, 2 True) // FLAG FALSE(1) && FLAG TRUE(2) // ACTIVATE GROUP (Unit 3) ONCE(1 False, 2 False) // FLAG FALSE(1) && FLAG FALSE(2) // ACTIVATE GROUP (Unit 4) So at mission start you randomly set two flags and then do tests to see which of the four outcomes is true to activate only a single unit or group of units out of four. You can add more random flags to get more options, but it goes as factors of 2 (2 flags for 4 possibilities, 3 flags for 8, 4 for 16 etc). Nice, thx for sharing. I made something like this with 2 groups: MISSION START(Set Flag 1) // RANDOM(50) // SET FLAG(1) ONCE() // FLAG TRUE(1) // ACTIVATE GROUP (Unit 1) ONCE() // FLAG FALSE(1)// ACTIVATE GROUP (Unit 2) but only like this both are being activated. I have to add a second action: like: ONCE() // FLAG TRUE(1) // ACTIVATE GROUP (Unit 1), DEACTIVATE GROUP (Unit 2) ONCE() // FLAG FALSE(1) // ACTIVATE GROUP (Unit 2), DEACTIVATE GROUP (Unit 1) to make it work Do you know why that is? Spoiler AMD Ryzen 9 5900X, MSI MEG X570 UNIFY (AM4, AMD X570, ATX), Noctua NH-DH14, EVGA GeForce RTX 3070 Ti XC3 ULTRA, Seasonic Focus PX (850W), Kingston HyperX 240GB, Samsung 970 EVO Plus (1000GB, M.2 2280), 32GB G.Skill Trident Z Neo DDR4-3600 DIMM CL16, Cooler Master 932 HAF, Samsung Odyssey G5; 34", Win 10 X64 Pro, Track IR, TM Warthog, TM MFDs, Saitek Pro Flight Rudders
Case Posted May 1, 2010 Posted May 1, 2010 but only like this both are being activated. I have to add a second action: like: ONCE() // FLAG TRUE(1) // ACTIVATE GROUP (Unit 1), DEACTIVATE GROUP (Unit 2) ONCE() // FLAG FALSE(1) // ACTIVATE GROUP (Unit 2), DEACTIVATE GROUP (Unit 1) to make it work Do you know why that is?Did you make sure you used a "Time Hold" of 23 hours for both units/groups? Only with this will you be able to activate them after mission start. 1 There are only 10 types of people in the world: Those who understand binary, and those who don't.
asparagin Posted May 1, 2010 Posted May 1, 2010 Of course I didn't. :smilewink: THX Case! Spoiler AMD Ryzen 9 5900X, MSI MEG X570 UNIFY (AM4, AMD X570, ATX), Noctua NH-DH14, EVGA GeForce RTX 3070 Ti XC3 ULTRA, Seasonic Focus PX (850W), Kingston HyperX 240GB, Samsung 970 EVO Plus (1000GB, M.2 2280), 32GB G.Skill Trident Z Neo DDR4-3600 DIMM CL16, Cooler Master 932 HAF, Samsung Odyssey G5; 34", Win 10 X64 Pro, Track IR, TM Warthog, TM MFDs, Saitek Pro Flight Rudders
Recommended Posts