• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Triggers2

Status
Not open for further replies.
Level 4
Joined
Jun 11, 2005
Messages
73
I need help with trigers:
1) how do you make the camera turn left if the unit turnes left so you will always see his back?
2)how do u make a unot to walk forward so he will go to the left only if he is turned to the left?
3)is it possible to meke the player control the carema with the mouse?
4)how do you make a unit attack the air and if someone is close then hurt him?

plz help.
 
Level 6
Joined
Mar 18, 2005
Messages
153
1) how do you make the camera turn left if the unit turnes left so you will always see his back?
Code:
3rdpersoncam
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Camera - Lock camera target for (player who's supposed to have 3rd person cam) to TheWatchedUnit, offset by (0.00, 0.00) using Default rotation
Camera - Set (player who's supposed to have 3rd person cam)'s camera Rotation to (Facing of TheWatchedUnit) over 1.50 seconds
the 1.5 is just a smoothing factor because its applied each 0.1 seconds. feel free to fiddle with the values. you might also want to change the pitchangle before.

2)how do u make a unot to walk forward so he will go to the left only if he is turned to the left?
Code:
Unit - Order TheWatchedUnit to Move To ((Position of (TheWatchedUnit)) offset by 400.00 towards (Facing of (TheWatchedUnit)) degrees)
use unit - issue order targeting a point and point with polar offset for this one.


3)is it possible to meke the player control the carema with the mouse?
i dont think so. not in a direct way since u cant get the mousemovement values.

4)how do you make a unit attack the air and if someone is close then hurt him?
there are different ways to do this. one would be an invisble projectile with aoe on impact targeting the ground in front of the unit - artillerystyle (to trigger this use polar offset again). i think that'd be the easiest way. of course you can just use unit animation attack and check for range and angle to nearby units but thats way more complicated.
 
Level 4
Joined
Jun 11, 2005
Messages
73
oh and i forgot one thing

I can't find a good trigger that will make the unit turn left if you press left i can only find:
if you press left the unit turnes left but only for some degrees and if you press left again he will face the sama dagress.
 
Level 6
Joined
Aug 29, 2004
Messages
159
I believe there is a full 3rd persone shooter system available on wc3campaigns. I remember watching a demo clip of it and being really impressed. Just watch out that such games often suffer from a bit of lag as the game responds to the pressing of buttons.
Another way of shooting would be to use a dummy unit as a projectile. Not sure if this would be easier or harder....
 
Level 4
Joined
Jun 11, 2005
Messages
73
Is there a way to use more buttons then left right up down and escape?
I'm having a problem with the attack buttons.
i have no more buttons avaliable.
 
Level 4
Joined
Jun 11, 2005
Messages
73
Is there a way to use more buttons then left right up down and escape?
I'm having a problem with the attack buttons.
i have no more buttons avaliable.
 
Status
Not open for further replies.
Top