Staredit Network > Forums > SC2 Assistance > Topic: Create Units with Unit Count Interval+ More
Create Units with Unit Count Interval+ More
Dec 24 2010, 12:55 am
By: Nib-  

Dec 24 2010, 12:55 am Nib- Post #1



Alright, so I started working on my map again and it's going to be a Helms Deep type of map. My problem with this are the triggers because SC2 triggers are so much more complicated than SC1....

1.
When I try to run the trigger (in the picture below), it is supposed to first check if there are 0 to 75 any units in Region 001 (the entire map), (if trigger)
if true, create these units specified below at certain locations and run trigger again waiting for the current one to finish
if false, run the trigger again waiting for the current one to finish

Problem is the if trigger isn't working correctly. Can anyone help?

2.
Also. How do you do the sc1 trigger of "Bring any unit to location" condition?

3.
How would I make an area of buildings invincible without triggers and if I can't do that how would i do it with triggers?



Attachments:
untitled.bmp
Hits: 1 Size: 3290.24kb



None.

Dec 24 2010, 1:09 am payne Post #2

:payne:

1. Use a "Periodic Event" Event. the "Map Init" only runs once: at map's first second.
2. You're searching for "Unit Matching Conditions" as the Unit.
3. Via triggers, use "Set Invincibility" (or is it "Set State" or "Set Invulnerability"). Via Data Editor, there's an "Invincible" (or "Invulnerable"?) flag you can check in the specific building's Unit tab. However, this flag will apply to all buildings on the map. Via triggers, I think you can also use the "Add Behavior" action to add the Behavior "Invincible" (or...) to the buildings.



None.

Dec 24 2010, 1:12 am NicholasBeige Post #3



1. This type of map will suck on SC2 because SC2 has a graphics engine, as opposed to SC1 which had Microsoft Paint. People will be forced to run your map on the lowest graphic settings, or be leave as soon as their frame-rate drops to unacceptable levels.

But, to answer your questions:
1. Firstly, your If statement. You're saying IF 0 is less than or equal to the number of units 'attached to the region'.. and well, okay.. Sorry I give up, I'll let someone else do this, someone with more patience.

In the mean time, go read a tutorial.

Edit: Epic Ninja'd by payne.



None.

Dec 25 2010, 1:15 am doite Post #4



Nib this map is waaaaaaaaaaaaaaaaaaay to hard for u to make... U will come back and ask for 10000 stuff if u cant even figure those out.. Read guides, look at onetwo howto's on youtube and try to learn more basic stuff



None.

Dec 25 2010, 2:05 am Ahli Post #5

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

@ 1
It won't work that way because the trigger runs over and over and over without wait/sleep. It's an hidden infinite loop. Starcraft should throw the error with "nested ..." something.
solutions:
-> Check if there are <= 75 guys in the area periodically like payne said it.
-> OR check that, whenever a unit dies OR leaves the region

Btw, you can have actions below the whole "if"-thing that will be executed after the "if" or "else". Having the same action for "if" and "else" is redundant and can be shortened with 1 action after the "if"-thing.


The unit attached condition won't count the units inside the region (I THINK... have to tinker a bit with that to gain more knowledge about regions and unit attachments).


@payne
his main mistake is the trigger call which causes an infinite loop, not when the whole loop is initiated which will cause many many units spawned at map start and/or causing an error.

@2
payne's post!

@3
without triggers -> data editor -> behavior with an periodic effect that searches buildings in an area around the unit and which will add an invincibility behavior onto the unit which will have a limited lifetime and disables the invincibility, if the time expires.
I would start copying the mothership's cloak ability and change the effect. It's doing what you want with a wrong unit filter and wrong effects.

Quote from doite
Nib this map is waaaaaaaaaaaaaaaaaaay to hard for u to make... U will come back and ask for 10000 stuff if u cant even figure those out.. Read guides, look at onetwo howto's on youtube and try to learn more basic stuff
You learn nothing, if you do nothing. Better start and learn to do things one by one even if you might cancel the map later on.
Every working system is a success and the gained knowledge will help him later on.

Post has been edited 1 time(s), last time on Dec 25 2010, 2:12 am by Ahli.




Dec 27 2010, 4:59 am Nib- Post #6



