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

Need help with a trigger...

Status
Not open for further replies.
Level 3
Joined
Jun 12, 2011
Messages
21
I've been trying to work on an RPG map of my own,and I'm having 2 problems:

1)How do I make my initial hero picking using a tavern. I would like to make a hero chooser with a tavern (or similar structure) and have the hero spawn, then walk through a waygate to the first area.

2)How do I respawn the hero after death?

Any help would be appreciated,thanks!
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I will create those systems right now, once I've got them down, I'll update this post and attach the demo-map.

Edit: map added. I've commented out what seemed important. I did not want to comment the hashtables because they're rather abstract structures (you'll learn how to use them in time, but it seems a little bit too soon for that).
Note: if the map doesn't save correctly, check if you have the variable "handleID", which should be an integer variable (this variable might not copy correctly).

It's rather basic, but I hope you like it.
 

Attachments

  • HeroStuff.w3x
    17.1 KB · Views: 30
Last edited:
Level 9
Joined
Apr 23, 2011
Messages
460
I actually have copies of these for my current map. Sorry if it's not as good as ap0calypse's but it works for me :D Btw this is not a cut paste out of my map, i changed it a bit just cuz it saves space.
  • Map Start Up
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Random Heroes --------
      • Set Random[1] = Paladin
      • Set Random[2] = Archmage
      • Set Random[3] = Mountain King
      • Set Random[4] = Blood Mage
      • Set Random[5] = Blademaster
      • Set Random[6] = Far Seer
      • Set Random[7] = Tauren Chieftain
      • Set Random[8] = Shadow Hunter
      • Set Random[9] = Death Knight
      • Set Random[10] = Lich
      • Set Random[11] = Dreadlord
      • Set Random[12] = Crypt Lord
      • Set Random[13] = Keeper of the Grove
      • Set Random[14] = Priestess of the Moon
      • Set Random[15] = Demon Hunter
      • Set Random[16] = Warden
      • Set Random[17] = Alchemist
      • Set Random[18] = Naga Sea Witch
      • Set Random[19] = Tinker
      • Set Random[20] = Beastmaster
      • Set Random[21] = Dark Ranger
      • Set Random[22] = Firelord
      • Set Random[23] = Pandaren Brewmaster
      • Set Random[24] = Pit Lord
      • Set Random[25] = Nerubian Battlelord
      • Set Random[26] = Mystic Priest
      • Set Random[27] = Nova Sire
      • -------- Player Setup --------
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Wisp for (Picked player) at (Center of Start Zone <gen>) facing Default building facing degrees
          • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across Start Zone <gen>
      • Set Players_Playing = (All players controlled by a User player)
  • Hero Select
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Not equal to Random
        • Then - Actions
          • Set temp_Hero = (Unit-type of (Sold unit))
          • Unit - Remove (Sold unit) from the game
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by (Owner of (Sold unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Wisp
                • Then - Actions
                  • Unit - Remove (Picked unit) from the game
                  • Unit - Create 1 temp_Hero for (Owner of (Sold unit)) at (Center of Hero Spawn <gen>) facing Default building facing degrees
                  • Camera - Pan camera for (Owner of (Sold unit)) to (Center of Hero Spawn <gen>) over 0.00 seconds
                  • Visibility - Create an initially Enabled visibility modifier for (Owner of (Buying unit)) emitting Black mask across Start Zone <gen>
                  • Player - Set (Owner of (Buying unit)) Current gold to 250
                • Else - Actions
        • Else - Actions
  • Random
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Random
    • Actions
      • Unit - Remove (Sold unit) from the game
      • Unit - Create 1 Random[(Random integer number between 1 and 27)] for (Owner of (Sold unit)) at (Center of Hero Spawn <gen>) facing Default building facing degrees
      • Camera - Pan camera for (Owner of (Buying unit)) to (Center of Hero Spawn <gen>) over 0.00 seconds
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Buying unit)) emitting Black mask across Start Zone <gen>
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Owner of (Sold unit)) of type Wisp) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Player - Set (Owner of (Buying unit)) Current gold to 500
Just in the startup change the heroes to whatever you want. Startup is really for the Random, but oh well.

EDIT: I'm sorry should have clarified that. I use Random for the random hero trigger, and I just made sure the unit bought wasn't random. I don't really know why. I needed to because otherwise I would have to do If/Then/Else for every hero, and having 27 currently, that's a waste. :p
 
Last edited:
Level 3
Joined
Jun 12, 2011
Messages
21
Okay guys!Thanks for the help.Its my first time diving into RPG-like triggers,really appreciate all of ya.ap0calypse Can't wait for your demo map :D

Edit:khamarr,I went through your triggers,and may I ask which category is (Unit-type of (Sold unit)) Not equal to Random under?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I uploaded the map, it's not really highly advanced, but I can add anything you want to it (didn't want to add too much, that could make it too complicated to start out).
There are quite a few "custom scripts" in it, but just ignore those for the time being ^^ Some of them are so the system doesn't bug when a lot of heroes die, others are to reduce lag.

"(Unit-type of (Sold unit)) Not equal to Random" is under Condition -> Unit-type comparison
"Random" is probably a unit he made in the object editor (for when you want to choose a random unit).

I didn't include random units because I... kinda forgot about it :|

Khamarr, you leak locations by the way (edit: and a player group leak, I read "all players" first - which doesn't leak, but it is "all players controlled by a user player", which does leak).
 
Level 3
Joined
Jun 12, 2011
Messages
21
Thanks ap0calypse.But...a noob question..where do I get your uploaded map xD

Edit:Oh okay didn't realise it was up there,haha
 
Level 3
Joined
Jun 12, 2011
Messages
21
wow ap0calypse,I can't thank you enough.Just read it through for a few minutes and I know this will solve a lot of my problems.Thanks again!
 
Status
Not open for further replies.
Top