• 🏆 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!

[Trigger] Keyboard Event Spawn

Status
Not open for further replies.
Level 4
Joined
Sep 2, 2006
Messages
99
I am having a little trouble, I want to make it so when the player presses an Arrow Key a Hero spawns, ok I got that. But I also want them to be able to press a different Arrow Key to spawn a different Hero, ok got that too, but what I am having trouble with is that my way would take a lot longer than typing this and asking this question to see if there is in fact a quicker way.

Right now this is what I have
NecroSpawn
Events
Player - Player 1 (Red) Presses the Up Arrow key
Conditions
Actions
Unit - Create 1 Necromancer (Balanced) for (Triggering player) at ((Triggering player) start location) facing (Center of (Playable map area))
Unit - Create 3 Raised Dead (All) for (Triggering player) at ((Triggering player) start location) facing (Center of (Playable map area))
Trigger - Turn off (This trigger)

So Basically I want so when the player presses Left/Right Arrows a Different Hero will spawn, and obviously turn off all the other options so you can't exploit the trigger.
If you are reading this and know how to also make the Down Arrow Spawn a one of three heroes as well, that would be
great.

I do know I could duplicate this trigger twice for each Player, but that would be thirty triggers..
 
Last edited:
Level 22
Joined
Jun 24, 2008
Messages
3,050
  • NecroSpawn
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
      • Actions
        • Unit - Create 1 Necromancer (Balanced) for (Triggering player) at ((Triggering player) start location) facing (Center of (Playable map area))
        • Unit - Create 3 Raised Dead (All) for (Triggering player) at ((Triggering player) start location) facing (Center of (Playable map area))
        • Trigger - Turn off (This trigger)
You leak terribly.
 
Level 7
Joined
Oct 8, 2008
Messages
200
If you want it for more player then just do this
  • NecroSpawn
  • Events
  • Player - Player 1 (Red) Presses the Up Arrow key
  • Player - Player 2 (Blue) Presses the Up Arrow key
  • Player - Player 3 (Teal) Presses the Up Arrow key
  • Conditions
  • Actions
  • Unit - Create 1 Necromancer (Balanced) for (Triggering player) at ((Triggering player) start location) facing (Center of (Playable map area))
  • Unit - Create 3 Raised Dead (All) for (Triggering player) at ((Triggering player) start location) facing (Center of (Playable map area))
  • Trigger - Turn off (This trigger)
 
Level 24
Joined
Jun 16, 2008
Messages
1,939
if u want it to work for each player one time for one unit, make one trigger for each player

u could also do one trigger for all 4 possibilities using conditions (i gues one player shall get only one hero, right?)

do it like this, make events for every arrow key and check which one was used, give the hero to the player depending on that
 
Level 24
Joined
Jun 16, 2008
Messages
1,939
blizzard suxx

hm, if not, blizzard forgot something again

maybe search under players? i will check that immediately



EDIT: Blizzard did forget something :hohum:

so, easiest thing would be to make more than one trigger, in this case 4 damn triggers for each damn player, a lot of copying and pasting, not rly funny

second thing would be, if u have umswe, u can check the event which fired off, but u need the jass code of it....
u could ask somebody for that ^^

another idea i just had is that u can make another event which activates the trigger a maximum of one time for a player, so that he wouldnt be able to use the arrow keys again

anothe idea: THIS SYSTEM IS SHIT!!! nothing against u, but i used this in my first map, and it turned out..............bad

just an advice, use another hero pick system
 
Last edited:
Status
Not open for further replies.
Top