• 0

    posted a message on Help! If player owns unit type in region > Do this

    Since you're checking for unit type, I assume you are using the pick all units in region option.

    If can be found under Action - General - If Then Else.
    Unit type == can be found under Condition - Comparison - (function) Unit Type of Unit.

    When done, it should look something like this:

        Unit Group - Pick each unit in (Any units in Region 001 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
            Actions
                General - If (Conditions) then do (Actions) else do (Actions)
                    If
                        (Unit type of (Picked unit)) == Planetary Fortress
                    Then
                        Do stuff!
    


    Posted in: Triggers
  • 0

    posted a message on [Help] Setting Unit and not Player Alliances

    Yeah, that's what I did, or thought I did at least. Didn't save the test-map. Whatever, if it works, great. :-)

    Posted in: Triggers
  • 0

    posted a message on Help! If player owns unit type in region > Do this
    Quote from dgh64: Go

    Well, that would work if the P.F. is pre-placed, but it wouldn't work if the player builds their own.

    Wrong.
    If the P.F. is placed by a trigger or built by a player, you would store it in a variable and use that as reference.

    ...or if the P.F. is a generic, just any P.F. acceptable, do it like Anthius said.

    Posted in: Triggers
  • 0

    posted a message on Help! If player owns unit type in region > Do this

    Actually, the if then else isn't even needed. Just add your condition to the trigger directly. Something like this:

    Fortress Alive
        Events
            Timer - Every 30.0 seconds of Game Time
        Local Variables
        Conditions
            (Planetary Fortress [20.50, 14.50] is in Fortress Area) == true
        Actions
    
    Posted in: Triggers
  • 0

    posted a message on (Trigger) Income not updateing

    Definitely impossible for me to fix without seeing the current code. My guess is that you forgot to delete a duplicate trigger or something when you were testing. My mini-timer-map did no such thing. Look around a bit before you rush back to the forums. I saw your earlier edit and kind of didn't even bother answering that... :-p

    Edit: haha, called it!

    Posted in: Triggers
  • 0

    posted a message on [Help] Setting Unit and not Player Alliances

    Really? I tried doing the save order thingy, both the entire queue and only the current order. Didn't work for some reason. Guess I messed up somewhere.

    Posted in: Triggers
  • 0

    posted a message on Condition Trigger?

    No, the active player group will only return only the number of players in the game (might count computer players too, not 100% sure.. but thats easily tested).

    Posted in: Triggers
  • 0

    posted a message on Framerate drops greatly in the initial ~10s

    Triggers don't impact much, if any, at all.

    Starting lag exists on many maps, it's not very consistent either. Melee maps, the campaign, custom maps. They don't even have to be big, sometimes it lags. Power computer, or not. Maybe you could distract the players with something at the beginning if it's really bad.

    Posted in: Miscellaneous Development
  • 0

    posted a message on How do I make a unit not spawn if the player is not playing?

    You'll want a variable that you keep updated with the number of active playes:

    Active Players = 0 <Integer>

      Update Playercount
          Events
              Game - Map initialization
              Player - Player Any Player leaves the game with Any
          Local Variables
          Conditions
          Actions
              Variable - Set Active Players = (Number of players in (Active Players))
    

    Now, any time you spawn units, multiply it with "Active Players". (You could insert the function "Number of players in (Active Players)" any time you spawn units, but it's way easier to just refer to a variable.)

            Unit - Create (Active Players * 10) Marine for player 1 at Spawn Area using default facing (No Options)
    

    If you need to spawn the units at different places, just add a condition instead before you spawn any units:

    Comparison
        Value 1: Status Of Player
            Player: 1
        Operator: ==
        Value 2: Playing
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on (Trigger) Income not updateing

    Ok, I've been playing around with timers a bit. Apparently you shouldn't start a new timer. Make a global variable (timer). Start that timer. No need to assign it to a variable after, in fact, that seems to be what's breaking it. Anyway, this works:

    Global variable:
    mytimer = (New timer) <Timer>
    
    Trigger 1:
        Events
            Game - Map initialization
        Local Variables
        Conditions
        Actions
            Timer - Start mytimer as a Repeating timer that will expire in 5.0 Game Time seconds
    
    Trigger 2:
        Events
            Timer - mytimer expires
        Local Variables
        Conditions
        Actions
            UI - Display "Restart" for (All players) to Chat area
    
    Posted in: Triggers
  • 0

    posted a message on (Trigger) Income not updateing

    So.. I'm confused, it's working now.. but only for testing purposes? Something you want to change, but then it doesn't work?

    Posted in: Triggers
  • 0

    posted a message on [Help] Setting Unit and not Player Alliances

    I'm in a bit of a rush now and haven't used this myself yet, but it should work. Store the order of the unit before you change ownership and then re-issue the order afterwards. I'm not sure, but I guess the index refers to the units order queue. So if you want all queued orders to transfer, store them all and re-order them one at a time. Again, not sure since i never used it, but the function "Unit - Unit Order Count" probably returns the number of orders queued up on a unit.

            Transfer order = No Order <Order>
    
            Variable - Set Transfer order = ((Triggering unit) order at index 0)
            Unit - Order (Triggering unit) to Transfer order (Replace Existing Orders)
    

    Edit:
    This would probably be a useful thing to do in a custom function with two parameters, the unit you want ownership to change for, and the player number to change to. I could try to set one up for you later if you need.

    I'm actually a bit surprised this isn't an event already: Change ownership and retain orders. (workers being given to the player in the campaign could really have used this as they often started mining during a cut-scene and then stopped after being given to the player).

    Posted in: Triggers
  • 0

    posted a message on using variables like in wc3???

    ...or if the variable you want associated with the unit happens to be a "Real", you can use the custom value. An array is more flexible, but then you would have to keep track of all, sometimes an unknown number of, created units. Would be great if you could assign any type of variable to a unit like this, but as far as I can see, we can't.

            Variable 001 = 0.0 <Real>
    
            Unit - Set (--UNIT--) custom value 0 to 100.0
            Variable - Variable 001 = (Custom value 0 of (--UNIT--))
    
    Posted in: Triggers
  • 0

    posted a message on (Trigger) Income not updateing

    You could try to send some chat text in the timer expires trigger, see if it fires at all, or just the mineral add don't work. I assume you checked the variable you are adding income with so it's not 0 or something. You could also test making the timer one shot only, see if it adds income once at least. Basically, narrow it down as much as you can. Hard to guess here when I'm not seeing everything in front of me in the editor.

    Posted in: Triggers
  • 0

    posted a message on using variables like in wc3???

    There are two kinds of variables. Global and Local.

    Local variables are the ones you put inside your triggers. These can only be used from within that trigger and are unique to each run of that trigger.
    Global variables can be used from anywhere. They are placed in the left area of the window (dunno what to call it).

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