Quote from Ahli
@ 1
It won't work that way because the trigger runs over and over and over without wait/sleep. It's an hidden infinite loop. Starcraft should throw the error with "nested ..." something.
solutions:
-> Check if there are <= 75 guys in the area periodically like payne said it.
-> OR check that, whenever a unit dies OR leaves the region

Btw, you can have actions below the whole "if"-thing that will be executed after the "if" or "else". Having the same action for "if" and "else" is redundant and can be shortened with 1 action after the "if"-thing.


The unit attached condition won't count the units inside the region (I THINK... have to tinker a bit with that to gain more knowledge about regions and unit attachments).


@payne
his main mistake is the trigger call which causes an infinite loop, not when the whole loop is initiated which will cause many many units spawned at map start and/or causing an error.

@2
payne's post!

@3
without triggers -> data editor -> behavior with an periodic effect that searches buildings in an area around the unit and which will add an invincibility behavior onto the unit which will have a limited lifetime and disables the invincibility, if the time expires.
I would start copying the mothership's cloak ability and change the effect. It's doing what you want with a wrong unit filter and wrong effects.

Quote from doite
Nib this map is waaaaaaaaaaaaaaaaaaay to hard for u to make... U will come back and ask for 10000 stuff if u cant even figure those out.. Read guides, look at onetwo howto's on youtube and try to learn more basic stuff
You learn nothing, if you do nothing. Better start and learn to do things one by one even if you might cancel the map later on.
Every working system is a success and the gained knowledge will help him later on.


haha. thanks for being supportive. sc1 is so much easier than sc2....

1. What I'm currently wondering is why this would be an infinite loop. The logic i was looking for was, "If player 4 commands less than 75 units, then the player 4 respawns his 200ish units, which should check not at a certain interval, but continuously. Oh wait. I accidentally put player 1 instead of player 4... Lol. If i changed that to player 4 instead of player 1, would this be fine as a trigger?

2. thanks for your help payne

3. Also, going back to the invincibility question, I was going to have it where a set of supply depots start out invincible (thus the gates from sc1) and by killing a certain building (hinge) it would deactivate those supply depots' invincibility. Data modding sounds like a great idea but the radius would be very inflexible, and I don't want these supply depots to stay invincible like payne suggested by setting them default. Also, Via Triggers, i tried that but that would mean i would have to create about 30 supply depots and about 200 hinge defenses that turned invincibility off and on, via triggers. So I guess the question I wanted to ask was, How would i set a group of certain units in a specific location invincible and be able to toggle it off later? Or would data modding be the only option?



None.

Dec 27 2010, 12:16 pm Ahli Post #7

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

Quote from Nib-
1. What I'm currently wondering is why this would be an infinite loop. The logic i was looking for was, "If player 4 commands less than 75 units, then the player 4 respawns his 200ish units, which should check not at a certain interval, but continuously. Oh wait. I accidentally put player 1 instead of player 4... Lol. If i changed that to player 4 instead of player 1, would this be fine as a trigger?
The code runs over and over and never comes to the point where the system can do other stuff. The problem is that you are starting the trigger at the end of your trigger every time.

There are other events that are suited for your problem like the "unit leaves region" and the "unit dies". Both will start the trigger and in that trigger you should check the amount of alive units within a region. And they are more efficient than a periodic checks because periodic checks cause periodic lags.

Quote from Nib-
3. Also, going back to the invincibility question, I was going to have it where a set of supply depots start out invincible (thus the gates from sc1) and by killing a certain building (hinge) it would deactivate those supply depots' invincibility. Data modding sounds like a great idea but the radius would be very inflexible, and I don't want these supply depots to stay invincible like payne suggested by setting them default. Also, Via Triggers, i tried that but that would mean i would have to create about 30 supply depots and about 200 hinge defenses that turned invincibility off and on, via triggers. So I guess the question I wanted to ask was, How would i set a group of certain units in a specific location invincible and be able to toggle it off later? Or would data modding be the only option?
I would add all the units with filters (e.g.: alive, building) to a unit group (global variable, variable in the trigger list), check every unit's type (e.g.: being a supply depot) and activate the invincibility. Later on, I would run through the unit group again and disable the invincibility.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[01:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
Please log in to shout.


Members Online: RIVE, Roy