HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Mining gold whilst flying

02-02-2004, 09:25 PM#1
Hunter0000
It apears that when you go to mine, a unit must have a clear GROUND route, whether the unit flys or not. I need to fix this, and invisable platforms arnt working. These units must go down a 4-story cloff(two sets of 2-height cliffs) before getting to gold mine level.

HELP!:mtk:
02-02-2004, 09:41 PM#2
Narwanza
You could simulate a normal gold rout via ordering.
02-02-2004, 09:42 PM#3
Hunter0000
Quote:
Originally posted by Narwanza
You could simulate a normal gold rout via ordering.


eh?

what is that saposed to mean?
02-02-2004, 10:29 PM#4
Narwanza
When the unit gets gold, just order them to move to the base. When the get within a certain range of the base then order them to put the resources that they gathered into the building. Then order them back to the position of the gold mine, and when they get within like 60 of the mine, order them to mine our of the mine. Then just make it repeat this pattern.
02-02-2004, 11:08 PM#5
Grater
I think:
Catch the "Harvest" order on the goldmine, change it to a "Move" or "Follow order", wait a second (adjust until it looks right) issue the peon a new "Harvest" order on the goldmine, do much the same for the return trip.

This trigger works.
Code:
function Trig_Goldmine_Conditions takes nothing returns boolean
    if (not ( GetUnitTypeId(GetOrderedUnit()) == 'o000' ) ) then
        return false
    endif
    if ( not ( GetUnitTypeId(GetOrderTargetUnit()) == 'ngol'  or IsUnitType(GetOrderTargetUnit(), UNIT_TYPE_TOWNHALL) == true ) ) then
        return false
    endif
    
    return true
endfunction

function Trig_Goldmine_Actions takes nothing returns nothing
    local unit orderedunit = GetOrderedUnit()
    local unit ordertargetunit = GetOrderTargetUnit()
    call DisableTrigger( GetTriggeringTrigger() )
    call IssueTargetOrderBJ( GetOrderedUnit(), "move", GetOrderTargetUnit() )
    call EnableTrigger( GetTriggeringTrigger() )
    call PolledWait( 2 )
    call DisableTrigger( GetTriggeringTrigger() )
    call IssueTargetOrderBJ(orderedunit, "smart", ordertargetunit )
    call EnableTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_Goldmine takes nothing returns nothing
    set gg_trg_Goldmine = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Goldmine, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerAddCondition( gg_trg_Goldmine, Condition( function Trig_Goldmine_Conditions ) )
    call TriggerAddAction( gg_trg_Goldmine, function Trig_Goldmine_Actions )
endfunction
02-02-2004, 11:31 PM#6
Hunter0000
lol, considering there are like 40 mines, I think ima just re-design the way they are harvested.

But thanks for your help guys:D
02-03-2004, 12:12 AM#7
Klownkiller
If i follow Grater's Jass correctly, then this would be a generic function and it would work for all your gold mines and town halls.
It could also be written without jass if you find that simpler.
02-03-2004, 12:14 AM#8
Hunter0000
Really?

Can I just make a custom-script trigger and CnP it? im not very JASS savy id u no what I mean.
02-03-2004, 01:25 AM#9
Grater
Yep, it's that simple.

I've enhanced the trigger a bit to make it more flawless and put the trigger in a map, it's now a GUI trigger using custom script actions and a single global variable.

Quite the interesting little challenge ;)
02-03-2004, 01:47 AM#10
Hunter0000
Grater, you are God! ;P:D

Heres a sceenie as apreciation!!
02-03-2004, 02:31 AM#11
zotax
0_o Wow, whats that for?
02-03-2004, 03:46 AM#12
Grater
My jaw dropped when I saw that screenie, thats WC3?! :D
02-03-2004, 06:30 AM#13
angel of light
Holy crap!! when does that map come out?? i wanna play it! :D
02-03-2004, 10:58 AM#14
brdarkmoon
Holy Wc3...What on earth?
It´s a awesome screenshot...what mod is it supposed to be?