Modding Union

[en] - Modding Corner => Mapping => Thema gestartet von: H4lbarad am 8. Jun 2016, 21:54

Titel: Creeps hostile against only one player ?
Beitrag von: H4lbarad am 8. Jun 2016, 21:54
Hey guys :)

Is it possible to create a sort of creeps that are hostile only against ONE player ?
It would be a team that would be allied with only player 1 for example, but player 1 could not see the vision of that team.

I tried to create a new team that I set "ennemy of player 2" and "neutral with player 1" but it doesn't work, the units of that team were unttackable at all, for both players...

Do you have an idea ? :)
Titel: Re: Creeps hostile against only one player ?
Beitrag von: Gnomi am 8. Jun 2016, 22:31
Just look at Minas Tirith or Isengard. The defenders are allied with the fortress player.
They are in a team belonging to PlyrCreeps and then the allegiances are changed with scripts - if you don't want sight, just set the allegiance to neutral. This means that they can't attack each other, but also aren't allied.
Titel: Re: Creeps hostile against only one player ?
Beitrag von: H4lbarad am 9. Jun 2016, 09:20
Thank you very much fot the answer! :)

It works fine with the player who must be ennemy of those "creeps", but I have a problem with the other one : if I set the allegiance to player 1 to neutral (via scripts), the creeps won't attack me, but I am able to attack him. And my units auto-attack them if they are near them.

I thought of 2 solutions :
- if I set the allegiance to neutral, maybe we can find a script who prohibits attack each other. But I don't know if such a script exists...
- if I set the allegiance to Friends, we can find a script who remove the shared sight. Sadly I didn't find such a script too.

Or do you have another solution ?

EDIT: I tried to set the allegiance to "Friends", and the problem was the same : I can attack the units that are supposed to be my allies :(
Titel: Re: Creeps hostile against only one player ?
Beitrag von: Gnomi am 9. Jun 2016, 17:16
You have to make two actions:
First one changes the allegiance from the team to the player
Second one changes the allegiance from the player to the team.