• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Help! Jass AI Script

Status
Not open for further replies.
Level 4
Joined
Aug 26, 2015
Messages
71
Hello. Could you help me with an AI Jass Ssript please? I don't know what is the problem but it doesn't work. I'll post everything you could need to help me. I just don't know what to do to fix it, because the Campaign AI tutorial on this forum isn't really for Campaigns.

JASS:
globals
player user = Player(1)
endglobals

function main takes nothing returns nothing
call CampaignAI(House,null)

call SetReplacements(2,2,4)

call SetBuildUnitEx( 0,0,1, TOWN_HALL        )
    call SetBuildUnitEx( 3,3,3, PEASANT            )
    call SetBuildUnitEx( 1,1,2, BARRACKS        )
    call SetBuildUnitEx( 1,1,1, LUMBER_MILL        )
    call SetBuildUnitEx( 1,1,1, HUMAN_ALTAR        )
    call SetBuildUnitEx( 1,1,1, BLACKSMITH        )
    call SetBuildUnitEx( 5,5,5, PEASANT            )
    call SetBuildUnitEx( 1,1,1, KEEP            )
    call SetBuildUnitEx( 1,1,1, WORKSHOP        )
    call SetBuildUnitEx( 1,1,1, CASTLE            )
    call CampaignDefenderEx( 1,1,1, RIFLEMAN      )
    call CampaignDefenderEx( 1,1,1, FOOTMAN      )

call WaitForSignal()

    //*** WAVE 1 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 4,4,4, RIFLEMAN    )
    call CampaignAttackerEx( 2,2,2, FOOTMAN        )
    call SuicideOnPlayerEx(M3,M3,M3,user)
// Yes, I created only one wave just to test if my script works.
endfunction

My triggers:

  • Train
    • Events
      • Map initAIlization
    • Conditions
    • Actions
      • AI - Start campaign AI script for Player 1 (Red): war3mapImported\bot.ai
      • Game - Display to (All players) the text: Bot Importado
      • Visibility - Create an initiaIly Enabled visibility modifier for Player 2 (Blue) emitting Visibilidad across Vision <gen>
      • Player - Set Player 2 (Blue) Actual gold to 1000
      • Player - Set Player 2 (Blue) Actual wood to 1000
      • Player - Set Player 1 (Red) Actual gold to 1000
      • Player - Set Player 1 (Red) Actual wood to 1000
  • Send Command
    • Events
      • Player - Player 2 (Blue) types a chat message containing ¡Activate! as Una correspondencAI exacta
    • Conditions
    • Actions
      • AI - Send Player 1 (Red) the AI Command (0, 0)
      • Game - Display to (All players) the text: Bot Ataque Activado...
  • Gold Up
    • Events
      • Player - Player 1 (Red)'s Actual gold becomes Less than 1000.00
    • Conditions
    • Actions
      • Player - Add 1000 to Player 1 (Red) Actual gold
  • Wood Up
    • Events
      • Player - Player 1 (Red)'s Actual wood becomes Less than 1000.00
    • Conditions
    • Actions
      • Player - Add 1000 to Player 1 (Red) Actual wood

If you needed the map... I have uploaded it. :)
Thanks everybody
 

Attachments

  • test.w3x
    3.9 MB · Views: 42
Status
Not open for further replies.
Top