HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Refering to Region Variables in "Unit enters" events

04-19-2005, 08:17 PM#1
Skwee
is it possible to refer to region Variables in 'unit enters blank region events?

Right now, my variable isnt showing up.

If it isnt possible is there a way around this?
04-19-2005, 08:57 PM#2
Anitarf
You can add events to triggers with the "trigger - add event" action. It accepts a variable there, however, don't misunderstand that, it will just add an event for the region to which the variable currently points to and the event will not change should the variable change, so, you would need to add a new event whenever it changes. At the same time, as far as I know, there's no way to remove events from triggers, so the problem is that the events would accumulate over time, and when one of them fired, you would have no way to determine which region is the entered region, because I see no "entered region" event response, and the boolean comparison "unit is in region" does not always give the same results, because the unit is on the edge of the region when this event happens, and it is considered to be in the region if it's on the top edge and outside of the region if it's on the bottom edge or something like that.

So, you would need to destroy and create whole triggers whenever you changed which region your variable points to. I think they could be very siple, though, because I read that event responses carry over to triggers you run with the "trigger - run trigger action", so all you would need to create when the region variable changed would be a trigger that runs on the "unit enters region" event and immediately runs the trigger that would actually do stuff. I haven't yet done anything like this in practice, so I'm speculating a bit here, someone like Lord Vexorian should confirm exactly how this could be done.
04-19-2005, 09:05 PM#3
Skwee
Quote:
Originally Posted by Anitarf
You can add events to triggers with the "trigger - add event" action. It accepts a variable there, however, don't misunderstand that, it will just add an event for the region to which the variable currently points to and the event will not change should the variable change, so, you would need to add a new event whenever it changes. At the same time, as far as I know, there's no way to remove events from triggers, so the problem is that the events would accumulate over time, and when one of them fired, you would have no way to determine which region is the entered region, because I see no "entered region" event response, and the boolean comparison "unit is in region" does not always give the same results, because the unit is on the edge of the region when this event happens, and it is considered to be in the region if it's on the top edge and outside of the region if it's on the bottom edge or something like that.

So, you would need to destroy and create whole triggers whenever you changed which region your variable points to. I think they could be very siple, though, because I read that event responses carry over to triggers you run with the "trigger - run trigger action", so all you would need to create when the region variable changed would be a trigger that runs on the "unit enters region" event and immediately runs the trigger that would actually do stuff. I haven't yet done anything like this in practice, so I'm speculating a bit here, someone like Lord Vexorian should confirm exactly how this could be done.

My variable is changing constantly... hehe i'll just start a new project i guess
04-20-2005, 12:16 AM#4
Raptor--
Quote:
Originally Posted by Skwee
My variable is changing constantly... hehe i'll just start a new project i guess

well u don't have to give up just cause of that, there are probably more efficient, less convoluted ways to do what you're trying to do
04-20-2005, 01:51 AM#5
Skwee
Quote:
Originally Posted by Raptor--
well u don't have to give up just cause of that, there are probably more efficient, less convoluted ways to do what you're trying to do

lol it wasnt really a project, just a little something i got side tracked with. lol i'll probably come back to it in a month or so