Page 1 of 1
New MP Map: Two Roads *now contains RANDOM FORCES version*
Posted: Tue Jun 14, 2011 10:23 pm
by djddalton
Hi,
Here is a new multiplayer scenario created by bones65 and djddalton.
Download link:
www.djddalton.talktalk.net/Dom_n_Ian_MP_Maps_Rand.zip
- Both Allies and Axis forces must mount offensive and defensive positions
- Although the Allied force is strong, they must face heavy artillery and aerial fire with no air defense
- Emphasis is on a fun and tactical game rather than historical/geographical accuracy
- The map has been tested for balance, but would welcome opinions whether or not improvements need to be made
- place the zipped folder under User/Documents/My Games/BBCBA/MULTIPLAYER and unzip contents to this location
Hope you enjoy, there is already a sequel/random version in the works
Happy gaming,
bones65 and djddalton
edit: to add random forces to your list, simply replace the entire folder in your MULTIPLAYER folder with the new download
Posted: Tue Jun 14, 2011 10:27 pm
by Merr
Thanks for your work .... but ... clicking the link, then following the folder links results in
No items in this folder

Posted: Tue Jun 14, 2011 11:08 pm
by djddalton
Sorry! A few edits later and finally got the download (and instructions) working!
Posted: Tue Jun 14, 2011 11:57 pm
by Merr
djddalton wrote:Sorry! A few edits later and finally got the download (and instructions) working!
Got it !
Thanks again for your work!
I hope to get my B.O.C. cleaned up enough for public use ... Right now, if anyone tried to read my scripts without taking a motion-sickness-pill ...
Well, need I say more!
Looking forward to more "scripted" heavy MP scenarios from you ... that is, if you don't end up in a mental hospital in the process!

Posted: Wed Jun 15, 2011 12:45 am
by djddalton
No prob, hope you enjoy!
There is absolutely no scripting in this map, however I would like to create maps with random forces, reinforcements, and special victory conditions, so I'm only fiddling around atm! Is there anything I can reference for the coding?
Edit: ok I reminded myself of the STUB engine documentation, just need to find a way to do randomised forces for both sides!
Posted: Wed Jun 15, 2011 1:42 am
by bones65
hey waddyaknow!.. the link works haha!

