• 🏆 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!

JASS AI Script - Changing Target Player

Status
Not open for further replies.
Level 2
Joined
Feb 12, 2008
Messages
6
Hello Everyone :)

I'm making a campaign (6 maps already) that what you make change the next map in some sort, i.e. If you don't destroy a faction base, they you apear in the next map; if you allies dies in one map, in the next they base will be destroyed too, etc...

Ok, all is going right, everthing is being made in the WE GUI =) Even the AI's is being made in the AI Editor.

But this editor is horrible... Have problems for units returning from battle, farm bug etc...

Every map is going well, but the AI sometimes suck and I wish to fix this to make the maps better.

So i'm using JASS (i'm noob) to recreate the AI's.
The AI's is VERY simple, even only using attack waves...

THE PROBLEM: I can't make a simple thing, ordering a AI attack like player Blue and after some event in the map, they change the target to player RED using a trigger (Send AI Command)

How I do that??

JASS:
globals
    player Player_1 = Player( 0 )
endglobals

function ConfigureAI takes nothing returns nothing
    call SetSlowChopping( true )
    call SetPeonsRepair( true )
endfunction

function main takes nothing returns nothing
    call CampaignAI( 'npgf', null )
    call ConfigureAI( )
    set do_campaign_farms = false
    // **********************************
    // *      Building Strategy         *
    // **********************************
    call SetReplacements( 3, 3, 3 )
    call SetBuildUnit( 6, 'ohun' )
    call CampaignDefenderEx( 2, 2, 2, 'ohun' )
    //**********************************
    //*    End Building Strategy       *
    //**********************************
    
    //**********************************
    //*       Attack Strategy          *
    //**********************************
//*** WAVE 1 *** 
    call InitAssaultGroup()
    call CampaignAttackerEx( 3, 3, 3, 'ohun' )  
    call SuicideOnPlayerEx( 30, 30, 30, Player_1 )
//*** WAVE 2 ***
    call InitAssaultGroup()
    call CampaignAttackerEx( 4, 4, 4, 'ohun' )  
    call SuicideOnPlayerEx( 70, 70, 70, Player_1 )
//*** WAVE 3 *** 
    call InitAssaultGroup()
    call CampaignAttackerEx( 5, 5, 5, 'ohun' )  
    call SuicideOnPlayerEx( 70, 70, 70, Player_1 )
//*** WAVE 4 *** 
    call InitAssaultGroup()
    call CampaignAttackerEx( 2, 2, 2, 'ohun' )  
    call SuicideOnPlayerEx( 70, 70, 70, Player_1 )
loop 
    //*** LAST WAVE *** 
    call InitAssaultGroup()
    call CampaignAttackerEx( 6, 6, 6, 'ohun' )  
    call SuicideOnPlayerEx( 70, 70, 70, Player_1 )  
  
    call InitAssaultGroup()
    call CampaignAttackerEx( 3, 3, 3, 'ohun' )  
    call SuicideOnPlayerEx( 70, 70, 70, Player_1 )
endloop 
    //**********************************
    //*   Attack Strategy never ends   *
    //********************************** 
endfunction
 
Level 2
Joined
Feb 12, 2008
Messages
6
Hunn, yes, the main point of the Player_1 = Player (0) is to the AI attack the Player Red (I want the AI to attack player Red)

But I wish like, when player red has defeat the map send a AI command and the script change the Player_1 to Player (5).

No one know the script to make this?

Any help will be apreciated =)
 
Status
Not open for further replies.
Top