Hero Ability Giving Items?

C

Chronoscythe

Guest
Hello, everyone! I'm making a Hero Arena map and have an issue I would like to attempt to clear up, and would be very grateful for any assistance you might have to offer...

?? Hero Abilities Giving Items ??

One of my heroes is an item specialist, and their primary ability is to receive items for free upon the ability's activation, one every activation until next cooldown ends.

What I want to do is have the character receive a free item in Inventory Slot 1 for every use of this ability. I would like it so that for the four upgrades of this ability, they receive items from a different Item Set, progressively more powerful.

My issue is that I am unable to locate where I could find the option for or lack the knowledge to create a trigger allowing for a character to receive an item from a specific Item Set upon the abilities' activation. Could somebody help set me in the right direction?
 
Hero begins casting an abilty
Ability being cast equal to (your ability)
Level of ability being cast equal to (level of ability)
Create (item) for (hero)
 
well having the set makes it more diffficult than that Im_On_56k becuase that doesn't speicify what item


you need a variable for every item in every set

E:
a unit begans casting abilty
C:
boolen-abilty being cast equal to <your abilty>
A:
if/then/esle
IF- boolen- level of abilty being cast equal to <your lvl for this array>
THEN- variable- <make a variable put it here> to random number (you can find that somewhere)
ELSE- do nothing
If/then /else
IF- boolen- level of abilty being cast equal to <your lvl for this array>
THEN- variable- <your other variable> equal to 1
ELSE- do nothing

you get the idea make 1 more of these triggers per lvl the abilty can get


NOW

make a trigger like this for each item in each set

E
boolen- your mom equal to your mom (put soemthing in that will be awlays true)
C
variable- <a variable> equal to 1
A
variable- set <for mentioned variable> to 0
unit- creat <your item for that variable> in units inventory in slot 1


WALLA! ok sorry im not good at making practical trigger code but i make trigger code just the same this will take alot of triggering work about 50 copys of the lower trigger someone will help you simplfy it but i cant mabey arrays? (i dont know how to use arrays or anything about them but everyone always talks about them in situtions like this)
 
Thank you very much for your help, guys, I'll put this in and try it out! *crosses fingers* :D
 
just becuase im stubborn and i think im awesome, heres what i would do:
first create a variable array of Item-Type and size how ever many levels the ability has. for this example i will use Summoned_Item as my variable name and a size of 3. The ability in my example is called Summon Potion.

STEP 1. create the items in the object editor that you want it to summon (you should have done this already). for this example i'll use Potion, Hi-Potion, and X-Potion (i was just playing final fantasy so if you dont like it too bad).
STEP 2. set the elements in the array to the right item type.
i want Summon Potion level 1 to give a Potion
i want Summon Potion level 2 to give a Hi-Potion
i want Summon Potion level 3 to give an X-Potion
so heres what the trigger would look like:
Code:
Array Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set Summoned_Potion[1] = Potion
        Set Summoned_Potion[2] = Hi-Potion
        Set Summoned_Potion[3] = X-Potion
STEP 3. make the trigger that gives the potion when the ability is used.
i noticed other people say to use the event [Unit - A unit Begins casting an ability] but i dont like that because it works when a unit BEGINS casting an ability, but have you noticed that when you begin to cast an ability you can sometimes move before you actually cast it? if you havent noticed that, it happens. Someone could begin casting the spell and then stop before it is actually cast and they would recieve the potion and the spell would never actually be used. There is an event that only works when the ability is actually used though, i like to use that one. and also my way you do not have to compare what level the ability is to give different items because you ahve the item types stored in an array. heres the trigger i would use:
Code:
Give Summoned Potion
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Summon Potion
    Actions
        Hero - Create Summoned_Potion[(Level of Summon Potion for (Casting unit))] and give it to (Casting unit)

my way takes a few extra steps in the beginning but it makes the actual trigger look much better i think and there is less comparing in the triggers too. i like arrays i use them when ever i can they make things much simpler (especially when you can use them in loops).
 
Sorry for the double post, but it appears I can't edit posts.

So far so good, guys, but to avoid trouble with so many triggers (1 for each item) I decided to store items in an array as you suggested.

