Tutorial Making mazes - Advanced

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
I've only seen one mazing tutorial on these forums, so I think I'll go ahead and make one too.

If you have not read Jindo's mazing tutorial, DO NOT read this one.. yet.



Index​
1. The basics, if you decided to read ahead (Ctrl+f code is 001)
2. Triggering (Ctrl+f code is 002)
3. Custom Script (Ctrl+f code is 003)
4. The Path of the Maze (Ctrl+f code is 004)
5. Out of Ideas? (Ctrl+f code is 005)

Credits to this tutorial goes to Jindo, him, and his maze making tutorial helped me learn how to make mazes, and learn GUI (amazingly..)​









_________________________________
The Basics

001
1. Get a feel of your maze.
1a Does it have a good idea?
1b Is it original?
1c Does it even make any sense? (I've seen ALOT of mazes like this, most of the mazes with no real story line, was shit. Thought out maze > Rushed Map with absolutely NO meaning, and no story line.
1d Learn GUI. I recommend going to the tutorial index.

2. Have something OTHER then dodging creeps.
2a Something unique? Don't copy something out of another maze. I've seen lots of original ideas. One maze I played had a unique idea of memorization. You have to watch the circle of powers blink, then after its done, repeat the pattern.
2b A unique terrain, style, feel? Does the maze have something with its surrondings that other mazes do not?



_________________________________



Triggering

002
Triggering is a VERY important part of making a maze, you need triggers to make units patrol, gates open, units die, make units attack, basically the entire maze.





For making it so if a unit goes off the path, you eighter make a region, then put it in use with this trigger.

Code:
Sample Trigger
    Events
        Unit - A unit enters Test Region <gen>
    Conditions
        (Unit-type of (Triggering unit)) Equal to Footman
    Actions
        Unit - Kill (Triggering unit)

Just replace the Footman class with your unit type mazer.




OR you could go with this trigger, it checks the terrain under the unit every 0.03 seconds.

Code:
Kill
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Test_Group and do (Actions)
            Loop - Actions
                Set Temp_Point1 = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at Test_Point) Equal to Sunken Ruins - Sand
                    Then - Actions
                        Unit - Kill (Picked unit)
                        Custom script:   call RemoveLocation(udg_Test_Point)
                    Else - Actions
                        Custom script:   call RemoveLocation(udg_Test_Point)
Test_Point is a Point variable
Test_Group is a Unit-Group variable.
Replace Sunken Ruins - Sand with your type of terrain that you do not want a mazer to enter.

The draw backs of each trigger; The region trigger requires MANY regions, usauly taking much time. The terrain checking trigger does not take alot of time, but if you cut a corner, or touch the border of any terrain, your dead.

Attack Ground Trigger.

Code:
Attack Ground
    Events
        Time - Every 2.00 seconds of game time
    Conditions
    Actions
        Set Test_Point = (Center of attack ground 1 <gen>)
        Unit - Order Rabbit Barfing Turtle 0013 <gen> to Attack Ground Test_Point
        Custom script:   call RemoveLocation(udg_Test_Point)
Test_Point is again, a point variable, and 2.00 can be replaced. But you must edit the unit attack speed.

This, the trigger I am about to present, is the trigger EVERYONE wants in their mazes (I dont know why, I like it too tho :))

Code:
Sliding
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in Test_Group and do (Actions)
            Loop - Actions
                Set Test_Point = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at Test_Point) Equal to Sunken Ruins - Large Bricks
                    Then - Actions
                        Set Test_Point2 = (Test_Point offset by 13.00 towards (Facing of (Picked unit)) degrees)
                        Unit - Move (Picked unit) instantly to Test_Point2
                        Custom script:   call RemoveLocation(udg_Test_Point2)
                    Else - Actions
                        Do nothing
                Custom script:   call RemoveLocation(udg_Test_Point)

Test Point's are point variables.

Test_Group is a unit type variable set in Map Initialization.

off set by 13.00 is just the speed. You can edit it to how high, and how low you want.



And of course there's the turning trigger.

Code:
Turning
    Events
        Unit - A unit owned by Player 1 (Red) Is issued an order targeting a point
        Unit - A unit owned by Player 2 (Blue) Is issued an order targeting a point
        Unit - A unit owned by Player 3 (Teal) Is issued an order targeting a point
        Unit - A unit owned by Player 4 (Purple) Is issued an order targeting a point
        Unit - A unit owned by Player 5 (Yellow) Is issued an order targeting a point
        Unit - A unit owned by Player 6 (Orange) Is issued an order targeting a point
        Unit - A unit owned by Player 7 (Green) Is issued an order targeting a point
        Unit - A unit owned by Player 8 (Pink) Is issued an order targeting a point
        Unit - A unit owned by Player 9 (Gray) Is issued an order targeting a point
        Unit - A unit owned by Player 10 (Light Blue) Is issued an order targeting a point
        Unit - A unit owned by Player 11 (Dark Green) Is issued an order targeting a point
    Conditions
        ((Triggering unit) has an item of type Socks) Equal to True
    Actions
        Set Test_Point = (Target point of issued order)
        Unit - Make (Triggering unit) face Test_Point over 0.00 seconds
        Custom script:   call RemoveLocation(udg_Test_Point)

