• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Help me fix my System

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
Last edited:
I see you changed your message here, you still have issue or solved?

The easiest fix I can think of is that the unit has an ability to "refresh" the area around.

Another option is to refresh 10 timers over a 5 minute period, after that it is released, the chanse of units blocking the land for such a long time is small.

A third option is to check unit position above the area, but not sure exactly how to determine if a unit is actually blocking.

Is grid farmable? Yes -> Is grid Walkable? No. -> Is there units there? Yes. -> Add grid to recheck index. -> Check Grid again after seconds. -> Repeat.
 
Last edited:
Could you select all the units in the area you want to turn into farm land and disable pathing for them and then re-enable it right after? It shouldn't cause problems if it all happens instantly, I don't think.
 
Could you select all the units in the area you want to turn into farm land and disable pathing for them and then re-enable it right after? It shouldn't cause problems if it all happens instantly, I don't think.

Doesn't work sadly. However adding removing locust or making the unit flying might, not sure how that is done exactly though.

JASS:
scope Test123 initializer Init 
    function Trig_Untitled_Trigger_001_Func001A takes nothing returns nothing
        call SetUnitPathing( GetEnumUnit(), false )
    endfunction

    function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
        call ForGroup( GetUnitsInRectAll(GetPlayableMapRect()), function Trig_Untitled_Trigger_001_Func001A )
        if IsTerrainWalkable(GetRectCenterX(gg_rct_a), GetRectCenterY(gg_rct_a)) then
            call BJDebugMsg("yes")
        else 
            call BJDebugMsg("no")
        endif   
    endfunction

    private function Init takes nothing returns nothing
        set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
        call TriggerRegisterTimerEventSingle( gg_trg_Untitled_Trigger_001, 1.00 )
        call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
    endfunction
endscope
 
Dang. Can you save their xy coordinates (using a hashtable), move them to the origin of the farmland, generate the farmland, and then move them back? I don't have a full grasp on everything your system does, so it might not work for all cases.
 
Dang. Can you save their xy coordinates (using a hashtable), move them to the origin of the farmland, generate the farmland, and then move them back? I don't have a full grasp on everything your system does, so it might not work for all cases.

I could do that, but visually it would look retarded wouldn't it? :P Gonna try it later though.
 
I could do that, but visually it would look retarded wouldn't it? :P Gonna try it later though.

How fast does the farmland generate? If it all just appears instantly, it shouldn't be a problem.

If it sort of grows out, you'd have to grab the units as it expands.
 
Status
Not open for further replies.
Back
Top