First scenario in the works...I have design questions!

Download scenarios and talk about scenario design.

Moderators: Slitherine Core, BA Moderators

Post Reply
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

First scenario in the works...I have design questions!

Post by acarhj »

Hi,

I (finally) started my conversion of the Rapid Fire Operation Market-Garden scenario book for BA.

The first Scenario is called "Break-out" and as you might guess, it is the breakout of 30 corps.

Some Q's.

I set a turn limit in the template and the turn counter does not show up in the scenario when I run it. What am I doing wrong!?

The column is long so I've decided to break it into 3rds and will have 2 of 3 parts arrive as reinforcements. I think grabbing objectives to cause them to appear would be a good way to get them on board. Any ideas on how to do this?

Initial barrage? How can this be accomplished. I want to drop an initial barrage. The attack started with a barrage and I think the second one could simply be placed by the player with the off board artillery asset. how does one pre-plot a barrage?

The enemy has an artillery asset as well. Do I just assign it or does the enemy have to be scripted to use the barrage?

John
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Assuming you are using the Victory Point Plugin, you might not see the turn limit if you haven't put down any VPs?

I'm not sure how you can trigger a barrage without the player doing it, but I know it is done for AI turns, so you could probably do it the same way. I've not looked into it, but (for example) the Bulge 1 mission begins with an AI barrage, so checking out the script for that mission might yield the answer! :)

Sorry for not being more specific - under the Mac gun atm, so a little off my scripting game!

Cheers

Pip
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

Actually even your vague answer helped. :D

I think the Normandy landing scenario starts with a barrage or two. I can get that.

However, does the AI use assets without scripting their use? Lets say I give them the recover asst. Will they use it on one of their units if available?
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

No - there is no AI logic for managing bonuses. It's on the very long wishlist.

Cheers

Pip
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

pipfromslitherine wrote:No - there is no AI logic for managing bonuses. It's on the very long wishlist.

Cheers

Pip
So, for the Germans, I will have to figure out who to get them to use in the off board 105 battery that they have then through scripting. GREAT!
tim1966
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 161
Joined: Sat Jul 31, 2010 7:15 pm
Location: Brighton, UK
Contact:

Post by tim1966 »

I found the best way is copy and paste bits from the original game scripts and then tinker until they work. If I get time I plan to put together a 'base' script which sets vp's, flags, adds reinforcements, achievements, objectives, random units and a couple of other things I've learnt. Pretty simple but gives you the tools to make most scenarios. I haven't worked out AI artillery bombard yet but I'm working on it.

Start simple and build it up bit by bit and save, save, save!
Models from Tim's Surplus Store ... Established 1966 ... Open 24/7 ... closed for TEA TIME
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

tim1966 wrote:I found the best way is copy and paste bits from the original game scripts and then tinker until they work. If I get time I plan to put together a 'base' script which sets vp's, flags, adds reinforcements, achievements, objectives, random units and a couple of other things I've learnt. Pretty simple but gives you the tools to make most scenarios. I haven't worked out AI artillery bombard yet but I'm working on it.

Start simple and build it up bit by bit and save, save, save!
Great advice. The only thing I really need is the reinforcements after an objective is taken. I think I can find that script in one of the American scenarios. Bulge I think. The artillery is a nice to have. Something like some of the desert scenarios where the artillery is a pre-plot that goes off if a unit hits a certain area.
tim1966
Administrative Corporal - SdKfz 232 8Rad
Administrative Corporal - SdKfz 232 8Rad
Posts: 161
Joined: Sat Jul 31, 2010 7:15 pm
Location: Brighton, UK
Contact:

Post by tim1966 »

Ok - here's reinforcements for your side (Allies). I think this should work when the Allies capture vp1 they get an infantry squad and a bren team and engineers in a half track - use the names from the squads csv. To add more just add more lines with the team name. The numbers are - first two = coordinates, third = facing (0,2,4 or 6 = 90 degrees turns - experiment to see which works best) or if 8 you can put them in a truck or halftrack by having that unit in the same square. So in this example the engineers will be in the half track. The getturn bit is so thye turn up after turn x - put in a number and then you only get them once (otherwise you get them every turn I think)

The showUI bit is the annoucement and you need to put IDS_REINF_M7a with the text you want in the text files. The REINF_M7a is my code for the annoucement - you make these bit up yourself as long as it matches with the IDS in the text file.


