How to spawn per 10 kills HELP

Smilis

TH.net Regular
Reaction score
7
I belive it should look like this:

Trigger:
  • Evolution
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kills[(Player number of (Owner of (Killing unit)))] Equal to 10
        • Then - Actions
          • Set Kills[(Player number of (Owner of (Killing unit)))] = 0
          • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
        • Else - Actions


Your code has:

Trigger:
  • Set Kills[(Player number of (Owner of (Killing unit)))] = Kills[((Player number of (Owner of (Killing unit))) + 1)]


not
Trigger:
  • Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)



And if you look closly you can see that in the first exemple the +1 is inside the [ and ], but in the second it is outside the [ and the ] ;)
 

ballzdeep85

New Member
Reaction score
0
i updated pink is killing my units im getting the kills and pink is gettting the units to spawn for every 10 kills.

problem is i am getting credit for kills.

i dont know if this changes anything you were saying.

please let me know.

thankyou,
ballzdeep85
 

ballzdeep85

New Member
Reaction score
0
and how do i get it this way
Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)


i dont know how

thankyou,
ballzdeep85
 

Moridin

Snow Leopard
Reaction score
144
Hate to hijack this thread, but I never really understood the point of array size.. what's the use.. if any.. I'm pretty sure an array size of just 1 would still work.

This is for MPI. You have 12 players, so you need 12 different values for the integer hence the array size. It's 13, because the first array index is 0, not 1.

and how do i get it this way
Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)

Steps:

1) Action
2) Set variable

-> Set ______ = _______

3) Click the first ______
4) Select KillCount / any integer array with a size of 13

-> Set KillCount[_______] = __________

5) Click the _____ in the [ ]
6) Select Player - Player number

-> Set KillCount[Player number of (______)] = _________

7) Select the _______ inside the ( )
8) Select "Player - Owner of unit"
9) Click the inner _______
10) Select "Event response - Killing unit"


So now you have:

-> Set KillCount[(Player number of (Owner of (Killing unit)))] = _____________

11) Select the second ________
12) Choose Arithmetic
13) You will get __________ + 1
14) Leave the 1 and the +
15) Select the first blank here
16) Repeat from step 4 to 10.
 

Tyman2007

Ya Rly >.
Reaction score
74
I think you don't quite understand the concept of array size.. Array size isn't the amount of instances that the variable can hold, I know that much for sure, but it's something else that's overcomplicated and doesn't really matter.

As far as I know, a larger array size means less instances of the variable can be running at the same time, which isn't exactly a very sought after thing =\

Also, good eye Smilis :p I didn't catch that at first.

And ballz, thehelper frowns upon those who double post and don't use the "Edit" button.
 

Moridin

Snow Leopard
Reaction score
144
Oookay. I'm pretty sure I'm right, because I've been using this for the past 2 years :p.

An integer variable "Int" for example can hold one integer. When you make it an array of size 13, then you get the following possible storage options:

int[0] = ?
int[1] = ?
int[2] = ?
int[3] = ?
int[4] = ?
int[5] = ?
int[6] = ?
int[7] = ?
int[8] = ?
int[9] = ?
int[10] = ?
int[11] = ?
int[12] = ?

which are 13 possible variables.

Edit: ...and because you need 1 to 12 (For player numbers) you need an array size of 13. Please don't confuse the poor guy with what arrays are. They aren't "something overcomplicated that doesn't really matter". I'm somewhat amazed that you've been able to code without using arrays :S.

Edit 2: Read please
 

ballzdeep85

New Member
Reaction score
0
im so confused.

that tutorial is using code and all im using is all editor.

im still stuck.
im almost done with the map to start beta testing.
myabe this is a lost cause?

anything anyone can do to write this for me/ but not just for me but so i can look at it and just trial and error untill mine looks exactly the same.

thankyou,
ballzdeep85.
 

Moridin

Snow Leopard
Reaction score
144
Again. This will work. You need to ensure that is is EXACTLY the same though, including the brackets for the variable changes.

Trigger:
  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set KillCount[Player number of (Owner of (Killing unit))] = Killcount[Player number of (Owner of (Killing unit))] + 1
      • If (All conditions are true) then do (Then actions) else do (Else actions)
        • If - Conditions
          • KillCount[Player number of (Owner of (Killing unit))] = 10
        • Then - Actions
          • Set KillCount[Player number of (Owner of (Killing unit))] = 0
          • Unit - Create 1 <your unit> for (Owner of (Killing unit)) at (point) facing (angle)


