HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

9 Races Mod

08-25-2004, 03:58 PM#1
Draec
i'm making a mod with 9 races in, humans, high elves, orcs, fel orcs, undead, night elves, corrupted night elves, naga and goblins.

as i've found out elsewhere, the ingame selection menu for units is hardcoded into the game, so editing that isn't an option, but i was wondering if i could get round that by using a trigger similar to one used in a 'hero arena' or similar map, where the desired unit chosen is spawned, only in this case, it would be a random selection of 10 predefined locations, spawning 5 of the unit (the worker of the race) and the town centre that matches it.

i know this is kinda a complicated question, but really it's like a slightly more complicated hero arena map, if anyone can help, i'd be very heppy lol!

thanks
Draec
08-25-2004, 04:32 PM#2
fugly
ok very simply do this
create 3 variables
1 is an integer that we are going to call x
1 is a unit type array that will hold the town center types we will call towntype
1 is a unit type array that will hold the worker's unit type we will call this workertype

now set the arrays like so

towntype[1] == orc townhall
workertype[1] == orc workers

towntype[2] == fel orc townhall
workertype[2] == fel orc workers

and so on,


now delete the actions in the game init triggers that create units and make put these actions in their place

set x = Random Int from 1-9
Create 1 towntype[x]
Create 5 workertype[x]

and that should do it, gl hf ;)
08-25-2004, 04:42 PM#3
sweet5
or u coulda just use dialogs at start up to pick ur race O.o
08-25-2004, 06:43 PM#4
DeaconRaptor
Quote:
Originally Posted by sweet5
or u coulda just use dialogs at start up to pick ur race O.o

how could you do this?
08-25-2004, 07:33 PM#5
sweet5
just make a dialog and 9 buttons and set all nine to 1 array and also set ur regions to an array, oh and a string array to check if the spot is taken. Then say

lets say for this example button[1] = human
and u have 5 random regions
Code:
Event - Dialog button click

Condtions - Dialog button = Button[1]

Actions - 
set race for trigger player = human
pick a random # between 1-5
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif

repeate for as many times as necicasry, I think 9 lol
08-25-2004, 07:42 PM#6
DeaconRaptor
is there a way to make a choose civ dialog box without using a JASS editor? just using the trigger editor I mean.
08-25-2004, 07:48 PM#7
sweet5
uh none of what I said was JASS o_O
08-25-2004, 07:53 PM#8
DeaconRaptor
Quote:
Originally Posted by sweet5
uh none of what I said was JASS o_O

ok lol.........have you guessed Im new to this yet?

but, how could you make a dialog option box to choose your civ........using only the trigger editor that Blizz included? I dunno how to use any of this code stuff yet, but I can get around halfway decently in the Editors.
08-26-2004, 02:03 AM#9
Bluemage427
Alrighty I'm not sure if you need TFT for the dialog boxes, but I don't think you do... Here's the code to make a dialog box with the nine buttons...
Code:
Race Dialog Box
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Dialog - Create a dialog button for RaceDialog labelled Humans
        Set Button[1] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Night Elves
        Set Button[2] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Orcs
        Set Button[3] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Fel Orcs
        Set Button[4] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Undead
        Set Button[5] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Goblins
        Set Button[6] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Corrupted Night Elv...
        Set Button[7] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled High Elves
        Set Button[8] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Naga
        Set Button[9] = (Last created dialog Button)
        Dialog - Show RaceDialog for Player 1 (Red)
        Dialog - Show RaceDialog for Player 2 (Blue)
        Dialog - Show RaceDialog for Player 3 (Teal)
        Dialog - Show RaceDialog for Player 4 (Purple)
        ...
        just keep going until you diplay it for all the players you want
Then you just use the code sweet5 gave you to actually make the town halls and workers... if you have any problems just ask.
Oh yea "RaceDialog" is a variable of the "dialog" type and "Button" is a variable array of the "dialog button" type with a size of 9.
08-26-2004, 09:26 AM#10
Draec
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]

is one of them wrong? should they both be called region or random? surely regioun, because you've already fixed the location above? if i'm being a wc n00b go easy on me ;)

*EDIT*

won't compile, billions of errors :(

