Flags

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

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

Post by Merr »

Amaz_Ed wrote:I put them in the anim folder in the core directory.
Ouch ..... Bad idea but works none-the-less.

Perhaps there is a problem with adding stuff to the players ANIM folder .... that's where they are suppose to go, and that's how it's suppose to work.

Pip ?
pipfromslitherine
Site Admin
Site Admin
Posts: 9898
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

I'll have to check whether just using DDS over-rides works. I think it expects a specific model file to use its own texture, but I will check.

Cheers

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

Post by Merr »

pipfromslitherine wrote:I'll have to check whether just using DDS over-rides works. I think it expects a specific model file to use its own texture, but I will check.

Cheers

Pip
Well, if it does need a specific model than I can make it work .... All I need to do is use a HEX-EDITOR on one of the flag S4F and change the DDS pointer.

EDIT -- Of course, it would be easier if you posted the ascii S3F of a flag model ... then anyone can use NOTEPAD to change the DDS. :wink:
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I got the flag to work with JSGME mod swapper. I'm about to abandon the My Games concept and use JSGME.
pipfromslitherine
Site Admin
Site Admin
Posts: 9898
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

At which point you won't be able to share your mods. It's possible that this is a bug, or just a misunderstanding of how it's set up to work. I'm going to check it out once I am free.

Cheers

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

Post by junk2drive »

Yes I can share my mods. Maybe not for multiplayer. JSGME works just fine for many games. Ever swapping exe files.

I appreciate you looking in to this.

I have tried putting the dds in

main

anim

core/anim

nothing works
pipfromslitherine
Site Admin
Site Admin
Posts: 9898
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

I think we're going back over old ground - it seems to ring a bell with me. You can't just over-ride the DDS files for a given flag, the flags are models which know the filenames of their textures, and the code isn't set up to be able to look into another folder for textures in a mod. So it's not possible to set up a different german (for example) DDS and it use that rather than the DDS which is in the same directory.

It might be possible to set it up so this can happen, but it would require some significant code changes.

A simpler solution is to tweak the flag S3F file, which only needs a text editor. Here is the GB flag S3F. To create a new flag, you just need to:

1 - rename the S3F to reflect the name you want to use.
2 - open with a text editor and change the DDS name on the 6th line. The path doesn't matter, just the final DDS name.
3 - save the file and you should now have a new animation available to use.

http://www.slitherine.com/files/bbc_ba/ ... marker.zip

Note that you only need to send out the generated S4F file in any mod packages you are distributing, not the S3F.

Cheers

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

Post by pipfromslitherine »

Note that the correct folder for the custom animations is My Documents\My Games\BBCBA\Campaigns\MyCampaign\Anim.

Cheers

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

Post by junk2drive »

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

Post by junk2drive »

junk2drive wrote:In Core\Anim

$german_victory_marker.s4f
$GB_victory_marker.s4f
and others
German_victory_marker#&.dds
GB_victory_marker#&.dds
and others

Upper case lower case, does it matter? The inconsistency drives me nuts (OCD, ADD, AR)

Why the extra characters ($#&) ?? Why $ in front of s4f and #& at end of dds?
I would still like to know about case sensitive with the files and what the extra characters are for.
pipfromslitherine
Site Admin
Site Admin
Posts: 9898
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

The case inconsistency is just because under windows case isn't important in filenames, and artists aren't generally very fussy about precision ;).

The special characters are:

$ at the start - keep the object pointing at the camera
# - use the alpha channel defined in this texture
& - don't light this texture with the global lights, show it fully lit

Cheers

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

Post by junk2drive »

Pip in the functions bsf in Data\scripts is the list of nations. Number 6 is France. Can you make a flag for France with the s3f in a user campaign and get it to work?

Right now I can't get anything but the GB flag to show on my map. I added japan as number 7. Placed your s3f in Anim in my campaign namedthe s3f japan with the dds named japan. I can't seem to get what to put in the scenario.bsf to make the flags appear.
pipfromslitherine
Site Admin
Site Admin
Posts: 9898
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

The VP stuff which we have used doesn't really expand well to additional nations. I am working to remedy that with the upcoming update, but for now I would suggest that you replace an existing nation and use it as the Japanese. E.g. the germans.

You would create your own version of the $german_victory_marker in your local ANIM folder, and a local sideicon1.DDS file for the start turn etc flag.

If that doesn't do the trick let me know and I will attempt to recreate here.

Cheers

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

Post by junk2drive »

I'm a little disappointed in that answer but thank you for being honest. Had I known this earlier...

I'll let you know how I make out.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

