Warcraft III resources & community, 2003–2006 · archived

Help!!!!!

31 posts
#1

Help!!!!!

I've made an Ai ,in Jass Editor, for my campaign for ,Player 2 Blue - Blood elf, but it don't work what is wrong on it???
-------------------------------------
globals
player user = PlayerEx(3)
endglobals

function main takes nothing returns nothing
call CampaingAI(ELF_FARM,null)

call SetWoodPeons = 2
call SetGoldPeons = 3

call SetReplacements(0,2,3)

call SetBuildUnitEx(0,0,1, TOWN_HALL)
call SetBuildUnitEx(0,1,2, ELF_HIGH_BARRACKS)
call SetBuildUnitEx(0,3,6, HOUSE)
call SetBuildUnitEx(0,0,2, LUMBER_MILL)
call SetBuildUnitEx(0,0,1, HUMAN_ALTAR)
call SetBuildUnitEx(0,0,1, BLACKSMITH)
call SetBuildUnitEx(0,0,1, SANCTUM)
call SetBuildUnitEx(0,0,1, KEEP)
call SetBuildUnitEx(0,0,1, CASTLE)

call CampaignDefenderEx( 1,1,1, SPELL_BREAKER )
call CampaignDefenderEx( 1,1,2, HIGH_SWORDMAN )
call CampaignDefenderEx( 0,0,1, SORCERESS )
call CampaignDefenderEx( 1,1,1, PRIEST )
call CampaignDefenderEx( 1,1,2, HIGH_ARCHER )

call WaitForSignal()


//*** WAVE 1 ***
call InitAssaultGroup()
call CampaignAttackerEx( 3,3,5, HIGH_SWORDMAN )
call CampaignAttackerEx( 2,2,3, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,1, BALLISTA )
call SuicideOnPlayerEx(M4,M3,M3,user)

//*** WAVE 2 ***
call InitAssaultGroup()
call CampaignAttackerEx( 2,3,4, SPELL_BREAKER )
call CampaignAttackerEx( 2,2,3, HIGH_ARCHER )
call SuicideOnPlayerEx(M6,M4,M5,user)

//*** WAVE 3 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, HIGH_SWORDMAN )
call CampaignAttackerEx( 1,1,2, PRIEST )
call CampaignAttackerEx( 1,1,3, SPELL_BREAKER )
call SuicideOnPlayerEx(M5,M4,M5,user)

//*** WAVE 4 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, SPELL_BREAKER )
call CampaignAttackerEx( 0,1,2, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,1, BALLISTA )
call SuicideOnPlayerEx(M4,M4,M2,user)


//*** WAVE 5 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, SPELL_BREAKER )
call CampaignAttackerEx( 0,0,2, HIGH_ARCHER )
call CampaignAttackerEx( 2,2,4, SORCERESS )
call SuicideOnPlayerEx(M6,M5,M7,user)

//*** WAVE 6 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, HIGH_SWORDMAN )
call CampaignAttackerEx( 2,2,4, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,2, PRIEST )
call SuicideOnPlayerEx(M6,M6,M7,user)

//*** WAVE 7 ***
call InitAssaultGroup()
call CampaignAttackerEx( 2,3,6, SPELL_BREAKER )
call CampaignAttackerEx( 0,1,2, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,1, BALLISTA )
call CampaignAttackerEx( 1,2,3, SORCERESS )
call SuicideOnPlayerEx(M7,M5,M6,user)

//*** WAVE 8 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,4, HIGH_SWORDMAN )
call CampaignAttackerEx( 2,2,2, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,2, PRIEST )
call SuicideOnPlayerEx(M8,M8,M3,user)

//*** WAVE 9 ***
call InitAssaultGroup()
call CampaignAttackerEx( 2,3,4, SPELL_BREAKER )
call CampaignAttackerEx( 2,2,3, HIGH_SWORDMAN )
call CampaignAttackerEx( 0,1,2, HIGH_ARCHER )
call SuicideOnPlayerEx(M8,M7,M7,user)

//*** WAVE 10 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, SPELL_BREAKER )
call CampaignAttackerEx( 0,0,2, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,1, BALLISTA )
call SuicideOnPlayerEx(M4,M4,M6,user)

//*** WAVE 11 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, HIGH_SWORDMAN )
call CampaignAttackerEx( 2,2,4, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,2, PRIEST )
call SuicideOnPlayerEx(M7,M7,M7,user)

