ai.inc - Condition IDs unique for every player?

Antworten
Benutzeravatar
Phantowm
Beiträge: 39
Registriert: Mo 25. Apr 2016, 20:28

ai.inc - Condition IDs unique for every player?

Beitrag von Phantowm » Do 3. Mai 2018, 15:24

Hello,


This is one of those questions that's been bugging me for ages. I would like to know if I can use the same condition IDs for each AI player.

For example: First AI player has 2 conditions with the ID 1 and 2 respectively.

Code: Alles auswählen

AI_SetCondition_True 1 1
AI_SetCondition_OnDiplomacyChange 1 2 1 0 1 1
Second AI Player has 3 conditions with the ID 1, 2 and 3 respectively:

Code: Alles auswählen

AI_SetCondition_OnTimer 2 1 240 120 1440
AI_SetCondition_OnPlayerSeen 2 2 0 0 2
AI_SetCondition_OnExternal 2 3 1
Does the game allow it? Or do I have to use IDs of 3, 4 and 5 for the second AI player?

The ai.inc is still a hit and miss for me. I tried using the same IDs once and it did not work, however I am not sure if it's the game or I made a typo (which happens quite often).


Kind regards,

Phantowm
Life is a sheer joy, a playfulness, a fun, a laughter, for no purpose at all.

Benutzeravatar
Tommy
Administrator
Beiträge: 1153
Registriert: Do 28. Mär 2013, 16:21
Wohnort: Nürnberg
Kontaktdaten:

Re: ai.inc - Condition IDs unique for every player?

Beitrag von Tommy » Do 3. Mai 2018, 20:17

Do you know Molt's AI tutorial?
In my opinion, the ID must be unique for each player.

Kind regards,

Tommy
Linux is like a tipi: no gates, no windows, apache inside.
Forum, Chat, MapDB, Tools und Dokus für Mapper http://www.wikinger-tommy.de

Benutzeravatar
Phantowm
Beiträge: 39
Registriert: Mo 25. Apr 2016, 20:28

Re: ai.inc - Condition IDs unique for every player?

Beitrag von Phantowm » Do 3. Mai 2018, 20:57

Hello Tommy,

Molt's tutorial on the AI is actually one of the first pdf files I downloaded. It has helped me immensely. I always have it open when it's time to modify the ai.inc ;)

I did some tests on my current map with identical IDs for two AI players and it has produced zero errors so far.

Here are the entries I've used:

Code: Alles auswählen

HAI_Disable 2
AI_UnitLimit 2 2
AI_MaxUnitLimit 2 80
AI_SoldiersDefaultPosition 2 68 204 10
AI_SetCondition_True 2 1
AI_MainTask_Defend 2 50 1 82 220 15 6 12
AI_MainTask_Defend 2 20 1 77 258 10 3 4
AI_MainTask_Defend 2 20 1 70 176 10 3 4
AI_MainTask_Defend 2 20 1 82 124 10 4 6
AI_SetCondition_OnExternal 2 2 1
AI_SetCondition_OnTimer 2 3 720 60 1440
AI_SetCondition_OnConditions 2 4 0 1 2 3
AI_MainTask_CreateCreatures 2 40 4 2 34 60 196 0 3
AI_MainTask_CreateCreatures 2 40 4 2 35 60 196 0 3
AI_MainTask_CreateCreatures 2 40 4 2 41 60 196 0 3
AI_SetCondition_OnExternal 2 5 0
AI_MainTask_Attack 2 100 5 198 200 15 20 50 103 222 1

Code: Alles auswählen

HAI_Disable 4
AI_UnitLimit 4 0
AI_MaxUnitLimit 4 120
AI_SoldiersDefaultPosition 4 214 196 10
AI_SetCondition_True 4 1
AI_MainTask_Defend 4 20 1 199 198 8 4 8
AI_MainTask_Defend 4 20 1 208 156 8 3 6
AI_MainTask_Defend 4 20 1 223 162 8 3 6
AI_MainTask_Defend 4 20 1 245 190 8 4 8
AI_MainTask_Defend 4 20 1 232 232 8 4 8
AI_SetCondition_OnExternal 4 2 1
AI_SetCondition_OnTimer 4 3 720 60 1440
AI_SetCondition_OnConditions 4 4 0 1 2 3
AI_MainTask_CreateCreatures 4 30 4 3 33 215 186 0 2
AI_MainTask_CreateCreatures 4 30 4 3 34 216 187 0 3
AI_MainTask_CreateCreatures 4 30 4 3 41 218 188 0 3
AI_MainTask_CreateCreatures 4 30 4 3 32 220 172 0 6 1

Kind regards,

Phantowm
Life is a sheer joy, a playfulness, a fun, a laughter, for no purpose at all.

Antworten