This is what we have
FUNCTION PreBattleSetup()
{
// Define nations numbers. These global variables are used by the VP script functions.
// Note that they do NOT correspond with the nation numbers in the editor
// 0 = UK, 1 = USA, 2 = Canada, 3 = Poland, 4 = Germany, 5 = Italy
SetGlobal("gNation0", 1) ;
SetGlobal("gNation1", 4) ;

// Define which side controls which VP at the start of the mission
// By default they start at 0 so you only need to set the VPs controlled by side 1
// The current functions script allows up to 9 VPs, named vp1, vp2, vp3, vp4, vp5, vp6, vp7, vp8 and vp9
// In this example we are giving vp2 to side 1, which is defined as Germans ("gNation1" = 4)
SetGlobal("vp1", 1) ;
SetGlobal("vp2", 1) ;

// Set the a mount of VPs held by player (side 0) at the start of the mission
// In this example we will be placing two VPs. vp1 is owned by the player, vp2 by the enemy.
// So "vps" should be = 1.
SetGlobal("vps", 0) ;

further down

FUNCTION VictoryConditions()
{
// Declare victory when all VPs are captured
if ( GetGlobal("vps") == 2 )
{
// Declare victory for side 0
EndBattle(0);
}
}


// The Tick function is called every game tick.
// Use this for things that have to be checked in real-time (instead of only at the start of a turn)
FUNCTION Tick(side)
{
// Place two VPs and run through VP capturing logic
// format is:
// CheckVP(-<x>, GetGlobal("vp<x>"), x coordinate, y coordinate) ;
// <x> is the number of the victory point (1 to 9)
CheckVP(-1, GetGlobal("vp1"), 26, 26) ;
CheckVP(-2, GetGlobal("vp2"), 30, 26) ;
}
And I still have GB flags on my map. They do not change when I occupy the square.
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

pipfromslitherine wrote:The VP stuff which we have used doesn't really expand well to additional nations. I am working to remedy that with the upcoming update, but for now I would suggest that you replace an existing nation and use it as the Japanese. E.g. the germans.

You would create your own version of the $german_victory_marker in your local ANIM folder, and a local sideicon1.DDS file for the start turn etc flag.

If that doesn't do the trick let me know and I will attempt to recreate here.

Cheers

Pip
Pip,

I got it to work ... goto Junks JAPAN thread, page 6 ... viewtopic.php?t=18212&start=100 ... 14 posts down.

It appears the problem is that the engine isn't reading the functions.bsf in my_campaign ... it's reading it from the core folder.
If you add the functions.bsf to any folder in my_campaign (then mod it) it won't read it.
If you comment out the "include" from within the scenario file it generates "predefine" errors (assuming you have a modded functions.bsf in my_campaign)
So, commenting out the include and then cut/paste the contents from the functions.bsf (with the change) into the scenario file works just fine.

Hope that helps!
pipfromslitherine
Site Admin
Site Admin
Posts: 9898
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Which file are you trying to read the include from? It should read from the folder the file is in, but if there is a 'top level' script which is including YOUR script then that top level script defines the folder that is looked in (if that makes sense).

I think I might have to add the ability to force the use of specific scripts.

As a note, what happens if you change the name of your version of the FUNCTIONS.BSF file and include that?

Cheers

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

Post by Merr »

pipfromslitherine wrote:Which file are you trying to read the include from? It should read from the folder the file is in, but if there is a 'top level' script which is including YOUR script then that top level script defines the folder that is looked in (if that makes sense).

I think I might have to add the ability to force the use of specific scripts.

As a note, what happens if you change the name of your version of the FUNCTIONS.BSF file and include that?

Cheers

Pip
Well ..... once again, chock this up to operator error ... :oops:

I went back to what adherbal said .... (thanks adherbal!)

In my SCENARIOS folder, I have functions.BSF (copy from core), and myscenario.BSF ....
In myscenario.BSF I have the ... include "functions.BSF"
In the functions.BSF I have modified the code (added sides 7 and 8 ).

Well ... now it works (as you advertised!) ... Everytime you call me on this it magically works ... :wink:

Junk2Drive ... you listening?

Thanks again Pip ... It all makes sense but for some reason I get it porked.
You made the light come on when you said ;
It should read from the folder the file is in, but if there is a 'top level' script which is including YOUR script then that top level script defines the folder that is looked in (if that makes sense).
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

I want to add to this though ....

When I was "troubleshooting" I was constantly making changes and running the game (starting/stopping) .... I hate to make excuses for "operator error" but when I made the last change in the post above I turned off my computer between the time I originally had the problem and when I just made this change.

Could the old code be stuck in memory when I'm making all these changes, thus not seeing a change?

I don't know .... I've sworn up and down it didn't work (twice with two different situations) but when I come back to the project later (after a shutdown) it magically works?

If this ever happens again I'll be sure to check my theory ... but who knows.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I've had that suspicion too. That something is caching the files and changes aren't taking effect.

If it is, could be the good luck bad luck problem too.
Post Reply

Return to “Battle Academy : Modders Corner ”