Code:
function Race Dialog Box
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Dialog - Create a dialog button for RaceDialog labelled Humans
        Set Button[1] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Orcs
        Set Button[2] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Undead
        Set Button[3] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Night Elves
        Set Button[4] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Fel Orcs
        Set Button[5] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Goblins
        Set Button[6] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Corrupted Night Elves
        Set Button[7] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled High Elves
        Set Button[8] = (Last created dialog Button)
        Dialog - Create a dialog button for RaceDialog labelled Naga
        Set Button[9] = (Last created dialog Button)
        Dialog - Show RaceDialog for Player 1 (Red)
        Dialog - Show RaceDialog for Player 2 (Blue)
        Dialog - Show RaceDialog for Player 3 (Teal)
        Dialog - Show RaceDialog for Player 4 (Purple)
        Dialog - Show RaceDialog for Player 5 (Yellow)
        Dialog - Show RaceDialog for Player 6 (Orange)
        Dialog - Show RaceDialog for Player 7 (Pink)
        Dialog - Show RaceDialog for Player 8 (Green)
        Dialog - Show RaceDialog for Player 9 (Grey)

Event - Dialog button click

Condtions - Dialog button = Button[1]

Actions - 
set race for trigger player = human
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif

Event - Dialog button click

Condtions - Dialog button = Button[2]

Actions - 
set race for trigger player = Orc
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif

Event - Dialog button click

Condtions - Dialog button = Button[3]

Actions - 
set race for trigger player = Undead
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif

Event - Dialog button click

Condtions - Dialog button = Button[4]

Actions - 
set race for trigger player = Night Elf
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if 

Event - Dialog button click

Condtions - Dialog button = Button[5]

Actions - 
set race for trigger player = Fel Orc
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif

Event - Dialog button click

Condtions - Dialog button = Button[6]

Actions - 
set race for trigger player = Goblins
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif

Event - Dialog button click

Condtions - Dialog button = Button[7]

Actions - 
set race for trigger player = Corrupted Night Elf
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif

Event - Dialog button click

Condtions - Dialog button = Button[8]

Actions - 
set race for trigger player = High Elf
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif

Event - Dialog button click

Condtions - Dialog button = Button[9]

Actions - 
set race for trigger player = Naga
pick a random # between 1-9
if 1 picked and taken[1] = not then
set taken[1] = taken
create 1 town hall for triggering player at random[1]
create 5 peasents for triggering player at region[1]
else if do nothing
endif
endfunction

tell me if i'm doing it wrong ;)
08-26-2004, 01:52 PM#11
Bluemage427
Alright... the way I would do it, which seemed the easiest for me, was this:
Code:
Make Town Hall and Peasants
    Events
        Dialog - A dialog button is clicked for RaceDialog
    Conditions
        (Clicked dialog button) Equal to Button[1]
    Actions
        For each (Integer A) from 1 to 9, do (Actions)
            Loop - Actions
                Set Place = (Integer A)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Taken[Place] Equal to not
                        Exists[(Player number of (Triggering player))] Equal to doesn't
                    Then - Actions
                        Unit - Create 1 Town Hall for (Triggering player) at (Center of Region[Place]) facing Default building facing degrees
                        Unit - Create 1 Peasant for (Triggering player) at (Center of Region[Place]) facing Default building facing degrees
                        Unit - Create 1 Peasant for (Triggering player) at (Center of Region[Place]) facing Default building facing degrees
                        Unit - Create 1 Peasant for (Triggering player) at (Center of Region[Place]) facing Default building facing degrees
                        Unit - Create 1 Peasant for (Triggering player) at (Center of Region[Place]) facing Default building facing degrees
                        Unit - Create 1 Peasant for (Triggering player) at (Center of Region[Place]) facing Default building facing degrees
                        Set Taken[Place] = taken
                        Set Exists[(Player number of (Triggering player))] = does
                    Else - Actions
                        Do nothing
This trigger uses 6 variables which are: "Button", dialog button type, array, size 9, initial value: -None-; "Exists", string type, array, size 9, initial value: "doesn't"; "Place", integer type, initial value: 0(default); "RaceDialog", dialog type, initial value: New Dialog(default); "Region", region type, array, size 9, initial value: no region; "Taken", string type, array, size 9, initial value: not. Just copy and paste this trigger 8 more times and change the button number for each as well as the actual units created. Oh yea... you need to make the 9 regions and assign each region to a variable in the "region" array, too. If you need help with that too just lemme know.
08-26-2004, 03:42 PM#12
sweet5
Bluemage thats basically what I said...just in real GUI lol, I just didnt do mine in real GUI cause I was working on another map =P
08-26-2004, 07:27 PM#13
Shimrra
Or could just have everyone start with a building that with nine researches and then when ou research a particualar reseach, it replaces the building with the proper town hall and creates the workers.

I would also suggest you combine the Fel Orcs and the Corrupt NE, thow ina few demons and call it the Burning Legion Remnant. Otherwise its a bit redundant...