| 06-29-2005, 12:00 AM | #1 |
Hey, I'm working on a project that has a King of the Hill part, and I need a trigger to do the following, but I'm not sure which conditions to use. EVENT - Periodic event every 10 secs. CONDITIONS - A unit owned by player 1 is in (region) - A unit owned by player 2 is not in (region) - A unit owned by player 3 is not in (region) ACTION - Player 1 captures (region) stuff So I need it to check for player 1 controlled units, player 2 controlled units, and player 3 controlled units, and if it only finds player 1 controlled units then it does the ACTION. I hope my question is clear and someone can answer it. |
| 06-29-2005, 12:38 AM | #2 |
Another, seperate, quetion: I once knew but forgot how to do random events. I searched the site but couldn't find my old posts. I need something like this: If randominteger = 1 then do this..... If randominteger = 2 then do this..... There's a way to do this using a randominteger variable? Help would be appreciated. |
| 06-29-2005, 12:45 AM | #3 | |
Guest | Quote:
|
| 06-29-2005, 08:26 AM | #4 |
If Then Else. If Player1 Then Player1 actions Else Do Nothing If Player2 Then Player2 actions Else Do Nothing I think you get the idea. |
| 07-01-2005, 10:31 PM | #5 |
Ok, I think I got random down fairly well, so this is one bump for the "Capture area" question. |
| 07-02-2005, 12:22 PM | #6 |
Heres a basic idea of one way you could do it. Depends on how many units and players you might be dealing with. Code:
King of the Hill BASIC
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Hill-Top)) and do (Actions)
Loop - Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units in (Hill-Top))) Less than or equal to 1
PlayerUnitArray[(Integer A)] Equal to (Picked unit)
Then - Actions
Game - Display to (Player group((Player((Integer A))))) the text: You are the King of...
Else - Actions
Do nothingNote: 12=Number of players in the Game Hill-Top=Region PlayerUnitArray[n]=A variable directed at the player's single unit |
| 07-02-2005, 09:12 PM | #7 |
Okay, I put that in a trigger, but how do I setup the variable? Is is a unit or player, etc. Also, the only players that can capture the areas are 1,3,5. Thanks for your help. |
| 07-03-2005, 03:53 AM | #8 | |
Guest | Quote:
"Also, the only players that can capture the areas are 1,3,5" Was that a question? |
| 07-03-2005, 03:44 PM | #9 |
Correct. Just do Code:
Set PlayerUnitArray[1] = <Player1's Unit Goes Here> Set PlayerUnitArray[3] = <Player3's Unit Goes Here> Set PlayerUnitArray[5] = <Player5's Unit Goes Here> If you have the units placed in the map to begin with. If not, just choose the apropreate setting to set the variable to the correct unit. |
