Warcraft III resources & community, 2003–2006 · archived

Need help making a hockey puck!

3 posts
#1

Need help making a hockey puck!

I'm thinking something along the lines of an item that you click then pick a target anywhere on the map, then the puck slides to where you targeted. I want it so when you get close to the puck it goes in your inventory. This way if you shoot from across the map, if someones in the way they get the puck. I know I have to do something like create a "puck" unit and use some triggers but I'm lost. can somebody help me? Let me know if more information is needed.
#2
i dunno what cho going on about but for the hoky puck shoot probly best of basing it of shockwave
#3
best bet is indeed to create a puck unit

you'll have to keep track of variables such as speed, direction

essentially when the item is casted at a location, you would remove the item from inventory, create a puck unit infront of the player, apply the (angle between unit and targeted point) to get the direction, and maybe distance from point of unit to target to get the speed

essentially you'd want to be running a trigger that goes something like
event: periodic every 0.05 seconds
actions: move puck to location in (direction) by (speed)

of course you'd want to clean memory cause that would be nasty with the location-pointer buildup at 0.05

and other things maybe reducing the speed every go to simulate friction

you'd also check the area infront of the puck for every go to check for other players, or walls, walls would rotate the direction