• 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.

How to make an ice escape map?

Status
Not open for further replies.
Level 3
Joined
Feb 14, 2011
Messages
43
hello.. anyone can help me with this +rep...
i got plenty of time when i was making this kind of thing.. but i didn't know how or where to start... kinda blur... making the ice escape map, beside putting unit patrolling , attacking, and slide...
how to make this as below on youtube : look at the 1:00mins (the things that moves around..

 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Those are just dummy units moving in a sphere.

  • Circular Shape
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set degrees = (degrees + 2.00)
      • Set tempLoc = (centerLoc offset by 300.00 towards degrees degrees)
      • Unit - Move Unit instantly to tempLoc
      • Custom script: call RemoveLocation(udg_tempLoc)
That is the base, just as an example.

It will move around centerLoc (previously set up, it's the center around which your unit circles) in a circular shape.
The speed can be adjusted by changing the "degrees + 2.00", the offset by changing the offset of course.

Again: this is just the basis of the system.
 
In addition to Ap0 wrote...if you want multiple units...

  • Circular Shape
  • Events
    • Time - Every 0.03 seconds of game time
  • Conditions
  • Actions
    • Set degrees = (degrees + 2.00)
    • For integer variable i from 1 to 5
      • Set distance = (distance + 50.00)
      • Set tempLoc = (centerLoc offset by distance towards degrees degrees)
      • Unit - Move Unit[i] instantly to tempLoc
      • Custom script: call RemoveLocation(udg_tempLoc)
    • endloop
the Unit[] is a unit array variable created via...

  • For integer variable u from 1 to 5
    • Unit - Create 1 UNIT
    • Set Unit[u] - Last Created Unit
 
Level 3
Joined
Feb 14, 2011
Messages
43
Those are just dummy units moving in a sphere.

  • Circular Shape
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set degrees = (degrees + 2.00)
      • Set tempLoc = (centerLoc offset by 300.00 towards degrees degrees)
      • Unit - Move Unit instantly to tempLoc
      • Custom script: call RemoveLocation(udg_tempLoc)
That is the base, just as an example.

It will move around centerLoc (previously set up, it's the center around which your unit circles) in a circular shape.
The speed can be adjusted by changing the "degrees + 2.00", the offset by changing the offset of course.

Again: this is just the basis of the system.

hello, what are the variables ?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I've attached a system I quickly put together.

Installing in your map:
  • Copy the map's header (the JASS-part) and paste it in your map's header.
  • Copy the category "Initialization" (you can rename it, I think that's best) and paste it in your map.
  • Done.

Creating a new circle:

I think it's pretty obvious.
  • Create a unit that's going to be circling (doesn't matter where you place it).
  • In the trigger "Init", copy/paste all actions under "Unit 1", up to "Unit 2".
  • circleCenterLoc: the unit will circle around this location.
  • circleUnit: the unit that will be circling.
  • circleDegrees: the amount of degrees the unit starts circling at (added so you can make nice figures with it :D).
  • circleSpeed: the angle speed (in degrees) at which the unit will be circling (higher = faster).
    Can also be negative to circle the other direction.
  • circleOffset: the range from circleCenterLoc to where the unit should be circling.
  • Custom script: whatever, DO NOT CHANGE! Always add it after you set up a circle, but never change it.

In the map are 5 examples, those should provide enough information.
Delete the visibility-actions of course. And delete the trigger "Copy Variables" after copying that trigger to your map.


Even if you know absolutely NOTHING about JASS, this should be a piece of cake to set up correctly.



Edit: By the way, the "map's header" is if you click the map's name (in my case: Circle Test.w3x) above all categories (trigger editor).

JASS:
function circleLoop takes nothing returns nothing
    local integer i = 0
    local real centerX
    local real centerY
    local real x
    local real y
    
    loop
        set i = i+1
        exitwhen i > udg_circleAmount
        
        set centerX = GetLocationX(udg_circleCenterLoc[i])
        set centerY = GetLocationY(udg_circleCenterLoc[i])
        set x = centerX + udg_circleOffset[i] * Cos(udg_circleDegrees[i] * 0.017453292)
        set y = centerY + udg_circleOffset[i] * Sin(udg_circleDegrees[i] * 0.017453292)
        
        call SetUnitX(udg_circleUnit[i], x)
        call SetUnitY(udg_circleUnit[i], y)
        
        set udg_circleDegrees[i] = udg_circleDegrees[i] + udg_circleSpeed[i]
    endloop
endfunction

function createCircle takes nothing returns nothing
    set udg_circleAmount = udg_circleAmount + 1
    set udg_circleOffset[udg_circleAmount] = udg_circleOffset[0]
    set udg_circleDegrees[udg_circleAmount] = udg_circleDegrees[0]
    set udg_circleSpeed[udg_circleAmount] = udg_circleSpeed[0]
    set udg_circleCenterLoc[udg_circleAmount] = udg_circleCenterLoc[0]
    set udg_circleUnit[udg_circleAmount] = udg_circleUnit[0]
    
    if udg_circleAmount == 1 then
        call TimerStart(udg_circleTimer, 0.03, true, function circleLoop)
    endif
    
    call RemoveLocation(udg_circleCenterLoc[0])
endfunction
You can copy/paste it from here as well now :)

Edit: updated the demo-map.
 

Attachments

  • Circle Test.w3x
    18 KB · Views: 156
Last edited:
Level 3
Joined
Feb 14, 2011
Messages
43
I've attached a system I quickly put together.

Installing in your map:
  • Copy the map's header (the JASS-part) and paste it in your map's header.
  • Copy the category "Initialization" (you can rename it, I think that's best) and paste it in your map.
  • Done.

Creating a new circle:

I think it's pretty obvious.
  • Create a unit that's going to be circling (doesn't matter where you place it).
  • In the trigger "Init", copy/paste all actions under "Unit 1", up to "Unit 2".
  • circleCenterLoc: the unit will circle around this location.
  • circleUnit: the unit that will be circling.
  • circleDegrees: the amount of degrees the unit starts circling at (added so you can make nice figures with it :D).
  • circleSpeed: the angle speed (in degrees) at which the unit will be circling (higher = faster).
    Can also be negative to circle the other direction.
  • circleOffset: the range from circleCenterLoc to where the unit should be circling.
  • Custom script: whatever, DO NOT CHANGE! Always add it after you set up a circle, but never change it.

In the map are 5 examples, those should provide enough information.
Delete the visibility-actions of course. And delete the trigger "Copy Variables" after copying that trigger to your map.


Even if you know absolutely NOTHING about JASS, this should be a piece of cake to set up correctly.



Edit: By the way, the "map's header" is if you click the map's name (in my case: Circle Test.w3x) above all categories (trigger editor).

JASS:
function circleLoop takes nothing returns nothing
    local integer i = 0
    local real centerX
    local real centerY
    local real x
    local real y
    
    loop
        set i = i+1
        exitwhen i > udg_circleAmount
        
        set centerX = GetLocationX(udg_circleCenterLoc[i])
        set centerY = GetLocationY(udg_circleCenterLoc[i])
        set x = centerX + udg_circleOffset[i] * Cos(udg_circleDegrees[i] * 0.017453292)
        set y = centerY + udg_circleOffset[i] * Sin(udg_circleDegrees[i] * 0.017453292)
        
        call SetUnitX(udg_circleUnit[i], x)
        call SetUnitY(udg_circleUnit[i], y)
        
        set udg_circleDegrees[i] = udg_circleDegrees[i] + udg_circleSpeed[i]
    endloop
endfunction

function createCircle takes nothing returns nothing
    set udg_circleAmount = udg_circleAmount + 1
    set udg_circleOffset[udg_circleAmount] = udg_circleOffset[0]
    set udg_circleDegrees[udg_circleAmount] = udg_circleDegrees[0]
    set udg_circleSpeed[udg_circleAmount] = udg_circleSpeed[0]
    set udg_circleCenterLoc[udg_circleAmount] = udg_circleCenterLoc[0]
    set udg_circleUnit[udg_circleAmount] = udg_circleUnit[0]
    
    if udg_circleAmount == 1 then
        call TimerStart(udg_circleTimer, 0.03, true, function circleLoop)
    endif
    
    call RemoveLocation(udg_circleCenterLoc[0])
endfunction
You can copy/paste it from here as well now :)

thanks a lot... ^^
 
Level 3
Joined
Feb 14, 2011
Messages
43
sir, 1 more question... about the circleCenterLoc.. i tried to change to another location..
i mean, i put an region then i set it to Center of the Region... how? others no problem now just changing location only...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I don't really get your question I think...

If it is what is sounds like, then it's just the first action you come across when you try to set "circleCenterLoc" to another location: "Center of Region".
centerofregion.jpg

Then just change "(Playable map Area)" with the region you made.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Oh, you are right. Thanks for pointing that out.

It's because of some stupid location removal (I don't know if it's a bug with locations or whatever, but I do know how to avoid it).
Changed it to coordinates and it works like a charm - you can download the new version in one of my previous posts (post #11).
 
Level 3
Joined
Feb 14, 2011
Messages
43
hello again.. i have an question, can i make more of the circling unit in my map? i wanted to make more, and because of that i added 2 more region and more dummy units and then i copy the trigger.. i tested it on Circle Test.w3x , i have no idea how to do it.. kinda blur actually...
 
Status
Not open for further replies.
Top