Staredit Network > Forums > SC2 Assistance > Topic: Attacking Unit from a Unit Group
Attacking Unit from a Unit Group
Aug 17 2010, 8:18 am
By: payne  

Aug 17 2010, 8:18 am payne Post #1

:payne:

I'm trying to change the lighting of the map for a player if his unit is attacked by a unit that is outside of a region centered on its unit. The region represents its sight.
(I mix the concepts of test maps from Temp and shmeeps)

I know my "Under Atk" trigger isn't working. The condition to the "If" isn't set properly... If I am right, that "value" I must enter is kind of the # of the units that entered the region (since I store units that enter the region into an Unit Group variable). If I could find a "All unit" or "Attacking unit", I could've made it, but I really couldn't.

I'm not sure if this is clear. I hope so. :><:
Map is attached.

http://www.staredit.net/?attachment=7342

Post has been edited 1 time(s), last time on Aug 17 2010, 7:03 pm by payne.



None.

Aug 17 2010, 3:06 pm TheFreak Post #2



If I understood right, then you might want to use something like this for your condition.

(Position of (Attacking Unit) is in Region 001) == false

Then
Put your 3 actions here.

This would get rid of the need of the InSight UnitGroup and the respective triggers, unless of course, they are needed somewhere else in the map.

Hope this helps.

~TheFreak



None.

Aug 17 2010, 4:03 pm shmeeps Post #3



Yes, the integer variable in Unit 1 from InSight refers to the first unit that was added to the unit group, kind of like an array (technically, a deque).

I take it this is changing the lighting/screen to a red glow whenever you're attacked, kind of like how it works in some FPS games?

What TheFreak suggested should work very well, and you wouldn't have to keep track of a unit group anymore. (But if you do keep it, remember to remove units from it on death ;))



None.

Aug 17 2010, 5:42 pm payne Post #4

:payne:

Thanks @ TheFreak. :)
Thanks for the precision on the array value @ shmeeps.

Nothing as for why the Corpses won't load? Do they load for you guys?
And also, is it me or does the Lighting affect the UI too. Any ways to prevent that?

EDIT: For future reference, the name of the condition is "Unit In Region".

EDIT: Is there a way to add an Omni Light to the Region? It'd make it look even more like a flashlight :)
And is there a way to reveal any source of light like lamps? Some of the standard lamps in the map move so I cannot just reveal a whole region... it has to be local to be realist.

Attachments:
tar7.SC2Map
Hits: 2 Size: 1874.22kb

Post has been edited 3 time(s), last time on Aug 17 2010, 7:03 pm by payne.



None.

Aug 18 2010, 12:50 am shmeeps Post #5



I know there are lighting made specifically for the UI, especially like portraits. There may be a flag somewhere in there to modify that, but I'm not sure off the top of my head, and I don't have an editor to check it with on this computer >.<

Not sure about adding lights to a region though. I'll look into it when I get home if no one else has answered your question.



None.

Aug 18 2010, 7:23 am shmeeps Post #6



Okay, looked into it slightly when I got home, there's different type of lighting types, such as Tileset, UI, Portrait, and Effects. Effects I think would be confined to a certain point? I'd have to do some testing, which I wont be able to do till at least tommorrow.

As far as adding in a omni light, they are listed under the actor category, so I assume you could also create one with the attach actor to unit or region triggers.



None.

Aug 18 2010, 5:50 pm shmeeps Post #7



T-T-T-Triple Post.

