HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[Help] Regions and Triggers

12-07-2007, 12:26 AM#1
cheekyvimto
Hi guys, my first post, I've just started doing my first custom maps for wc3, and theres still quite alot I don't understand (loving the tutorials here btw)

I have been making my own version of a well played custom map (Stronghold, original concept by deadevil i think)

I have pretty much got the entire thing done now from the ground up.

Theres just one bug I can't figure out for the life of me how to fix.

When Units are spawned they follow the movement path I've created using the following triggers

Trigger:
Events
Unit - A unit enters Spawn Region <gen>
Conditions
Actions
Unit - Order (Entering unit) to Move To (Center of Region1 <gen>)

thats all fine, but what do I need to do to stop my Tower Builder from being issued the same movement order when it passes over Region1

Thanks in advance

/cheeky
12-07-2007, 03:17 AM#2
Vexorian
You want to add something to conditions about that. Unit type comparison Unit type of entering unit not equal to tower builder
12-07-2007, 06:55 AM#3
The Elite
Trigger:
Events
Unit - A unit enters Spawn Region <gen>
Conditions
(Owner of (Entering unit)) Equal to Bad Guys
Actions
Unit - Order (Entering unit) to Move To (Center of Region1 <gen>)
do that.
12-07-2007, 09:38 AM#4
Troll-Brain
Trigger:
Events
Unit - A unit enters Spawn Region1 <gen>
Conditions
Actions
your actions

You want say you has a trigger like that , and don't want the unit to run the trigger ?
then use custom value and conditions integer
12-07-2007, 01:16 PM#5
cheekyvimto
Thanks to everyone for replying, I used The_Elite's method in the end, and modified it slightly.


Trigger:
Team 1 TOPA to TOPB
Collapse Events
Unit - A unit enters Spawn Area Team 1 TOP <gen>
Collapse Conditions
((Triggering unit) is A structure) Equal to False
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Triggering unit)) Not equal to Player 1 (Red)
(Owner of (Triggering unit)) Not equal to Player 2 (Blue)
Collapse Then - Actions
Unit - Order (Triggering unit) to Move To (Center of 1st Base Team 1 top <gen>)
Collapse Else - Actions
Do nothing


This seems to work a treat, so thanks alot :D

/cheeky
12-07-2007, 01:38 PM#6
Deaod
please, dont use "Do nothing", as it really doesnt do anything but consuming Flops of your CPU.

you're leaking a Location Variable, too.

This should help avoiding that leak.
Trigger:
Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
-------- Compare the players --------
Collapse Then - Actions
Set Locfix = (Center of 1st Base Team 1 top <gen>)
Unit - Order (Triggering unit) to Move To (Center of 1st Base Team 1 top <gen>)
Custom Script: call RemoveLocation(udg_Locfix)
Else - Actions
What you basically do here is storing a point into a global variable, so you dont have to dynamically create it during the execution of that "Order Unit ... ". And after you used that point you remove/destroy it so other functions/triggers may use that variable too.
12-07-2007, 03:33 PM#7
Troll-Brain
do nothing is very useless but it make your code more easy to reading (in gui )
12-08-2007, 01:59 AM#8
cheekyvimto
Quote:
Originally Posted by Deaod
please, dont use "Do nothing", as it really doesnt do anything but consuming Flops of your CPU.

you're leaking a Location Variable, too.

This should help avoiding that leak.
Trigger:
Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
-------- Compare the players --------
Collapse Then - Actions
Set Locfix = (Center of 1st Base Team 1 top <gen>)
Unit - Order (Triggering unit) to Move To (Center of 1st Base Team 1 top <gen>)
Custom Script: call RemoveLocation(udg_Locfix)
Else - Actions
What you basically do here is storing a point into a global variable, so you dont have to dynamically create it during the execution of that "Order Unit ... ". And after you used that point you remove/destroy it so other functions/triggers may use that variable too.

Thank you for your explaination on leaks, as I said this is my first creation so I'm still learning quite alot. Found this answer very helpful, so thanks.

added reps to those that have helped :)

/cheeky
12-09-2007, 12:20 AM#9
Deaod
urgs, made a mistake. I'm sorry.

heres the corrected one:
Trigger:
Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
-------- Compare the players --------
Collapse Then - Actions
Set Locfix = (Center of 1st Base Team 1 top <gen>)
-------- Here was the mistake --------
Unit - Order (Triggering unit) to Move To (Locfix)
-------- Here was the mistake --------
Custom Script: call RemoveLocation(udg_Locfix)
Else - Actions
12-09-2007, 10:17 AM#10
cheekyvimto
Thanks again Deaod, I figured what what had meant to do in the first answer :)

/cheeky