hi,
I build with my builder units, a BMARINE (custom marine) into region with ID 1, that have inside other ragions with id 11 to 240.
From here its all is ok.
I want when "X time go away", build into a ragion with id 11+1140 to 240+1140 a normal MARINE (not custom) into the same region of Bmarine but with ID+1140
I build a script but dont work. If i check into clicle that in region id 11to240 have a BMARINE, dont work. If i check into cicle that in region id11to240 have someone, script build me 240 marines units into region id1150 to 1380...
yeah.. that is problem.. if i build 1-2 x... BMARINE, in X different region, its not important, the wrong scritp, dont left work, and dont build anythingh or build in all region assigned to build
I want build ONE ONLY Bmarine at regionid 11 or 12 or 14 and 55... and found a Marine at region id: 11+1440 or 12+1440 or 14+1440 and 55+1440 ... in the same region id of Bmarine+1440. bUT, if BMARINE havent in some region ID, i want that script build anything
You might need to post more of your triggers, such as the triggers responsible for attaching units to regions. RegionGetAttachUnit will only return a unit if you attach the region to one using the following native.
Without attaching a unit to the region it will likely return null. Getting the unit type of null might return a null string. This would explain why it either evaluates true for all regions or no regions.
If the Bmarine is stationary you could attach the appropriate region to it. Then the trigger may work.
Otherwise those natives might not be what you are after using.
bmarine it is a no attacker units. He is just what u build for waves 1Bmarie = 1marine on arena 1Bdevastator = 1 devastor on arena 34Bmarine = 34marine on arena in the same position of bmarine. Script of attak i think is not important, but if u need i post all code. More good, i post all project ^^ pls help me, im blocking
Trigger: quanti Bmarine entrano 1 it is the triger of problem
Your trigger does not make any sense for the reason I mentioned before. You never attach any regions to any units so trying to get the unit a region is attached to will always return null. I think you misunderstood the mechanics of the function.
I do not understand clearly what you want done but I tried to make a trigger that seemed logical and could be what you want. When the unit enters the big region I look for which sub-region it is in. Units appear to spawn in a reasonable way but I am not sure if that is intended.
this script dont work if i make a timer for wave on condition. like:
TriggerAddEventTimePeriodic(10,c_timeGame)
That is because that is an "event" not a "condition"?
This is the first time I am reading anything about periodic events. What job must be done periodically?
If you want to periodically spawn all units placed then use some kind of array system to track them. Use a 2 dimensional int array where each column represents the unit type spawned and each row the spawn point with the value being the number to spawn. You could use a boolean array in parallel to rows (via struct or a separate array) to keep track of which spawn points have units to spawn so that you do not bother checking the columns needlessly. The mapping of column to unit type could be done with a unit type array.
NOTHING, my mind it is broke, can you help me for the last time? u can use the last map that i post here. Can u write me this? This is a last rock i think, for finish my project.
Soo, THX very much if u can or if u cant, for all your help u give to me.
fixing waves by timer like what u told me. spwan units at periodic time event. Put some Bmarine and after x time, marine spawn on arena like old fix but after periodic time, in some position of bmarine, but on arena . Just add a periodic time event, and array bidimensional like what u told me for give last fix work with a periodical timer event . If u can/want..
The idea is to create a data fed system to minimize your work and maximize efficiency. I demonstrate you such a system in your map that spawns both marines and reapers.
Currently it only works for player 1 as you did not cover other players as far as desired behaviour goes. However it should be easy enough to extend to all players with a few modifications.
Ive think to make other area 2x2, but that hurt, lot of location areas on map, and ive to duplicate all script. I dont want make heavy all. Some idea?
I have no idea what you are asking. I am not even entirely sure what you are after still since you never explained it anywhere in understandable English so I have been having to guess.
Some observations I made from my last edit.
Your regions appear to be in a grid, consider generating them with simple loop triggers. This turns your hours of work copying regions into about 30 seconds of writing triggers. And changing the region granularity becomes a few seconds job at most.
If you are after simple point translation then consider doing that rather than anything with regions. Then you could loop for all units in a big region and use a switch statement to convert the spawner type into a spawn type and then with a translation (add a point) spawn where you want. Would be easier and more accurate.
i hope that my description of problem now it is more accurate:
I try to explain:
The last script make for example a Bmarine with route(plane i think it is more good word) 1x1 into a 1x1 area of player1. After the script, build a new units, by what it found on area 11 to 240, for example a Marine.
The problem is that:
when i make for example, a tank, a units that have trace 2x2, the script found one unit on lot of area :11,12,51,52 and dont work and make a error.
If i try to resize units route of a units 2x2 to 1x1, the script work, but if i make units near, the script make error. I think becouse found 2 units in the same area.
I hope to make problem more clear and comprehensible , if dont... i try again ^^
I post the latest map with error when try to build a tank. In game: Select Ajatax builder, on menu press F, after build a tank, S shortcut
P.s.
Excuse me for bad english, my english it is unforgivable
The footprint size of the unit should make no difference since it tests the origin point. What I guess is happening is you have regions overlapping at corners so when a unit is 2*2 it's origin is in all 4 regions.
As I stated, there is probably a far easier solution to this that I will look in to now.
EDIT1: Upon looking at the regions I noticed some of the spawn ones were out of bounds. Is this intentional (will not alter).
yes, for make more long the way of arena i move spawn region out of camera limit. I search to dont make more big the map for dont make it heavy. Now have only 1player vs cpu, but after i will want make 3v3 players and the map must to be not heavy.
Here we go. I removed all your regions and replaced them with the point translation system I described earlier. The result is your map is now even smaller than when you first handed it to me. It also supports all 6 players as well.
Add the Protoss units to the spawn function as you did with Terran units as it handles both.
I am not too sure about the performance but I would imagine it being good for at least 100-200 spawns per wave (past which the units themselves would probably be the performance bottleneck).
hi, I build with my builder units, a BMARINE (custom marine) into region with ID 1, that have inside other ragions with id 11 to 240.
From here its all is ok. I want when "X time go away", build into a ragion with id 11+1140 to 240+1140 a normal MARINE (not custom) into the same region of Bmarine but with ID+1140 I build a script but dont work. If i check into clicle that in region id 11to240 have a BMARINE, dont work. If i check into cicle that in region id11to240 have someone, script build me 240 marines units into region id1150 to 1380... yeah.. that is problem.. if i build 1-2 x... BMARINE, in X different region, its not important, the wrong scritp, dont left work, and dont build anythingh or build in all region assigned to build
with:
(UnitGetType(RegionGetAttachUnit(RegionFromId(lv_cicloposizioni))) == null)
with:
(UnitGetType(RegionGetAttachUnit(RegionFromId(lv_cicloposizioni))) != null)
build nothing.
Here the code:
in finish:
I want build ONE ONLY Bmarine at regionid 11 or 12 or 14 and 55... and found a Marine at region id: 11+1440 or 12+1440 or 14+1440 and 55+1440 ... in the same region id of Bmarine+1440. bUT, if BMARINE havent in some region ID, i want that script build anything
no one can help me?
You might need to post more of your triggers, such as the triggers responsible for attaching units to regions. RegionGetAttachUnit will only return a unit if you attach the region to one using the following native.
Without attaching a unit to the region it will likely return null. Getting the unit type of null might return a null string. This would explain why it either evaluates true for all regions or no regions.
If the Bmarine is stationary you could attach the appropriate region to it. Then the trigger may work.
Otherwise those natives might not be what you are after using.
bmarine it is a no attacker units. He is just what u build for waves 1Bmarie = 1marine on arena 1Bdevastator = 1 devastor on arena 34Bmarine = 34marine on arena in the same position of bmarine. Script of attak i think is not important, but if u need i post all code. More good, i post all project ^^ pls help me, im blocking Trigger: quanti Bmarine entrano 1 it is the triger of problem
if u need more info, tell me pls. thx
Your trigger does not make any sense for the reason I mentioned before. You never attach any regions to any units so trying to get the unit a region is attached to will always return null. I think you misunderstood the mechanics of the function.
I do not understand clearly what you want done but I tried to make a trigger that seemed logical and could be what you want. When the unit enters the big region I look for which sub-region it is in. Units appear to spawn in a reasonable way but I am not sure if that is intended.
thx very much, it is what i want. Best reguard
P.s. Sorry, second time i work with editor of sc2, and i use a buider scripting inside; i think i make some error that u correct.
THX VERY MUCH AGAIN, U ROCK!
this script dont work if i make a timer for wave on condition. like:
TriggerAddEventTimePeriodic(10,c_timeGame)
becouse the script into variable enteringpoint use EventUnit() and also it dont storage all position but last position
That is because that is an "event" not a "condition"?
This is the first time I am reading anything about periodic events. What job must be done periodically?
If you want to periodically spawn all units placed then use some kind of array system to track them. Use a 2 dimensional int array where each column represents the unit type spawned and each row the spawn point with the value being the number to spawn. You could use a boolean array in parallel to rows (via struct or a separate array) to keep track of which spawn points have units to spawn so that you do not bother checking the columns needlessly. The mapping of column to unit type could be done with a unit type array.
thx, i try it
NOTHING, my mind it is broke, can you help me for the last time? u can use the last map that i post here. Can u write me this? This is a last rock i think, for finish my project. Soo, THX very much if u can or if u cant, for all your help u give to me.
Bye
Write you what? You have not asked for anything else other than the initial fix which appeared to be working.
fixing waves by timer like what u told me. spwan units at periodic time event. Put some Bmarine and after x time, marine spawn on arena like old fix but after periodic time, in some position of bmarine, but on arena . Just add a periodic time event, and array bidimensional like what u told me for give last fix work with a periodical timer event . If u can/want..
best reguard
The idea is to create a data fed system to minimize your work and maximize efficiency. I demonstrate you such a system in your map that spawns both marines and reapers.
Currently it only works for player 1 as you did not cover other players as far as desired behaviour goes. However it should be easy enough to extend to all players with a few modifications.
thx very much. Thousand of THX, script work very well.
yeah, i have a new problem incoming.
Now the project take soo big, and work very well.
But i found problem when i try to position a unit more big than 1x1.
for example a tank that have tile 2x2.
Have u some idea about for resolve the problem?
Ive think to make other area 2x2, but that hurt, lot of location areas on map, and ive to duplicate all script. I dont want make heavy all. Some idea?
thx, bye bye
No as I do not know what the problem is. You have not mentioned anywhere. You have only mentioned the cause. What is the problem?
Is it that it registers multiple copies of the unit? It should not be able to since it tests if the unit's origin is inside a region.
I have no idea what you are asking. I am not even entirely sure what you are after still since you never explained it anywhere in understandable English so I have been having to guess.
Some observations I made from my last edit.
i hope that my description of problem now it is more accurate:
I try to explain:
The last script make for example a Bmarine with route(plane i think it is more good word) 1x1 into a 1x1 area of player1. After the script, build a new units, by what it found on area 11 to 240, for example a Marine.
The problem is that:
when i make for example, a tank, a units that have trace 2x2, the script found one unit on lot of area :11,12,51,52 and dont work and make a error. If i try to resize units route of a units 2x2 to 1x1, the script work, but if i make units near, the script make error. I think becouse found 2 units in the same area.
I hope to make problem more clear and comprehensible , if dont... i try again ^^
I post the latest map with error when try to build a tank. In game: Select Ajatax builder, on menu press F, after build a tank, S shortcut
P.s. Excuse me for bad english, my english it is unforgivable
The footprint size of the unit should make no difference since it tests the origin point. What I guess is happening is you have regions overlapping at corners so when a unit is 2*2 it's origin is in all 4 regions.
As I stated, there is probably a far easier solution to this that I will look in to now.
EDIT1: Upon looking at the regions I noticed some of the spawn ones were out of bounds. Is this intentional (will not alter).
yes, for make more long the way of arena i move spawn region out of camera limit. I search to dont make more big the map for dont make it heavy. Now have only 1player vs cpu, but after i will want make 3v3 players and the map must to be not heavy.
Here we go. I removed all your regions and replaced them with the point translation system I described earlier. The result is your map is now even smaller than when you first handed it to me. It also supports all 6 players as well.
Add the Protoss units to the spawn function as you did with Terran units as it handles both.
I am not too sure about the performance but I would imagine it being good for at least 100-200 spawns per wave (past which the units themselves would probably be the performance bottleneck).