HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Player Handicaps?

03-25-2006, 05:23 PM#1
StRoNgFoE_2000
Hi everyone. I've been having problems with setting up a handicap for players. For some reason, it just doesn't seem to work, at all. Maybe I just don't understand how the handicap action works, or I'm applying it wrong. Here is what I'm working on and trying to do.

Ive been working on a WMW map for some time (yeah I'm part of the disease), but this one is ownage in comparison. But that doesn't relate to my problem. I'm trying to set a difficulty selectable through a dialog menu on startup, but it just doesn't do anything. I got it to take the life down of one enemy unit once, then it just went back to 100%.

Here is my handicap triggers:
Trigger:
Difficulty Chooser
Events
Conditions
Collapse Actions
Dialog - Clear SetupDialog
Dialog - Change the title of SetupDialog to Choose the difficul...
Dialog - Create a dialog button for SetupDialog labelled Normal - (100% Hit ...
Set SetupDialogEntries[0] = (Last created dialog Button)
Dialog - Create a dialog button for SetupDialog labelled Hard - (125% Hit Po...
Set SetupDialogEntries[1] = (Last created dialog Button)
Dialog - Create a dialog button for SetupDialog labelled Extreme - (%150 Hit...
Set SetupDialogEntries[2] = (Last created dialog Button)
Player Group - Pick every player in PlayerStartups1 and do (Dialog - Show SetupDialog for (Picked player))
Set SetupStep = 8
Wait 11.00 seconds
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
GameSet[5] Equal to True
Collapse Then - Actions
Do nothing
Collapse Else - Actions
Set Difficulty_Normal = True
Game - Display to (All players) the text: Normal difficulty h...
Multiboard - Set the text for (Last created multiboard) item in column 2, row 16 to Normal
Trigger - Run Tower Limit Chooser <gen> (ignoring conditions)

^^The above trigger is run from a previous dialog trigger. PlayerStartups1 is the first available player on team 1 to recieve the menu. The If/then/else command is to autoset after 11 seconds in case of an AFK idiot.



Trigger:
Difficulty Set
Collapse Events
Dialog - A dialog button is clicked for SetupDialog
Collapse Conditions
SetupStep Equal to 8
Collapse Actions
If ((Clicked dialog button) Equal to SetupDialogEntries[0]) then do (Set Handicap = 75.00) else do (Do nothing)
If ((Clicked dialog button) Equal to SetupDialogEntries[0]) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 16 to Normal) else do (Do nothing)
If ((Clicked dialog button) Equal to SetupDialogEntries[1]) then do (Set Handicap = 100.00) else do (Do nothing)
If ((Clicked dialog button) Equal to SetupDialogEntries[1]) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 16 to Hard) else do (Do nothing)
If ((Clicked dialog button) Equal to SetupDialogEntries[2]) then do (Set Handicap = 125.00) else do (Do nothing)
If ((Clicked dialog button) Equal to SetupDialogEntries[2]) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 16 to Extreme) else do (Do nothing)
Set GameSet[5] = True
Player - Set Player 7 (Green) handicap to Handicap%
Player - Set Player 8 (Pink) handicap to Handicap%
Player - Set Player 9 (Gray) handicap to Handicap%
Player - Set Player 10 (Light Blue) handicap to Handicap%
Player - Set Player 11 (Dark Green) handicap to Handicap%
Player - Set Player 12 (Brown) handicap to Handicap%
Wait 0.20 seconds
Trigger - Run Tower Limit Chooser <gen> (ignoring conditions)

^^Player 7-12 are the players I use to mass units with, so they are the ones I want to recieve the handicap. Notice 100% normal is really 75% in trigger, but nobody will know the difference. I'm not sure why this doesn't work... But here is my unit massing trigger. This is for the top team, but bottom has the same trigger:

Trigger:
Build Unit Top
Collapse Events
Unit - A unit enters Region Top <gen>
Collapse Conditions
((Triggering unit) is A giant) Equal to False
((Triggering unit) is A peon-type unit) Equal to False
((Triggering unit) is A structure) Equal to False
Collapse Actions
Set PathingCreate[1] = (Center of Middle Center Bottom Left <gen>)
Unit Group - Pick every unit in (Units in Region Top <gen>((Matching unit) Equal to (Entering unit))) and do (Unit - Create 1 (Unit-type of (Picked unit)) for (Owner of (Picked unit)) at PathingCreate[1] facing Default building facing (270.0) degrees)
Unit Group - Destroy unit group (Last created unit group)
Point - Remove PathingCreate[1]
Set Income[(Player number of (Owner of (Entering unit)))] = (Income[(Player number of (Owner of (Entering unit)))] + (Point-value of (Entering unit)))
Set TotalIncome1 = (Income[1] + (Income[2] + Income[3]))
If ((Owner of (Entering unit)) Equal to Player 1 (Red)) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (String(Income[1]))) else do (Do nothing)
If ((Owner of (Entering unit)) Equal to Player 2 (Blue)) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to (String(Income[2]))) else do (Do nothing)
If ((Owner of (Entering unit)) Equal to Player 3 (Teal)) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 4 to (String(Income[3]))) else do (Do nothing)
Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to (String(TotalIncome1))
If (UnitPlayerTop Equal to 3) then do (Set UnitPlayerTop = 0) else do (Do nothing)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
UnitPlayerTop Equal to 0
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Greed Equal to True
Collapse Then - Actions
Unit - Change ownership of (Entering unit) to Player 7 (Green) and Retain color
Unit - Change ownership of (Last created unit) to Player 7 (Green) and Retain color
Collapse Else - Actions
Unit - Change ownership of (Entering unit) to Player 11 (Dark Green) and Retain color
Unit - Change ownership of (Last created unit) to Player 11 (Dark Green) and Retain color
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
UnitPlayerTop Equal to 1
Collapse Then - Actions
Unit - Change ownership of (Entering unit) to Player 9 (Gray) and Retain color
Unit - Change ownership of (Last created unit) to Player 9 (Gray) and Retain color
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
UnitPlayerTop Equal to 2
Collapse Then - Actions
Unit - Change ownership of (Entering unit) to Player 11 (Dark Green) and Retain color
Unit - Change ownership of (Last created unit) to Player 11 (Dark Green) and Retain color
Collapse Else - Actions
Do nothing
Set PathingCreate[4] = (Center of Middle Center Top Right <gen>)
Unit - Move (Entering unit) instantly to PathingCreate[4]
Point - Remove PathingCreate[4]
Set PathingMovement[5] = (Center of Middle Right <gen>)
Set PathingMovement[6] = (Center of Middle Left <gen>)
Unit - Order (Entering unit) to Move To PathingMovement[5]
Unit - Order (Last created unit) to Move To PathingMovement[6]
Point - Remove PathingMovement[5]
Point - Remove PathingMovement[6]
Set UnitPlayerTop = (UnitPlayerTop + 1)

