how do use custom AI with a custom race for a Campaign

Status
Not open for further replies.
Level 3
Joined
Jun 7, 2016
Messages
21
upload_2017-11-5_22-47-19.png
 
Level 16
Joined
Mar 25, 2016
Messages
1,327
A few things I noticed:
the player is player 2, but player 1 is set as victim in the ai script.
you have several triggers with the event map initialization, that are connected and need to run in a certain order to work:
Burning Legion AI Attack has to run after Name, because it uses the variable that is set in Name
you can use
  • Trigger - Run Burning Legion AI Attack <gen> (checking conditions)
in Name to run Burning Legion AI Attack and remove the event from Burning Legion AI Attack.
the raw codes in your ai script are wrong:
Doomguard: you use "n00M:nbal", but you need to use 'n00M'. Raw codes consist of 4 characters and are marked with these ' '
With a syntax highlighter it looks like this:
JASS:
"n00M:nbal" //this is a string
'n00M' //this is a raw code
The hero abilities also need to be surrounded by ' ' and not " ".

There are syntax errors in your AI script:
JASS:
function main takes nothing returns nothing   
    call CampaignAI (<"u004:unp2">, function hero_levels)
    call ConfigureAI()
   
    local integer cmd // <==Only set it if you are going to use the option 2
    ... // Your building code here
    // Option 1
    call WaitForSignal() // <== Just waits until the map sends a command
local variables may only be declared at the top of the function, so no "set", "call", "if" or any other similar keyword before all locals
the ... before the // will also cause a syntax error. Either remove them or put them behind the //

I can't say for sure, that the AI will work, if you fix these, but you are getting it closer to work.
 
Level 3
Joined
Jun 7, 2016
Messages
21
A few things I noticed:
the player is player 2, but player 1 is set as victim in the ai script.
you have several triggers with the event map initialization, that are connected and need to run in a certain order to work:
Burning Legion AI Attack has to run after Name, because it uses the variable that is set in Name
you can use
  • Trigger - Run Burning Legion AI Attack <gen> (checking conditions)
in Name to run Burning Legion AI Attack and remove the event from Burning Legion AI Attack.
the raw codes in your ai script are wrong:
Doomguard: you use "n00M:nbal", but you need to use 'n00M'. Raw codes consist of 4 characters and are marked with these ' '
With a syntax highlighter it looks like this:
JASS:
"n00M:nbal" //this is a string
'n00M' //this is a raw code
The hero abilities also need to be surrounded by ' ' and not " ".

There are syntax errors in your AI script:
JASS:
function main takes nothing returns nothing  
    call CampaignAI (<"u004:unp2">, function hero_levels)
    call ConfigureAI()
  
    local integer cmd // <==Only set it if you are going to use the option 2
    ... // Your building code here
    // Option 1
    call WaitForSignal() // <== Just waits until the map sends a command
local variables may only be declared at the top of the function, so no "set", "call", "if" or any other similar keyword before all locals
the ... before the // will also cause a syntax error. Either remove them or put them behind the //

I can't say for sure, that the AI will work, if you fix these, but you are getting it closer to work.


Thank for the help and i get the AI working for the most part but now the AI is not sending out unit to attack.
 
Status
Not open for further replies.
Top