• 0

    posted a message on Function question

    That code starts on 1. If you are using player 0 change that^ ^ ^ to a 0.

    Posted in: Triggers
  • 0

    posted a message on Ordering units to attack closest to it
    Quote from joemart06: Go

    Actions Unit - Order (Picked unit) to (Attack targeting (Position of (Closest unit to (Position of (Picked unit)) in (Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)))) (Replace Existing Orders)

    You need to have an alliance check, otherwise the unit will attack move towards itself.

    Instead of:
    "(Any units in Inside PF owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)"

    Use the action "Units In Region With Alliance To Player":
    (Units in (Inside PF) having alliance Enemy with player 14 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)

    Posted in: Triggers
  • 0

    posted a message on Function question

    You could then put that in a condition or function so that you could check easily with one condition e.g.

             allPlayersHaveSelectedTheUnit() == True
    
    Posted in: Triggers
  • 0

    posted a message on Function question

    The for loop equivalent in GUI is called "For each integer variable"

    To check that Player[i] == 1 for all players, you would do something like this:

        Local Variables
            i = 0 <Integer>
            all = True <Boolean>
    
    
            General - For each integer i from 1 to numOfPlayers with increment 1, do (Actions)
                Actions
                    General - If (Conditions) then do (Actions) else do (Actions)
                        If
                            Player[i] != 1
                        Then
                            Variable - Set all = False
                            General - Break
                        Else
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    all == True
                Then
                    (Do whatever you want to do)
                Else
    
    Posted in: Triggers
  • 0

    posted a message on Players problem!
    Quote from joemart06: Go

    BUT, in game, this changes, now if I want to give a certain player a unit, or anything. How do I this?

    Are you asking how to give a unit from one player to another?

    If so, use the "Change Owner" action.

    Posted in: Triggers
  • 0

    posted a message on TriggerDestroy + Script Obfuscation

    Oh. Hmm yes strange indeed. Maybe I'd have a clue if I knew what that flag actually did.

    WoL:

    Posted in: Triggers
  • 0

    posted a message on TriggerDestroy + Script Obfuscation

    Glad you got it working. :)

    This part of that tutorial seems to be false (or outdated): "You can call the parameters whatever you want but you will need to change the script identifier to the name given in the natives.galaxy file."

    Because I tested it with other script identifiers for the parameter and it still worked fine. Only the type and number of parameters needed to be the same (Otherwise a compile error occurs).

    It's strange yours only works with that "use reference" flag checked because in mine it worked fine without it.

    Example map:

    Posted in: Triggers
  • 0

    posted a message on TriggerDestroy + Script Obfuscation

    @FunkyUserName: Go

    Make sure to add a parameter of type trigger to the "TriggerDestroy" custom action you created. And tick the "Native" option. It works.

    Posted in: Triggers
  • 0

    posted a message on Get unit from map by id

    You can use the "Unit Tag" function to return a unique integer associated with a unit.

    You can't access a unit by its tag without looping through all the units and checking for the correct tag, or using a data structure to store the unit in, e.g. a data table as you suggested.

    There is a UnitFromId(int) function in galaxyscript, but it only works with units that were pre-placed in the editor.

    Posted in: Triggers
  • 0

    posted a message on Error when player leaves

    @fishy77: Go

    What's the event for the trigger that runs that code?

    Posted in: Triggers
  • 0

    posted a message on How do I detect target unit of an attack command?

    @wisesquirrel: Go

    Index is referring to the index of the order in the unit's order queue. So 0 is the correct choice for you to use because it is the currently executing order.

    Order at index 1 would be an order that is shift-queued to happen after the order at index 0.

    I.e. the currently executing order will be at index 0, index 1 is the next order in the queue, and so on. Once order 0 completes, the order at index 1 will move to index 0 and be executed.



    There is nothing wrong with your condition as far as I can tell, except that part "Position of Unit in (Unit Group which Allied Units belong to)" Did you mean "Position of Unit 1 in (Unit Group which Allied Units belong to)"?

    That would make your condition "if the closest player unit to the first unit that was added to the allied unit group is attacking rocks". Is that what you wanted?

    Posted in: Triggers
  • 0

    posted a message on Can a user defined function accept a record?

    Only possible with galaxy script. If you must do in GUI, put your variables of the same record type into arrays, then pass the array index.

    http://www.sc2mapster.com/forums/development/triggers/60722-how-to-use-a-record-as-custom-actions-parameter/

    http://www.sc2mapster.com/forums/development/galaxy-scripting-and-trigger-lib/55282-galaxy-classes/

    Posted in: Triggers
  • 0

    posted a message on Facing angle problem

    You are using the action "Make Unit Face Angle"? And what is the type of the unit you are changing the facing of?

    Posted in: Triggers
  • 0

    posted a message on Map file too big for Mapster??

    @Hockleberry: Go#

    Imported things will usually take up the most space. I assume you imported a crap-load of things?

    Posted in: General Chat
  • 0

    posted a message on Map file too big for Mapster??

    Wow that is quite huge! Maybe if you split a lot of the assets into mod files, then you would be able to upload it in pieces?

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