Posted: Wed Jun 15, 2011 2:45 am
by Merr
djddalton wrote:No prob, hope you enjoy!
There is absolutely no scripting in this map, however I would like to create maps with random forces, reinforcements, and special victory conditions, so I'm only fiddling around atm! Is there anything I can reference for the coding?
Edit: ok I reminded myself of the STUB engine documentation, just need to find a way to do randomised forces for both sides!
Ok ... This should be rather painfull ... but, I'll just post the script you need ...
(I got the script from
BETA_Slith_MP_Random, and cut out the parts you don't need)
... Copy/Paste the code below into a new text file ...
... Save this text file into your scenario folder as
two_roads.bsf
Note how I chose 1000 pts for each side ...
Side 0 had 1579 pts ... Side 1 had 1326 pts ... so, basically I chose roughly 3/4 your total pts.
You may need to adjust accordingly ... add more units, lower the selection points ... whatever
I tested this and it works!
This is what I'm using in my B.O.C..
Code: Select all
include "Functions.BSF"
// called at the start of every turn.
// You would tend to use this for events
FUNCTION StartTurn(side)
{
if (GetTurn() == -1 )
{
RandomForce(0, 1000) ;
RandomForce(1, 1000) ;
}
}
//*****************************************************************************
//*****************************************************************************
FUNCTION RandomForce(side, points)
{
int i ;
int id ;
int count ;
int placed ;
int index ;
int tries ;
int cost ;
int loaded ;
ClearArray(-1) ;
count = 0 ; // not strictly needed as all vars default to 0, but clearer
for(i=0;i<GetUnitCount(side);i++)
{
id = GetUnitID(side, i) ;
if( IsUnitValid(id) == 1 )
{
// valid unit to look at
SetArray(count, id) ;
count++ ;
}
}
// now have all the team members in the array that are not fixed
// try 512 times at most
placed = 0 ;
tries = 1024 ;
for(i=0;i<tries;i++)
{
if( placed == count )
{
// done
i = tries ;
}
else
{
index = Rand(0, count-1) ;
id = GetArray(index) ;
if( id != -1 )
{
cost = GetUnitCost(id) ;
loaded = GetLoadedUnit(id) ;
if( loaded != -1)
{
cost += GetUnitCost(loaded) ;
}
if( cost <= points )
{
// we will keep this unit
SetArray(index, -1) ;
points -= cost ;
placed++ ;
}
}
}
}
// now remove any units still in the list
for(i=0;i<count;i++)
{
id = GetArray(i) ;
if(id != -1)
{
RemoveUnit(id, 1) ;
}
}
}
Posted: Wed Jun 15, 2011 10:39 am
by djddalton
Merr, you are a legend! That's a great help, much easier than what I was trying to do (TOTALLY random reinforcements, which I might try anyway)
Is it possible to split each side into teams (so for example, I randomise tanks, infantry separately) or will that take more work?
Also, who's property is functions.bsf? I suspected it belonged to Insidius, that or was created by Slitherine. Anyhow it's very useful
Will post random version soon when I am happy with it
Posted: Wed Jun 15, 2011 3:51 pm
by pipfromslitherine
Functions is a kind of dropbox for all our useful helper functions

.
You could fairly easily add logic to do teams seperately, that is in fact what the random plugin does. You would just need a points total per team and then cycle across each team, rather than the whole side.
Cheers
Pip
Posted: Thu Jun 16, 2011 4:32 am
by Merr
djddalton wrote:
Is it possible to split each side into teams (so for example, I randomise tanks, infantry separately) or will that take more work?
That, I'm afraid, will take more work. Let us know if you want to take the plunge into more scripting.
Now, I looked at your recent version and we may need to make a slight change to the script, this depends on what your intention was when generating the random forces.
I noticed, in the editor, that some of your units are FIXED.
The script was built for MP and it's different from the solo script used in the PLUGIN.
What's different is that it includes FIXED units(when randomly selecting) in the MP script. Also, the MP script looks at loaded units and adds them to the point total.
If your intention was to have FIXED units always present, then we need to fix that.
So, lets do that now ... (saves an extra post by you if this was the case!)
Open the
two_roads_random_forces.bsf , locate the
FUNCTION RandomForce(side, points).
Scroll down to this code below ...
Change this ...
Code: Select all
if( IsUnitValid(id) == 1 )
{
// valid unit to look at
SetArray(count, id) ;
count++ ;
}
To read this ...
Code: Select all
if( IsUnitValid(id) == 1 )
{
if( IsUnitFixed(id) == 0 )
{
// valid unit to look at
SetArray(count, id) ;
count++ ;
}
}
So now, your FIXED units will always be in the scenario, and non-fixed units will be randomly selected.
One more note ... I see that you physically added the FUNCTIONS.BSF to your scenario file. This isn't needed unless you made a change to that bsf. So, you can remove that bsf. Don't worry that the script says to include that bsf, because the functions.bsf is already there, in the core folder.
Hope that helps!
Posted: Thu Jun 16, 2011 11:14 am
by macnab
Thanks for maps i have put in folder and they show up on My Challenge screen ,but as yet i havent played with them will let you know how they go,
Posted: Thu Jun 16, 2011 1:05 pm
by djddalton
Much appreciated, I'm adding this to a document called 'coding lessons from Merr' lol
I realised this was the case, I'm playing one now where I'm lacking my wespe...but in actuality it's quite cool, I'll think I'll stick to totally random for now.
Your trackhit is awesome btw, I'm surprised it hasn't been included in any updates yet!
Posted: Fri Jun 17, 2011 10:52 pm
by Merr
djddalton wrote:Your trackhit is awesome btw, I'm surprised it hasn't been included in any updates yet!
I'm glad you liked TrackHit! .... It's just a concept really. It shows how a noob like me can script-in changes.
Maybe we'll see a professional Slitherine version someday.
This is my view on the whole thing :
Slitherine gave us a sandbox to play in ...
Slitherine maintains the sandbox (functionality, server, etc) ...
We, the players, create the fun stuff (like you did!) ...
If Slitherine can "fit" our toys and ideas into their sandbox without breaking anything .... Yipee!
Hey ... I've got an idea about FIXED units ...
Pretend the FIXED units are your core forces ... Infantry Company, Tank Company, whatever.
The NON-FIXED are your initial support forces.
Now, with this idea (and more scripting) .... You can expand the MP exerience another notch.
Also, there are several approaches to a TOTAL Random force. However, scripting is required to make it work correctly.
The script outline would be like this ...
1. Create several real world OOB's.
2. Randomly select that OOB.
3. Randomize the OOB strength, experience, etc.
4. Drop the OOB onto the map.
When you're ready to take the plunge into scripting, holler!
Posted: Fri Jun 17, 2011 11:31 pm
by pipfromslitherine
It might be something that I can look at to allow 'global' mods - that is, if you wanted to play a campaign with trackhit or some other feature in it, to allow you to do so without having to copy the campaign and add in script files etc. The main issue is making it all play nicely if we alter our core scripts etc.
Cheers
Pip
Posted: Sat Jun 18, 2011 12:05 am
by Merr
pipfromslitherine wrote:It might be something that I can look at to allow 'global' mods - that is, if you wanted to play a campaign with trackhit or some other feature in it, to allow you to do so without having to copy the campaign and add in script files etc. The main issue is making it all play nicely if we alter our core scripts etc.
Cheers
Pip
Pip,
I was thinking the same thing .... Something like an "Include Mod" button ... However, the mod would have to be configured correctly to import into a players camp, and I can see errors popping up left and right with that one!
Pip .... while I have you .... Can you look into allowing SIDE(0), in the editor, to change the Team number? Currently, side(1) can only be changed since the editor was built for solo editting. Having this functionality would allow the side(0) to use the PLUGIN code for Teams. Basically, it's another RandomForce Plugin for side(0).
The only way I know to change teams is to edit the BAM .... ugly, but it works! (I think).
Thank you.
Posted: Sat Jun 18, 2011 2:11 am
by pipfromslitherine
I'll take a look. We altered it to make it friendlier for people, but I can see the possible uses for sure.
Cheers
Pip
Re: New MP Map: Two Roads *now contains RANDOM FORCES versio
Posted: Wed May 22, 2013 11:47 am
by blownapart
how do you edit a .BSF file
Re: New MP Map: Two Roads *now contains RANDOM FORCES versio
Posted: Wed May 22, 2013 4:10 pm
by pipfromslitherine
blownapart wrote:how do you edit a .BSF file
The wiki has details on installing and setting up Notepad++
http://www.slitherinebravo.net/GameWiki ... gine#tools
that is the simplest way to edit BSF files.
Cheers
Pip
Re: New MP Map: Two Roads *now contains RANDOM FORCES versio
Posted: Thu Jun 13, 2013 9:14 am
by leci
Hi - I have placed this Mod/Scenario on the Playable Mods & Scenario directory Sticky at
viewtopic.php?f=87&t=43167
Gilles