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

Command that move you to other place

Status
Not open for further replies.
Level 14
Joined
Apr 20, 2009
Messages
1,543
Something like this?

  • type
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
      • Set Temp_loc = (Center of Rect 000 <gen>)
      • Unit - Move My_Hero instantly to Temp_loc
      • Custom script: call RemoveLocation(udg_Temp_loc)
Where Temp_loc is a point variable
My_Hero is a unit variable (set in another trigger to contain the hero of the player)
and where call RemoveLocation(udg_Temp_loc)
Removes the location leak inside your memory.
 
Level 5
Joined
Nov 5, 2011
Messages
93
Something like this?

  • type
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
      • Set Temp_loc = (Center of Rect 000 <gen>)
      • Unit - Move My_Hero instantly to Temp_loc
      • Custom script: call RemoveLocation(udg_Temp_loc)
Where Temp_loc is a point variable
My_Hero is a unit variable (set in another trigger to contain the hero of the player)
and where call RemoveLocation(udg_Temp_loc)
Removes the location leak inside your memory.

yes. .. can u expalain that how you do it?^^
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
First you create a region where you want your units to move to.

To do this go inside the editor to:
Layer -> Regions

This will pop up a toolbox that allows you to create regions on your map.

Now you can use the regions you've created within the trigger editor.

First you create a few variables inside your variable editor which can be done inside the trigger editor (F9).
In order to create variables, click on the yellow X or control + B.
This will pop up a window.
Click on the green +X, this will create a new variable for you.
You specify the type and name and click on OK.
Now you should have made a new variable.
Press Ok to close the variable editor again.

For the variables that we are going to use you need to set it's type to unit and point.

Now to create a trigger you simply right click a folder inside your trigger editor and click on New Trigger. Now you will see a untitled trigger like this:

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
Right click anywhere inside the window on any text and click on New Event. Scroll down to Player - Chat Message and change the options to your needs by clicking on them.

Now your trigger should look like this:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
Right click again and create a New Action.
Scroll down to Set - Variable, now select your temporary location variable and specify it by selecting the region we've created earlyer. (Center of your_region <gen>). Now your trigger will look like this:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
      • Set Temp_loc = (Center your_region <gen>)
Now create another action and scroll all the way down to: Unit - Move Unit (Instantly). Now click on Triggering unit and specify the variable we've created for our unit. Now simply make sure that it is moving instantly to the Temp_loc variable.

Your trigger should look like this:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
      • Set Temp_loc = (Center of Rect 000 <gen>)
      • Unit - Move your_unit instantly to Temp_loc
Now to make sure that we destroy the location we have just used inside our memory so that it won't build up in memory when not being used anymore (Removing a leak) we create another action under Custom Script.

Here you type in the following:
call RemoveLocation(udg_Temp_loc)

Now your trigger is finished and should look like this:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
      • Set Temp_loc = (Center of Rect 000 <gen>)
      • Unit - Move your_unit instantly to Temp_loc
      • Custom script: call RemoveLocation(udg_Temp_loc)
Make sure that you set the variable your_unit in another trigger so that it points to the hero of player 1.

I hope this explains enough...
 
Level 5
Joined
Nov 5, 2011
Messages
93
First you create a region where you want your units to move to.

To do this go inside the editor to:
Layer -> Regions

This will pop up a toolbox that allows you to create regions on your map.

Now you can use the regions you've created within the trigger editor.

First you create a few variables inside your variable editor which can be done inside the trigger editor (F9).
In order to create variables, click on the yellow X or control + B.
This will pop up a window.
Click on the green +X, this will create a new variable for you.
You specify the type and name and click on OK.
Now you should have made a new variable.
Press Ok to close the variable editor again.

For the variables that we are going to use you need to set it's type to unit and point.

Now to create a trigger you simply right click a folder inside your trigger editor and click on New Trigger. Now you will see a untitled trigger like this:

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
Right click anywhere inside the window on any text and click on New Event. Scroll down to Player - Chat Message and change the options to your needs by clicking on them.

Now your trigger should look like this:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
Right click again and create a New Action.
Scroll down to Set - Variable, now select your temporary location variable and specify it by selecting the region we've created earlyer. (Center of your_region <gen>). Now your trigger will look like this:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
      • Set Temp_loc = (Center your_region <gen>)
Now create another action and scroll all the way down to: Unit - Move Unit (Instantly). Now click on Triggering unit and specify the variable we've created for our unit. Now simply make sure that it is moving instantly to the Temp_loc variable.

Your trigger should look like this:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
      • Set Temp_loc = (Center of Rect 000 <gen>)
      • Unit - Move your_unit instantly to Temp_loc
Now to make sure that we destroy the location we have just used inside our memory so that it won't build up in memory when not being used anymore (Removing a leak) we create another action under Custom Script.

Here you type in the following:
call RemoveLocation(udg_Temp_loc)

Now your trigger is finished and should look like this:
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -arena as An exact match
    • Conditions
    • Actions
      • Set Temp_loc = (Center of Rect 000 <gen>)
      • Unit - Move your_unit instantly to Temp_loc
      • Custom script: call RemoveLocation(udg_Temp_loc)
Make sure that you set the variable your_unit in another trigger so that it points to the hero of player 1.

I hope this explains enough...

ty . .. :goblin_good_job:
 
Status
Not open for further replies.
Top