^^This trigger builds a unit, and sends it to the first rect of the mass. It will cycle giving the unit to player 7, then 9, then 11, only if the game mode greed is true. If not, it just does 9 and 11. More players handling the units means no clumping, which is why I did it this way. Anyway, the handicap is not applied to the units being sent. I have even tried applying the handicap everytime this trigger is run, but that doesn't work either.

The map can be found at http://bmgcl.emuxhaven.net/wmw.htm. It is the "Tournament Edition" found at the bottom, for I've stopped making superspeed. It's protected so can't be opened, but you can see the only thing I'm missing is a difficulty selector.
03-25-2006, 06:07 PM#2
Jacek
Why won't u make it like:

Create unit xxx at loc xx facing x
Set life of Last Created Unit to Handicap% of max life
03-25-2006, 11:59 PM#3
StRoNgFoE_2000
Yes, that would work, but that's not what I'm trying to accomplish. Then I would have to go through every unit and change their max HP to the maximum difficulty, and it just wouldn't look as nice as if thier max hit points was altered instead of walking down the aisle half dead. I want to get the handicap function to work, but I don't understand how to.. plus I can't find any resources on it.
03-26-2006, 01:47 AM#4
StRoNgFoE_2000
Can anyone at least tell my why handicap isn't working AT ALL? I seem to be the only person (I searched every thread I could find) in which handicap is doing nothing for.
03-26-2006, 08:34 AM#5
Captain Griffen
Are the units origionally owned by players 1/2/3, rather than those with the handicap?

If so, that is the problem.
03-26-2006, 09:23 PM#6
StRoNgFoE_2000
Ahhh thank you, that is the problem. I dont' want to alter player 1-6's units directly, so I made an alternative trigger to modify player 7 and 8 instead, then change the ownership accordingly. But it isn't ordering the unit correctly.

