- Joined
- Sep 12, 2008
- Messages
- 657
Arena Type Map AI
hey.. i was working on ai for the computers for my arena map..
but for some reason, after the unit dies, he stops the ai,
and never does it again.
any idea?..
and btw, the 1/2 message display in first code is to test..
** Another Bug ! **
whenever it picks hero # 5. it doesnt work o.o
he wont move, wont do anything..
thanks in advance =]
EDIT: SOLVED BY MY SELF...
hey.. i was working on ai for the computers for my arena map..
but for some reason, after the unit dies, he stops the ai,
and never does it again.
any idea?..
-
Computer AI Setup
-
Events
-
Time - Elapsed game time is 0.05 seconds
-
-
Conditions
-
Actions
-
Set ComputerAI_PlayerHero[1] = HeroNumber1Name
-
Set ComputerAI_PlayerHero[2] = HeroNumber2Name
-
Set ComputerAI_PlayerHero[3] = HeroNumber3Name
-
Set ComputerAI_PlayerHero[4] = HeroNumber4Name
-
Set ComputerAI_PlayerHero[5] = HeroNumber5Name
-
-------- --------------------------------- --------
-
Set ComputerAI_CreepsPoint[1] = (Center of Creeps 1 <gen>)
-
Set ComputerAI_CreepsPoint[2] = (Center of Creeps 2 <gen>)
-
Set ComputerAI_CreepsPoint[3] = (Center of Creeps 3 <gen>)
-
Set ComputerAI_CreepsPoint[4] = (Center of Creeps 4 <gen>)
-
-------- --------------------------------- --------
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Player((Integer A))) slot status) Not equal to Is playing
-
-
Then - Actions
-
Game - Display to (All players) the text: 1
-
Set ComputerAI_PlayerCount = (ComputerAI_PlayerCount + 1)
-
Set ComputerAI_PlayerNumber[ComputerAI_PlayerCount] = (Player((Integer A)))
-
Set ComputerAI_PlayerRandomInt[ComputerAI_PlayerCount] = (Random integer number between 1 and 5)
-
Unit - Create 1 ComputerAI_PlayerHero[ComputerAI_PlayerRandomInt[ComputerAI_PlayerCount]] for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
-
Set Computer_AIHero[ComputerAI_PlayerCount] = (Last created unit)
-
Set ComputerAI_HealingPoint[ComputerAI_PlayerCount] = ((Player((Integer A))) start location)
-
Trigger - Run Computer AI Run <gen> (checking conditions)
-
-
Else - Actions
-
Game - Display to (All players) the text: 2
-
-
-
-
-
-
-
Computer AI Run
-
Events
-
Time - Every 7.00 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer A) from 1 to ComputerAI_PlayerCount, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Life of Computer_AIHero[(Integer A)]) Greater than or equal to ((Max life of Computer_AIHero[(Integer A)]) / 3.00)
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in (Units within 500.00 of ComputerAI_CreepsPoint[ComputerAI_PlayerRandomInt[(Integer A)]] matching (((Owner of (Matching unit)) is an enemy of ComputerAI_PlayerNumber[(Integer A)]) Equal to True))) Greater than 0
-
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Life of ComputerAI_Enemy[(Integer A)]) Less than or equal to 0.00
-
ComputerAI_Enemy[(Integer A)] Equal to No unit
-
-
-
-
Then - Actions
-
Set ComputerAI_PlayerRandomInt[(Integer A)] = (Random integer number between 1 and Computer_AIMaxCreepPoints)
-
Set ComputerAI_RandomPoint = ComputerAI_CreepsPoint[ComputerAI_PlayerRandomInt[(Integer A)]]
-
Set ComputerAI_Enemy[(Integer A)] = (Random unit from (Units within 500.00 of ComputerAI_CreepsPoint[ComputerAI_PlayerRandomInt[(Integer A)]]))
-
Unit - Order Computer_AIHero[(Integer A)] to Attack ComputerAI_Enemy[(Integer A)]
-
Custom script: call RemoveLocation(udg_ComputerAI_RandomPoint)
-
-
Else - Actions
-
-
-
Else - Actions
-
-
-
Else - Actions
-
Set ComputerAI_RandomPoint = ComputerAI_HealingPoint[(Integer A)]
-
Unit - Order Computer_AIHero[(Integer A)] to Move To ComputerAI_HealingPoint[(Integer A)]
-
Custom script: call RemoveLocation(udg_ComputerAI_RandomPoint)
-
-
-
-
-
-
and btw, the 1/2 message display in first code is to test..
** Another Bug ! **
whenever it picks hero # 5. it doesnt work o.o
he wont move, wont do anything..
thanks in advance =]
EDIT: SOLVED BY MY SELF...
Last edited: