# each 10 waves a boss must appear

#### MissKerrigan

##### Active Member
Hello Guys,

My problem is multi-way, I try to explain it down here

- I want the new wave to run ONLY if all creeps in the game are killed (also other players)
- So I placed the creeps in the unit group wave units after they spawned
- The trigger-event is creep dies/escapes and the condition is when the unit group wave units is empty, then a new wave will be spawned

This works very nice but I got one question:

- How do I spawn 9 normal waves and a boss after? (1 boss each 10 levels)

Marloes

note: I can't create a trigger that repeats 9 times and creates a boss after, because the new wave must start only when the last creep in the game is killed or has escaped

#### Siretu

##### Starcraft 2 Editor Moderator
Staff member
Have a global integer variable that keeps track of your current level. So have the integer start at 1 and then every time you spawn a wave, add one to the integer. Then you can have a check that checks if it's level 10, spawn a boss wave, otherwise spawn a normal wave.

To adapt this to make it every 10 waves and not just wave 10, set up the condition to be Modulo(level, 10) == 0

#### MissKerrigan

##### Active Member
which condition is checking if the integer is 10? and what's a module?

#### Phubar

##### Well-Known Member
Modulo(X,Y) gives you the remainder of the division X/Y
Es Modulo(5,2) gives 1 (5/2=2 with remainder 1)
Modulo(12,7) gives 5 (12/7=1 with remainder 5)
Modulo (12,10) gives 2 (12/10=1 with remainder 2)
Modulo (20,10) gives 0 (20/10=2 with remainder 0)

When you need to start a weave make an If/Then/Else action and use the conditions to check if the value of "Modulo(level, 10) == 0" is true (you are in a 10, 20, 30, 40 wave) and then spawn a Boss, else you are in a middle weave so spawn normal creeps.

#### MissKerrigan

##### Active Member
sorry I don't get it

module 12,7 = 5
module 12,10 is 2

why then module 20,10 isn't 10??

I guess we're going to much into math now

Can't I just make a trigger like this?

action:

if: integer is 10
then: create boss
else: create normal wave

??

#### Siretu

##### Starcraft 2 Editor Moderator
Staff member
It's a simple operation. You don't have to know how it works, just use it.

If you want to understand:
You put the second number as many times as possible in the first one, how much is left? Imagine that the first number is a box of that size and the second number is an item.

Example: modulo 12,7: How many times can you put 7 in 12? Well, you can only put it there one time. So what do you have left? Well you have 12-7 = 5 left.

Example modulo 13,4: How many times can you put 4 in 13? You can put it 3 times because if you take four of it, you get 16 which doesn't fit in the 13 box, so the max is 3. If you put 3 4's in the 13 box, how much do you have left? Well 3 boxes of 4 has the size 4*3 = 12. If you put 12 in 13, you got 1 left.

Example: modulo 20,10: How many times can you put 10 in 20? Well, two times because 2*10 is 20. If you put 20 in a 20 box, how much do you have left? Nothing! It's all full! So you got 0 left.

#### MissKerrigan

##### Active Member
so what's the point of this?
which numbers do I have to make now?

I have 24 creep waves, and the 25th is a boss

Maximum level is 200, so it are 8 bosses in total

Let me guess: I have to make a module 24,1 now?

#### Siretu

##### Starcraft 2 Editor Moderator
Staff member
No, you'd have modulo 24,25. How many times does 25 fit in 24? 0 times. How much is left? 24!

Also, I thought you had boss levels every 10 levels?

#### X-maul

##### AKA: Demtrod
If your boss waves are not in a specific order (every 5 or 10 wave) then just make a condition that checks if the wave is 10, another one checking if it's 25 and so on, for every boss level.

#### MissKerrigan

##### Active Member
1. yes I had bosses each 10 waves, but after each boss, a new unit in the command card will be unlocked, it's too fast if I create this after each 10 rounds

2. I still don't get it, I'm very sorry I must sounds really stupid now

