Page 1 of 1
Bonus disappears
Posted: Sat Mar 07, 2015 7:35 am
by enric
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.
Re: Bonus disappears
Posted: Sat Mar 07, 2015 9:50 pm
by pipfromslitherine
I will need to look at the specific implementation and see what the expected behaviour is.
Cheers
Pip
Re: Bonus disappears
Posted: Sat Mar 07, 2015 11:43 pm
by enric
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

- Screen Shot 2015-03-08 at 0.52.45.jpg (56.68 KiB) Viewed 3290 times
next turn

- Screen Shot 2015-03-08 at 0.55.19.jpg (72.19 KiB) Viewed 3290 times
Re: Bonus disappears
Posted: Mon Mar 09, 2015 3:03 pm
by pipfromslitherine
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
Re: Bonus disappears
Posted: Mon Mar 09, 2015 3:15 pm
by enric
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
Re: Bonus disappears
Posted: Mon Mar 09, 2015 4:53 pm
by pipfromslitherine
It is possible that it is only intended for use pre-battle, but I will need to look at the code.
Cheers
Pip
Re: Bonus disappears
Posted: Mon Mar 09, 2015 4:58 pm
by enric
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
The odd think is that in SP it works normal, and the same scenario in MP don't.
Re: Bonus disappears
Posted: Mon Mar 09, 2015 7:43 pm
by pipfromslitherine
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
Re: Bonus disappears
Posted: Tue Mar 17, 2015 1:26 am
by jcb989
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
Posted: Tue Mar 17, 2015 6:42 am
by enric
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 ?
Could you be more explicit?
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".