• 0

    posted a message on Attachment, Change Ownership, and Turret Control

    Hi,

    There are numerous threads about controlling turrets and I was wondering if this would be a solution. Could a unit, such as one with a turret model, be attached to say, a tank? Suppose both units are neutral. Then, when a player owned unit steps on a point on map, such as in a region, change ownership of the attached turret to that player, enable its attacks, and then the player controls the turret? Then, if the player owned unit moves from that spot, disable ownership of the turret, and disable its attacks. But, how do you attach a unit to another unit? Thanks.

    Posted in: Triggers
  • 0

    posted a message on [Trigger] Default Minimap and Commandcard outside the default UI

    How did u get rid of the original UI? When u are creating the new ones with dialog boxes, does that automatically disable the old ones from being seen?

    Posted in: Tutorials
  • 0

    posted a message on Help with flashlight?

    @DarkTrouper11: Go

    Hey, here is my flashlight trigger. Two triggers, One for flashlight light, and one to refill darkness around flashlight. It is attached to front of hero, and may be used in conjunction with an ability, as I have done. For the ability, make a new ability based off of cloak, and set the buttons to light on and light off for cloak on and cloak off, respectively. Then, in trigger editor, set event for turning flashlight on to use of ability, light on. Likewise, set event for turning light off to use of ability, light off.

    Flashlight trigger:

    flashlight 2
        Events
            Timer - Every 0.0125 seconds of Game Time
        Local Variables
            counter = 0.0 <Real>
            flashlight holders = (Any units in (Playable map area) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) <Unit Group>
            flashlight length = 9 <Integer>
            flashlight initial size = 1.25 <Real>
            flashlight expanding size = 0.25 <Real>
            unit facing angle = 0.0 <Real>
            unit position = No Point <Point>
        Conditions
        Actions
            Unit Group - Pick each unit in flashlight holders and do (Actions)
                Actions
                    Variable - Set unit position = ((Position of (Picked unit)) offset by (0.0, 0.0))
                    Variable - Set unit facing angle = (Facing of (Picked unit))
                    General - For each integer counter from 0 to flashlight length with increment 1, do (Actions)
                        Actions
                            Visibility - Reveal (Region((unit position offset by counter towards unit facing angle degrees), (flashlight initial size + (counter * flashlight expanding size)))) for player (Owner of (Picked unit)) for 0.0125 seconds and Do Not check cliff level
    

    Darkness:

    black mask
        Events
            Timer - Every 0.01 seconds of Game Time
        Local Variables
        Conditions
        Actions
            Visibility - Enable Black Mask visibility
            Visibility - Enable Fog Of War visibility
            Visibility - Change visibility for player 1 to Unexplored within (Playable map area) and Do Not check cliff level
    

    And if you don't want to use flashlight trigger with an ability, but want it always on, here is that trigger:

    flashlight
        Events
            Timer - Every 0.0125 seconds of Game Time
        Local Variables
            counter = 0.0 <Real>
            flashlight holders = (Any units in Region 001 owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) <Unit Group>
            flashlight length = 9 <Integer>
            flashlight initial size = 1.25 <Real>
            flashlight expanding size = 0.25 <Real>
            unit facing angle = 0.0 <Real>
            unit position = No Point <Point>
        Conditions
        Actions
            Unit Group - Pick each unit in flashlight holders and do (Actions)
                Actions
                    Variable - Set unit position = ((Position of (Picked unit)) offset by (0.0, 0.0))
                    Variable - Set unit facing angle = (Facing of (Picked unit))
                    General - For each integer counter from 0 to flashlight length with increment 1, do (Actions)
                        Actions
                            Visibility - Reveal (Region((unit position offset by counter towards unit facing angle degrees), (flashlight initial size + (counter * flashlight expanding size)))) for player (Owner of (Picked unit)) for 0.0125 seconds and Do Not check cliff level
    
    Posted in: Triggers
  • 0

    posted a message on Rotating Searchlight

    @DeotaAndOrainAtKhazModan: Go

    Aw man, That's especially helpful. I have been trying random things. Actually, I have a new trigger, which does what i want it to to a degree; the unit(lamp rotates, and reveals an area, however, the area it reveals is much smaller than the area intended. I am not sure how to have a constant amount of area revealed. Unlike the flashlight trigger, which grows to its complete area and remains constant, the trigger for the lamp never reaches the length or width of the same amount of area and instead only reveals a small portion.

    Heres the rotating lamp trigger:

    flashlight rotating
        Events
            Game - Map initialization
        Local Variables
            counter = 0.0 <Real>
            flashlight length = 10 <Integer>
            flashlight initial size = 1.25 <Real>
            flashlight expanding size = 0.25 <Real>
            unit facing angle = 0.0 <Real>
            unit position = No Point <Point>
        Conditions
        Actions
            Unit - Create 1 dummy for player 1 at Point 001 facing 360.0 degrees (No Options)
            Variable - Set unit position = ((Position of (Last created unit)) offset by (0.0, 0.0))
            Variable - Set unit facing angle = (Facing of (Last created unit))
            Visibility - Reveal (Region((unit position offset by counter towards unit facing angle degrees), (flashlight initial size + (counter * flashlight expanding size)))) for player 1 for 0.0125 seconds and Do Not check cliff level
            Unit - Make (Last created unit) face 270.0 over 3.0 seconds
            General - Wait 1.0 Game Time seconds
            Unit - Make (Last created unit) face 360.0 over 3.0 seconds
            General - Wait 1.0 Game Time seconds
            Unit - Make (Last created unit) face 270.0 over 3.0 seconds
    

    So this creates an invisible unit which rotates and projects light in the direction it faces, dispelling the darkness, which refills newly unlit areas as the unit continues to rotate. However, it doesn't reveal the proper area as I have stated above. Furthermore, because this unit is placed at a point near the lamp doodad, and is not the lamp itself, their movements are not synchronized. Is there a way to make a unit, with the model art of the rotating doodad? I would like to use variation 2 of the floodlight doodad, which is a prop. And then, once I have this unit, would it be possible to establish a direction for the direction in which the lamp light is facing? This seems difficult because I do not know if there is a way to attach an actor(not really sure what to attach though either way) to the direction in which the lamp light faces. Thanks for looking.

    EDIT: Actually, it isn't rotating, it shines light once, and then stops. I have also tried adding more instances of the visibility reveal region action, such as after the make unit face angle action, and wait action but to no avail.

    Posted in: Triggers
  • 0

    posted a message on How can I rotate a turret with a trigger?

    How do you create a dummy unit?

    Posted in: Triggers
  • 0

    posted a message on Rotating Searchlight

    Would it work if I set the unit position to the position of an actor instead, and then rotate the actor? I have not the slightest idea how to do this though, I just saw that setting the variable as an actor instead as an option, and then I think it is possible to rotate the actor. Or, would it work to set the unit position to a point in front of the unit, and then make the point to look at certain angles, and define these angles as an array, while making the point hesitate, or wait, say 2 game seconds, before continuing the rotation in the next angle? Not sure how to trigger this either. Any help appreciated.

    Posted in: Triggers
  • 0

    posted a message on Rotating Searchlight

    Hi, I would like to make a trigger with which a rotating searchlight provides an arc of light revealing dark areas. The map is continually black masked, so that when the lamp rotates back, the previously lit area becomes dark again. I have made a trigger which provides an arc of light in the direction in which a unit is facing and a trigger which resumes darkness; these triggers are below.

    flashlight trigger(to be lamp light arc)

    flashlight 2
        Events
            Timer - Every 0.0125 seconds of Game Time
        Local Variables
            counter = 0.0 <Real>
            flashlight holders = (Any units in (Playable map area) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) <Unit Group>
            flashlight length = 9 <Integer>
            flashlight initial size = 1.25 <Real>
            flashlight expanding size = 0.25 <Real>
            unit facing angle = 0.0 <Real>
            unit position = No Point <Point>
        Conditions
        Actions
            Unit Group - Pick each unit in flashlight holders and do (Actions)
                Actions
                    Variable - Set unit position = ((Position of (Picked unit)) offset by (0.0, 0.0))
                    Variable - Set unit facing angle = (Facing of (Picked unit))
                    General - For each integer counter from 0 to flashlight length with increment 1, do (Actions)
                        Actions
                            Visibility - Reveal (Region((unit position offset by counter towards unit facing angle degrees), (flashlight initial size + (counter * flashlight expanding size)))) for player (Owner of (Picked unit)) for 0.0125 seconds and Do Not check cliff level
    
    black mask
        Events
            Timer - Every 0.01 seconds of Game Time
        Local Variables
        Conditions
        Actions
            Visibility - Enable Black Mask visibility
            Visibility - Enable Fog Of War visibility
            Visibility - Change visibility for player 1 to Unexplored within (Playable map area) and Do Not check cliff level
    

    Now, I would like to use the doodad for the rotating lamp and attach this light trigger to it and have the arc of light rotate with the lamp as it rotates. How do I do this? I would like to use the variation of the lamp which is rotating, would it be possible to attach this lamp model to a unit or structure, or could the trigger be attached to the doodad itself?

    Thanks

    EDIT: K, now this is a correct post. I had messed up triggers before hand with the code input option.

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