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

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