Test_Point is a point variable.
You can delete the unneeded players.

For unit patrols use this,

Code:
Patrol
    Events
        Map initialization
    Conditions
    Actions
        Set Temp_Point1 = (Center of Patrol 3 <gen>)
        Unit - Order YourUnit <gen> to Patrol To Temp_Point1
        Custom script:   call RemoveLocation(udg_Temp_Point1)

Replace YourUnit with any unit you want to patrol. To have multiple units keep on patrolling paste Set Test_Point and Custom script on the same spots as last patrol.
Set
Unit
Custom

For patroling a unit to more then one spot, you would use this:
Code:
Patrol Multiple
    Events
        Map initialization
    Conditions
    Actions
        Set Test_Point = (Center of (YouRegion))
        Unit - Order (YourUnit) to Move To Test_Point
        Custom script:   call RemoveLocation(udg_Test_Point)

Code:
Patrol Multiple 2
    Events
        Unit - A unit enters Destination Of Issued Move <gen>
    Conditions
        (Unit-type of (Triggering unit)) Equal to Unit Entering
    Actions
        Set Test_Point = (Center of (Next Move))
        Unit - Order (Your Unit) to Move To (Center of (Test_Point))
        Custom script:   call RemoveLocation(udg_Test_Point)

Code:
Patrol Go Back To Beginning
    Events
        Unit - A unit enters Destination Of Issued Move <gen>
    Conditions
        (Unit-type of (Triggering unit)) Equal to Unit Entering
    Actions
        Set Test_Point = (Center of (Beginning Region))
        Unit - Order (Your Unit) to Move To (Center of (Test_Point))
        Custom script:   call RemoveLocation(udg_Test_Point)

Code:
Repeat
    Events
        Unit - A unit enters Beginning <gen>
    Conditions
        (Unit-type of (Triggering unit)) Equal to Unit Entering
    Actions
        Set Test_Point = (Center of (Next Move))
        Unit - Order (Your Unit) to Move To (Center of (Test_Point))
        Custom script:   call RemoveLocation(udg_Test_Point)

For that trigger you would need 3 regions, and one unit patrolling in them (3 would work)

If the unit entered one region, it would move to the next one, and enter the other one, moving to the next one etc.

To make a gate open, with an item, no matter where it is in the inventory, and how many you have, you would use this.

Code:
Open Gate1
    Events
        Unit - A unit enters Gate1 <gen>
    Conditions
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item carried by (Triggering unit) in slot (Integer A))) Equal to Sacred Relic
                        (Massive Ruined Gate (Vertical) 0000 <gen> is alive) Equal to True
                    Then - Actions
                        Item - Remove (Item carried by (Triggering unit) in slot (Integer A))
                        Destructible - Open Massive Ruined Gate (Vertical) 0000 <gen>
                        Trigger - Turn off (This trigger)
                    Else - Actions
                        Do nothing

This would check the units inventory from 1-6 checking for the item of type (replaceable) and makes sure the gate is not open, so it does not remove all the items.

For killing a unit with collision you would give the unit you use permenant immolation, then remove the buff images. Then set the damage to 999999 or something. Then change the AoE to the size of the unit (estimate) then test repeatedly till when you die, you actually touch the unit.



_________________________________





Custom Script
003
Since I know that people will ask this, here's my breif description of the use of 'custom script'

Leak: Noun.

A leak is anything in WE that is not removed after use, if it has no other use.

Things that have generally no use, after it is used are; points, unit-groups, and special effects. These are removed in GUI within 'Custom Scripts' , or for special effects blizzard's already made GUI action.

For unit groups you would use Custom script: call DestroyGroup(udg_Unit_Group)
replacing Unit_Group with the name of your unit group variable.

For points you would use Custom script: call RemoveLocation(udg_Temp_Point) replacing Temp_Point with the name of your point variable.

For special effects you would use the action Special Effect - Destroy (Last created special effect)

If you do not clear up the leaks, it leads to lag, server splits, and on other cases FATAL errors

There are also leaks, that I do not want to list.



_________________________________



The Path
004
The path for a maze is VERY important, with out an intresting, or a bit windy path, a maze is a bunch of good ideas, gone to waste, and is un-usable.

An example of a good maze path would be

tutorialscreenie1pn4.th.jpg


If you choose a diagnal path, like grass, It would be wise to make the diagnol, a 2 squared path. As the terrain checking trigger would most likely kill any mazer that crosses it.



_________________________________




So, Your Out of Ideas?
005
What I do when I'm out of ideas is do what jindo told me to do (in his tutorial)
Breath in, Breath out. Now think of something. Anything. Slimy, squishy, crunchy, grass, path, steam rolling a tank over a chicken.
Now, this should give you a good idea. Maybe some thing that spawns rows of tanks that goes down a path, and you have to dodge them?













