• 0

    posted a message on Defining actions for multple players

    Just in the spirit of throwing out ideas: Perhaps have the game start up and a dialog appear asking which faction the player wants to join, then giving the appropriate starting units upon selection. Ahli's idea of making duplicate race entries in the data module sounds promising.

    Posted in: Triggers
  • 0

    posted a message on Shared Supplies

    @MaskedImposter:

    Now that I need to look in to! Thanks!

    Posted in: Triggers
  • 0

    posted a message on Shared Supplies

    Another problem...

    If a protoss unit is generated in the region where the control is given to the computer (triggering region), the warping unit no longer has power and the warp in is cancelled. This wouldn't be a big deal, except the death of the warping in unit happens before the supply is added to the protoss player. This means that the cost of the dying unit is subtracted from the players supply count without being added, allowing the player to effectively reset their supply to 0. Will need to figure out how to either allow the warp in to finish before giving control over, or not allow warp in in that region...

    Edit: looks like the best option for now is to not allow building in that region and disable warp prisms. Hopefully a better option can be found...

    Posted in: Triggers
  • 0

    posted a message on Shared Supplies

    That seems to do pretty well. Here is what I now have:

    Global variable:
    supplies = -0.1 <Real[9]>

    Triggers:
    Give Unit:
        Local Variables
            supply = (Real((Value of Units (Unit type of (Triggering unit)) Food for player Any Player))) <Real>
            owner = (Owner of (Triggering unit)) <Integer>
       Actions
            Unit - Change ownership of (Triggering unit) to player {owner+8} and Retain Color
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    supply <= 0
                Then
                    Player - Modify player owner Supplies Used: Subtract {(Integer({supplies[owner]-supply}))-(Integer(supplies[owner]))}
                    Variable - Modify supplies[owner]: + supply
                Else
                    Player - Modify player owner Supplies Made: Add (Integer(supply))

    Unit Dies:
        Local Variables
            supply = (Real((Value of Units (Unit type of (Triggering unit)) Food for player Any Player))) <Real>
            owner = {(Owner of (Triggering unit))-8} <Integer>
        Conditions
            (Owner of (Triggering unit)) >= 9
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    supply <= 0
                Then
                    Player - Modify player owner Supplies Used: Add {(Integer({supplies[owner]+supply}))-(Integer(supplies[owner]))}
                    Variable - Modify supplies[owner]: - supply
                Else
                    Player - Modify player owner Supplies Made: Subtract (Integer(supply))

    The only problem I've run into with this is if the player kills a zergling before giving it away (loses 0.5 supply, but number does not go down), then gives away the other zergling, it goes from 0.5 on the user to 0.4 on the computer, allowing the player to get out one more supply worth of units. Ultimately, the max pop is then 200+1 computer zergling. The alternative is if the player just tributes one zergling, then the player has 0.5 rounded to 1 and the computer has 0.5 rounded to 1, the player has one fewer supply. This will also be more apparent, especially if they give units one at a time, the supply with switch between correct and +1. I think I can live with this.

    Posted in: Triggers
  • 0

    posted a message on Shared Supplies

    so instead of trying to keep track of the supply of both the player and computer, just keep track of the modification I made to the player supply. Then when a player dies, change the modification value, get the difference as an integer, and apply that to the player supplies. I'm guessing at most I could be off by 1 supply (both player and computer has 0.5 rounded), but perhaps I could live wit that.

    I like it, let's see if I can do it without too many bugs (perhaps after my 1 yr old son stops trying to use my computer...lol).

    Posted in: Triggers
  • 0

    posted a message on Shared Supplies

    In this map I am currently working on I am giving control of units from a player to a computer. However, in the process of doing this I would like the unit to still count against the players supply so that the player cannot make too many units (and as a quick count of how many units the player has for reference).

    Here is the problem: using modify player supplies used: - food requires that food be an integer. The obvious problem with this is zerglings (-0.5 food). I then tried keeping my own supply count in an array of real values, but that became a nightmare quite quickly (trying to catch all created, cancelled, and zerg egg/larva deaths was surprisingly difficult). Another option might be to simply double the cost of everything and give the player 400 supply, but it doesn't seem quite elegant enough of a solution. Lastly I thought to have a boolean array to denote the half, and do the adding/subtracting based on that. It might work (haven't had a good chance to work out the current problems).

    I was wondering if anyone tried something like this, and if there were some simpler solution? (Like setting allied with shared supply, lol) It seems silly to me that I can't edit the real version of the supplies used before it is converted to an integer and displayed on the UI.

    Posted in: Triggers
  • 0

    posted a message on Zergling flashes around the map?

    Have you tried making a very simple map, complete open space with just the region and the triggers related to making the zergling? This will help determine if it is the trigger itself or some interaction with other commands that aren't expected.

    Posted in: Triggers
  • 0

    posted a message on Victory for player with most points on Leaderboard

    Here would be my approach:
    define highest = 0
    define player = 0
    General: Pick each integer from 1 to 8 <--- This would be the number of players in the array
       if
          points[picked integer] > highest
       then
          highest = points[picked integer]
          player = picked integer

    After the iteration, use player to give the victory condition.

    Posted in: Triggers
  • To post a comment, please or register a new account.