• 0

    posted a message on is there a way we can get player names?

    Hmm... tough one. Maybe the function "Name of Player" could do what you want?
    Seriously.. at least try to look before you ask.

    Posted in: Triggers
  • 0

    posted a message on Supply and Demand, is it possible?

    I'd use Arrays and/or Records to store the different values. Easier to see what's what. Something like this:

    Property (Record)
        Variables
            Demand = 0 <Integer>
            Supply = 0 <Integer>
            Sells at = 0 <Integer>
            Buys at = 0 <Integer>
    
    Goods (Record)
        Variables
            Coal <Property>
            Cloth <Property>
            Food <Property>
    
    Paris <Goods>
    Amsterdam <Goods>
    or
    City <Goods[6]>
    
    Variable - Set Paris.Food.Sells at = 1000
    
    Posted in: Triggers
  • 0

    posted a message on Supply and Demand, is it possible?

    I'd say it's very possible. But you would have to custom make pretty much everything from scratch.

    I'd start out by making a new unit, the hatchery or what you want it to look like. Customize the command panel with new buttons (like the limited weapons / ammo used by Raynor on the secret mission), that show the currently available goods. Set up two or three cities and start making the triggers that will control everything. Set up (random?) initial supply and cost for everything at each city. Make some trigger that checks for the highest price of each good, send units between the cities carrying the goods (transport units with custom made cargo units maybe).. etc. etc. etc.

    There are so many things to do, you'll just have to start somewhere and work out each thing at a time as it comes up.

    Posted in: Triggers
  • 0

    posted a message on "Kill any unit in entire map" Simple but OMG!!!! Others too.

    Once you get the hang of it, what you asked actually is very simple. Hope this is enough to get you started to figure out how the trigger editor works.
    (When you find the Data Editor, we'll be here... :-)

    Issue orders, (Any Unit, In Region 1) to attack region 2.

    Issue Order To Unit Group
        Group: Units In Region Matching Condition
            Unit Type: Any
            Region: Region 001
            Player: Any Player
            Unit Filter: Excluded: Missile, Dead, Hidden
            Count: Any Amount
        Order: Order Targeting Point
            Ability Command:  Attack
            Target Point: Center Of Region
                Region: Region 002
        Queue: Replace Existing Orders
    

    Issue orders, (Any Unit, Owned by player 1), to attack, region 2.

    Issue Order To Unit Group
        Group: Units In Region Matching Condition
            Unit Type: Any
            Region: Anywhere
            Player: 1
            Unit Filter: Excluded: Missile, Dead, Hidden
            Count: Any Amount
        Order: Order Targeting Point
            Ability Command:  Attack
            Target Point: Center Of Region
                Region: Region 002
        Queue: Replace Existing Orders
    

    If Player 1 number of units = 0, Create units for player 1 at region 1.

            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Number of Living units in (Any units in (Entire map) owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) == 0
                Then
                    Unit - Create 1 Marine for player 1 at (Center of Region 001) using default facing (No Options)
    

    If player 1 number of units in region 1 < player 2 number of units in region 1, then set switch 1 to on.

            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    (Number of Living units in (Any units in Region 001 owned by player 1 matching Excluded: Missile, Dead, Hidden, with at most Any Amount)) < (Number of Living units in (Any units in Region 001 owned by player 2 matching Excluded: Missile, Dead, Hidden, with at most Any Amount))
                Then
                    Variable - Set A-Global-Variable = true
    

    If any unit owned by player 1 dies, then toggle switch 1.

        Events
            Unit - Any Unit dies
        Local Variables
        Conditions
            (Owner of (Triggering unit)) == 1
        Actions
            General - If (Conditions) then do (Actions) else do (Actions)
                If
                    A-Global-Variable == true
                Then
                    Variable - Set A-Global-Variable = false
                Else
                    Variable - Set A-Global-Variable = true
    

    If any unit in region 1 dies, set counter 1 to -1

        Events
            Unit - Any Unit dies
        Local Variables
        Conditions
            ((Triggering unit) is in Region 001) == true
        Actions
            Variable - Modify Counter: - 1
    

    Kill all units in entire map.

            Unit Group - Pick each unit in (Any units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
                Actions
                    Unit - Kill (Picked unit)
    
    Posted in: Triggers
  • 0

    posted a message on Score screen bug ?

    Dunno, I haven't gotten to the publish phase of my maps yet, but I doubt you have to set up some triggers to make the score screen work. More likely, you have something else somewhere in your map that mess it up.

    Posted in: Triggers
  • 0

    posted a message on Score screen bug ?

    Do you need the score screen at the end? In my experience it doesn't really tell you anything useful anyway unless you were playing a normal melee map. Try "Don't Show Score screen" and see if it still gives you an error.

    Just guessing here, but what if you change "All Players" to "Active Players"? If you try to end the game for a player that doesn't play... might be a problem.

    Posted in: Triggers
  • 0

    posted a message on Score screen bug ?

    No, noone will be able to help you unless you either provide the map for us to look at or describe pretty much everything you did.

    Posted in: Triggers
  • 0

    posted a message on Walk/Attack when stopped?

    You could modify the collision properties of the units so that they could walk through each other. This would fix the pathing issue that the units want to walk around rather than into each other. Now you can use the "Unit Enters/Leaves Range Of Unit" event in a trigger, as suggested by Bump, and order the units to do what you want.

    Edit:
    As for the blink command, it should look something like this:
    (The unit triggering the event will blink 5 range in the direction it's currently facing. Assuming of course that the unit has the Blink ability and it's not on cooldown.)

    Issue Order
        Unit: Triggering Unit
        Order: Order Targeting Point
            Ability Command: Stalker - Blink
            Target Point: Point With Polar Offset
                Point: Position Of Unit
                    Unit: Triggering Unit
                Distance: 5.0
                Angle: Facing Angle Of Unit
                    Unit: Triggering Unit
        Queue: Replace Existing Orders
    
    Posted in: Triggers
  • 0

    posted a message on Walk/Attack when stopped?

    Is this like a TD, where it's supposed to stop and attack when there is no possible route to the destination, or do you want the unit to try to move straight (birds path) towards the destination and stop to attack when something blocks him?

    Posted in: Triggers
  • 0

    posted a message on Cone of Sight

    Basically, you should only have to check two things.
    1. That the distance between the units does not exceed the max sight range.
    2. That the "Lookers" facing angle does not differ too much from the angle between the two units.

    I'm unsure if "Distance Between Points" takes the Z axis into account. Also, this obviously won't take into account any obstacles that may block true LOS, such as cliffs, trees, etc. I don't know what kind of map you're making, but the Z axis shouldn't matter that much anyway?

    The Angle comparison should be simple enough, except that it has to know that 359 and 0 are only 1 degree apart. I kind of got bored with the problem before managing to figure out a smart way to detect these cases (sorry :-). Also, while testing, I found out that the units facing does not return 0 -> 359,9999... but -179,9999... -> 180. I haven't tested if "Angle Between Points" use the same range, but I would assume it does.

    So, modify the angle check to detect the special cases and this should work.

    Unit in LOS
      Options: Function
      Return Type: Boolean
      Parameters
        Main Unit = No Unit <Unit>
        Target Unit = No Unit <Unit>
        Sight Range = 0.0 <Real>
      Grammar Text: Unit in LOS(Main Unit, Target Unit, Sight Range)
      Hint Text: (None)
      Custom Script Code
      Local Variables
        Angle Between Units = (Angle from (Position of Main Unit) to (Position of Target Unit)) <Real>
      Actions
        General - If (Conditions) then do (Actions) else do (Actions)
          If
            (Distance between (Position of Main Unit) and (Position of Target Unit)) <= Sight Range
            (Angle Between Units - 22.5) <= (Facing of Main Unit) <= (Angle Between Units + 22.5)
          Then
            General - Return true
          Else
            General - Return false
    
    Posted in: Miscellaneous Development
  • 0

    posted a message on Stuffing 2 events into one trigger

    Hmm, yeah. This can't really be avoided I think since you have to check the condition for something that doesn't exist in one of the event cases.

    You're probably better of making two different triggers and use a custom action (or run a third trigger, but that's the "ugly" way to do it from a programmers point of view).

    Posted in: Triggers
  • 0

    posted a message on changing terrain with Triggers

    I think he wants to create a hole, using cliff levels, for the "footprints" of the king kong robot.

    ...and no, as far as I know.. don't think it's possible either.

    A work around... maybe. Since it's a cinematic and I assume it's the same each time. Maybe you could create the holes with the map, and cover them with map textured doodads.

    Posted in: Triggers
  • 0

    posted a message on Stuffing 2 events into one trigger

    This would work assuming "(Used dialog item) == No Dialog Item" returns true when you press "1".
    (I can't seem to find "Used Dialog Button", but whatever. I'll assume I'm blind or you used the wrong term, doesn't really matter.)

    Events:
    Player presses 1 key
    Any dialog item is clicked
    
    Conditions:
    Or...
       And...
          Currentweapon != 1
          (Used dialog item) == Riflebutton
       And...
          Currentweapon != 1
          (Used dialog item) == No Dialog Item
    
    Actions:
    Add Rifle to Unit
    
    Posted in: Triggers
  • 0

    posted a message on Attacking a neutral unit to accelerate it.

    You can find it under "Behavior - Behaviors+" add "Critter Wander".

    But if you want any sort of control over how the unit flees (it will run away even if you just move near him with the wander behavior), you should make a trigger that orders the unit around when hit.

    Posted in: Miscellaneous Development
  • 0

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

    @Anthius: Go

    He asked how to find the things since he couldn't find it. So I pasted exactly how it wold look. Your text was an approximate of how it would look. Good enough for some, but since he asked again after, I elaborated.

    Hopefully one of our detailed explanations will work for him now. :-)

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