Attaching a map demonstrating centering an omni light in the region (It's a modified version of the sight test map used for the August contest.). Basically, I created a new unit based off the marine with not abilities and the "No Draw" Flag. Then, I attached a colored omni light to him via the "Attach Actor to Unit" trigger, and then continuously move the dummy unit to the center of the flashlight region. It's hard to see with certain colors, but it does work.

Quote from payne
And is there a way to reveal any source of light like lamps? Some of the standard lamps in the map move so I cannot just reveal a whole region... it has to be local to be realist.
I'm not sure what you mean by this, just to apply a revealer to every light? Or do you mean something else.

Still looking into lighting affecting the UI though.

EDIT: Also, upon opening your new map, I get the following errors:

Code
Warning: Invalid placed doodad 'ColonistCorpse' at (53.118408,32.432373,9.056641).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (48.716309,33.528076,8.924072).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (61.609863,43.081299,8.736084).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (46.930176,32.423828,9.106689).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (62.854492,48.625244,9.204834).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (64.735840,44.641357,8.840820).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (60.166016,45.284668,9.041504).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (63.338379,48.601563,9.219971).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (64.808838,45.674805,8.909912).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (64.423828,48.474854,9.483398).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (49.729980,43.509766,9.441406).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (55.817871,31.510010,8.727051).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (50.535645,46.515869,9.132568).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (59.588135,44.079346,8.947266).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (61.907959,49.760010,10.167236).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (55.018799,31.794434,8.847412).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (60.038574,34.566162,8.860840).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (51.639893,46.410400,8.974609).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (60.290771,50.428711,9.131836).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (61.101807,50.374268,9.921387).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (61.631348,35.051758,8.809570).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (62.750000,47.955566,8.927490).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (61.604248,49.378418,9.706055).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (53.474365,43.722900,8.750488).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (62.506348,48.657959,9.185791).  A placeholder model will be used.
Warning: Invalid placed doodad 'ColonistCorpse' at (64.594727,47.627441,9.250488).  A placeholder model will be used.
Warning: Invalid placed doodad 'MarineCorpse' at (48.035645,34.220215,8.812744).  A placeholder model will be used.
Warning: Invalid placed doodad 'MarineCorpse' at (51.964355,30.914795,8.764160).  A placeholder model will be used.
Warning: Invalid placed doodad 'MarineCorpse' at (50.853271,35.914307,8.845215).  A placeholder model will be used.
Warning: Invalid placed doodad 'MarineCorpse' at (47.167480,39.033936,9.527344).  A placeholder model will be used.
Warning: Invalid placed doodad 'ScientistCorpseGory' at (47.605713,36.621338,9.062744).  A placeholder model will be used.


Attachments:
Sight Test.SC2Map
Hits: 2 Size: 173.56kb

Post has been edited 1 time(s), last time on Aug 18 2010, 5:54 pm by shmeeps. Reason: Map >.<



None.

Aug 18 2010, 6:17 pm Devourer Post #8

Hello

I think that these errors are because payne might be using campaign doodads and you did not set the campaign dependencies.



Please report errors in the Staredit.Network forum.

Aug 18 2010, 6:29 pm payne Post #9

:payne:

Attaching revealer to a source of light. You know, there are some street lamps that rotates, thus moving the light we see on the ground. Well, in my test map, there's a trigger that disables the vision of the whole map to show only a bit of vision in front of the unit.
But when that's done, we do not see the doodads' animation. Moreover, for realism, think of it as if you were in the dark and could only see what was in the range of your flashlight, even though there are sources of light at some places around you. In real life, you'd see what is within the range of your flashlight -and- what is under the sources of light.
So basically, I want to know if there's an easy to attach a region to a source of light, including the moving ones.

Quote
Still looking into lighting affecting the UI though.
Just to make sure, I want the UI -not- to be affected by the quick red-flash lighting.

Quote
Also, upon opening your new map, I get the following errors:
Quote
I think that these errors are because payne might be using campaign doodads and you did not set the campaign dependencies.
I get those too, even though I have added the Dependencies. I believe those doodads exist, but I can't find them anywhere, somehow.
The initial map was uploaded by LoveLess. Ever since I downloaded it from him, I get those annoying errors.

EDIT: Somehow, in your test map, if I go too far to the left, the omni light disappears! O.o
Also, what is the exact effect of the "No Draw" Flag?
And what do you mean by "marine with not abilities"? :/
... And is there any ways to attach the Omni light closer to the marine instead of simply in the middle of the region?

P.S. The only purpose of this Omni light is to increase the idea that a player is wearing a flashlight since it creates a shadow.

Post has been edited 1 time(s), last time on Aug 18 2010, 6:37 pm by payne.



None.

Aug 18 2010, 6:46 pm Temp Post #10



You should use the flashlight from the campaign, it makes a more realistic flashlight.



None.

Aug 18 2010, 7:02 pm payne Post #11

:payne:

Quote from Temp
You should use the flashlight from the campaign, it makes a more realistic flashlight.
But they are too small. :(



None.

Aug 18 2010, 7:11 pm shmeeps Post #12



Quote from payne
EDIT: Somehow, in your test map, if I go too far to the left, the omni light disappears! O.o
Also, what is the exact effect of the "No Draw" Flag?
And what do you mean by "marine with not abilities"? :/
... And is there any ways to attach the Omni light closer to the marine instead of simply in the middle of the region?
Hmm, strange. Maybe the dummy unit got killed, or couldn't be moved?
No draw makes it so the unit is literally not drawn. It's pretty much like being invisible and not being able to be detected. I'm not sure if it has any other characteristics (IE, uncontrollable, unmovable) though.
And I removed the dummy units (marine) abilities so it wouldn't have a chance to attack, or give sight, or anything like that.

Theoritcally, you could move the dummy unit closer by using the point with offset function, then set it to "center of the region offset towards (position of Marine)", or something similar.



None.

Aug 18 2010, 10:04 pm Temp Post #13



Quote from payne
Quote from Temp
You should use the flashlight from the campaign, it makes a more realistic flashlight.
But they are too small. :(
The problem with omni lights is they emit light from the centre in all directions. The flashlight model only does 1 direction as far as I know.



None.

Aug 18 2010, 11:52 pm payne Post #14

:payne:

Quote from Temp
Quote from payne
Quote from Temp
You should use the flashlight from the campaign, it makes a more realistic flashlight.
But they are too small. :(
The problem with omni lights is they emit light from the centre in all directions. The flashlight model only does 1 direction as far as I know.
You Editor-Gods have any ways to make this flashlight effect bigger?



None.

Aug 19 2010, 5:31 am shmeeps Post #15



It's an actor right? There's a scale under the Art section of actor, where you can scale the model in each xyz direction by a certain amount.



None.

Aug 19 2010, 6:00 am Temp Post #16



I don't think you can edit the size of lights :(



None.

Aug 30 2010, 1:04 am LoveLess Post #17

Let me show you how to hump without making love.

Quote from Temp
I don't think you can edit the size of lights :(
You can as doodads and I have tried as an actor, for some reason, it disables the light when you try to edit it as an actor.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:54 pm]
Ultraviolet -- :wob:
[12:25 pm]
Zergy -- :wob: (Hello there.)
[02:53 am]
lil-Inferno -- :wob:
[2022-8-10. : 6:09 pm]
Excalibur -- :wob:
[2022-8-10. : 11:20 am]
UndeadStar -- :wob:
[2022-8-09. : 9:51 pm]
Ultraviolet -- :wob:
[2022-8-08. : 4:18 pm]
jjf28 -- :wob:
[2022-8-08. : 2:07 am]
Ultraviolet -- :wob:
[2022-8-06. : 1:54 am]
RIVE -- :wob:
[2022-8-04. : 11:35 am]
UndeadStar -- :wob:
Please log in to shout.


Members Online: Roy, Dem0n