Japan

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

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

Post by junk2drive » Mon Sep 27, 2010 4:16 pm

I don't know how reinf would be set as fixed?

The starting units are fixed but the AI comes a running once things get going.

I stopped working on it until we get some answers from Pip

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

Post by pipfromslitherine » Mon Sep 27, 2010 4:19 pm

Sorry, I'm not sure what issue you guys are having? It's a pretty long thread, so if there is something specific that is holding things up, then I'm happy to help.

Cheers

Pip

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

Post by junk2drive » Mon Sep 27, 2010 4:24 pm

I'll go through and summarise when I get home tonight.

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

Post by Merr » Mon Sep 27, 2010 4:40 pm

junk2drive wrote:I don't know how reinf would be set as fixed?

The starting units are fixed but the AI comes a running once things get going.

I stopped working on it until we get some answers from Pip
Ok ... just a misunderstanding .... Let me start over.

Your FIXED unit's (units that start the scenario) are currently on TEAM 0 .... You said they are agressive enough ... I left them that way.
TEAM 1 and TEAM 2 are your reinforcements .... they are set to an agressive value of 32 ... which suppose to make them move to AI point 0 and 1 respectively.
Below is the code in Build5-1 that I posted yesterday, that suppose to handle this logic ....

Code: Select all

        // default team 0 to seek and destroy, use threat
		SetTeamAggression(1, 0, 48) ;
		
		// default team 1 to heading out for AI point 0
		// killing as we go		
		SetTeamAggression(1, 1, 32) ;	

		// default team 2 to heading out for AI point 1
		// killing as we go
		SetTeamAggression(1, 2, 32) ;

		// set our destination as being AI point 0, team 1
		SetTeamData(1, 1, 0, 0) ;
		// set our destination as being AI point 1, team 2
		SetTeamData(1, 2, 1, 0) ;
My problem is what the values (index,value) mean in SetTeamData ... I might have them backwards
... from the ENGINE DOCS ...

//set the team data
SetTeamData(side, team, index, value)

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

Post by Merr » Mon Sep 27, 2010 7:04 pm

junk2drive wrote:I'll go through and summarise when I get home tonight.
I hope Pip can help.... actually we all know Pip CAN help :wink:

I need to abandon you for awhile because I need to get my own scenario out the door ... Prisoner Rescue.(perhaps today or tomorrow).
Once I get this done I can help incorporate snipers and such into your scenario ... but, this is easy and it's complicated ... easy to add and complicated because the snipers need to be on a seperate team and behave properly.
Hopefully you'll have this all sorted out before that point.

I'm glad I could help (get it running) and I'm sorry I couldn't help (getting the AI/reinforcements to work correctly).

Until later ... :)

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

Post by junk2drive » Mon Sep 27, 2010 7:15 pm

Thanks for helping. I'll try yours out when you get it done.

Actually my scenario is supposed to have two tank crews that need protecting, somewhat like your prisoner rescue.
junk2drive wrote:OK I'm looking to have the reinf lineup to be at 17.39 and 16.39

Flags at 26,26 and 30,26 owned by Japan and to be captured by USA.

Then I need to decide on a victory condition.
Pip we need help with

VP vs VF. What determines the flag flipping sides when taken? Can they be assigned points? If no, then I will have to do a:

Capture and hold the flags for 12 turns

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

Post by Merr » Mon Sep 27, 2010 7:40 pm

junk2drive wrote:Actually my scenario is supposed to have two tank crews that need protecting, somewhat like your prisoner rescue.
Cool ... we can add that in special.
FYI ... My code starts the prisoner as German (enemy) and flips to other side, which generates a KILL SCORE ... so, if your Victory Conditions call for a body count we'll have to ammend those scripts too.
It's no trouble ... but you'll just have to live with the end of battle casualty results being inflated ... almost like real world, eh? :lol:

On the subject of tank crews .... I was pondering writing some code for BAILOUT ... A small 3-man tank crew generates after a tank is destroyed.
It's do-able, but not tested ... It's something "advanced" so for now, lets wait on this if you like the idea.

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

Post by pipfromslitherine » Mon Sep 27, 2010 7:41 pm

Assuming you are using the standard Functions.BSF code, then a unit sitting on the tile should switch the side to that unit's side. It will then stay that way until the other side should capture it.

CHeers

Pip

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

Post by junk2drive » Tue Sep 28, 2010 3:38 am

Merr the reinf attack now. I still can't get the flags to work.

EDIT I finally got the USMC flag to show for the US flag and not the GB flag. I suspect the GB flag is a default when the program can't find what it is looking for.

Now I just need to get the US flag to be German or Japan.
I have the Function.bsf set to Japan = 8 and the spwaw.bam at 8 and the bsf at 8.

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

Post by Merr » Tue Sep 28, 2010 6:33 am

junk2drive wrote:Merr the reinf attack now. I still can't get the flags to work.
Thats good news ....
junk2drive wrote: EDIT I finally got the USMC flag to show for the US flag and not the GB flag. I suspect the GB flag is a default when the program can't find what it is looking for.

