Random Item Generation Ability: Trigger Check

Y

Yonidam

Guest
Code:
Engineered Device
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Engineered Device 
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Engineered Device  for (Triggering unit)) Equal to 1
                (Ability being cast) Equal to Engineered Device 
            Then - Actions
                Set EngineeredDevice = (Random integer number between 1 and 3)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        EngineeredDevice Equal to 1
                    Then - Actions
                        Hero - Create Light Explosive (Level 1 Item) and give it to (Triggering unit)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                EngineeredDevice Equal to 2
                            Then - Actions
                                Hero - Create Gnomish Spyglass (Level 1 Item) and give it to (Triggering unit)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        EngineeredDevice Equal to 3
                                    Then - Actions
                                        Hero - Create Repair Kit (Level 1 Item) and give it to (Triggering unit)
                                    Else - Actions
                                        Do nothing
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Engineered Device  for (Triggering unit)) Equal to 2
                        (Ability being cast) Equal to Engineered Device 
                    Then - Actions
                        Set EngineeredDevice = (Random integer number between 1 and 6)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                EngineeredDevice Equal to 1
                            Then - Actions
                                Hero - Create Light Explosive (Level 1 Item) and give it to (Triggering unit)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        EngineeredDevice Equal to 2
                                    Then - Actions
                                        Hero - Create Gnomish Spyglass (Level 1 Item) and give it to (Triggering unit)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                EngineeredDevice Equal to 3
                                            Then - Actions
                                                Hero - Create Repair Kit (Level 1 Item) and give it to (Triggering unit)
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        EngineeredDevice Equal to 4
                                                    Then - Actions
                                                        Hero - Create Medium Explosive (Level 2 Item) and give it to (Triggering unit)
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                EngineeredDevice Equal to 5
                                                            Then - Actions
                                                                Hero - Create Gnomish Cloning Device (Level 2 Item) and give it to (Triggering unit)
                                                            Else - Actions
                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    If - Conditions
                                                                        EngineeredDevice Equal to 6
                                                                    Then - Actions
                                                                        Hero - Create Rocket Boots (Level 2 Item) and give it to (Triggering unit)
                                                                    Else - Actions
                                                                        Do nothing
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Level of Engineered Device  for (Triggering unit)) Equal to 3
                                (Ability being cast) Equal to Engineered Device 
                            Then - Actions
                                Set EngineeredDevice = (Random integer number between 1 and 9)
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        EngineeredDevice Equal to 1
                                    Then - Actions
                                        Hero - Create Light Explosive (Level 1 Item) and give it to (Triggering unit)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                EngineeredDevice Equal to 2
                                            Then - Actions
                                                Hero - Create Gnomish Spyglass (Level 1 Item) and give it to (Triggering unit)
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        EngineeredDevice Equal to 3
                                                    Then - Actions
                                                        Hero - Create Repair Kit (Level 1 Item) and give it to (Triggering unit)
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                EngineeredDevice Equal to 4
                                                            Then - Actions
                                                                Hero - Create Medium Explosive (Level 2 Item) and give it to (Triggering unit)
                                                            Else - Actions
                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    If - Conditions
                                                                        EngineeredDevice Equal to 5
                                                                    Then - Actions
                                                                        Hero - Create Gnomish Cloning Device (Level 2 Item) and give it to (Triggering unit)
                                                                    Else - Actions
                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                            If - Conditions
                                                                                EngineeredDevice Equal to 6
                                                                            Then - Actions
                                                                                Hero - Create Rocket Boots (Level 2 Item) and give it to (Triggering unit)
                                                                            Else - Actions
                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                    If - Conditions
                                                                                        EngineeredDevice Equal to 7
                                                                                    Then - Actions
                                                                                        Hero - Create Heavy Explosive (Level 3 Item) and give it to (Triggering unit)
                                                                                    Else - Actions
                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                            If - Conditions
                                                                                                EngineeredDevice Equal to 8
                                                                                            Then - Actions
                                                                                                Hero - Create Trapper (Level 3 Item) and give it to (Triggering unit)
                                                                                            Else - Actions
                                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                    If - Conditions
                                                                                                        EngineeredDevice Equal to 9
                                                                                                    Then - Actions
                                                                                                        Hero - Create Microchip (Level 3 Item) and give it to (Triggering unit)
                                                                                                    Else - Actions
                                                                                                        Do nothing
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Level of Engineered Device  for (Triggering unit)) Equal to 4
                                        (Ability being cast) Equal to Engineered Device 
                                    Then - Actions
                                        Set EngineeredDevice = (Random integer number between 1 and 12)
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                EngineeredDevice Equal to 1
                                            Then - Actions
                                                Hero - Create Light Explosive (Level 1 Item) and give it to (Triggering unit)
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        EngineeredDevice Equal to 2
                                                    Then - Actions
                                                        Hero - Create Gnomish Spyglass (Level 1 Item) and give it to (Triggering unit)
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                EngineeredDevice Equal to 3
                                                            Then - Actions
                                                                Hero - Create Repair Kit (Level 1 Item) and give it to (Triggering unit)
                                                            Else - Actions
                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    If - Conditions
                                                                        EngineeredDevice Equal to 4
                                                                    Then - Actions
                                                                        Hero - Create Medium Explosive (Level 2 Item) and give it to (Triggering unit)
                                                                    Else - Actions
                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                            If - Conditions
                                                                                EngineeredDevice Equal to 5
                                                                            Then - Actions
                                                                                Hero - Create Gnomish Cloning Device (Level 2 Item) and give it to (Triggering unit)
                                                                            Else - Actions
                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                    If - Conditions
                                                                                        EngineeredDevice Equal to 6
                                                                                    Then - Actions
                                                                                        Hero - Create Rocket Boots (Level 2 Item) and give it to (Triggering unit)
                                                                                    Else - Actions
                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                            If - Conditions
                                                                                                EngineeredDevice Equal to 7
                                                                                            Then - Actions
                                                                                                Hero - Create Heavy Explosive (Level 3 Item) and give it to (Triggering unit)
                                                                                            Else - Actions
                                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                    If - Conditions
                                                                                                        EngineeredDevice Equal to 8
                                                                                                    Then - Actions
                                                                                                        Hero - Create Trapper (Level 3 Item) and give it to (Triggering unit)
                                                                                                    Else - Actions
                                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                            If - Conditions
                                                                                                                EngineeredDevice Equal to 9
                                                                                                            Then - Actions
                                                                                                                Hero - Create Microchip (Level 3 Item) and give it to (Triggering unit)
                                                                                                            Else - Actions
                                                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                    If - Conditions
                                                                                                                        EngineeredDevice Equal to 10
                                                                                                                    Then - Actions
                                                                                                                        Hero - Create Gnomish Jumper Cables (Level 4 Item) and give it to (Triggering unit)
                                                                                                                    Else - Actions
                                                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                            If - Conditions
                                                                                                                                EngineeredDevice Equal to 11
                                                                                                                            Then - Actions
                                                                                                                                Hero - Create Land Mine (Level 4 Item) and give it to (Triggering unit)
                                                                                                                            Else - Actions
                                                                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                                                    If - Conditions
                                                                                                                                        EngineeredDevice Equal to 12
                                                                                                                                    Then - Actions
                                                                                                                                        Hero - Create Guard Tower (Level 4 Item) and give it to (Triggering unit)
                                                                                                                                    Else - Actions
                                                                                                                                        Do nothing
                                    Else - Actions
                                        Do nothing