if( side == 0 )
{
// intro message
if(GetTurn() == 0)
{
ShowBriefing() ;
}
else
{
// End Turn report
//ShowUIScreen("BattlePop0", "Anim1", "IDS_ENDTURN");
}
// Reinforcements

if( (GetTurn() == X ) && (GetGlobal("vp1") == 0) )
{
PlaceUnit(16, 26, 0, 0, 0, "BRITISH_INFANTRY") ;
PlaceUnit(16, 28, 0, 0, 0, "BRITISH_BREN") ;
PlaceUnit(16, 29, 2, 0, 0, "M3_HALFTRACK") ;
PlaceUnit(16, 29, 8, 0, 0, "BRITISH_ENGINEER") ;


ShowUIScreenX( "BattleHead0", "Anim1", "IDS_REINF_M7a", "BHead0Image:british_infantry_head") ;
AddVizCamCenter(16, 28 ) ;
}


If you want it to be German reinfrocement then oput it under side ==1 and then everything lese is pretty much the same with the German squad names obviously.

If any of the above is wrong hopefully Merr or J2D will jump in :D
Models from Tim's Surplus Store ... Established 1966 ... Open 24/7 ... closed for TEA TIME
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I'm too tired to think right now. There may be a thread or two where Merr made me scripts for reinforcements.

I wish there was an easy way to have the AI use bonus items.
You can call me junk - and type that with one hand.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

What Merr and I started doing was taking a copy of Functions.bsf and renaming it to the scenario name .bsf then adding our script bits to that.
Here is the reinforcement script from my Did You Hear That battle in my Pacific campaign 1

FUNCTION StartTurn(side)
{
// Reinforcements
if( (GetTurn() == 4) )
{
if(side == 0)
{
// AddUnit with more options : FUNCTION PlaceUnit(x, y, facing, side, team, type)

ShowUIScreenX( "BattleHead0", "Anim1", "IDS_REINF", "BHead0Image:us_tanker_head") ;

PlaceUnit(16, 20, 2, 0, 1, "SHERMAN") ;
PlaceUnit(16, 21, 2, 0, 1, "SHERMAN") ;
PlaceUnit(16, 22, 2, 0, 1, "SHERMAN") ;
PlaceUnit(16, 23, 2, 0, 1, "SHERMAN") ;


AddVizCamCenter(16, 20);
}
}

// GetTurn() returns the current turn number,
// -1 is a special "turn" that is called in the beginning when the scenario is loaded.
if (GetTurn() == -1 )
{
// Setup VPs
PreBattleSetup() ;
}
else
{
// Check if any victory conditions are met
VictoryConditions() ;
}
}
You can call me junk - and type that with one hand.
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

Exactly what I was looking for.

Of course, now this spawns other questions. In this case, Tim's script is the application I need for this scenario if only because the British column is so long.

How do I know what the VP is called? I noticed that in AI mode the points are called "Point 0", "Point 1" and "Point 2". Does that mean that the identifier is POINT_0 etc?

How do you identify what a unit is? If it says Bren Carrier does that mean the value for the function is BREN_CARRIER?

When you place the script in the BSF file, is that a single separate object in the script or is it nested in another object?

Thanks all for the help so far!

John
pipfromslitherine
Site Admin
Site Admin
Posts: 9929
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Another option is to use the VP plugin in the editor to deal with the victory points, if you have no need of special case logic for them. Then just use the script to do the reinforcements. One reason is that the scripting used in the original missions is a little hard to read if you're not familiar with it.

The name you use for a unit is the name used as it's identifier in the squads.csv file that is being used.

The code that Tim posted would live inside the StartTurn function which every mission script needs to have. Or you can make it a new function and call it from the existing StartTurn, whatever makes it cleaner for you.

Cheers

Pip
acarhj
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 101
Joined: Wed Feb 27, 2008 3:20 am

Post by acarhj »

pipfromslitherine wrote:Another option is to use the VP plugin in the editor to deal with the victory points, if you have no need of special case logic for them. Then just use the script to do the reinforcements. One reason is that the scripting used in the original missions is a little hard to read if you're not familiar with it.

The name you use for a unit is the name used as it's identifier in the squads.csv file that is being used.

The code that Tim posted would live inside the StartTurn function which every mission script needs to have. Or you can make it a new function and call it from the existing StartTurn, whatever makes it cleaner for you.

Cheers

Pip
Thanks Pip. That's a big help there! I used the VP plugin. But I need the VP to be captured so I guess I will hunt down the script in the bulge scenario that does this.

John
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

junk2drive wrote: I wish there was an easy way to have the AI use bonus items.
I think it can be done ... like artillery and airstrikes you mean, right?

Make a Reinforcement Bonus the same way ... then, in the editor assign the bonus to the AI side(1).

From that point on, all you have to do is tweak the bonus script instead of inventing the wheel everytime you create a new scenario.

Hmmm ... Pip? ... Have you every thought about a Reinforcement PLUGIN ?
It would look like your VP plugin ... instead of 8 vp's, you would have 8 reinforcement "locations".

Just a wild thought.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I just had a look at the tutorial Hurricane bonus and see how I can delay a bonus so that the player can't use it from the start of the battle. Will be useful to prevent bombers and arty from upsetting the balance too early.

I still don't know how to make the AI use a bonus like arty and airstrikes.
You can call me junk - and type that with one hand.
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

junk2drive wrote: I still don't know how to make the AI use a bonus like arty and airstrikes.
I think it's pretty simple, and I'll have to find the script example in one of the scenarios.

I remember it's in the StartTurn function and perhaps the Tick function ... From there it run's a script telling the barrage the turn # and X/Y location, the rest is handle by the bombard function. Those are the only two parameters I can think of that the AI needs to know.

The Normandy scenario's have one that I remember looking at a while ago. It also had specific condionals for the barrage, ie if side(0) units were in a specific radius of an X/Y location, or (more commonly) if a flag was taken (side 0 owns it) then it will initiate the barrage.

I was too busy yesterday to look, but I'll make it a task for later today when I get home from work. I'll post the info then.

Rob
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I think what you are talking about is a script that carries out a barrage or airstrike on the AI turn based on triggers.

What I want is a reactive or proactive AI that can look at the situation and decide to use the bonus given in the editor.
You can call me junk - and type that with one hand.
Post Reply

Return to “Battle Academy : Scenario Design”