HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

directional tutorials?

07-25-2003, 04:15 AM#1
piRo-piOn
Are there any tutorials that explain in detail the polar offsets and stuff like that? basically all the things you use to generate point in game (angles, stuff like that) i could never really understand it.
07-25-2003, 04:26 AM#2
Mordrag
Same here. I would love someone to show me a tutorial to enable a heros movement with the keypad.
07-25-2003, 06:32 AM#3
gurubvin
as far as the point things are concerned, i havent seen ne. i'm doing a turn based strat (similar to ari's) and here are a few things though that i've found useful:

1) polar offset. this'll grab the point x distance away from ur unit at a certain angle. it's useful for creating effects. say u wanted to make a ring of fire around ur unit. ud make a "for loop" and create a "fire effect" at polar offset. it would be 100 away from the location of ur unit. set the angle to a variable. everytime the loop executes add 45 to that variable. thus u would have a fire effect on the north side of the unit. the ne side. east side. and so on.

it's also useful for the keypad move. create an event that executes every time a player presses up. order that unit to move to the point offset by 100 at angle 90 or 270, i cant remember which way was up.

2) distance from unit a to b. this is useful if u want to make a check of whether or not a unit is within range. ud make a check to see if the distance from a to b is greater than... let's say ur attack range. if so then the unit is too far. by attack range i mean like a custom attack range u created, not the one with WE.

3) math functions. u'll want to manipulate the x, y values in order to create pretty effects. it'll take some study, but u should be able to make some nice effects with those functions.

4) functions that return points, like location of unit, location of destructable, center of region, etc. u'll usually use these when referring to a point, rather than using an actual real value.

as far as the walking using arrows, i made a function to do it. just assign a unit to it, and it'll allow u to control that unit with arrows. it follows the direction of the camera so up will go forward no matter which direction ur camera faces. it's useful if u want to allow the user to spin the camera. i made a function for that also.

going back to the points issue, i made a function that'll round any value to the closest second value of ur choosing. so if u wanted too u could round 3 to the nearest 5.44. this is useful cuz lets say u wanted ur unit to only move on intervals of 100. u would take the point clicked by the user, and round the x and y val of that point to the nearest 100. then ud order the unit to move there. u can also do this with angles. say u wanted to make ur units move in only 4 directions. ud take the angle between wer the player clicked, and wer ur unit is, and round that to the nearest 90.

i was actually writing all these functions for a campaign/mod we're doin. i posted in the jass forums if some of the guys there wanted to compile all the new functions that have been made and give em to scio for the next umswe. regardless i was planning to put all of these in editor with gui just so the team mapmakers could create maps more easily. if u want em now though i can give u the blizz.j file. i'll explain how u can access the functions via jass.