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!
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..
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.
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.
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 ).
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
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 ).
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
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...
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".
Then just change "(Playable map Area)" with the region you made.
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).
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.