| 02-03-2005, 03:32 AM | #1 |
How can you do this? I found several ways how to do it by brainstorming, but I don't know how to do it. :( 1. Based on the number of human controlled players are playing determines which hostile units will be removed from the game. But the units are manually chosen. 2. Using the "Easy, Normal, Hard" existing difficulties that automattically adjust to how many human players are playing, removing units to which difficulty. 3. Make a dialog box that shows the following difficulties: Novice (Easy) Apprentice (Normal) Elite (Hard) Prince (Very Hard) Depending on what dialog box is picked, determines which units are manually removed from the game. I'd really appreciate your help if you could tell me what to do for one them. Thanks. ^_^ |
| 02-03-2005, 06:08 AM | #2 |
I'll get you started on the basics for each of these. You kind of wrote them in reverse order to how i want to answer them though, so they're getting answered backwards First, #3) Basically, you're going to create a dialog through a trigger. You'll need to create a couple variables -- one array that will represent each button that will be clicked, and one for the dialog itself. This probably sounds a little confusing, but it's not so bad. Here's an example. Trigger 1: Create your Dialog This trigger creates and then shows a Dialog that allows players to vote on Game Time. The btnDialog variable is a DialogButton array. Basically what happens is I give them 6 options to vote on. After I create an option, I set a btnDialog to that button. DlgGameTime is a Dialog type variable. Note that this trigger has no events. You will need to run this trigger using Trigger - Run Trigger. I'd suggest using the "Game Time - Elapsed game time is .5 seconds" event. The Advanced code is a safety mechanism I added. Basically, after 15 seconds, it checks to make sure they have voted. If they have not, it sets the game time to a default. It does this by using a boolean variable. The boolean is defaulted to false, meaning they have not voted, but in Trigger #2 I set it to true. Code:
Game Time Dialog
Events
Conditions
Actions
Dialog - Clear dlgGameTime
Dialog - Change the title of dlgGameTime to Game Time
Dialog - Create a dialog button for dlgGameTime labelled No Time Limit
Set btnDialog[0] = (Last created dialog Button)
Dialog - Create a dialog button for dlgGameTime labelled 10 Minute Game
Set btnDialog[1] = (Last created dialog Button)
Dialog - Create a dialog button for dlgGameTime labelled 20 Minute Game
Set btnDialog[2] = (Last created dialog Button)
Dialog - Create a dialog button for dlgGameTime labelled 30 Minute Game
Set btnDialog[3] = (Last created dialog Button)
Dialog - Create a dialog button for dlgGameTime labelled 45 Minute Game
Set btnDialog[4] = (Last created dialog Button)
Dialog - Create a dialog button for dlgGameTime labelled 60 Minute Game
Set btnDialog[5] = (Last created dialog Button)
Dialog - Show dlgGameTime for Player 1 (Red)
[color=red]Advanced
Wait 15.00 game-time seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
blnDialogTimeClicked Equal to True
Then - Actions
Else - Actions
Dialog - Hide dlgGameTime for Player 1 (Red)
Set intGameModeTime = 0
Trigger - Run Game Mode Dialog <gen> (ignoring conditions)
[/color]Trigger 2: Respond to a button Click This trigger runs whenever a button is clicked for the Dialog created above. I use an Integer type variable to track my game time selection (I suggest you do the same for game difficulty). This is a slightly advanced way of doing things...but basically what happens is that it runs through trying to find what the number is for the button that was clicked (this number is called an index). When it finds the right one, it sets the gametime to that number. As an example, lets say the player clicked 10 Minutes. If you look back at the first dialog, the index for 10 Minutes is 1. This will loop through and when it finds out btnDialog[1] was clicked, it sets intGameModeTime to 1. Hopefully this isn't TOO confusing. Code:
Game Time Selected
Events
Dialog - A dialog button is clicked for dlgGameTime
Conditions
Actions
Set blnDialogTimeClicked = True
For each (Integer A) from 0 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Clicked dialog button) Equal to btnDialog[(Integer A)]
Then - Actions
Set intGameModeTime = (Integer A)
Else - ActionsI'm looking a little bit closer at your questions, and I'm not sure I completely understand what you are asking with #1 and #2. Is the basic idea that they vote to select a difficulty, and that difficulty determines how many units they get to remove? Or is it the number of players? Or is it a mix? Can you try to explain in a little more detail what you want to do next? Hopefully this was helpful for you. |
| 02-16-2005, 07:19 AM | #3 | |
Quote:
About #1: This is determined by how many human controlled players only. If there are 2 human players playing, then I chose within the trigger to delete so-and-so, it's done manually, not by any randomness. This has no voting. About #2: This is one is like #3, but your using the "Easy, Normal, Hard" only, deleting so-and-so. This has voting. Did that help? |
| 02-16-2005, 05:14 PM | #4 |
That helps, but I'm not sure what exactly you need help with. If you've implemented the triggers I gave you that would allow the Host to select a difficulty, then hopefully you've got a variable in place of intGameModeTime to represent game difficulty. I'll just take a guess and say you called it intDifficulty. So intDifficulty can have 4 values - 0 = Novice, 1 = Apprentice, 2 = Elite, 3 = Prince. After all the voting has taken place, you would just need to run a trigger to remove whatever units you want to remove. It would look something like this: Code:
Game Time Dialog
Events
Conditions
Actions
If (intDifficulty = 0)
Then - Actions
Unit - Remove Unit A
Unit - Remove Unit B
Unit - Remove Unit C
Else
If (intDifficulty = 1)
Then - Actions
Unit - Remove Unit A
Unit - Remove Unit B
Else
If (intDifficulty = 2)
Then - Actions
Unit - Remove Unit A Hopefully that gets you on the right track for #2. For #1, you're going to have a very similar trigger. Instead of intDifficulty, though, you'll use the current number of players in the game. I'm 90% sure there is a Count function, so you should be able to use If (Count(Number of Players in All Players) = 1) and so on. Does this help, or is this not what you were looking for? |
| 02-19-2005, 07:12 AM | #5 |
Cool! I'll try it and see what happens. Thanks a lot. |