//*** WAVE 12 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, SPELL_BREAKER )
call CampaignAttackerEx( 0,0,2, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,1, BALLISTA )
call SuicideOnPlayerEx(M8,M8,M3,user)

loop
//*** WAVE 13 ***
call InitAssaultGroup()
call CampaignAttackerEx( 1,2,4, HIGH_SWORDMAN )
call CampaignAttackerEx( 2,2,2, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,2, PRIEST )
call CampaignAttackerEx( 1,1,2, SORCERESS )
call SuicideOnPlayerEx(M5,M4,M3,user)

//*** WAVE 14 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,4, HIGH_SWORDMAN )
call CampaignAttackerEx( 1,2,3, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,1, PRIEST )
call CampaignAttackerEx( 1,1,2, SORCERESS )
call SuicideOnPlayerEx(M6,M4,M4,user)

//*** WAVE 15 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, SPELL_BREAKER )
call CampaignAttackerEx( 0,0,2, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,1, BALLISTA )
call CampaignAttackerEx( 2,2,4, SORCERESS )
call SuicideOnPlayerEx(M8,M6,M6,user)

//*** WAVE 16 ***
call InitAssaultGroup()
call CampaignAttackerEx( 4,4,6, SPELL_BREAKER )
call CampaignAttackerEx( 0,2,3, HIGH_ARCHER )
call CampaignAttackerEx( 1,1,1, BALLISTA )
call CampaignAttackerEx( 2,2,4, SORCERESS )
call SuicideOnPlayerEx(M8,M5,M4,user)
endloop
endfunction
--------------------------------------------
#2
Do you mean that it does not start at all? If that is the case, have you run it throught JASS Syntax Checker?

These lines look suspicious:
call SetWoodPeons = 2
call SetGoldPeons = 3
#3
Yes, i run troght JASS Sintax Checker, it still don't work.
#4
I'm pretty sure that the two lines I pointed out aren't correct. I can't understand your code very well, because you use many non-native functions. Uh, and what are M-variables in SuicideOnPlayer function calls?

call SuicideOnPlayerEx(M4,M3,M3,user)


You also have your user variable wrong. Player 2 is Player(1), not Player(3). I suggest that you use InitAI() and then use ai_player variable to refer to the player in question. Or you may set:

player user = Player(GetAiPlayer())
#5
I deleted the two lines of the pions and put the GetAIplayer... but it still don't work, ciuld it be because i'm doing someting wrong in importing the file??
#6
I deleted the two lines of the pions and put the GetAIplayer... but it still don't work, could it be because i'm doing something wrong in importing the file??
#7
Have you tried debugging it? Insert DisplayTimedTextToPlayer calls here and there and try to figure out what's the problem.

First, add "Hello World" at the start of the function main and see if the script starts at all.
#8
M variables mean "minute" - M6 means 6 minutes.
(That's defined in common.ai.)

player user is NOT GetAIPlayer! "user" is the player
he wants to attack! There is no function to
determine that, u must set it manualy.
So "player user=Player(0)" means Player 1(Red) is
the user on this map. Computer will attack him.

The two lines u wrote are really not correct,
'cause SetWoodPeon is a FUNCTION!
So "call SetWoodPeons(2)" is the sollution.

DEATH is written so, not deaht :)
#9
Good points fury! You are right about user variable. Looking at the SuicidePlayerEx function that indeed appears to be the case.
#10
Thanks for the help tommy and fury, I have made the modifications but it appears that when an AI don't want to work it simple don't work, this Ai is going to make me crazy!!!!!!!!!!!

Please don't pay attention in my english, as you can see in the location i'm from South America, the english i leran was in WC3 :lol: .
#11
Did you checked it with jass syntax checker demo?
If it had a syntax error what was it?
If it had not what is what it does not when you play it?
You have to write your problem detailed else we cant help you!
#12
No syntax error, the problem is that the AI don't start, I put the right triggers but it don't start.

Maybe someone could send me an AI that work...
( [email protected] )
#14
Yeah, it's just A LITTLE BIT overcomlicated.
A 'campaign AI' can be done much easier.
You tried to make a 'melee mix campaign AI',
and it's far too long and lots of unnessesary
stuff. I would rewrite it if I were you.
(But I'm not so you decide :wink: )
#15
It seems so simple to me. :P What parts would you rewrite? Maybe I'm just thinking complicated...