At Map Initialization, I get four item arrays, with ranges of 10 (for 10 items each level) and then proceed to store item variables in each array for summoning, then recall a random number in the process you taught me, and the rest is history.

I'll post it once I get it done and final so you can see it, and then maybe put it in the free trigger thread later... I think that it would be useful. :)

Thanks again!
 
Whoa, Grundy, thanks! I must have been posting while you posted yours... it's very similar to what I did, but I did not notice the possible loop hole with casting/starting to cast abilities...

Thanks for pointing that out, man. I'll test it out now. :D
 
The random number I'm using to choose a random item out of the ten in each set.
 
oh each level gives 1 of 10 different items?

well in that case you could use my little trick of how to make a 2-dimentional array when the world editor can only do 1-dimentional arrays. but it's complicated and no one will ever just accept that fact that it works, all you have to do is change 2 numbers that represent the row and column. when i tell people how to do it, it's so easy for them to just copy it but they decide to just question me instead of using it.
 
Alright, this is what I did!

First I used a trigger to set the First Item Set for skill level 1 of the ability, Weapon Summoning.

Code:
Arsenal Set 1
    Events
        Map initialization
    Conditions
    Actions
        Set Arsenal_1[1] = Hologram Generator 0037 <gen>
        Set Arsenal_1[2] = Lightning Armor Generator 0038 <gen>
        Set Arsenal_1[3] = Agile Socks 0039 <gen>
        Set Arsenal_1[4] = Booster Gauntlets 0040 <gen>
        Set Arsenal_1[5] = Boots of Speed 0041 <gen>
        Set Arsenal_1[6] = Crown of Skill 0042 <gen>
        Set Arsenal_1[7] = Focus Armor 0043 <gen>
        Set Arsenal_1[8] = Power Gauntlets 0044 <gen>
        Set Arsenal_1[9] = Wristblades 0045 <gen>
        Set Arsenal_1[10] = Shield Generator 0046 <gen>

Then I made the trigger like you guys said to create a variable upon use of ability!

Code:
Arsenal Weapon Summoning
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Weapon Summoning 
    Actions
        If ((Level of (Ability being cast) for (Triggering unit)) Equal to 1) then do (Set Arsenal_Check1 = (Random integer number between 1 and 10)) else do (Do nothing)

Finally, the Item is given based on the number given, and the variable is reset!

Code:
Arsenal Weapon Summoning 2
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Weapon Summoning 
    Actions
        Hero - Create (Item-type of Arsenal_1[Arsenal_Check1]) and give it to (Triggering unit)
        Set Arsenal_Check1 = 0

I repeat this four times, and suddenly I have all four levels of the ability!

Thanks for your help, guys! I'll be sure to have more Q's for you later. :rolleyes:
 
finish casting an ability is a bad event too because a unit can move before it actuall "finishes" casting the ability and the trigger would never go off.

just use starts the effect of an ability like i said before that will always work right.

and also if you want to make it more efficient, it is unnecessary to use 2 triggers and an integer variable.

