Bonus disappears
Moderators: Slitherine Core, BA Moderators
Bonus disappears
Probably is a misunderstanding mine but, if a bonus is added dynamically:
AddBonus(0, "RALLY");
or
AddBonus(1, "STUKA");
In SP the bonus stand until you use it, but in MP it appear the turn added, but, if not used, next turn has disappeared, is this a normal behavior?
The same bonus work fine if added to the scenario using the editor.
AddBonus(0, "RALLY");
or
AddBonus(1, "STUKA");
In SP the bonus stand until you use it, but in MP it appear the turn added, but, if not used, next turn has disappeared, is this a normal behavior?
The same bonus work fine if added to the scenario using the editor.
-
pipfromslitherine
- Site Admin

- Posts: 9923
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Bonus disappears
I will need to look at the specific implementation and see what the expected behaviour is.
Cheers
Pip
Cheers
Pip
follow me on Twitter here
Re: Bonus disappears
What do you mean?, you need more info on how is implemented?
Imagine, you want just to add a "Rally" bonus in turn X
in Startturn
if (GetTurn() == X)
{
// activate Bonus for side 0
AddBonus(0, "RALLY");
}
In SP the bonus is added, and if you don't use in X turn you may use it in next turn, then the delay of the bonus and use it again.
In MP it appear the turn added (with a delay) but next turn has disappeared.
Example
in turn 2
next turn
Imagine, you want just to add a "Rally" bonus in turn X
in Startturn
if (GetTurn() == X)
{
// activate Bonus for side 0
AddBonus(0, "RALLY");
}
In SP the bonus is added, and if you don't use in X turn you may use it in next turn, then the delay of the bonus and use it again.
In MP it appear the turn added (with a delay) but next turn has disappeared.
Example
in turn 2
next turn
-
pipfromslitherine
- Site Admin

- Posts: 9923
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Bonus disappears
No - I mean that I didn't implement the AddBonus function and so I will need to dig deeper to see what it is doing and what it is supposed to do 
Cheers
Pip
Cheers
Pip
follow me on Twitter here
Re: Bonus disappears
ah, sorry, as not native english sometimes (too often
) I misunderstand the meaning.
I used the function with the only info available now:
//grant the named bonus to the side
AddBonus(side, bonusName);
I did not found any case of use in scenarios that come with BA2, the only place where is used is
MAPGENERATE.BSF
I used the function with the only info available now:
//grant the named bonus to the side
AddBonus(side, bonusName);
I did not found any case of use in scenarios that come with BA2, the only place where is used is
MAPGENERATE.BSF
-
pipfromslitherine
- Site Admin

- Posts: 9923
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Bonus disappears
It is possible that it is only intended for use pre-battle, but I will need to look at the code.
Cheers
Pip
Cheers
Pip
follow me on Twitter here
Re: Bonus disappears
The odd think is that in SP it works normal, and the same scenario in MP don't.pipfromslitherine wrote:It is possible that it is only intended for use pre-battle, but I will need to look at the code.
Cheers
Pip
-
pipfromslitherine
- Site Admin

- Posts: 9923
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Bonus disappears
I think that in SP it will stop working if you try and save and then reload. The command is only intended to be used in the generation scripts for skirmish games - skirmish games do a 'save' of the map into their save game and this is what stores the bonus state. Using the command during a battle adds the bonus at that point, but there is nothing to tell the game to reload it at a later point when the game is loaded from a save (as happens in MP effectively).
Sorry - but it won't do what I think you are attempting.
Cheers
Pip
Sorry - but it won't do what I think you are attempting.
Cheers
Pip
follow me on Twitter here
-
jcb989
- Colonel - Fallschirmjäger

- Posts: 1423
- Joined: Fri Nov 05, 2010 12:02 am
- Location: Bradenton, Florida
Re: Bonus disappears
Enric, could you not "force it to work the hard way" but toggling a bit, then assign the bonus (each turn) based on if the bit = 1 ?
Re: Bonus disappears
Could you be more explicit?jcb989 wrote:Enric, could you not "force it to work the hard way" but toggling a bit, then assign the bonus (each turn) based on if the bit = 1 ?
In fact the bonus are working fine for me, I was just looking for a more elegant implementation way.
Now I add the bonus using the editor ( even a bonus modded or new) and with code I control the status "not available", "ready", "loading" , etc. (look for example Channels).
Even so, I'm still interested on the "bit=1".