25 fits 0 times in 24, but why then is 24 left???
and how can I understand, if the number is 24, then 24 waves are coming and 1 boss after?

(X-Maul: if there would be a condition that checks if the integer is a specific number, then I already would figured it out)

#### X-maul

##### AKA: Demtrod
(X-Maul: if there would be a condition that checks if the integer is a specific number, then I already would figured it out)
If you go right click the conditions and click New Element, you will see this screen;

Then you click where I marked with red.
Then you will see this;

Click the red circle, and you will see all your variables (Global and local for that trigger).
Now select the variable you want to compare, and depending on what type it is, you can set the camparing part to something. If it's an integer variable, you can set it to a number, if it's a boolean you can set it to true or false, and so on.

In the end it will look like this;
Code:
``````Untitled Trigger 001
Events
Local Variables
X = 0 <Integer>
Conditions
X == 1
Actions

#### MissKerrigan

##### Active Member
!!!! I DIDN'T KNOW THIS YET !!!!

Does this means, that if I add +1 to an integer every wave, I can trigger the boss waves if the variable is 24/49/74 and 99?

That would just be making 4 condition triggers for 4 bosses, I'm gonna try this out

THANK YOU!

#### X-maul

##### AKA: Demtrod
You're very welcome. You have to understand that a condition is just a camparison of 2 values. each value can be set to either a variable, or a function to get a value.

#### Siretu

##### Starcraft 2 Editor Moderator
Staff member
There's also a condition called compare. If you look at X-mauls first picture, there's a list of conditions with "Comparison" currently selected. If you want it to trigger at 24/49/74/99, you have to use an OR and then afterwards create the conditions with X-mauls instructions. This way, it checks if the wave is 24 OR 49 OR 74 OR 99.

If you don't do this, it'll check if the wave is 24 AND 49 AND 74 AND 99, and that obviously wont work since it cant be two different waves at the same time.

#### MissKerrigan

##### Active Member
so instead of making 4 triggers, I can just make an 'or' condition with the values 24,49,74 and 99? thanks

But there must come only 1 boss when the condition is true

#### X-maul

##### AKA: Demtrod
The OR condition returns true, if any of the conditions are true

In your case, it will check if any of the 4 values, then it will return true, if not, then false.

#### Siretu

##### Starcraft 2 Editor Moderator
Staff member
So yes, there will only come one boss when the condition is true.

#### MissKerrigan

##### Active Member
txx

General chit-chat
Help Users
• No one is chatting at the moment.
• Varine:
Did we get a new chat thing?
• Ghan:
We did!
• Ghan:
The old shoutbox wasn't supported anymore. We updated xenForo, so it had to be replaced.
• jonas:
let's see if everyone finds it... the nice thing about the shoutbox was I could check on it even while logged out, but the existence of this one is hidden when you're not logged in
• Ghan:
We can fix that.
• Ghan:
Chat should show on the sidebar when not logged in now.
• Ghan:
• Ghan:
Test!
• tom_mai78101:
I must be in a test server.
• tom_mai78101:
Nice, Twitter tweets embedding now works
• Wizard:
Yup.
• Ghan:
Excellent.
• Ghan:
@tom_mai78101 Hello there.
• Ghan:
Tagging works in the chat too.
• tom_mai78101:
@Ghan Missed it.
• Wizard:
Still fixing things here and there. Added widgets to the portal, will make it match the ones here on the forum index tomorrow.
• Ghan:
The venerable World Editor Tutorials site has been converted to HTTPS at last.
• jonas:
cool
• jonas:
and I can even edit my messages, nice
• seph ir oth:
GENERAL CHIT CHAT, YOU ARE A BOLD ONE
• Ghan:
Hello there
• The Helper:
this new chatbox is great and the forum software update is great too
+1
• The Helper:
upgrade has fixed forum registration spam problem
• tom_mai78101:
Something tells me we might be able to customize the chatbox a bit, considering that there's a gap under every message.

### Members online

No members online now.