Unit dies. item drops from table, but how to loop

  • Thread starter Thread starter Navazrayel
  • Start date Start date
N

Navazrayel

Guest
Okay. Here I go thinking I'm really clever. Mistake number 1.
I was trying to make a system that drops an item based off an item table. I tried setting up so a unit called "reward" had the table. when a unit was killed, unless it was one of the reward units, the reward unit was killed, effectively activating the item-table. 2 problems presents itself....

I cant seem to get the game to determine the killing player, and I cant seem to ressurrect the "reward" so it can be killed again, with the item table.

posting code :


Reward
Events
Unit - A unit Dies
Conditions
(Triggering unit) Not equal to Reward 1 0020 <gen>
(Triggering unit) Not equal to Reward 2 0024 <gen>
(Triggering unit) Not equal to Reward 3 0025 <gen>
(Triggering unit) Not equal to Reward 4 0026 <gen>
(Triggering unit) Not equal to Reward 5 0027 <gen>
(Triggering unit) Not equal to Reward 1 0021 <gen>
(Triggering unit) Not equal to Reward 2 0028 <gen>
(Triggering unit) Not equal to Reward 3 0031 <gen>
(Triggering unit) Not equal to Reward 4 0034 <gen>
(Triggering unit) Not equal to Reward 5 0037 <gen>
(Triggering unit) Not equal to Reward 1 0022 <gen>
(Triggering unit) Not equal to Reward 2 0029 <gen>
(Triggering unit) Not equal to Reward 3 0032 <gen>
(Triggering unit) Not equal to Reward 4 0035 <gen>
(Triggering unit) Not equal to Reward 5 0038 <gen>
(Triggering unit) Not equal to Reward 1 0023 <gen>
(Triggering unit) Not equal to Reward 2 0030 <gen>
(Triggering unit) Not equal to Reward 3 0033 <gen>
(Triggering unit) Not equal to Reward 4 0036 <gen>
(Triggering unit) Not equal to Reward 5 0039 <gen>
Actions
Set Killingunit = (Damage source) <----- this wont work.
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of Killingunit) Equal to Player 2 (Blue)
Then - Actions
Set Killingunitowner = Player 2 (Blue)
Set Killingunitownerregion = Blue reward area <gen>
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Blue reward area <gen> contains (Position of No item)) Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 2 (Blue) Current lumber) Equal to (Min(0, 100))
Then - Actions
Unit - Kill Reward 1 0020 <gen>
Unit - Create 1 Reward 1 for Neutral Passive at (Random point in Killingunitownerregion) facing Default building facing degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 2 (Blue) Current lumber) Equal to (Min(101, 200))
Then - Actions
Else - Actions
Else - Actions
Do nothing
Else - Actions


Hope my english is to your approval.<----- this part will not work due to event response
 
un i get the drift of what ur saying but u dont need that many variables...
if ya can put it into english of what u want to do i will help u sence you atleast tried to make a trigger.
 
okay. reformulation time.

Lets see...

The trigger event is whenever a unit dies.

The conditions check for any of the 20 reward units. if it is one of those, the trigger isnt activated.

after that, it tries to sett variable "killingunit" = damage source... but since no damage event is used to start this trigger, this part won't work.

Anyway, the rest of the trigger checks to see what player got the kill, how much lumber that player has, and kill one "reward" unit of the proper level. Example from 0 to 100 lumber, kill level 1, from 101 -200 level 2.

But here is another problem. They will have to be ressurrected, or the trigger is now moot. I can simply create a new one, but what will happen then? will it still be recognized as the spesific unit that will be killed when the trigger demands it? will it still have the item table of the original?

biggest problem so far. thanks for any and all help.

oh, and one thing, my english, though maybe not perfect, is rather close to it;) the last comment in the first post is more of a joke... thanks for the response though, hope someone finds sense in this problem.
 
Reward unit?

What's that? Or, what is it supposed to do?

After "Kill Reward 1 0020 <gen>", that unit is gone. For good.

For the "killingunit", there would be the event response "killing unit".

Note that Min(0, 100) is always 0.
I guess you want to "value greater or equal to 0 AND value less then 100" instead.
 
fine... flipin ruin it for me... i did say i would give him the trigger if he needed 1
 
reward unit is a pre-placed unit that is invisible, and invulnerable. when it dies, it drops an item from an item table.

so there is no way to get that same unit back? humm... that puts the entire thing into a bad place...

I couldn't find a event response - killing unit ... that would be the logical thing to use.

if you understand what I mean and can help me with the code, ocossin, I'd be very grateful... if not, it seems I need to rebuild the entire thing again.

thanks for help.
 
let me go make a trigger... ill edit this in a minut... bu do you have roc or ftf.. if u have roc go buy tft... and if ya got tft go on bnet to get latest editor.

Help Other
Events
Unit - A unit Dies
Conditions
(All of the conditions you had)
Actions
Item - Create (Your Item) at (Position of (Killing unit))
Unit - Remove (your unit) from the game


If you cant find killing unit u could put triggering unit.

Or if u want the item, at like therir base you could put this item creater insted on the one above

Item - Create (Your Item) at ((Owner of (Killing unit)) start location)
 
yes

yes, I see what you mean... but that would only make a specific item somewhere... With what I am trying to do, killing a unit would give you a % chance of getting an addditional reward at your base site...

thanks for your help tho, I'll try to get it to work...

I have tft, and the latest version. no other way to live, eh;)

thanks again.
 
Variables, arrays, random...

As an example: use an item-type array, of size ten.

then a couple "set variable":

array[1] = item 1
array[2] = item 1
array[3] = item 1
array[4] = item 1
array[5] = item 2
array[6] = item 2
array[7] = item 2
array[8] = item 3
array[9] = item 3
array[10] = item 4

then simply create one "array[random 1 to 10]" item...

You see what that will do?



There are other ways, this is one of them ;)
 
Dude u have to explain what your trying to do COMPLETELY because nothing in your trigger even sugest that only a % of the time the unit will get the item... any way i have an idea how to do this... how bad do you want the chance of geting an item to be?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1
  • The Helper The Helper:
    Weekend went by too fast. Next weekend I am going to try to do a nature thing - buddy of mine lives by the Colorado river and has some kayaks and invited me to do some kayaking from a place he knows to get on the river.
  • Ghan Ghan:
    That sounds like an adventure.
  • The Helper The Helper:
    400 users all online all looking at latest content
  • The Helper The Helper:
    I wonder how all these bots that sit on the lastest content page get passed anubis or maybe they did not but they are just registering on whos online
  • The Helper The Helper:
    showing up on whos online not registration
  • Ghan Ghan:
    The first gate is stopping all the bots that don't execute javascript.
  • Ghan Ghan:
    That's the main thing with Anubis - no Javascript, no site. Typically you can still get the site to load without Javascript.
  • The Helper The Helper:
    I remember the whole javascript thing, question - how many real people disable that?
  • The Helper The Helper:
    Hell I guess I could go back on the stats to know that - we probably capture that and we know the before and after
  • Ghan Ghan:
    Real users can't really disable Javascript anymore these days.
  • Ghan Ghan:
    The internet is broken without it.
  • Ghan Ghan:
    Bot readable, not human usable.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top