Hey, im very very very new to map making. Been watching basic tutorials on youtube for the last 10 hours to learn the ropes on this stuff. I've been looking for a way to take a custom hero u make (multiple actually), and provide a window upon map initialization that you can select a hero to spawn into the map with. Not sure if this is a triggered event, but i figure it is. Any idea how maps like Hero-wars or the like accomplish this task?
1. Create a dialog
2. save dialog in a global variable (global means that it is defined where you add triggers and folders, it can be used everywhere in your triggers then)
3. add dialog items with the type button to the dialog
4. save the buttons in global variables. If you tick the array flag in a variable's definition, then you can make a list out of it. Then, if you store or read a value, you need to specify which position in the list you want to use. So, if you have 4 heroes, use an array of the size 4 in its definition and save the buttons in 1 to 4.
5. show the dialog to the players
-
6. Create a trigger with the event "Any player used dialog item clicked"
7. Check which saved button was used. Also, check if the dialog is visible for the player.
8. Hide the dialog for the player that used a button of that dialog. Then create the correct hero depending on the button used.
Arrays actually start from 0, but 1 might be easier to understand.
Hey, im very very very new to map making. Been watching basic tutorials on youtube for the last 10 hours to learn the ropes on this stuff. I've been looking for a way to take a custom hero u make (multiple actually), and provide a window upon map initialization that you can select a hero to spawn into the map with. Not sure if this is a triggered event, but i figure it is. Any idea how maps like Hero-wars or the like accomplish this task?
1. Create a dialog
2. save dialog in a global variable (global means that it is defined where you add triggers and folders, it can be used everywhere in your triggers then)
3. add dialog items with the type button to the dialog
4. save the buttons in global variables. If you tick the array flag in a variable's definition, then you can make a list out of it. Then, if you store or read a value, you need to specify which position in the list you want to use. So, if you have 4 heroes, use an array of the size 4 in its definition and save the buttons in 1 to 4.
5. show the dialog to the players
-
6. Create a trigger with the event "Any player used dialog item clicked"
7. Check which saved button was used. Also, check if the dialog is visible for the player.
8. Hide the dialog for the player that used a button of that dialog. Then create the correct hero depending on the button used.
Arrays actually start from 0, but 1 might be easier to understand.
Thanks, figured it all out from your help. Kudos