Allright. I tested the ability many times and I can't get the items to generate. I have no clue what is wrong with this trigger. Any Ideas?
 
Change
Code:
  Events
        Unit - A unit Learns a skill
to
Code:
  Events
        Unit - A unit begins the effect of an ability
 
hmm, I think i may have fixed it though. I changed the initial event and condition:

Event:
From - Hero Learns Ability
To - Hero Starts Casting an Ability

Condition:
From - Learn Hero Skill Equal to ...
To - Ability being cast Equal to...
 
Ok a few things, you need to change your events conditions, also you need to change your if/then/else, i have a feeling things aren't being checked in the proper order. (There is a much easier way to do your ability using arrays below)

I would create an item-type array (Engineer_Item_List[]) with one item you would like to create in one spot.

Code:
Engineered Device Setup

    Events
        Map initialization

    Conditions

    Actions
        Set Engineer_Item_List[1] = <Level 1, Item 1>
        Set Engineer_Item_List[2] = <Level 1, Item 2>
        Set Engineer_Item_List[3] = <Level 1, Item 3>
        Set Engineer_Item_List[4] = <Level 2, Item 4>
        Set Engineer_Item_List[5] = <Level 2, Item 5>
        Set Engineer_Item_List[6] = <Level 2, Item 6>
        Set Engineer_Item_List[7] = <Level 3, Item 7>
        Set Engineer_Item_List[8] = <Level 3, Item 8>
        Set Engineer_Item_List[9] = <Level 3, Item 9>
        Set Engineer_Item_List[10] = <Level 4, Item 10>
        Set Engineer_Item_List[11] = <Level 4, Item 11>
        Set Engineer_Item_List[12] = <Level 4, Item 12>

