End turn button

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

End turn button

Post by enric »

Is there a way to script control de icon of the End Turn button?
pipfromslitherine
Site Admin
Site Admin
Posts: 9923
Joined: Wed Mar 23, 2005 10:35 pm

Re: End turn button

Post by pipfromslitherine »

Hmmm. It sets the texture in code, every tick IIRC. You could try using the UI script commands to change it, but unless you managed to find just the right script to change it in I imagine you would be fighting the code.

Cheers

Pip
follow me on Twitter here
pipfromslitherine
Site Admin
Site Admin
Posts: 9923
Joined: Wed Mar 23, 2005 10:35 pm

Re: End turn button

Post by pipfromslitherine »

That said, you could (I guess) replace it with your own button and move the actual End Turn button offscreen, then do what you like with YOUR button and just have it trigger the offscreen button for its functionality. I think Hell ended up doing something like this for some reason :)

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: End turn button

Post by enric »

pipfromslitherine wrote:That said, you could (I guess) replace it with your own button and move the actual End Turn button offscreen, then do what you like with YOUR button and just have it trigger the offscreen button for its functionality. I think Hell ended up doing something like this for some reason :)

Cheers

Pip
Is there a link to the Hell example/scenario?
pipfromslitherine
Site Admin
Site Admin
Posts: 9923
Joined: Wed Mar 23, 2005 10:35 pm

Re: End turn button

Post by pipfromslitherine »

It's part of the core game. As I say, all they do is customise the UI to move the End Turn button offscreen, then trigger it using script commands from their custom UI control.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: End turn button

Post by enric »

pipfromslitherine wrote:It's part of the core game. As I say, all they do is customise the UI to move the End Turn button offscreen, then trigger it using script commands from their custom UI control.

Cheers

Pip
Give me a clue to avoid to have to open every core campaign scenarios
pipfromslitherine
Site Admin
Site Admin
Posts: 9923
Joined: Wed Mar 23, 2005 10:35 pm

Re: End turn button

Post by pipfromslitherine »

No - it's part of their UI setup. I will try and be clearer as to what you (in theory) can do:

have a replacement for battlecommon.txt in your own campaign UI. In this UI file you move the existing DeployFightButton control offscreen (this is the end turn button that the code reacts to). Add your own button with a different name and hook it up to your UI script (which you will need to add to the UI file too).

You can then control your UI button as you like, in terms of changing textures, strings etc. When you want to actually end the turn, you would use TriggerUIObject to 'press' the DeployFightButton control (which is offscreen) to end the turn as per normal.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: End turn button

Post by enric »

Thanks, I'll try it.
Post Reply

Return to “Battle Academy 2: Modders Corner”