• 🏆 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] island transport system

Status
Not open for further replies.
Level 2
Joined
Jun 29, 2013
Messages
13
ok so earlier i asked a question about transporting from island to island with boats with no luck. thried everything via WE like making zeppelin into a boat etc...

i decided to try making my own jass, to order boats to transport units.
i must say im still new to jass, and programing in general, but i read alot of scripts, and did alot of tutorials blabla...

so my idea is to do every step in this transporting through command like:

1. AI makes units (first cmd)
2. Boats load them (sec)
3. Wait for attack order(third)
4. Send them to other island
5. Unload
6. Suicide units

First command about making units i have no problem making constant same units for every time i issue command, thing is i want to make waves like Grunts were first wave, then next time i issue same command to make wave 2 raiders etc.. (is that possible ? :) )
Second command is first to count if there are any available boats for them to transport
JASS:
function count_boats takes nothing returns boolean
    if ( not ( CountLivingPlayerUnitsOfTypeId(BOAT, Player(2)) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function add_units_to_group takes nothing returns nothing
    call GroupAddUnitSimple( GetEnumUnit(), BOATS )
endfunction

function add_boats takes nothing returns nothing
    call ForGroupBJ( GetUnitsOfTypeIdAll(BOAT), function add_units_to_group )
endfunction

i declared BOATS in global as group../

Tricky part i want to do is for ai to recognize a wave is done building then load them. something like when harass_length = attack_index [unit_count]...

Other funcs i can work, but the second is most problematic for me.
If u have some time to explain is this even possible to do, and how to do it.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,892
There is a level of RoC campaign that uses zepplin to transport units land to land and then they attack your base, undead campaign. Go take a look at triggers.
JASS:
//This part should be like this
function count_boats takes nothing returns boolean
    return CountLivingPlayerUnitsOfTypeId(BOAT, Player(2)) >= 1
endfunction

//this
function add_units_to_group takes nothing returns nothing
    call GroupAddUnitSimple( GetEnumUnit(), BOATS )
endfunction

function add_boats takes nothing returns nothing
    call ForGroupBJ( GetUnitsOfTypeIdAll(BOAT), function add_units_to_group )
endfunction

//->

function add_boats takes nothing returns nothing
    local group grp = GetUnitsOfTypeIdAll(BOAT)
//stuff
endfunction
 
Status
Not open for further replies.
Top