Easiest way for the Set action, follow the instructions I posted earlier. The "1" is outside the variable array bracket.
 

ballzdeep85

New Member
Reaction score
0
how do i get the brackets ] +1
mine is on the outside.

i figured this was all i needed to get right.

sweet!!!

so how do i do that:)

thankyou,
ballzdeep85.
 

Moridin

Snow Leopard
Reaction score
144
11) Select the second ________
12) Choose Arithmetic
13) You will get __________ + 1
14) Leave the 1 and the +
15) Select the first blank here
16) Repeat from step 4 to 10.

Bold line
 

tommerbob

Minecraft. :D
Reaction score
110
Follow Moridins instructions in post #24. They are very simple to follow. Read them each carefully, do each step, and then move onto the next step.
 

ballzdeep85

New Member
Reaction score
0
for if coditions i have:
KillCount[Player number of (Owner of (Killing unit))] equal to 10
not
KillCount[Player number of (Owner of (Killing unit))] = 10

is that ok?

thankyou,
ballzdeep85.
 

ballzdeep85

New Member
Reaction score
0
im getting 2 kills on the board for every 1 unit killed what happend?

ez fix or not?

thankyou,
ballzdeep85
 

tommerbob

Minecraft. :D
Reaction score
110
I would suggest uploading a test map. It is much easier to debug and make sure it works.
 

ballzdeep85

New Member
Reaction score
0
iam testing it.

and not to be crappy but its not ready to have distrabution yet.

oh yeah and when i get ten kills even though its say 2 kills for every on unit killed i get a unit spawned but..... the total score dose not stay it resets; whats up with that?

thankyou,
ballzdeep85
 

Tyman2007

Ya Rly >.
Reaction score
74
Oookay. I'm pretty sure I'm right, because I've been using this for the past 2 years :p.

Edit 2: Read please

Experience and knowledge are 2 different things, don't confuse the 2 :p

You're confusing index and size, and that link you showed me you didn't even read on.

Size
Arrays in JASS all have the same max index of 8192. This means that the 'size' field for arrays in the WE is useless (to my knowledge). In this sense arrays are more like hash-tables, as you will not recieve an 'index out of bounds' error. But it also means that every array you make will occupy a certain amount of space no matter how much or little data is put into it.

Size REDUCES the amount of indexes you can use. That topic is 5 years old when nobody really knew.. or even cared about size. Now that we use structs, we have a much larger understanding :p

The world editor can hold a total size of 8190. If you change the size to 10, you can run 819 instances, or 819 indexes. Change it to 100, you can run 81 (It doesn't round, you must truncate). Change it to 1000, you get 8.

See where I'm going with this? I understand what ur going at there :p You just confused index value and size value. An easy mistake to make to the inexperienced programmer.

Anyway, as for this topic, I don't really know what else to say. The above text I have is for future reference for anyone to use :p Learn something new everyday eh?
 

Moridin

Snow Leopard
Reaction score
144
Can you post your triggers?

Also you can use
Trigger:
  • tags to put GUI without using screenshots. Right click the heading of the trigger, select "Copy as text". Then in the forum type:
    • [noparse]
    • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_5">
    • <li class="lasttree"><span class="default">&amp;lt;paste the text&amp;gt;</span></li>
    • </ul>
    • </div></div>
    • [/noparse]
 

ballzdeep85

New Member
Reaction score
0
Trigger:
  • Evolution 1 pink1 Copy 2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Kills[(Player number of (Owner of (Killing unit)))] Equal to 10
        • Then - Actions
          • Set Kills[(Player number of (Owner of (Killing unit)))] = 0
          • Unit - Create 1 Golem Population Peice for (Owner of (Killing unit)) at (Random point in Golem Population &lt;gen&gt;) facing Default building facing degrees
        • Else - Actions


thankyou,
ballzdeep85.
 

Tyman2007

Ya Rly >.
Reaction score
74
Ballz, ya should post a demo map. It will help you help us in helping you :p
Simply post it as an attachment.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top