VP Plugin

Tech support for Battle Academy

Moderators: Slitherine Core, BA Moderators

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

VP Plugin

Post by junk2drive »

I set up a test battle with US and Japan with neutral flags. I let Japan take the flags and they change to hidden. Instead of adding my country marker list I tried adding this

if(side == 1)
{
StartWorkString() ;
PrintWorkStringLiteral("victory_marker_") ;
PrintWorkStringInt(nation) ;

if(ret == 1)
{
ShowEffectMarker(marker, x, y, GetWorkString(), 0, -1, "FF00B4FF") ;
}
else
{
ShowEffectMarker(marker, x, y, GetWorkString(), 0, -1, "FFFF4E00") ;
}
}

below if side = 0 but that didn't work.
pipfromslitherine
Site Admin
Site Admin
Posts: 9925
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Sorry - I didn't understand the issue/what you were trying to do. Can you clarify for me - sorry.

Cheers

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

Post by junk2drive »

You have the nations listed then
// this allows for extended sides. If it hasn't used one of the flags we know about, then build a string and try and find an anim
I am trying to get additional country flags to show and thought that the above was for that.
pipfromslitherine
Site Admin
Site Admin
Posts: 9925
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

If you rename the asset file file the flag to be victory_marker_<side> then it should just show that correctly.

Cheers

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

Post by junk2drive »

In the editor you have the sideicon flags in the UI. Tooltip says "side id for side 0" If you use other than the standard 6 flags, the plugin will not show the 3D flag on the map.

I can script flags to show correctly, just not with the plugin. I tried placing a copy of the plugins folder in my campaign and adding the text to the script but that didn't help. Where should the folder go?
pipfromslitherine
Site Admin
Site Admin
Posts: 9925
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

In theory (although I must confess to not having tested it) it you name the flag in the way I list, it will show, even if it is not on the list of flags defined in the script.

If it's not working then let me know and I will ensure it is fixed in the next update.

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 gave up trying to get side7 and side8 to show the flags.

Using the VP UI I place a side 0, USA flag inside the USA control area. I want side 1 to take the flag within 30 turns.

I set owner to 0, place at xx,yy

Below I set capture to 0, defend to 1, turns 30, AI team 0 to take the flag.

When I start the battle, it says objective completed.

Thinking I had it backwards, I changed to capture 1, defend 0, still the same.
pipfromslitherine
Site Admin
Site Admin
Posts: 9925
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

The numbers are basically how many you need to hold to win, and how many you need to hold before you lose, respectively. So I think you would need to set capture to 2 and defend to 1 in this case. I know it seems a little odd, but it does make sense if you think about it :).

If that doesn't work, then I guess this case was one I didn't consider when I did the code, and so I can update the logic.

Cheers

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

Post by junk2drive »

That works.

I couldn't see the flag but knew roughly where is was. Starting error is cannot find victory marker 8, is it in the anim folder? Then when the enemy takes it I get cannot find victory marker 7, is it in the anim folder?

I have the modded s4f and dds that works when I make a scenario.bsf in the anim folder. I just doesn't work with this.

I think I need to be able to put the Plugins folder or Slith_VictoryPoints folder or the UI folder or the Slith_VictoryPoints.bsf on my campaign so that I can add nation 7 and 8 to the bsf.
pipfromslitherine
Site Admin
Site Admin
Posts: 9925
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Plugins don't work like that. It's the tradeoff between integrating stuff, and making it simple to use. I will see what is going on with it not displaying the flags when you rename them.

Cheers

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

Post by pipfromslitherine »

OK - well it seems to work for me. Here is what I did.

- created a map with VPs for each side. Made the sides 7 and 8 (which don't have markers etc for them). Means the VPs can't be seen.
- create the ANIM folder in my custom campaign. Copy in the US victory marker
- change the victory marker to point to renamed textures
- renamed the victory marker file to $victory_marker_7.s3f for side 7, and _8 for side 8
- works!

Hope that helps

Cheers

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

Post by junk2drive »

After much trial and error, I finally got it.

Rename $<country>_victory_marker.sf3 to $victory_marker_<number>.sf3 and don't change the dds

Thanks!

edit Now I just have to figure out the capture/defend thing with flags on both sides or neutral.
pipfromslitherine
Site Admin
Site Admin
Posts: 9925
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Not sure what you mean. The only gotcha seems to be that if you want a pure defend mission (that is, you can't ever win by capturing all the flags) then set the capture number to greater than the number of flags that you place. It would be better to have an option for it, but I would need to be very careful not to break any existing missions :)

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 not sure what I mean either. Because I haven't broken it yet. Give me time :lol:

The defend threw me a loop so I figured there may be a catch to anything other than capture a flag.
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

I made a battle with 3 US flags. I set the capture to 4 and defend to 3, turns 10. I lose after 10 turns. Change it to 3 and 3, win without a shot. Now what?
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 »

I've tried every combination I can think of and can't get it to work. How the heck did I do it before?

I tried 1 flag, 3 flags, add an opponent flag and every combo of capture and defend.
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've tried every combination I can think of and can't get it to work. How the heck did I do it before?

I tried 1 flag, 3 flags, add an opponent flag and every combo of capture and defend.
You lost me a few posts ago ... what doesn't work Paul?
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

Make a map or a blank one. Put some units on each side. Open the VP tool. Put one flag on side 0 and make it work so that side 0 has to defend that flag for x number of turns.
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:Make a map or a blank one. Put some units on each side. Open the VP tool. Put one flag on side 0 and make it work so that side 0 has to defend that flag for x number of turns.
You're not crazy ... I tried it ... doesn't work, game over I win.

Must be something in the logic when you have only 1 VP ... perhaps not meant to play with 1 VP ... but that doesn't sound right either :?:
junk2drive
BA Moderator
BA Moderator
Posts: 1478
Joined: Sun May 23, 2010 4:47 pm
Location: Arizona USA -7GMT

Post by junk2drive »

If you can make sense of my posts above, I've tried it with every combination of flags, not just one. I swear I got it to work once, but all of my scenarios have bsf files instead of this. I'm pretty sure the VP tool works fine for capturing enemy or neutral flags, just not defend scenarios.
You can call me junk - and type that with one hand.
Post Reply

Return to “Battle Academy : Tech Support”