Code:
Engineered Device

    Events
        Unit - A unit (Finishes casting an ability)

    Conditions
        (Ability being cast) Equal to (Engineered Device)

    Actions
        Set Ability_Level = (Level of (Engineered Device) for (Casting unit))
        Set Item_Number = (Random integer number between (1) and (Ability_Level x 3))
        Hero - Create Engineer_Item_List[Item_Number] and give it to (Casting unit)

Much simplier eh? =]
 
Wow that is a lot simpler. Unfortunately, I got it to work properly with my long if/then/else statement chain. I'll make both triggers though, thanks.

Just a question, how do you make the variable array values. the level and the item values for the setup trigger?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    Today I had to scramble, I didn't work most of dinner service and no one told me shit. They had a rough few hours lol
  • Varine Varine:
    I have two salmon, Sockeye and Atlantic. Atlantic is used for the kids salmon and the salmon and beet salad, and can also be added onto any dish or just as a side. Atlantic salmon will almost exclusively ever be FARMED, as it is endangered in the wild, and we ALWAYS cut them to 4 ounces.
  • Varine Varine:
    SOCKEYE salmon, very different and this IS wild caught. We have an ENTREE version, and an add on version. The entree is 7 ounces, the add on is 4. Why? Because that is how someone that wasn't me set up the computer.
  • Varine Varine:
    I had to have this conversation like ten fucking times tonight
  • Varine Varine:
    The issue being, I came into work and had none of this whatsoever
  • Varine Varine:
    No one told me shit
  • Varine Varine:
    So, taking into consideration that what I typed out up there is kind of some fucking nonsense that under normal circumstances no one really needs to fucking be able to explain in any rational way
  • Varine Varine:
    Let alone trying to figure it out from a wildly stressed out me that is also on a phone call trying to get something to show up from Seattle tomorrow while trying to explain this salmon situation, that also is barely solved in maybe a few hours and and but I am bulking it with a few steelhead filets I have and that is a WHOLE fucking different thing to the 19 year old server that got put on day shift C crew that doesn't know who I am.
  • Varine Varine:
    I did however really want days. I like getting off at 4 half the time, and that makes it worth it!
  • Varine Varine:
    Also I hate my job right now but I think that was the hard part. Now it's just work
  • Varine Varine:
    @jonas I'm sorry? I don't know what you're referring to.
  • Varine Varine:
    Once we hit winter I feel like I get to back to having a pretty cool job. Like I bitch about it all the time, but it's work. I'm still gonna bitch
  • Varine Varine:
    All in all though I think this summer is going really well. Some complicated things, but at the end of the day it isn't THAT big of a deal. Not all of our servers have quite realized they are technically sales
  • Varine Varine:
    Like yeah it is a substitute, but FOMO. Chef isn't getting this again this year, he has to figure it out, so it's slightly off on the menu, but that is more or less the LOWEST quality and price. Right now, steelhead is a real stealhear, right?
  • Varine Varine:
    Like fuck off even I can do it
  • Varine Varine:
    I am going to get one of my servers to do that in her server voice and you'll see my point
  • Varine Varine:
    Maybe the bartender. Idk, it's one of my favorite things to hear them go from calm to customer service voice. They will translate it to like "The chef is trying to change that a bit right now so he does have a Alaskan river steelhead. Yeah like the one you might fish probably!" And then the girls can bat their eyes and do pretty girl server shit
  • Varine Varine:
    At least that's how imagine some of them. Did you know mayonnaise is dairy free? A suprisingly amount of people don't\
  • The Helper The Helper:
    mayo is eggs right?
  • The Helper The Helper:
    Seems I never watched the Witcher - looks like i have a lot of content
  • The Helper The Helper:
    Season 1 Episode 8 the marathon continues...
  • jonas jonas:
    mayo is eggs & oil
    +1
  • The Helper The Helper:
    I got halfway season 2 on The Witcher and it lost me. I am going to have to pick this one up again later.
  • jonas jonas:
    season 2 is with the new actor right? it's so far below the first one
  • The Helper The Helper:
    first season was good the 2nd season is bleh I hope I can make it through it for 3

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top