____________________________________
Almost Complete
Status: Almost Complete​
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
890
Inconsistancies:

Code:
Set Temp_Point1 = (Position of (Picked unit))
Code:
Custom script:   call RemoveLocation(udg_Test_Point)

The variables aren't the same.

Same here:

Code:
Set Test_Point = (Center of attack ground 1 <gen>)
Code:
Custom script:   call RemoveLocation(udg_Temp_Point1)
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
I fixed that, I'm working it out, I'm copying and pasting the stuff from my new maze thats coming Sea Of Hope 2.
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
24 - Hour Bump, You may now post comments. The tutorial is basically done, I'm taking requests for any additions. Also willing to help others with any questions, as long as you tried first.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
890
Hasn't been 24 hrs....

> The draw backs of each trigger; The region trigger requires MANY regions

Regions? I don't see any regions with that trigger. You're merely checking the terrain type.


Code:
Else - Actions
   Do nothing

You don't need the Do nothing action. What would it do if you didn't put it there? Nothing. :p

Code:
Turning
    Events
        Unit - A unit owned by Player 1 (Red) Is issued an order targeting a point
        Unit - A unit owned by Player 2 (Blue) Is issued an order targeting a point
        Unit - A unit owned by Player 3 (Teal) Is issued an order targeting a point
        Unit - A unit owned by Player 4 (Purple) Is issued an order targeting a point
        Unit - A unit owned by Player 5 (Yellow) Is issued an order targeting a point
        Unit - A unit owned by Player 6 (Orange) Is issued an order targeting a point
        Unit - A unit owned by Player 7 (Green) Is issued an order targeting a point
        Unit - A unit owned by Player 8 (Pink) Is issued an order targeting a point
        Unit - A unit owned by Player 9 (Gray) Is issued an order targeting a point
        Unit - A unit owned by Player 10 (Light Blue) Is issued an order targeting a point
        Unit - A unit owned by Player 11 (Dark Green) Is issued an order targeting a point

Why not just use a generic unit event? You could simply check which player if it's even necessary. Also, won't this trigger go off even if the unit is not sliding?
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
No it wouldn't, I have a condition there, if you check again, would go off if they have item of type ___
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
The region trigger requires MANY regions, I'm referring to the Unit enters region trigger.

EDIT: DOUBLE POST SORRY :(
 

Nestharus

o-o
Reaction score
84
Code:
Turning
    Events
        Unit - A unit owned by Player 1 (Red) Is issued an order targeting a point
        Unit - A unit owned by Player 2 (Blue) Is issued an order targeting a point
        Unit - A unit owned by Player 3 (Teal) Is issued an order targeting a point
        Unit - A unit owned by Player 4 (Purple) Is issued an order targeting a point
        Unit - A unit owned by Player 5 (Yellow) Is issued an order targeting a point
        Unit - A unit owned by Player 6 (Orange) Is issued an order targeting a point
        Unit - A unit owned by Player 7 (Green) Is issued an order targeting a point
        Unit - A unit owned by Player 8 (Pink) Is issued an order targeting a point
        Unit - A unit owned by Player 9 (Gray) Is issued an order targeting a point
        Unit - A unit owned by Player 10 (Light Blue) Is issued an order targeting a point
        Unit - A unit owned by Player 11 (Dark Green) Is issued an order targeting a point

Er... why not just add something in the setup to add all the events to this trigger. Triggers that target lots of players, etc, that can be looped, should not be like this. There should be 0 events in triggers like this. It should all be done using the Trigger - Add New Event function

-.-

This can be done in GUI, so there are no excuses : P
It also saves a load of lines = )

Now, for your unit groups, I REALLY don't suggest using unit groups. Set a unit variable to each unit that's created for each player, like Player 1s mazer would be PlayerUnit[1], etc. From there, just go thru a regular loop -.-

loop
udg_PlayerUnit[x]
set x = x + 1
exitwhen x > 11
endloop

Or, in GUI

for each integer A from 1-11

That'll save you code from cleaning up your memory leaks

Another thing, don't use locations for the terrain type checking... Yea, using x,y coords can only be used in JASS (in GUI, it converts the x,y coords to locations), but it saves so much because you don't have to remove memory leaks. You don't have to set any variables at the start, it's just one line...

Oh well, those are my suggestions ^_^

Oh wait!! Another thing!! You should base the slider speed on the ice off of the unit movement speed ^_-

And if you really want to get cool and make a real sliding trigger, meaning it'll be like real world ice, you should have a unit's weight to see how far they continue to slide, how long it takes them to pick up speed, etc ^_^

It could be really neato if you have to do something in a certain amount of time :eek:

You can also define the slow down speed ^_^, once again based off of momentum. You could even define different frictions with ice so you can have higher accels on some ice and slower on other, etc ^_^

Another thing you should include is flying platforms : )

You should also talk about how it's terrible to place units on a map. Each unit should be created and stored. This works very very well with flying platforms, for example, going over dangerous terrain on a cooleo platform ^_^

There is so much you can do, oi oi
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top