• 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] How to block the mouse event?

Status
Not open for further replies.
Level 1
Joined
Dec 2, 2007
Messages
3
Dear All helpers,

I would like to block the mouse event so that it doesn't allow the player to click the mouse to move his character anywhere in the game. Why i would like to block the mouse event is because i just want the player to use the arrow keys to move the characters ...Can anyone help???

Besides, The second question is I would like the character to stop moving down once it is blocked by something e.g :wall if the player continues to press the left arrow as see below, can anyone know how to do it?

(wall)
|
| <---How to make the character to be blocked by the wall if it continues
| to press the left arrow
| instead of moving down to the bottom (As the world warcraft once
| detects the character is blocked , it will make that character to
| move down to bottom by default)
|
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
1st question:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(move))
    • Actions
      • Unit - Order (Triggering unit) to Stop

2nd question

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
    • Conditions
    • Actions
      • Set Point[(Player number of (Triggering player))] = (Position of (Triggering unit))
      • Set Point[((Player number of (Triggering player)) + 10)] = (Point[(Player number of (Triggering player))] offset by 50.00 towards 270.00 degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at Point[((Player number of (Triggering player)) + 10)] of type Walkability is off) Equal to True
        • Then - Actions
          • Unit - Order (Last created unit) to Move To Point[((Player number of (Triggering player)) + 10)]
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Point[GetConvertedPlayerId(GetTriggerPlayer())])
      • Custom script: call RemoveLocation(udg_Point[( GetConvertedPlayerId(GetTriggerPlayer()) + 10 )])

The problem in this is that the first trigger blocks the second one :/
There's sure a way to make it work though.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
knock knock
you forgot
Disable Move Preventring Trigger
order to mvoe
enable move preventing trigger
 
Level 9
Joined
May 27, 2006
Messages
498
Some time ago i was working on map where u had to move your character left or right using arrow keys and fire projectiles using up arrow key... Anyway, i made it work by putting two paladins, the first one that can be seen, with swarm ability, and a second one, that had scale 0.1, was selected all the time, it was moved every 0.3 sec to the position of the first pala... Similar system was in Blizzard`s Death Sheep.

And, in making of my map i didn`t think about the solution that Need_O2 have suggested ;P

@Blocking unit
Put 2 dummies on the walls, and make trigger:
  • Events:
    • Unit - A unit enters a rectangle centered at position of dummy1 (100, 100)
    • Unit - A unit enters a rectangle centered at position of dummy2 (100, 100)
  • Conditions:
    • Triggering unit equal to YourHero
  • Actions:
    • Unit - Order unit to stop
 
Status
Not open for further replies.
Top