So it would be something like this (if I use the information from your first post):
Code:
|
HandleEvent(BeginTurn)'Test_IsHumanPlayer'post{
if(IsHumanPlayer(1)){
//Do something here
}
} |
This could be a little bit problematic, because players and ints are not the same thing, in the slic documentation you find this:
player.owner - An integer version of the player.
This is a hint that ints and players are not identical, but obviously we have a lot of implecit typecasts here in slic, but unfortunatly they fail sometimes. And other functions expects a integer representaion of the player as argument.
I think something like this should work:
Code:
|
HandleEvent(BeginTurn)'Test_IsHumanPlayer'post{
if(IsHumanPlayer(player[0])){
//Do something here
}
} |
Also this could work:
Code:
|
HandleEvent(BeginTurn)'Test_IsHumanPlayer'post{
player[0] = 1;
if(IsHumanPlayer(player[0])){
//Do something here
}
} |
And this should also work:
Code:
|
HandleEvent(BeginTurn)'Test_IsHumanPlayer'post{
if(IsHumanPlayer(g.player)){
//Do something here
}
} |
In frenzy we have the problem that ints and players treated as the same thing. Most of the frenzy arguments for the IsHumanPlayer function are integers and not players.
-Martin