Moving Units within a Region

Skasian

New Member
Reaction score
1
I have 2 regions (region1) (region2).

If I have some units in region1 and I want to move them say at 6PM to region2. So I use the following event...

EVENT:
Game Time of day = 18.00
CONDITIONS:
None
ACTIONS:
----What action will allow me to automatically move these units to region2?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
Trigger:
  • Actions
    • Set Temp_Group = your units
    • Set Temp_Point = center of (your region)
    • Unit Group - pick every unit in Temp_Group and do actions
      • Loop Actions
        • Unit - Move Picked Unit to Temp_Point facing (facing degrees of picked unit)
    • Custom Script: call DestroyGroup(udg_Temp_Group)
    • Custom Script: call RemoveLocation(udg_Temp_Point)
 

merlinds

Member
Reaction score
15
And to set the group "Temp_Group" you can use the function:
Set Temp_Group = (Units in YourRegion <gen>)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
its just the actions custom script, then you type in that EXACT match case sensitive (variations can only be the variable name but it does require the udg_
 

Skasian

New Member
Reaction score
1
Thanks heaps:

Btw is there a way where I can see a list of all the available custom scripts and what they do in the editor?
 

Grags_1977

Ultra Cool Member
Reaction score
32
Custom Scripts are just JASS code.

This page might be useful to you.

However, I know next to nothing about Jass. A more qualified Jass user may point you in a better direction.

Generally, GUI users mainly use Custom Scripts to remove leaks.
 

Skasian

New Member
Reaction score
1
I'm confused so are Custom Scripts already incorporated into WC3 editor?

Or do I have to go and download the scripts that I want somewhere?
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Custom Scripts are a way of using small amounts of JASS code in a GUI trigger. JASS is what you see when you choose Edit > Convert to Custom Text, and is the base coding language of the WE.

There is no need to download custom scripts; all you have to do is convert a trigger and find the relevant function. Learning these functions will help you to use them in custom script.

Search the forum for some JASS tutorials if you feel like finding out. Alternatively just search for emiljr's tutorial on Memory Leaks.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
essentially, GUI puts the script into a more user-friendly and readable script, but its made up of all that custom script you see... triggers are actually made up of 3 functions: actions are 1 function, conditions are another, and the function that puts them all into a nice and neat trigger
like this:

JASS:
function actions takes nothing returns nothing
     call DoSomeAction
     call DoSomeAction
endfunction

function conditions takes nothing returns boolean//&lt;-- that is a condition return, if it returns true it will run the trigger, false it wont
     if (Variable = 1) then
          return true
     else
          return false
     endif//this ends the if/then/else
endfunction

//============================================================

function trigger takes nothing returns nothing//this must be below the actions/conditions we add to it because it needs to use them and in order to use another function it must be above the one using it in the code
     local trigger t = CreateTrigger()//this creates a local variable (one that is only used for this function) and creates a trigger to set to it
     call TriggerRegisterSomeEvent(t)//this would be the event, t is the local trigger variable t (adding the event to the trigger)
     call TriggerAddCondition(t, Filter(function conditions))//here we add the condition by making it a filter for the trigger and making sure the function that adds the conditions is (function conditions) because thats where we created our conditions
     call TriggerAddActions(t, function actions)//here we add all the actions from function actions
endfunction

handwritten, dont hate me lol
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top