How to spawn per 10 kills HELP

ballzdeep85

New Member
Reaction score
0
i have another thread like this open but its cluttered and no results.

how do i spawn a unit per every 10 kills example 10,20,30,40 etc....
for just one player.

i have a variable made for my score board name kills.

please help
what do i need to do.

thankyou,
ballzdeep85
 

Moridin

Snow Leopard
Reaction score
144
Here:

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)


KillCount[] is an integer Array with a size of 13.
 

tommerbob

Minecraft. :D
Reaction score
110
Moridin's trigger will work, but don't start a new thread on the same topic as your last one. You need to be patient and wait for replies from people. You started this thread even before anyone had a chance to reply to your other one. :thdown:
 

ballzdeep85

New Member
Reaction score
0
no one was dumbing it down for me like i asked nicely.
but yes i will not do that again.
thankyou for the trigger and i will test and c how it ends up.

thankyou,
ballzdeep85
 

tommerbob

Minecraft. :D
Reaction score
110
That's why I said you need to be patient. I was about to respond with a solution in your other thread, but you already created this one, barely 12 hours later.
 

ballzdeep85

New Member
Reaction score
0
right now the way i have it my kill count is set to a amount of 10.

-UPDATE-
with this set up, exactly like urs posted to this thread dose not spawn any peices.
gnospwn.jpg
i test the map as red and sent units to pink, pinks tower killed 10 units and no spawn now.

what is causing this instead of 1 spawn per 10 kills?

thankyou for everything and i will be more patient from now on.

thankyou,
ballzdeep85.
 

Attachments

  • gspawn.jpg
    gspawn.jpg
    27.3 KB · Views: 135

Tyman2007

Ya Rly >.
Reaction score
74
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.

But I see your problem. This line:

Set KillCount[PN of killer] should = KillCount[Player number yada yada] + 1 instead of [Player Number whatever] + 1

The way it is now, it's not adding 1 to the killcount, it's adding 1 to the player number of the owner of the killing unit. so red will always have a value of 2 seeing as how he's player 1 in GUI. player 9 will get a piece EVERY time because 9 + 1 = 10.
 

ballzdeep85

New Member
Reaction score
0
actually all other players spawn a unit also every time they kill some other player's unit.

any ideas still?

thankyou,
ballzdeep85.
 

Tyman2007

Ya Rly >.
Reaction score
74
I'm sorry if I didn't quite understand you there.

So you're saying if you kill another player's unit, they can spawn more pieces?

If so just add a condition. It's a boolean comparison.

Look under unit, and is unit ally. Make sure that it's set to is equal to false, or not equal to true.
 

ballzdeep85

New Member
Reaction score
0
please read thread.

i am trying to get a unit to spawn every time i get 10 kills.

right now if i set the value in my condition from 10 to 0 ill spawn 1 unit every time i kill 1 unit.

get it now or not?

thankyou,
ballzdeep85
 

Tyman2007

Ya Rly >.
Reaction score
74
I understand what you're trying to do, but it's just this line I don't quite understand.. I'm sorry for my inabilities T.T

right now if i set the value in my condition from 10 to 0 ill spawn 1 unit every time i kill 1 unit.

So if you set it to check for 0 kills rather than 10 it will spawn a unit every time, but if you change it back to 10 it will never spawn a unit?
 

ballzdeep85

New Member
Reaction score
0
yes that is correct.

let me know what you can figure out.
i dont understand the line either someone else made them for me.

going to get pizza be back in like lil be ill keep updated if i can figure stuff out.

thankyou,
ballzdeep85
 

Tyman2007

Ya Rly >.
Reaction score
74
Well if you follow what I said earlier it should work :p

The problem lies in this line right here.
Trigger:
  • Set KillCount[[Player number of (Owner of (Killing unit)))] = ((Player number of (Owner of (Killing unit))) + 1)


Allow me to highlight the part that's wrong which is causing this to not work.

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


Ok, so what's so wrong about that?

Each player is given a number from 1 to 12 depending on the player slot they have chosen.
E.G. Player red is given a 1, because he's player 1. Player blue is given a 2, because he's player 2, and so on and so forth.

The highlighted part, ((Player number of (Owner of (Killing unit))) + 1) takes the number that player is given, then adds a 1 to it.
So, player 1 will always get a kill count of 2.
player 2 will always get a kill count of 3
player 9 will always get a kill count of 10 (Thus always spawning a unit every kill)

You are setting the killcount to a constant value, rather than adding onto it.

I believe you're familiar with the traditional add 1 to value line, going as follows

Trigger:
  • set integer = integer + 1


Because we're using arrays, we add in an index value

Trigger:
  • set integer[1] = integer[1] + 1


you did something like this

Trigger:
  • set integer[1] = [1] + 1


thus always coming out to a 2.

Simply change what it sets the killcount to to the variable + 1.

You forgot the variable in the line :p

Hope this helps!
 

ballzdeep85

New Member
Reaction score
0
can you set show me in what i have here and tell me whats wrong.
can you rewrite for me?

show me where stuff needs to go please.
help.jpg

when you are talking about the integer line equation do i have to make a new integer like i had to do for the variable?

you kinda lost me.

thankyouk,
ballzdeep85
 

Tyman2007

Ya Rly >.
Reaction score
74
Hmm, your trigger seems just fine.. but there's one thing in particular that I've noticed about it..

It's not enabled :p Right click on the trigger under the category view and check the "Enable Trigger" line.

I'm not quite sure if you've done that on purpose, but a trigger will never work if it's disabled.
 

ballzdeep85

New Member
Reaction score
0
i know. i disableed it so i t wouldnt load while i was working on trying different combos.


please show me where to put the integer thing in i dont know how to get a spawn to happen every ten kills.

im lost right now.

thankyou,
ballzdeep85.
 

ballzdeep85

New Member
Reaction score
0
Is the hilighted part in blue right?
And is it in the right spot?
Or do i need to inject it somewhere?

unigol.jpg

Please SHow me where it goes if im wrong.

because where its at is wrong.(dosen't work)

oh and killcount has a array value of 13.//// if that helps?

thankyou,
ballzdeep85.
 

ballzdeep85

New Member
Reaction score
0
ok got it to work / not work.
this is what i have
almost.jpg

im playing as red, pink is killing my units, leader board is telling me im getting the kills... and PINK getting granted a golem for every ten kills.
- what do i need to do to get the player who is killing the units credit for the kills and spawn the units ?

let me know if i need to move anything around.

thankyou,
ballzdeep85.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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