Trigger:
Build Unit Top Alternate
Collapse Events
Unit - A unit enters Region Top <gen>
Collapse Conditions
((Triggering unit) is A giant) Equal to False
((Triggering unit) is A peon-type unit) Equal to False
((Triggering unit) is A structure) Equal to False
Collapse Actions
Set Income[(Player number of (Owner of (Entering unit)))] = (Income[(Player number of (Owner of (Entering unit)))] + (Point-value of (Entering unit)))
If ((Owner of (Entering unit)) Equal to Player 1 (Red)) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 2 to (String(Income[1]))) else do (Do nothing)
If ((Owner of (Entering unit)) Equal to Player 2 (Blue)) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to (String(Income[2]))) else do (Do nothing)
If ((Owner of (Entering unit)) Equal to Player 3 (Teal)) then do (Multiboard - Set the text for (Last created multiboard) item in column 2, row 4 to (String(Income[3]))) else do (Do nothing)
Set TotalIncome1 = (Income[1] + (Income[2] + Income[3]))
Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to (String(TotalIncome1))
Set PathingCreate[1] = (Center of Middle Center Bottom Left <gen>)
Set PathingCreate[2] = (Center of Middle Center Top Right <gen>)
Set PathingMovement[1] = (Center of Middle Right <gen>)
Set PathingMovement[2] = (Center of Middle Left <gen>)
Collapse Unit Group - Pick every unit in (Units in Region Top <gen>((Matching unit) Equal to (Entering unit))) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 (Unit-type of (Picked unit)) for Player 7 (Green) at PathingCreate[1] facing (Position of (Triggering unit))
Unit - Order (Last created unit) to Move To PathingMovement[1]
Set UnitBuildTop[1] = (Last created unit)
Unit Group - Destroy unit group (Last created unit group)
Collapse Unit Group - Pick every unit in (Units in Region Top <gen>((Matching unit) Equal to (Entering unit))) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 (Unit-type of (Picked unit)) for Player 7 (Green) at PathingCreate[2] facing (Position of (Triggering unit))
Unit - Order (Last created unit) to Move To PathingMovement[2]
Set UnitBuildTop[2] = (Last created unit)
Unit Group - Destroy unit group (Last created unit group)
Unit - Remove (Entering unit) from the game
Point - Remove PathingCreate[1]
Point - Remove PathingCreate[2]
Point - Remove PathingMovement[1]
Point - Remove PathingMovement[2]
If (UnitPlayerTop Equal to 3) then do (Set UnitPlayerTop = 0) else do (Do nothing)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
UnitPlayerTop Equal to 0
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Greed Equal to True
Collapse Then - Actions
Unit - Change ownership of UnitBuildTop[1] to Player 7 (Green) and Retain color
Unit - Change ownership of UnitBuildTop[2] to Player 7 (Green) and Retain color
Collapse Else - Actions
Unit - Change ownership of UnitBuildTop[1] to Player 11 (Dark Green) and Retain color
Unit - Change ownership of UnitBuildTop[2] to Player 11 (Dark Green) and Retain color
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
UnitPlayerTop Equal to 1
Collapse Then - Actions
Unit - Change ownership of UnitBuildTop[1] to Player 9 (Gray) and Retain color
Unit - Change ownership of UnitBuildTop[2] to Player 9 (Gray) and Retain color
Collapse Else - Actions
Do nothing
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
UnitPlayerTop Equal to 2
Collapse Then - Actions
Unit - Change ownership of UnitBuildTop[1] to Player 11 (Dark Green) and Retain color
Unit - Change ownership of UnitBuildTop[2] to Player 11 (Dark Green) and Retain color
Collapse Else - Actions
Do nothing
Set UnitPlayerTop = (UnitPlayerTop + 1)
This sets the handicap correctly, but doesn't move the unit.. I'm using (Unit - Order (Last created unit) to Move To (Center of XXXXX <gen>)) Which in theory should work, but isn't.. It creates the unit, it sets the variable and changes the ownership, but the Order isn't moving the unit. I'll mess around with it some more, but if anyone can see the fault in this, please let me know.

Edit: Nevermind, I got it all down now, thank you for the people that helped! I changed the trigger slightly to this and it helped a ton.

Trigger:
Collapse Unit Group - Pick every unit in (Units in Region Top <gen>((Matching unit) Equal to (Entering unit))) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 (Unit-type of (Picked unit)) for Player 7 (Green) at PathingCreate[1] facing (Position of (Triggering unit))
Set UnitBuildTop[1] = (Last created unit)
Unit Group - Destroy unit group (Last created unit group)
Collapse Unit Group - Pick every unit in (Units in Region Top <gen>((Matching unit) Equal to (Entering unit))) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 (Unit-type of (Picked unit)) for Player 7 (Green) at PathingCreate[2] facing (Position of (Triggering unit))
Set UnitBuildTop[2] = (Last created unit)
Unit Group - Destroy unit group (Last created unit group)
Unit - Order UnitBuildTop[1] to Move To PathingMovement[1]
Unit - Order UnitBuildTop[2] to Move To PathingMovement[2]