Post by Hells Angel on Jul 13, 2005 18:17:53 GMT 1
Okay this tutorial is about setting up a dialog for picking your race. This kind of system is found in games such as Warcraft 4
Anyway for this tutorial you'll need the following material(s):
RmX17 AI
Note: Thsi is only for one one player (user) and one comp (players red and blue).
Trigger 1:
Events:
-Map initialization
Conditions:
-None
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)
-Trigger - Run Trigger 2 <gen> (checking conditions)
Trigger 2:
Events:
-None
Conditions:
-None
Actions:
-If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player 2 (Blue) slot status) Equal to Is playing) and ((Player 2 (Blue) controller) Equal to Computer)
Then - Actions
Melee Game - Create Human starting units for Player 2 (Blue) at (Player 2 (Blue) start location) (Exclude Heroes)
AI - Start melee AI script for Player 2 (Blue): war3mapImported\Human_(By_RmX17).ai
Else - Actions
Do nothing
Trigger 3:
Eevents:
-Time - Elapsed game time is 1.00 seconds
Conditions:
-None
Actions:
-Dialog - Change the title of Dialog to Choose Your Race
-Dialog - Create a dialog button for Dialog labelled Human
-Set Human = (Last created dialog Button)
-Dialog - Create a dialog button for Dialog labelled Orc
-Set Orc = (Last created dialog Button)
-Dialog - Create a dialog button for Dialog labelled Undead
-Set Undead = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Night Elf
-Set Night_Elf = (Last created dialog Button)
-Dialog - Show Dialog for Player 1 (Red)
Trigger 4:
Events:
-Dialog - A dialog button is clicked for Dialog
Conditions:
-(Clicked dialog button) Equal to Human
Actions:
-Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) + has choosen to be human)
-Melee Game - Create Human starting units for Player 1 (Red) at (Player 1 (Red) start location) (Exclude Heroes)
Trigger 5:
Events:
-Dialog - A dialog button is clicked for Dialog
Conditions:
-(Clicked dialog button) Equal to Orc
Actions:
-Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) + has choosen to be Orc)
-Melee Game - Create Orc starting units for Player 1 (Red) at (Player 1 (Red) start location) (Exclude Heroes)
Trigger 6:
Events:
-Dialog - A dialog button is clicked for Dialog
Conditions:
-(Clicked dialog button) Equal to Undead
Actions:
-Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) + has choosen to be Undead)
-Melee Game - Create Undead starting units for Player 1 (Red) at (Player 1 (Red) start location) (Exclude Heroes)
Trigger 7:
Events:
-Dialog - A dialog button is clicked for Dialog
Conditions:
-(Clicked dialog button) Equal to Night Elf
Actions:
-Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) + has choosen to be Night Elf)
-Melee Game - Create Night Elf starting units for Player 1 (Red) at (Player 1 (Red) start location) (Exclude Heroes)
Okay if you have an questions about Dialogs or about the triggering just ask and I'll so my best to answer them. Sry if there's any mistakes in this becuase I'm really rushing this so I can get down stairs and turn on Andromida. Anyway have fun ;D
Edit: Okay I made these triggers into a small map to show you all the triggering in actually content. here's the map also I edited the the script a bit to fix up some mistakes.
Anyway for this tutorial you'll need the following material(s):
RmX17 AI
Note: Thsi is only for one one player (user) and one comp (players red and blue).
Trigger 1:
Events:
-Map initialization
Conditions:
-None
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)
-Trigger - Run Trigger 2 <gen> (checking conditions)
Trigger 2:
Events:
-None
Conditions:
-None
Actions:
-If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Player 2 (Blue) slot status) Equal to Is playing) and ((Player 2 (Blue) controller) Equal to Computer)
Then - Actions
Melee Game - Create Human starting units for Player 2 (Blue) at (Player 2 (Blue) start location) (Exclude Heroes)
AI - Start melee AI script for Player 2 (Blue): war3mapImported\Human_(By_RmX17).ai
Else - Actions
Do nothing
Trigger 3:
Eevents:
-Time - Elapsed game time is 1.00 seconds
Conditions:
-None
Actions:
-Dialog - Change the title of Dialog to Choose Your Race
-Dialog - Create a dialog button for Dialog labelled Human
-Set Human = (Last created dialog Button)
-Dialog - Create a dialog button for Dialog labelled Orc
-Set Orc = (Last created dialog Button)
-Dialog - Create a dialog button for Dialog labelled Undead
-Set Undead = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Night Elf
-Set Night_Elf = (Last created dialog Button)
-Dialog - Show Dialog for Player 1 (Red)
Trigger 4:
Events:
-Dialog - A dialog button is clicked for Dialog
Conditions:
-(Clicked dialog button) Equal to Human
Actions:
-Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) + has choosen to be human)
-Melee Game - Create Human starting units for Player 1 (Red) at (Player 1 (Red) start location) (Exclude Heroes)
Trigger 5:
Events:
-Dialog - A dialog button is clicked for Dialog
Conditions:
-(Clicked dialog button) Equal to Orc
Actions:
-Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) + has choosen to be Orc)
-Melee Game - Create Orc starting units for Player 1 (Red) at (Player 1 (Red) start location) (Exclude Heroes)
Trigger 6:
Events:
-Dialog - A dialog button is clicked for Dialog
Conditions:
-(Clicked dialog button) Equal to Undead
Actions:
-Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) + has choosen to be Undead)
-Melee Game - Create Undead starting units for Player 1 (Red) at (Player 1 (Red) start location) (Exclude Heroes)
Trigger 7:
Events:
-Dialog - A dialog button is clicked for Dialog
Conditions:
-(Clicked dialog button) Equal to Night Elf
Actions:
-Game - Display to (All players) for 10.00 seconds the text: ((Name of Player 1 (Red)) + has choosen to be Night Elf)
-Melee Game - Create Night Elf starting units for Player 1 (Red) at (Player 1 (Red) start location) (Exclude Heroes)
Okay if you have an questions about Dialogs or about the triggering just ask and I'll so my best to answer them. Sry if there's any mistakes in this becuase I'm really rushing this so I can get down stairs and turn on Andromida. Anyway have fun ;D
Edit: Okay I made these triggers into a small map to show you all the triggering in actually content. here's the map also I edited the the script a bit to fix up some mistakes.