One before latest. 1-26.
IsWithinDistanceOfUnit(UnitTypes eOtherUnit, int iDistance, bool bIsFriendly, bool bIsEnemy)
bool IsWithinDistanceOfUnit(UnitTypes eOtherUnit, int iDistance, bool bIsFriendly, bool bIsEnemy) ;
bool IsWithinDistanceOfUnitClass(UnitClassTypes eUnitClass, int iDistance, bool bIsFriendly, bool bIsEnemy) ;
bool IsWithinDistanceOfUnitCombatType(UnitCombatTypes eUnitCombat, int iDistance, bool bIsFriendly, bool bIsEnemy) ;
bool IsWithinDistanceOfUnitPromotion(PromotionTypes eUnitPromotion, int iDistance, bool bIsFriendly, bool bIsEnemy) ;
bool IsAdjacentToUnit(UnitTypes eOtherUnit, bool bIsFriendly, bool bIsEnemy) ;
bool IsAdjacentToUnitClass(UnitClassTypes eUnitClass, bool bIsFriendly, bool bIsEnemy) ;
bool IsAdjacentToUnitCombatType(UnitCombatTypes eUnitCombat, bool bIsFriendly, bool bIsEnemy) ;
bool IsAdjacentToUnitPromotion(PromotionTypes eUnitPromotion, bool bIsFriendly, bool bIsEnemy) ;
Upgrade to VP 2-1, otherwise I won't be able to help you.Now it is something else. After few turns it crashed me. Now I started another game and everything works fine.
Why would non-unique unit provide the benefits of a unique unit? Isn't that a bit too much?But promotions stay after upgrade so tracking unit type won't work.
But analyze goedendag. It gives nd takes buffs from unit.
I cannot choose what event is triggered. So I need to put all 3 to be sure every situation is fullfiled.
- When goedendag moves to unit or unit moves to goedendag, then we need to track that (UnitSetXY).
- When you train Goedendag in the city after researchng it then we need to check all units around it (UnitTrained)
- When you train unit you need to check if Goedendag is around the city (UnitTrained - SetXY won't work)
- You made militaristic CS ally. It gave you goendendag - its special unit. You need to track all units around new Goedendag (Unitcreated - SetXY won't work)
Are you 100% sure that Unit created is triggered on unit training? I believe it's not, I checked that. But I can do that again to be sure. Then UnitTrained wouldn't be needed.
This is custom event. You need to enable it:Are you 100% sure that Unit created is triggered on unit training? I believe it's not, I checked that. But I can do that again to be sure. Then UnitTrained wouldn't be needed.
UPDATE CustomModOptions SET Value = 1 WHERE Name = 'EVENTS_UNIT_CREATED';
I did. I will check that tomorrow again. Then simplify code if needed.This is custom event. You need to enable it:
Code:UPDATE CustomModOptions SET Value = 1 WHERE Name = 'EVENTS_UNIT_CREATED';
It runs for all players, including minors and barbs.PlayerEndTurnCompleted is working only for HUMAN players I believe.
If so, that one would be better than PlayerDoTurn.It runs for all players, including minors and barbs.