Warcraft III resources & community, 2003–2006 · archived

Triggers2

10 posts
#1

Triggers2

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.
#2
1) how do you make the camera turn left if the unit turnes left so you will always see his back?

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?

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.
#3
:D Thanks a lot! :D
#4
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.
#5
Make unit face its current angle -/+ x degrees.
#6
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....
#7
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.
#8
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.
#9
You can create blank abilities, and use their shortcuts as keys [e.g. create an ability named Up, which does nothing, and give it shortcut "W". Then create a trigger handling its cast]
#10
Thaks again! :D