killing value

MissKerrigan

Active Member
Reaction score
23
Hey there,

This will be a silly question, but I'm having problems with the next thing:


In my tower defense, creeps give minerals if you killed them

- level 1/10 must give 1 mineral for killing a creep
- level 10/20 must give 2 minerals for killing a creep
- level 20/30 must give 3 minerals for killing a creep
- level 30/40....... etc

I tried to create an integer and called it 'mineral value' and set it to 1
Every 10 waves I set it +1 but it is not working

Does anyone know how this is solved?

I know there must be a simple solution for this
I should shame myself using the editor for about 2 years now...

MissKerrigan
 

Fatmankev

Chef, Writer, and Midnight Toker
Reaction score
240
If you're not using it already, just assign the 1 mineral, 2 mineral, etc., to the Point Value of each set of units in the Unit Editor. Then just add x minerals to the killing player's resources, with x being the Point Value of the killed unit, and that should do it. Little messier, little more work, and maybe it has leaks - I don't know enough about coding to say for sure. But it should do what you want it to do.
 

Dave312

Censored for your safe viewing
Reaction score
269
You should post your triggers if you want to know why your solution is not working.
 

X-maul

AKA: Demtrod
Reaction score
201
Please do as Dave312 says - If you did just post your trigger the first time, the problem would most likely have been solved in a matter of hours.
___________________________________________________

I dont quite understand why it does not work, the only thing I could think of, is that you do not set the bounty value at all.
make sure you use the action Set Unit Property and set it to Bounty (Minerals);
Code:
        Unit - Set (Last created unit) Bounty (Minerals) to mineral value
Make sure you put this action right after you spawn each unit.
 

MissKerrigan

Active Member
Reaction score
23
I know why it IS not working because:

- If level 11 is spawning and I set the 'income integer' +1 then some of the creeps of level 10 are still in the map, they will given 2 minerals now instead of 1

- If I wait till level 10 is killed and THEN set the integer +1, there might be already killed some creeps of level 11


so these both cases are not working, I can't post the triggers because it are to much triggers + variables
 

X-maul

AKA: Demtrod
Reaction score
201
Did you try my method? When you set the bounty of the unit to a variable, the bounty of that unit wont change if you change the variable value later on.
 

MissKerrigan

Active Member
Reaction score
23
Yes I red your bounty explanation, but I have no idea where I can find this

Besides, I still would have trouble with the correct 'text tag' I create on the unit after killing
 

X-maul

AKA: Demtrod
Reaction score
201
This trigger, would spawn a unit periodically, give an order, and set the bounty to a variable, then increase the value of the variable by one. And go on and run the trigger again.
Code:
SPAWN
    Events
        Timer - Every 5.0 seconds of Game Time
    Local Variables
    Conditions
    Actions
        Unit - Create 1 Marine for player 1 at (Center of (Entire map)) facing 270.0 degrees (No Options)
        Unit - Order (Last created unit) to ( Move targeting (Center of (Entire map))) (Replace Existing Orders)
        Unit - Set (Last created unit) Bounty (Minerals) to KILLINGVALUE
        Variable - Set KILLINGVALUE = (KILLINGVALUE + 1)
NOTE: KILLINGVALUE is a global integer variable.

I'm confused by why you would like to create a text tag when the unit dies, if you just set the bounty, it will automatically display a text tag with the minerals earned.
 

MissKerrigan

Active Member
Reaction score
23
ok listen, here is what I think:


If I kill the first marine AFTER a new marine is spawned, the KILLINGVALUE is set to 2, and the text tag will be +2 minerals instead of 1 when I kill the FIRST marine

If you think I'm wrong then explain me why the text tag is showing the wrong number please
 

X-maul

AKA: Demtrod
Reaction score
201
because your text tag displays the variable and not the bounty of the dying unit.
 

MissKerrigan

Active Member
Reaction score
23
I got 2 variables:


1. Bounty (integer)

2. Text Tag (combined with integer)


So I MUST kill the unit before the next unit appears, or the integer will add +1, I can't escape from this
 

X-maul

AKA: Demtrod
Reaction score
201
the text tag should NOT be using the integer, but instead show the bounty of the dying unit.
 

X-maul

AKA: Demtrod
Reaction score
201
Oh, well I thought I used that at some point. Well it seems that there is no way to get the bounty of a unit.
Then what you want to do is to create a variable named "Bounty" with array of as much as possible (8192) and when a unit is spawned:
Code:
                        Variable - Set Bounty[(Unit tag of (Last created unit))] = KILLINGVALUE
Then when a unit dies, just refer to the Bounty[Unit tag of (Dying Unit))].

(A unit tag is an individual tag that each unit gets, that can never be mistaken for another unit)
 

X-maul

AKA: Demtrod
Reaction score
201
Uhmm... not an integer, that's a variable TYPE - click the variable (of type behavior) and check the "Array" box and set the array to the highest possible, even though it's only 128, you should still try the method I suggested.
 

Dave312

Censored for your safe viewing
Reaction score
269
I would just be using the Custom Value property of a unit rather than trying to save the values into an array. When a unit is created, set the Custom Value of the unit using the Set Unit Custom Value to the amount of bounty. Then when you want to give the bounty, just use the function Custom Value of Unit. Leave the Index parameter as 0.


Also X-Maul, you can reference a Unit's bounty (as specified in the data editor or a value assigned for that particular unit) by using the Unit Property function. You probably couldn't find it because the data type is Real, not Integer.

There are a lot of different ways you can go about doing this, but personally I would but using the built in Bounty system (as X-Maul suggested) as it displays the bounty text tag automatically for you.
 

MissKerrigan

Active Member
Reaction score
23
I found already a way to do it, not that correct way, but it works for my map

can somebody explain me the next 3 things?


1. custom value?

2. parameter?

3. string?


(sorry I'm not english, probably it's more understandable to english people)
 

Dave312

Censored for your safe viewing
Reaction score
269
Every unit has a Custom Value property which you can use to store a number. This number will be tied directly with that particular unit. In your case, you could use this property to store the bounty by setting the custom value when the unit is created and then retrieving this value when the unit dies.

A Parameter is a value you set when you call an action, function, condition or event. For example, the Unit Dies event has the parameter Unit where it allows you to specify which Unit the event responds to.

A string is a series of characters (numbers, letters and symbols). It is similar to the text data type except it does not store formatting (i.e you can't make the text a particular colour or font).
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      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