Now I just need to get the US flag to be German or Japan.
I have the Function.bsf set to Japan = 8 and the spwaw.bam at 8 and the bsf at 8.
Ok ... I have an idea .... What folder do you have the Functions.bsf and the FunctionsWithVLs.bsf ?
- I assume you spelled the files correctly ? ... you keep saying "function.bsf" without the "s".
- I assume you still have the files located in \Japan\DATA\scripts ?

If I'm assuming correctly ... move both files to your campaign main folder ... same place as the text1 file ... (\Japan)

Perhaps the files aren't being recognized in the folder you have them (\Japan\DATA\scripts) ... this folder (Data\scripts) does not exist in the STUB ENGINE docs "directory tree".

I had the same problem when I first started because I put files in the wrong folder :oops: ... and the game wasn't acknowledging the change ... that drove me crazy.

If that doesn't work ... try the \battle\scripts folder. I'm guessing because I never modified the functions.bsf before.

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

Post by Merr » Tue Sep 28, 2010 6:58 am

And one final suggestion ...

First of all ... What sides are you defining? You got German, then Japanese, then german again but with Japanese flags defined on side8 :?

If using german all the way ... In the Editor go back and change side 1 as German in the spwaw.bam ... I don't even know if this is a good idea.

I think you're chasing your tail again ... ie, changing this but not that, changing that but forgot to go back to change this.
Oh what a tangled web you have made ... :wink:

I've been chasing my tail for a month ... it's not pretty.

So make sure everything same-same.... You are treading on unknown territory (for me).

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

Post by junk2drive » Tue Sep 28, 2010 12:23 pm

Ok ... I have an idea .... What folder do you have the Functions.bsf and the FunctionsWithVLs.bsf ?
- I assume you spelled the files correctly ? ... you keep saying "function.bsf" without the "s".
- I assume you still have the files located in \Japan\DATA\scripts ?
I deleted the withVLs when I cleaned up the files. That was just a Functions with some text pasted in that I was going to try out later.
I copy and pasted the Functions.bsf from the original game.
Yes

I tried this with 4 for Germany (since Pip said 8 wouldn't work) and it didn't work either. I changed all 3 file locations to 8 and mentioned it so that you might have an idea if I am missing something.

I didn't think to check the STUB tree. I did try putting the flags in the main but not the Functions.

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

Post by junk2drive » Tue Sep 28, 2010 1:09 pm

I moved the Functions.bsf to the Japan folder, no change.

Changed the spwaw.BAM to 4 and the spwaw.BSF to 4 and I still have US flags with USMC graphic on the map.

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

Post by junk2drive » Tue Sep 28, 2010 2:06 pm

I wonder if the scenario needs to be made initially with one of the 5 nations in the editor and the other sides can be minor nations?

I'll try that tonight.

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

Post by junk2drive » Wed Sep 29, 2010 2:27 am

I made a simple scen with side 0 usa, side 1 ge with an 88 gun and then some side 8 units.

Copy and paste and rename Merr build 5 script with country changed to 4, add scen to campaign text and text1

Played 30 turns. USMC flags show for US, AI never appeared.

EDIT I checked the bam and it still had a 8 for side 1 so it must use whatever is last used in the editor.

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

Post by junk2drive » Wed Sep 29, 2010 1:29 pm

Well I found that sideid is not SetGlobal nation. 4 is France, 2 is German.

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

Post by Merr » Wed Sep 29, 2010 2:07 pm

I'm glad you made a seperate scenario to test the flags ... that's the best approach.

I know it's a bear to troubleshoot but keep plugging along.

Again, I'd help but you're in territory that I haven't crossed into (yet), I would just confuse the issue.

With regards to a test scenario, I recommend starting with the bare bones (TEMPLATE scenario). This has code in the template.bsf that displays flags a different way.
Start with that, add in one flag at coordinates "gVPX" and "Y", set the global vps to 0 (US doesn't own flags), and change the showeffect marker to read the jap flag.

That's the only suggestion I have, start new and work with that code in the template.

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

Post by junk2drive » Wed Sep 29, 2010 2:26 pm

Pip's comment in the flags thread, that the game isn't ready for adding countries, makes me think I should give up for now.

I'll read the STUB 50 times and try to figure out scripting. I suspect there is a lot that they aren't telling us as they assume we have the knowledge before attempting these projects.

Thanks for all your help.

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

Post by Merr » Wed Sep 29, 2010 2:35 pm

junk2drive wrote:Pip's comment in the flags thread, that the game isn't ready for adding countries, makes me think I should give up for now.
True .... but for now you're running the US vs Germans and simply swapping the German flag to Japanese. That's why I mentioned the template scenario. The showeffect calls the flag you want displayed.
If you get that test to work then you've jumped through the hoop.

Also, you using NotePad or NotePadd ++ to edit the bsf? I recommend NotePad ++.

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

Post by junk2drive » Wed Sep 29, 2010 2:37 pm

Nopepad++ er Notepad++

Post Reply

Return to “Battle Academy : Modders Corner ”