• 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.

Quick Question

Status
Not open for further replies.
Level 3
Joined
Aug 7, 2005
Messages
39
In my TD, i want to have it where players on force 1 are automatically a race of my pre-selection. If anyone could tell me how to do this, it would be greatly appreciated.
 
Level 3
Joined
Aug 7, 2005
Messages
39
Yes, for instance, I want all of the players on force 1 to be Undead. Is there anyway to do that?
 

Ralle

Owner
Level 79
Joined
Oct 6, 2004
Messages
10,182
Then you need to remove the action:
Code:
Melee Game - Create starting units (for all players)
from Map Initialization
You will then need to make some triggers like this:
Code:
Dialog Actions
    Events
        Dialog - A dialog button is clicked for Dialog
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtonUndead
            Then - Actions
                Player Group - Pick every player in Force[ForceNumber] and do (Actions)
                    Loop - Actions
                        Unit - Create 5 Acolyte for (Picked player) at ((Picked player) start location) facing Default building facing (270.0) degrees
                        Unit - Create 1 Tree of Life for (Picked player) at ((Picked player) start location) facing Default building facing (270.0) degrees
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Clicked dialog button) Equal to DialogButtonHuman
            Then - Actions
                Player Group - Pick every player in Force[ForceNumber] and do (Actions)
                    Loop - Actions
                        Unit - Create 5 Peasant for (Picked player) at ((Picked player) start location) facing Default building facing (270.0) degrees
                        Unit - Create 1 Town Hall for (Picked player) at ((Picked player) start location) facing Default building facing (270.0) degrees
            Else - Actions
        Set ForceNumber = 2
        Dialog - Change the title of Dialog to (Set race of Force  + (String(ForceNumber)))
        Dialog - Show Dialog for (Triggering player)
Code:
Dialog Setup
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Dialog - Change the title of Dialog to (Set race of Force  + (String(ForceNumber)))
        Dialog - Create a dialog button for Dialog labelled Undead
        Set DialogButtonUndead = (Last created dialog Button)
        Dialog - Create a dialog button for Dialog labelled Human
        Set DialogButtonHuman = (Last created dialog Button)
Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Melee Game - Use melee time of day (for all players)
        Melee Game - Limit Heroes to 1 per Hero-type (for all players)
        Melee Game - Give trained Heroes a Scroll of Town Portal (for all players)
        Melee Game - Set starting resources (for all players)
        Melee Game - Remove creeps and critters from used start locations (for all players)
        Melee Game - Run melee AI scripts (for computer players)
        Melee Game - Enforce victory/defeat conditions (for all players)
        Player Group - Add Player 1 (Red) to Force[1]
        Player Group - Add Player 2 (Blue) to Force[1]
        Player Group - Add Player 3 (Teal) to Force[2]
        Player Group - Add Player 4 (Purple) to Force[2]
I also made a demo map for you. You will need to specify all stuff so it matches your needs.
 

Attachments

  • workie.w3x
    13.5 KB · Views: 100
Level 3
Joined
Aug 7, 2005
Messages
39
Yeah, that would work if used the dialog box, but when you enter in some games, you will find, that the race will be set to an alliance that can not be altered. Are there anyways, without triggers, to do that?
 

Ralle

Owner
Level 79
Joined
Oct 6, 2004
Messages
10,182
yeah sure. look at this:
playerprops1pv.jpg

and
playerpropos0qo.jpg
 
Level 3
Joined
Aug 7, 2005
Messages
39
Yeah, i figured that, but when i test the game i will have possibly an Orcish Theme, a Human Theme, or Night Elf Theme, when it is supposed to be altered to an Undead Theme.
 
Status
Not open for further replies.
Top