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

[Trigger] movement + camera bounds

Status
Not open for further replies.
Level 7
Joined
Oct 6, 2006
Messages
293
Need help figuring out a triggering system that will move units without using the move command. That why I can have the unit facing the same direction all the time while moving up,down,left,right.

The second one giving trouble is setting a moving camera bound. Trying to set it to a moving unit so that the camera bounds move with the unit but ive never done this before.

*edit* Third one lol
Making a trigger that when i cast an ability it creates a unit at like point 5,0 of triggering unit. Then commands it to move offset of triggering unit like 90,0. Then im trying to make it so if it collides with an ally unit it just disapears but if it comes in range of a enemy unit it does damage. If it doesnt collide its removed. Like a bullet being shot out.

Any help :)?
 
Last edited:
Level 7
Joined
Oct 6, 2006
Messages
293
Yea it was kinda vague.

The first is i want to move a unit using like point offsets +1 or w/e to instantly move unit to point. Like i press left arrorw, unit instantly moved to point every .5 seconds. Its instantly moving him without using the move command.

And the second is setting a camera bound, not quite locking a camera to char. Its like i want a char to constantly be moving across the screen with camera bounds locked to it. Think of a sidescrolling shooting game back in the snes days. You cant go past the screen right or left but u can move around in middle.

I sorta almost know how to do the first but it will have to use variables that im not quite familiar with yet.

I played a game recently that has a moving camera bounds for everyone and u have to keep moving through obstacles to the right cuz if the left side of the camera bounds catches up to you, you die.
 
ok, for the first one, you can use move unit instantly (to point with polar offset) to position of (your unit) offset by 20 toward (it depends, the angle, if you are pressing the right key, then it would be 0 degrees, right key, 180)

i think you mean for the camera, that you want the camera to move if your character goes too far to the right, then the camera will start scrolling right? or that the camera keeps going? which one?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
1. You pretty much told yourself what you need to do :wink:
  • Unknown
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
    • Conditions
    • Actions
      • Set TempLoc1 = (Position of No unit)
      • Set TempLoc2 = ((Position of No unit) offset by (5.00, 0.00))
      • Unit - Move Your_Unit instantly to TempLoc2, facing (Facing of Your_Unit) degrees
      • Custom script: call RemoveLocation( udg_TempLoc1)
      • Custom script: call RemoveLocation( udg_TempLoc2)
No leaks :thumbs_up:

2. Know what you are talking about... don't know how to make it :hohum:

3. 1st trigger.
  • Unknown
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
  • Conditions you want
    • Actions
      • Set TempLoc1 = (Position of (Triggering unit))
      • Set TempLoc2 = (TempLoc1 offset by 40.00 towards (Facing of (Triggering unit)) degrees)
      • Unit - Create 1 Shot for Player 1 (Red) at TempLoc2 facing (Facing of (Triggering unit)) degrees
      • Custom script: Call removelocation( udg_TempLoc1)
      • Custom script: Call removelocation( udg_TempLoc2)
Second trigger
  • Unknown
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set Shots = (Units of type Shot)
      • Unit Group - Pick every unit in Shots and do (Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 10.00 towards (Facing of (Picked unit)) degrees)
(dunno how to do this leakless :thumbs_down:)

For the shot getting close to enemy/ally + effects I don't know any usefull way with pure triggers.
You can make (I think its pretty usefull and easy) an aura for the shot's unit and make it to be very small AoE (like 50-100 ?), then when a unit gets the buff of the aura you can say "If unit with buff is enemy do ---, If unit with buff is ally do ---)
Here's a trigger for example

  • Unknown
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set All_Units = (Units in (Playable map area))
      • Unit Group - Pick every unit in All_Units and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Shot_Buff) Equal to True
            • Then - Actions
              • If (((Picked unit) belongs to an ally of Player 1 (Red)) Equal to True) then do (-------- Actions for allies --------) else do (Do nothing)
            • Else - Actions
              • -------- Actions for enemys --------
I think this should work fine, but it requires you to have something diffrent beetwin the shots.
It can be aura's for example.

Hope I helped.
 
Last edited:
Status
Not open for further replies.
Top