attaching region to unit.

Anubis520

New Member
Reaction score
0
Hi. I searched the forums and can't seem to find anything so I am finally posting the question. As stated in the title, I can't get a region to attach to a unit. I've been trying but for what ever reason it does absolutely nothing. I am using it right now to reveal the movement of a unit but it isn't moving.

Code:
attach region
    Events
        Timer - Every 0.1 seconds of Game Time
    Local Variables
    Conditions
    Actions
        Region - Attach Region 016 to Colony Ship (Landed) [203.00, 97.00] with offset (Point(0.0, 0.0))

any ideas?
 

MissKerrigan

Active Member
Reaction score
23
you don't need to make the event 'every 0.1 game seconds' just make this:

event: elapsed time is 2.0 game seconds
conditions: none
action: attach region to 'your unit'

If your unit get's killed, the region will stay at that position till you give it a new attachment
 

Anubis520

New Member
Reaction score
0
I think my map is broken then. I tried that as well and it didn't work. I also tried attaching it to a point and the region didn't move. Thanks for the help.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
How do you know it's not actually attached? It could be that it's attached but your other stuff isn't working.

What MissKerrigan wrote is correct and should definitely work. I am convinced the problem is somewhere else. You mentioned revealing the movement of the unit, can you show us the triggers for that?
 

Anubis520

New Member
Reaction score
0
Siretu, i tried using other methods to see if it was the region or the revealer. The code the attaches the region and turns the revealer is:
Code:
    Events
        Unit - Any Unit Enters Region 015
    Local Variables
    Conditions
        (Owner of (Triggering unit)) != 0
        (Owner of (Triggering unit)) != 15
    Actions
        Unit - Remove (Triggering unit) from the game
        Trigger - Turn attach region On
        Player Group - Pick each player in (All players) and do (Actions)
            Actions
                Visibility - Reveal Region 016 for player (Picked player) for 30.0 seconds and Do Not check cliff level
        Variable - Set Counter = 1

I also tried what you said to see if it was the region or if maybe the revealer wasn't moving so I changed the code to:
Code:
    Events
        Timer - Every 2.0 seconds of Game Time
    Local Variables
    Conditions
    Actions
        Region - Attach Region 016 to Colony Ship (Landed) [203.00, 97.00] with offset (Point(0.0, 0.0))
        UI - Display "triggered" for (All players) to Subtitle area
        Ping - Ping the minimap at (Center of Region 016) for (All players) over 1.0 seconds, using the color (100%, 0%, 0%)

and it still doesn't seem to be working... i think it is something with this file or something...
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
What was the result of your change? Did you see the ping and the "triggered" message? Note that if you changed the event of the second trigger to "elapsed time is 2.0 game seconds" it would not start. Using the action that turns on a trigger does not ensure that it actually runs. It just means that it'll now start running if an appropriate event occurs.

Say for example you have a trigger(that you turn off in the trigger editor) that displays a message when a unit dies. If a unit dies, it wont show a message since it's turned off. If you turn it on in some other trigger, it wont display a message directly, but if more units die, it will.

To make a trigger start regardless of if the event occurs, use the "Run trigger" action.

Anyway, back to your problem. I would suggest you put everything in the same trigger. Since attach region should work even if your unit moves, you don't have to do it periodically. So replace "Trigger - Turn attach region On" with "Region - Attach Region 016 to Colony Ship (Landed) [203.00, 97.00] with offset (Point(0.0, 0.0))".
 

Anubis520

New Member
Reaction score
0
Well both the ping and the message appeared but the region didn't move. I also thought that maybe it was because the colony ship takes off before it moves so i tried attaching it to a different unit and it didn't move. It wasn't a whole lot of movement that I needed to show so I made 5 circle regions that turn on and off as the ship moves instead of attaching a single region. it's no clean or perfect but it gets the job done.
 

MissKerrigan

Active Member
Reaction score
23
I don't understand the whole point of the plan you are trying to make

- Why do you call it 'region15'?
- Can you describe exactly what you want to make?
- You must exclude your own unit from the trigger or it will fire also if your unit enters the region
 

Anubis520

New Member
Reaction score
0
So the point of the trigger is that there is a neutral transport ship owned by player 0. When a player gets to the transport they "enter" (removed from the game temporarily until the transport lands). So when the players unit is removed I want them to be able to see the transport move but I don't want to set allied vision because it will reveal other parts of the map.

As for the names... I am just lazy...
 

Anubis520

New Member
Reaction score
0
This game is just messing with me now. A few days I was hitting some kind of error I had given up on. I had a unit get to a point then patrol from there some where else(I was issuing orders then using "after existing order"). For some reason it wasn't patrolling it would reach the point but wouldn't move. It refused to work so just now I deleted the line and replaced it with a units that was working and now both are working properly. The reason I brought that up is because the region is now moving. The strange part is that I was skipping that trigger during testing so it shouldn't have had an effect. Even more so, the triggers have no effect on each other and aren't even in the same folder. In any case, thanks for helping and trying to get this resolved. The final product is expected to be an RPG that takes place after the war of the worlds movie!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top