Page 1 of 1
StartTurn.bsf
Posted: Tue May 21, 2013 5:25 pm
by Amaris
If you want restrict this function to the current side don't use:
Code: Select all
if (GetCurrentSide() == GetUnitSide(me))
{
.....
}
but this:
Code: Select all
if (GetShowSide() == GetUnitSide(me))
{
.....
}
Re: StartTurn.bsf
Posted: Tue May 21, 2013 5:31 pm
by pipfromslitherine
You need to be VERY careful using this

Otherwise you can end up executing different code in MP replays. The current side is the side whose units are currently doing their thing, either under player control or during a replay.
Cheers
Pip
Re: StartTurn.bsf
Posted: Wed May 22, 2013 3:48 pm
by Amaris
pipfromslitherine wrote:You need to be VERY careful using this

Otherwise you can end up executing different code in MP replays. The current side is the side whose units are currently doing their thing, either under player control or during a replay.
Cheers
Pip
Damn!
I think use this function to land the defensive airplanes placed in defense int the previous turn.
This results in changes of attribute value for the units of the active camp (lot of SetAttrib(), no rand()

). Do you think it might be a problem?
Re: StartTurn.bsf
Posted: Wed May 22, 2013 4:07 pm
by pipfromslitherine
The key is that in MP you need to make sure the same thing happens in both the player turn and the MP replay.
Cheers
Pip
Re: StartTurn.bsf
Posted: Wed May 22, 2013 4:13 pm
by Amaris
I understand that.
Well tests will tell!
