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

Unit Facing point laterally -with his weapon

Status
Not open for further replies.
Level 7
Joined
Feb 4, 2005
Messages
289
Im using an ability of item based on blizzard with hidden shards and effects (no effects). I add a special effect to the weapon (e.g weapon of marine) with trigg and turn it on/off when it starts/finishes. I want to make the marine to turn with his weapon to the target point of ability being cast, how can i do it ? It's lateral as you can see, otherwise using make unit face point, imagine the e ffect on the weapon being lateral when the unit faces the point of the ability. I want always to face with his weapon until the ability finishes. There is also no lock 'weapon' trigger. This belongs to map cuz, the ability part with effects and damage i did already.
 
Level 5
Joined
Jun 17, 2006
Messages
114
this ability will require 2 triggers, an activation trigger and a trigger to enact the effect. the activation trigger should look like this:

events
a unit begins casting an ability

conditions
ability being cast equal to (your ability)

actions
set playerAbilityFacingAngle(player number of (owner of triggering unit)) = (angle between position of triggering unit and target unit of ability being cast)
//playerAbilityFacingAngle is an array of reals
set playerAbilityOn(player number of (owner of triggering unit)) = true
//playerAbilityOn is an array of booleans
--ability triggers go here--
set playerAbilityOn(player number of (owner of triggering unit)) = false
//it's over!

enacting trigger:
events
every 0.02 seconds of game time

conditions
none

actions
for (each integer A from 1 to 12) do actions:
if (playerAbilityOn(player(for loop integer A)) equal to true
make (playerHero(for loop integer A)) face playerAbilityFacingAngle(for loop integer A)
//playerHero is an array of units that stores each player's hero
//so long as the appropriate player's playerAbilityOn variable is set to true, this trigger will execute for that player

and that's about it. it's kinda complicated, so if anyone has a shorter idea you may want to try theirs first. hope this helps.
 
Level 7
Joined
Feb 4, 2005
Messages
289
This complicated ? Not for me but.., i did it all and still doesnt work. I got a perfect idea since i usually make things work with as simple triggers as possible.

I need a variable to be - facing of unit 90 degrees of target point of ability being cast. In this way the unit wont face the point, but will turn in the degrees and the weapon will be aming the point since it's 90 degrees. I hope it excludes the possibility of other 90 (or 180 degrees) where the weapon wontf face the point but the opposite side of the point.

Or I just need to make the caster face 90 degrees of taget point of ... How ??
 
Level 5
Joined
Jun 17, 2006
Messages
114
ah, then instead of setting the angle toward the target point, set the agle toward the target point plus (or minus, depending on which you want) 90 degrees. if this still doesn't work then you probably just need some debugging. these triggers were not meant to be copied directly, you'll have to change them according the variables, etc. that you have specified.
 
Level 7
Joined
Feb 4, 2005
Messages
289
Ok i use:

Set set playerAbilityFacingAngle[(Player number of (Owner of (Triggering unit)))] = ((Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) + 90.00)

Still Nothing, can i offer you to send a map with the triggs, then you might make it work ?

I also add an ability flame that damages the units and when spell finishes i remove the ability, although doesnt work always. Can i send a map with these so that you can fix them pls ?
 
Level 7
Joined
Feb 4, 2005
Messages
289
Yes i made it the same + 90 degrees and nothing. Can i send you a map with it so that u can fix it ?
 
Status
Not open for further replies.
Top