• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[AI] Don't Work AI Script

Status
Not open for further replies.
Level 1
Joined
Sep 12, 2014
Messages
4
Hello. I write AI Script:
JASS:
function DebugText takes nothing return nothing
endfunction

function main takes nothing returns nothing
    call Sleep(2)
    call DisplayTextToPlayer(GetLocalPlayer(), 0.0, 0.0, "Check ...")
    call CampaignAI(null, null)
    //call SetReplacementCount(3)
    //call SetCaptainHome(BOTH_CAPTAINS, 900, 4400)
    //call CampaignDefender(NORMAL, 4, ARCHER)
    //call CampaignDefender(EASY, 1, HUNTRESS)
    //call StopGathering()
    //call Sleep(10)
    //call AddGuardPost(ARCHER, 5000, -3000)
    //call Sleep(M1)
    //call FillGuardPosts()                                                    
    //call InitAssaultGroup()
    //call CampaignAttacker(EASY, 2, ARCHER)
    //call SuicideOnPlayer(M1, Player(0))
endfunction

But why he doesn't work. If script have function DebugText, script doesn't work, if function DebugText haven't script work. Why ?
 
Level 4
Joined
Nov 27, 2012
Messages
85
I'm not entirely sure what's going on in your trigger

The 2 "//" placed on the 12 bottom lines turns those actions into comments, so those don't do anything

JASS:
call CampaignAI(null, null)
There should be 2 values where null is


JASS:
function DebugText takes nothing return nothing
endfunction
This function is not referred to at all in this trigger, so I'm not sure how it is affecting it
 
Level 1
Joined
Sep 12, 2014
Messages
4
To not have any questions, here is the complete script
JASS:
globals
    boolean debug_func = true
endglobals

function DebugText takes string debug_text return nothing
    if debug_func then
        call DisplayTextToPlayer(GetLocalPlayer(), 0.0, 0.0, debug_text)
    endif
endfunction

function main takes nothing returns nothing
    call Sleep(2)
    call DebugText("Test Work : AI")
    call CampaignAI(MOON_WELL, null)
endfunction
He doesn't work.
 
Level 1
Joined
Sep 12, 2014
Messages
4
Sleep - this order AI nothing don't. Sleep(2) - Order nothing don't 2 seconds.Function main doesn't called, she automatic called.
 
Status
Not open for further replies.
Top