Jump to content

Random Attack programming?


Twistfish

Recommended Posts

Hey Treadheads,

I have been trying to practice my mission building skills and am wondering how to create an enemy force that has random attack patterns... There are a few missions out there that have this embedded, but when I try to crack them open in the mission editor to see how they are built in the control logic section, the mission is password protected.

Living in the US I am pretty much using American Armor - M1, M1A1, Humvees and Bradleys and stacking them up against all the other armor available in the program. So far I can create an opposing force of 'bad guys' but since I'm the one building the mission I always know where they are and the mission lacks any element of surprise..

Specifically, how would I give the enemy say - 6 T80 tanks, a few helos, 10 APCs + artillery and then program the mission to have them attack me from different locations & in different strengths every time?

Thanks for your help

Twistfish

Link to comment
Share on other sites

Thanks for the replies fellas but I think I'm gonna need a bit more help here...

There are events + triggers + conditions for the control logic, all I want to do at this point is drop in 4 enemy tanks and have them attack from a different location each time.

the X1, X2, Xnew etc... not exactly sure how this works> seems like this works in conjunction with the quartile brackets and dictates the "probability" of the random event.

do i put in X4 if I want to have 4 enemy tanks? Does the X# correspond to the number of enemies I am trying to have in the game? How do I specify that the random variable is infact the origin of attack and not something else?

I read the tutorial on SBwiki from the link provided- its only 3 paragraphs; gives a nice overall explanation of capabilities of the logic system but provides no concrete examples of "how to"- so I am still pretty lost here.

This is one part of SB that I wish had more documentation to make it a bit more user friendly to create scenarios -

Could one of you please toss up a screen shot large enough to read with the settings to simply have 4 enemy tanks attacking from a different location each time?

How about giving the enemy 4 different types of vehicles- how do I program in to have them attack in different combinations? ie, enemy has a tank, heli, apc & rifle platoon. 1st battle the rifle platoon + heli attack me. 2nd battle the apc, tank + heli attack. 3rd battle its just the heli attacking.. & so forth.

I'm sure for you SB veterans out there this is pretty easy stuff but for me, with no examples, just starting out building missions & adding in simple variables to make it interesting is like trying to troubleshoot a circuit board with no schematics!

Thanks for your assistance Treadheads!!!

Twistfish

Link to comment
Share on other sites

  • Members
Thanks for the replies fellas but I think I'm gonna need a bit more help here...

There are events + triggers + conditions for the control logic, all I want to do at this point is drop in 4 enemy tanks and have them attack from a different location each time.

Super-easy:

  1. Assuming that the tanks are in one single platoon: create four routes from that tank platoon to the four different starting locations that you want.
  2. Assuming that you want each of the four locations with the same likelihood:
    right-click the route to waypoint 1 and select "Jump to end, if..." with the condition 0 < X1 < 25.
    right-click the route to waypoint 2 and select "Jump to end, if..." with the condition 25 < X1 < 50.
    right-click the route to waypoint 3 and select "Jump to end, if..." with the condition 50 < X1 < 75.
    right-click the route to waypoint 4 and select "Jump to end, if..." with the condition 75 < X1 < 100.
  3. Now right-click your tank platoon and select "Spawn, if..." with the condition 0 < X1 < 100.

As a result, the enemy tank platoon will spawn as you open the mission (=in the planning phase), and immediately move to either waypoint 1, 2, 3, or four, depending on which value the random variable X1 has in this game session.

From waypoints 1,2,3, and 4 you then plot your attack routes normally.

Link to comment
Share on other sites

  • Moderators
Is the 'Spawn if' necessary for the 'Jump to end if' function?

For the most part yes, but there is one little known exception. You can create Jump to End without Spawn If as long as the Jump to End is based only on a random variable. In this way you can have a unit change it's starting location as soon as the Planning Phase starts. This is useful to put the human player or AI in different starting positions at beginning of Planning Phase (Top Tank Platoon does this).

Link to comment
Share on other sites

  • Members
How about giving the enemy 4 different types of vehicles- how do I program in to have them attack in different combinations?

That you do with spawn conditions, e.g. to have the tanks present in 75% of all runs of this scenario, use a "Spawn, if..." condition 0 < X2 < 75

To have IFVs present in 75% of all cases, but only in two thirds of those scenario runs that also have tanks, use the "Spawn, if..." condition 25 < X2 < 100

To have helicopters present in every fourth scenario, but only if tanks and IFVs aren't present together, you'd need to make a "Spawn, if..." condition [0 < X2 < 15] OR [90 < X2 < 100].

You then use the routes with the jump conditions that you created in my first example. Right-click, select "copy", then right-click the IFVs and helicopters and select "paste". Repeat that with each of the four jump routes. Whatever force composition you'll have in a scenario, they will all start in the same vicinity of your random start location.

In other words, by using the same random variable you get coordinated randomness, which is an important difference to just chaos.

Link to comment
Share on other sites

Yep, it can get complex very quickly. If you look at "The Sentinel" in the mission editor, you can see a bunch of random routes for red. It should be in your Contest 3 folder.

Holy crap, I just took a look at it and wow, who put that scenario together?

Link to comment
Share on other sites

Yep, it can get complex very quickly. If you look at "The Sentinel" in the mission editor, you can see a bunch of random routes for red. It should be in your Contest 3 folder.

Searched for The Sentinel in both MP and SP .sce download sections. No can find :(

Salut for your commanding in last night's Red Tide battle btw. And you should get a medal for your 'peace keeping' abilities too. :)

Link to comment
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...