Glad I could help :) do me a favor and edit the title of your thread with [Resolved] both so people know it's fixed, and so if people are looking for a solution they know one is here :)
a (bad) workaround I can think of, are to stick actual circular regiongs in some corner of the map, assign them to the trigger, and then turn them off until you need each one, then move it and turn it on (attach it to the unit)...
I'm not sure what you are asking... You are creating text tags. You want to remove the text tags NOT after a time, but when you decide to destroy them? If this is the case, you can make an array and put the text tags in that array so you can destroy them when ever you want.
From the Looks of it, you are new to scripting. I suggest you go down to the resources section and check out the tutorials. There are a lot of good resources on this forum.
That being said... I am going to guess at a few clarifications, if they are wrong then my solution may not work... but from the sounds of it, you want to have a region in which, every 5 seconds of game time, the game checks to see if a player has a unit in it. This unit can be of any type and the player can have any number of units in it. If the player has at least one unit of any type within this region, they get a certain ammount of minerals. It does not matter if they have one or twenty units in the region, they get a fixed ammount of resources. Then you want to have multiple regions that behave like this. If the player has units in multiple of these regions, they then get the resources for each region they have a unit it, regardless of how many units are in each one... (i.e. a player has one unit in regionA, three units in regionC, and thirteen units in regionF, they would get three times the resources)
IF this is the case... You will need something as follows...
Global Variable(type: region, array): RegionArrayForResources (put ALL your regions in this variable array)
Global Variable(type: interger): TotalNumberOfRegionsMinusOne
Count: 1 NOTE: This can be Any Amount, I just set it to 1 to stop after we find at least 1 unit)
Opperator: >
Value: 0
Then:
Modify Player Property
Player: 1
Property: Minerals
Operation: Add
Value: 10
Now if you want this to work for multiple players, you need to add a "pick each player" loop between the For-Each and the If-Then-Else and change the player index to arithmetic: picked player - 1
If a lot of this doesn't make sense, I really suggest you go look at the tutorials. Solusions to problems like this can seem simple, and end up being quite convoluted. There might be a shorter "cheatier" way to do this, but it most likely will result in buggy behavior down the road.
So I got lost in all the bizzare explanations what you were trying to do...
You want to be able to do "actions" when a unit enters within a certain range of a drop pod???
Is this drop pod a unit or a doddad?
Is there the possibility of being more than 1 drop pod
Assuming the pod is a unit and there will only be one you need this...
Event: Unit is created
Conditions: Unit type == Drop Pod
Actions: variable: MyDropPodHolderVariable == triggering unit
THEN, in your other trigger you need
Event: Unit Enters/Leaves Range Of Unit
Unit: Any Unit
State: Enters
Range: SomeRangeVariable
From Unit: MyDropPodHolderVariable (If this isn't a choice, check your variable type)
Conditions: !Make sure the unit is a valid unit cause this is going to fire every time ANY unit gets close to this drop pod
Actions: !Do Some Stuff
The first time you make this (or any trigger) put an action "Debug Msg" and have it output "Running Trigger (name of trigger) so that way you know the trigger is at least executing. Its a REALLY good practice, and anyone making maps should always do it.
There might be a way to short cut it... but the solution that imedately comes to mind is...
Events:
Timer Expires - myThirtySecondTimer
Actions:
Pick each unit in unit group - Units In Region Matching Condition (Any, yourPFregion, 1, Excluded... , Any Amount)
Actions
If (unit type == P.F.)
Do This stuff like spawn a Levithan
Edit: If you are checking your WHOLE map for these P.F.s and you have a lot of units, this is going to bog down your game. If that's the case, then I'd do something like "when a unit is created, condition it's a P.F., add one to variable LevithansToBeSpawned". Then reset the variable OR track when a unit is killed, and subtract one from the varible if you want the possibility of multiple Levithans to be spawned if a P.F. remains in the region for prolonged periods
Not sure what everyone's getting at... but your problem is probably of data types...
Unit - Any unit enters within X of (point) takes a point, so you cannot use a "unit". What you need to do is get the "point" or position of the unit. So instead of trying to put in your unit variable, use the function "get position of unit" (I think that's what it's called) and THEN, when it asks for the unit, you can put in your unit variable.
So it looks like, for now, we have to create our own event handler (aka using a looping timer, which I imagine gets a bit slow with heavy loads) or we piggy back if you will, our actions onto another one.
I've been working with Delegates in the XNA framework, and so I don't like the idea of having to create a loop... this event isn't going to fire very often, doesn't require any logic to fire (I'm just calling it), and I don't like adding the "cost" of 32 if statements a second (I know the engine can take it)... Ugh...
I've thought about stealing one of the built in events that doesn't ever fire, locking it out some how, and then simply using a force call to it, but I haven't seen a way to force an event either, other than creating a trigger that does what ever it takes to trigger that event. This may be the solution I use if I can find a couple events to highjack.
Thanks everyone for your input. Maybe Blizzard will stick events in the next content patch and we won't have to worry about this messy business.
I thought I had it, but I must have posted it in another thread...
I've got a repeating timer that uses a decrementing counter each loop, and then is paused when the counter reaches zero. This timer spawns a unit each tie the counter expires. I'd like to "throw an event" when this counter reaches zero so people using the library may use the event to build game logic around.
Just to clarify, are you debating between learning to script i GS (Galaxy Script) vs GUI triggers? or are you debating on wether to pick up SC2 edtitor as opposed to something like UDK (Unreal Development Kit) or Unity etc???
I am going to assume that you mean script vs GUI.
My short answer is... If you''re comfortable being called a "programmer", pick up scripting, if you aren't use the GUI.
SC2 is a bit more complex than WC3, but I recomended WC3 editor to a lot of my art major friends back in school because it was "color by number programming". That's not to make it sound bad or childish, it helps protect you from making a lot of mistakes and getting stuck on "programmer bugs" like the perverbial missig semi colon (Galaxy's Debugger is... barely there). It' also a good place to learn and refine your programming skills in terms of structure if you are a beginner programmer.
If you want deep control at the cost of complexity, script, but I doubt you'd be asking this question if that were the case.
0
Glad I could help :) do me a favor and edit the title of your thread with [Resolved] both so people know it's fixed, and so if people are looking for a solution they know one is here :)
0
a (bad) workaround I can think of, are to stick actual circular regiongs in some corner of the map, assign them to the trigger, and then turn them off until you need each one, then move it and turn it on (attach it to the unit)...
0
Ahh, Helral answers your question... I did not know that about the SC2 engine... that's unfortunate...
Good to know, I hadn't read through all the responses... my bad.
It looks like this isn't possible without using custom scripts.
0
I'm not sure what you are asking... You are creating text tags. You want to remove the text tags NOT after a time, but when you decide to destroy them? If this is the case, you can make an array and put the text tags in that array so you can destroy them when ever you want.
0
@PsychoMC: Go
I am not sure about anything but the first sentance of your question... and even that I'm not sure about... but here's a guess.
You want a trigger that goes off when a unit gets within a certain distance of another unit.
If this does not work for you, and you actually need to use a region, there is an event "Any Unit Enters Region"
0
From the Looks of it, you are new to scripting. I suggest you go down to the resources section and check out the tutorials. There are a lot of good resources on this forum.
That being said... I am going to guess at a few clarifications, if they are wrong then my solution may not work... but from the sounds of it, you want to have a region in which, every 5 seconds of game time, the game checks to see if a player has a unit in it. This unit can be of any type and the player can have any number of units in it. If the player has at least one unit of any type within this region, they get a certain ammount of minerals. It does not matter if they have one or twenty units in the region, they get a fixed ammount of resources. Then you want to have multiple regions that behave like this. If the player has units in multiple of these regions, they then get the resources for each region they have a unit it, regardless of how many units are in each one... (i.e. a player has one unit in regionA, three units in regionC, and thirteen units in regionF, they would get three times the resources)
IF this is the case... You will need something as follows...
Global Variable(type: region, array): RegionArrayForResources (put ALL your regions in this variable array) Global Variable(type: interger): TotalNumberOfRegionsMinusOne
Trigger: GivePlayersResources
Now if you want this to work for multiple players, you need to add a "pick each player" loop between the For-Each and the If-Then-Else and change the player index to arithmetic: picked player - 1
If a lot of this doesn't make sense, I really suggest you go look at the tutorials. Solusions to problems like this can seem simple, and end up being quite convoluted. There might be a shorter "cheatier" way to do this, but it most likely will result in buggy behavior down the road.
0
Take it easy. Lets not get worked up yet...
So I got lost in all the bizzare explanations what you were trying to do...
You want to be able to do "actions" when a unit enters within a certain range of a drop pod???
Is this drop pod a unit or a doddad?
Is there the possibility of being more than 1 drop pod
Assuming the pod is a unit and there will only be one you need this...
THEN, in your other trigger you need
The first time you make this (or any trigger) put an action "Debug Msg" and have it output "Running Trigger (name of trigger) so that way you know the trigger is at least executing. Its a REALLY good practice, and anyone making maps should always do it.
0
Also note: this could have been googled
0
0
There might be a way to short cut it... but the solution that imedately comes to mind is...
Edit: If you are checking your WHOLE map for these P.F.s and you have a lot of units, this is going to bog down your game. If that's the case, then I'd do something like "when a unit is created, condition it's a P.F., add one to variable LevithansToBeSpawned". Then reset the variable OR track when a unit is killed, and subtract one from the varible if you want the possibility of multiple Levithans to be spawned if a P.F. remains in the region for prolonged periods
0
@Devrak: Go
Not sure what everyone's getting at... but your problem is probably of data types...
Unit - Any unit enters within X of (point) takes a point, so you cannot use a "unit". What you need to do is get the "point" or position of the unit. So instead of trying to put in your unit variable, use the function "get position of unit" (I think that's what it's called) and THEN, when it asks for the unit, you can put in your unit variable.
0
So it looks like, for now, we have to create our own event handler (aka using a looping timer, which I imagine gets a bit slow with heavy loads) or we piggy back if you will, our actions onto another one.
I've been working with Delegates in the XNA framework, and so I don't like the idea of having to create a loop... this event isn't going to fire very often, doesn't require any logic to fire (I'm just calling it), and I don't like adding the "cost" of 32 if statements a second (I know the engine can take it)... Ugh...
@RileyStarcraft: Go
I've thought about stealing one of the built in events that doesn't ever fire, locking it out some how, and then simply using a force call to it, but I haven't seen a way to force an event either, other than creating a trigger that does what ever it takes to trigger that event. This may be the solution I use if I can find a couple events to highjack.
Thanks everyone for your input. Maybe Blizzard will stick events in the next content patch and we won't have to worry about this messy business.
0
@Klishu: Go
I thought I had it, but I must have posted it in another thread...
I've got a repeating timer that uses a decrementing counter each loop, and then is paused when the counter reaches zero. This timer spawns a unit each tie the counter expires. I'd like to "throw an event" when this counter reaches zero so people using the library may use the event to build game logic around.
0
@Jercy: Go
Just to clarify, are you debating between learning to script i GS (Galaxy Script) vs GUI triggers? or are you debating on wether to pick up SC2 edtitor as opposed to something like UDK (Unreal Development Kit) or Unity etc???
I am going to assume that you mean script vs GUI.
My short answer is... If you''re comfortable being called a "programmer", pick up scripting, if you aren't use the GUI.
SC2 is a bit more complex than WC3, but I recomended WC3 editor to a lot of my art major friends back in school because it was "color by number programming". That's not to make it sound bad or childish, it helps protect you from making a lot of mistakes and getting stuck on "programmer bugs" like the perverbial missig semi colon (Galaxy's Debugger is... barely there). It' also a good place to learn and refine your programming skills in terms of structure if you are a beginner programmer.
If you want deep control at the cost of complexity, script, but I doubt you'd be asking this question if that were the case.
0
other solution:
other other solutions (read: "bad solutions"):