• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Need help making a hockey puck!

Status
Not open for further replies.
Level 3
Joined
Sep 6, 2005
Messages
20
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.
 
Level 7
Joined
Jul 30, 2004
Messages
451
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
 
Status
Not open for further replies.
Top