i notice in the first trigger all you do is set a variable to a random number and in the 2nd trigger you use the variable.
you could just get rid of the first trigger and the variable and change your second trigger to:
Code:
Arsenal Weapon Summoning 2
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Weapon Summoning 
    Actions
        Hero - Create (Item-type of Arsenal_1[random integer number between 1 and 10]) and give it to (Triggering unit)
        Set Arsenal_Check1 = 0
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    Mayo also has vinegar. Vinegar is a very important part of it, it's effectively a delivery method FOR vinegar but hidden
    +1
  • Varine Varine:
    It's a neat ingredient. But yeah it's eggs. But a LOT of people think eggs count as dairy because of the fucking food pyramid the US keeps trying to make a thing
  • Varine Varine:
    I think on the new one they did change it, but idk. I don't really care whatever the government is doing right now because it's consistently absurd. Like what is RFK doing in charge of health anything? I love the bear story because WTF was that, but also, pretty much every time he talks it's WTF. Like even his voice sounds microwaved
    +1
  • Varine Varine:
    The pyramid is fucking dumb as shit, no matter how you arrange it.
  • Varine Varine:
    It's actually remarkably easy to make mayonnaise though. Fun fact, it USED to kind of be a French mother sauce. I believe that Careme considered it one, it may have been aioli but that has also built a different meaning than it used to. An aioli is just mayonnaise I mixed with other shit typically, I didn't start it don't come at me
  • Varine Varine:
    It's very hard to do it on a large scale though
  • Varine Varine:
    Depending on how you pour the oil the consistency can vary wildly, but that's true for most emulsions. I can only make about two quarts at a time with my robo coup, and if I have to make several in series because I forgot to order it becomes really obvious even when I do it. We have to wait and mix them all together to make sure we have the same thing.
  • Varine Varine:
    Hollandaise is also kind of like that, emulsions require a very steady hand to do exactly the same every time.
  • Varine Varine:
    Luckily I live in an age with electricity so it's way fucking faster, but when I was just a boy trying to find my place I had some hardcore chefs that made use do things like that by hand. It is WAY easier to get right by hand because you control it and can feel it, but it takes soooooo much longer. And on the scale a modern kitchen requires... I serve 400-500 guests on average per day right now, if I had 100 then we could do things way better
  • Varine Varine:
    But we can't do that. In the winter yeah, but I HAVE to get people through here right now so I can afford the staff that we CAN do that. We have about 100 days of summer, and if that summer doesn't make us what it will, then I can't operate the other most of the year with my staff. The owner is talking about closing two days a week to cut down on labor, I told him he should cut down on vacations and it did not go great. I do think I won though, I have to keep my fucking core staff and they have to be gainfully employed
  • Varine Varine:
    Sure some of them might take a second job, but I can't just cut my entire staff to unlivable hours, nor can I can cut them off all winter if I want them to come back.
  • Varine Varine:
    And also, there is no fucking way I'm pulling these hours come september. I only do this right now because I have to, the second I don't have to be the one doing it I won't be
  • Varine Varine:
    I have a 5 person core staff in the kitchen, not including me or Chef Ben
  • Varine Varine:
    Though two of those people are likely not making it this year. One of them has been replaced, the other I am kind of trying to. He's being a giant bitch, today I had to get onto him because in the three hours before I left he had taken like thirty minutes for cigarette breaks
  • Varine Varine:
    And he was also complaining to me the other day that he was out of weed so couldn't smoke any before work that day, and was confused about why I was annoyed he was telling me, his boss, that he is smoking weed everyday before work.
    +1
  • Varine Varine:
    Like yeah I can tell. I don't need to fucking know.
  • Varine Varine:
    So now he's getting scrutinized and will not be top of the list. I know I don't have the smartest people but I do expect them to have some common fucking sense
  • Varine Varine:
    I did do a rare thing for me and hire a girl last month without warning. Everyone was made at me because I started her at like 21, but she worked with me before and I was like don't care. She made 19 at her old job and I wanted her to come work with me, she is the best
    +1
  • Varine Varine:
    I'm going to get her a raise at the end of the summer. She wants to go to school again, but I want her to still work with me so.... she kind of can just tell me what the price is. I can go to 25 if she keeps up. I need to get her onto line more, that's what she wants, but I need her where she is and it's not fair that she doesn't get the little bit of raise that comes with it. She can do it no problem, I've worked with her there.
  • Varine Varine:
    It's just hard to move and train people unnecessarily right now. And also the line fucking sucks, it's not any more fun. This is turn and burn so I have the bankroll, and everyone suffers for it
  • Varine Varine:
    Eventually we'll get it balanced, we'
  • Varine Varine:
    we're starting online orders and stuff, but I also turn that off all the time because I barely keep up trying to be the best at Sysco shit
  • Varine Varine:
    I think it's gonna be a good fall and winter though. We're going to have a good staff, they will get along, they will be able to manage the workload and the complications, they know how to really cook this year, like every person on line knows their steak temps. Some of them use thermometers a lot and they don't always use them right, but they do know how to do it. Failure, especially in this field, is the only way to get better. They'll get it
  • Varine Varine:
    They won't get feel down while they do the thermometer, but we didn't have an instant read probe when I was learning. Like they did but god knows how off it is, you HAD to do it by feel. Even if the chef was fine with me bringing my own, it takes too long. Poke and know
  • The Helper The Helper:
    420 threads in the Artificial Intelligence forum :)

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top