• 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 help: Custom race selector

Status
Not open for further replies.
Level 14
Joined
Dec 12, 2009
Messages
1,027
Well, I have something similar on my map Erebus ( it's a hero select function). You'll need to rename a few things (not the variables themselves unless you really want to). Download it (see my sig), open up the trigger editor and look for the folder HeroSelect.

The first trigger is called HeroSelect and it deals with creating the dialog box and naming each of the buttons. Currently it's set up for 3 options - if you want more then you'd need to edit the HeroType[#] array to allow for more selections. You can name each of the buttons by editing the action Dialog - Create a dialog button for HeroSelect labelled <change the label to whatever you want>. Repeat for the other buttons.

The other triggers pertain to what happens after a player makes a selection or allows for a random selection. This section may not be the most efficient way of doing this... but I got it to work for me.

Copy & pasting from one map to another should auto-'transfer' all used variables. Let me know if I was too vague or I gave a bad directory - that way I don't confuse others in the future.

//\\oo//\\

Edit:
You can change the event for the HeroSelect trigger to something else, I have it set to go off at the beginning of the game with a 30second timer to make a selection before forcing an autoselect
 
Level 12
Joined
May 20, 2009
Messages
822
I would suggest just using Nirvana. It's a bit hard to learn but it's totally worth it for making custom races. You get to have custom UI, selectable at race-selection screen, it doesn't mess with original WC3 files, and if everyone has the same version of the mod then they can play it on Bnet without having to download maps so you get around 8MB limit in a sense.

But, if you really don't want to try and learn it then going with the trigger is totally fine.
 
Level 8
Joined
Oct 20, 2010
Messages
213
Well, I have something similar on my map Erebus ( it's a hero select function). You'll need to rename a few things (not the variables themselves unless you really want to). Download it (see my sig), open up the trigger editor and look for the folder HeroSelect.

The first trigger is called HeroSelect and it deals with creating the dialog box and naming each of the buttons. Currently it's set up for 3 options - if you want more then you'd need to edit the HeroType[#] array to allow for more selections. You can name each of the buttons by editing the action Dialog - Create a dialog button for HeroSelect labelled <change the label to whatever you want>. Repeat for the other buttons.

The other triggers pertain to what happens after a player makes a selection or allows for a random selection. This section may not be the most efficient way of doing this... but I got it to work for me.

Copy & pasting from one map to another should auto-'transfer' all used variables. Let me know if I was too vague or I gave a bad directory - that way I don't confuse others in the future.

//\\oo//\\

Edit:
You can change the event for the HeroSelect trigger to something else, I have it set to go off at the beginning of the game with a 30second timer to make a selection before forcing an autoselect


Appreciate you trying to help, but I was looking for a menu that would let you select a race at the start of the game, including custom races.
 
Level 8
Joined
Oct 20, 2010
Messages
213
I would suggest just using Nirvana. It's a bit hard to learn but it's totally worth it for making custom races. You get to have custom UI, selectable at race-selection screen, it doesn't mess with original WC3 files, and if everyone has the same version of the mod then they can play it on Bnet without having to download maps so you get around 8MB limit in a sense.

But, if you really don't want to try and learn it then going with the trigger is totally fine.

Thanks, I'll try this and get back to you.
 
Level 8
Joined
Oct 20, 2010
Messages
213
That's alright, I assumed you wanted a menu in-game - not before it.

//\\==//\\


Yes, I was looking for a menu in game, at the start of it. To select a race in a melee/altered melee map. But I assumed what you were saying was about selecting a hero, as in dota or any other map like that.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I attached it. It's the exact copy of the triggers in the thread you posted.
It is made to be as basic as it can be, however for efficiency and other things, changing it a bit might be good as well (mainly using your own unique integer variable for the "For each..." loop, instead of Integer A; and adding a fourth dialog button for "No change" that is just there to be clicked but has no effect on changing anything, as with how it is right now, you will be forced to pick one of the three new races (Races A to C) even if you want to play one of the standard ones.


Also, do not double post unless there is a 3 day difference between the new post and the last one, else edit your last post.
 

Attachments

  • Race Selection.w3x
    16.7 KB · Views: 418
Level 14
Joined
Dec 12, 2009
Messages
1,027
Yes, I was looking for a menu in game, at the start of it. To select a race in a melee/altered melee map. But I assumed what you were saying was about selecting a hero, as in dota or any other map like that.

The triggering for hero & race selecting in a game will be the same so far as the use of dialog boxes and the determination of which dialog buttons were clicked. They only differ in the actions performed and the naming of dialog buttons [if you're a stickler, then you'd change the variable names too].

Instead of using my actions for button selection you'd insert yours. Anything a user gives you here will require some rework on your part unless you're intent on giving us your map and having us make all the changes you want. My map has the system you're looking for, all you need to do is copy & paste it into your map and make a few text edits.

//\\oo//\\
 
Level 8
Joined
Oct 20, 2010
Messages
213
I attached it. It's the exact copy of the triggers in the thread you posted.
It is made to be as basic as it can be, however for efficiency and other things, changing it a bit might be good as well (mainly using your own unique integer variable for the "For each..." loop, instead of Integer A; and adding a fourth dialog button for "No change" that is just there to be clicked but has no effect on changing anything, as with how it is right now, you will be forced to pick one of the three new races (Races A to C) even if you want to play one of the standard ones.


Also, do not double post unless there is a 3 day difference between the new post and the last one, else edit your last post.

I've loaded up the map in Warcraft III, but when I start the game no dialogue comes up, and no original race actually spawns, leaving the map blank of any units. Is there a way I could fix this, or possibly you?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
as I wrote, I made just the copy of the triggers from the thread you posted. Those triggers actually do nothing as they are.
The reason is: First trigger has no event, so it is logical that no dialog buttons will appear, since the trigger is not even fired.
Adding an event "Time - Elapsed Game Time equal to 1.00 second" or similar time will show those dialog buttons after 1 second of ingame time.
Second, even if you press dialog buttons, nothing will happen at the moment.

Notice the If/Then/Else structures. The condition for each is that one of the dialog buttons is clicked, however there are no actions in the "Then" block.
The logic of the If/Then/Else is "if all conditions are met, do *things in Then block*, else do *things in Else block*".
In your case, "If dialog_button[0] has been clicked, then "Change race to race A", else "check other dialog buttons (this leads to other ITE structure)".

So what you need to do is basically remove all workers of player who clicked the button and his main building and replace them with the building of the new race and new workers. All of this has to be in the "Then" block for said race.
 
Status
Not open for further replies.
Top