#89

Creation of Dynamic Actions

    • Created on: Wed, Oct 26 2011 (7 months ago)
    • Reported by: Pilus
    • Assigned to: -
    • Milestone: Concepts
    • Bug detected in Version: -
    • Technical Difficulty: Medium
    • Status: Ready for review
    • Priority: Normal (3)
    • Component: Dynamic Actions
    • Permission type: Private
    • Type: Feature
    • Depends on ticket(s): -

    Suggested actions:


    Script (outside categories)

    Player requirements
    Name - Checks the name of the player Done
    Gender done
    Guild name done
    Level done
    Class done
    Race review
    Profession -- Done
    Is mounted done
    Is flying done
    Is swimming done
    Lua statement

    Logic
    Random Number - Generates a random number (between a given interval) and places it as output Aurorbalde:Done may need review Pilus: OK
    Random Port - Selects a port at random. Each port can be given weight, which changes the scale of the outcome Aurorablade: Done (changes made for descriptions as per suggestion)
    Random Chance - Selects port(s) where each port is given with with a percentage chance to succeed. Several ports might be triggered Aurorablade:Done, hope i did it correctly

    Location
    Zone - Detects if a player is inside or outside of a given zone done
    Subzone - Detects if a player is inside or outside of a given subzone done
    Indoors - Detects if a player is indoors or outdoors done
    Coordinates (Circle) - Detects if a player is inside a circle given with a center (in coordinates) and a radius (in meters). Keeps reporting outside area when i know i am not. Pilus: Awaiting implementing of a new type: 'coordinates'
    Coordinates (Square) - Detects if a player is inside a square given with a center, a height and a width. Aurorablade: ^
    Flyable Area - Not a lot of places disallow flying these days, but a check for this could be useful. For instance, if a player makes a whistle to summon a drake, this could allow them to have a different emote occur if they can't summon their drake there. -- Aurorablade:Done
    Level Range - This one would be a bit of a pain, since it would probably require a bit of data entry. But having the ability to see if the player is in a zone that they are the right level for could be very helpful. Rather than making the script check if the player is in Dun Morogh, Elwynn Forest, Teldrassil, Tirisfal, Durotar or Mulgore, they could simply check if the player is in a zone that has a level range 1-10. -- Aurorablade: DONE (I hope)

    Communication
    Send Data (direct)
    Receive Data (direct)
    Send Data (channel)
    Receive Data (channel)

    String formatting
    Aurorablade:Done, Suggested changes made to string contains
    String contains - Tests if a given string contains another given string Pilus: OK, but the term 'word' might be changed to e.g. 'substring' in the descriptions, because you can use this to search for a string containing more words
    String equals Pilus: OK
    Join String Pilus: OK

    Actions and Effects
    Apply Buff
    Remove Buff
    Expression Aurorbalde: Done Pilus: OK (both of them)
    Chat Message Aurorablade: Done, May need review
    Play Sound Aurorablade:Ready for Review(Type of sound needs implemented)
    Play Area Sound Aurorablade:see above ^
    Equip Item - Equips a normal wow item done
    Show Screen Effect Aurorablade:Done
    Summon Mount * Aurorablade: Done *
    Dismount Aurorablade: Done
    Summon Companion -- Aurorablade: Done
    Remove Companion -- Aurorablade: Done

    Item and container
    Open Bag Needs Review
    Produce Item
    Consume Item
    Got Item - Check if the player got a given item with a given amount needs review

    UI Elements
    Set Cursor
    Got Cursor
    Slash Command
    Cast Bar

    Menu
    Menu Setup Start
    Menu Setup End
    New Line
    New Page
    Text
    Editbox
    Slider
    Time slider
    Dummy
    Checkbox
    Dropdown
    Button
    Editfield
    Codefield
    Horizontal Bar

    number formatting
    Aurorablade: Implemented ready for review
    To Text - Converts a number into text. E.g. "twenty-four"
    Procent - calculates the percentage of two numbers
    Round

    Other
    Print - Prints a string Isn't this the one labeled 'message'?
    Event - Handles an event
    Delay - Waits X sec before the output is triggered
  • Followers
     
    Ico-users Aurorablade , Pilus 
     
    Attachments
    No attachments
    Associations
     
    No associations
    Activity
     
    User picture

          on Feb 15, 2012 @ 11:40pm UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Feb 15, 2012 @ 11:41pm UTC * By Aurorablade

    also level range error
    [18:40:09] ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:915: [string "GHI_UpdateMeta(nil);..."]:15: 'then' expected near '='
    [C]: ?
    [C]: in function `error'
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:915: in function <...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:908>
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:938: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:213: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:128>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:222: in function `Execute'
    ...terface\AddOns\GHM\Objects\GHM_DynamicActionArea.lua:108: in function `func'
    Interface\FrameXML\UIDropDownMenu.lua:706: in function `UIDropDownMenuButton_OnClick'
    [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>
    User picture

          on Feb 18, 2012 @ 06:10pm UTC * By Aurorablade

    (In revision:636) re #89 string formatting.
    User picture

          on Feb 18, 2012 @ 06:11pm UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Feb 20, 2012 @ 09:09pm UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Feb 20, 2012 @ 10:32pm UTC * By Pilus

    I hope to be able to have time to review the next ones tomorrow afternoon.
    User picture

          on Feb 21, 2012 @ 12:55pm UTC * By Pilus

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    I have reviewed the string actions and some other. I also fixed some errors in the dynamic action system in the process.
    User picture

          on Feb 22, 2012 @ 12:16am UTC * By Aurorablade

    getting a
    [19:14:00] ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:915: [string "GHI_UpdateMeta(nil);..."]:15: 'then' expected near '='
    [C]: ?
    [C]: in function `error'
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:915: in function <...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:908>
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:938: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:273: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:188>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:282: in function `Execute'
    ...terface\AddOns\GHM\Objects\GHM_DynamicActionArea.lua:109: in function `func'
    Interface\FrameXML\UIDropDownMenu.lua:706: in function `UIDropDownMenuButton_OnClick'
    [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>
    on zone level

    about to make a commit in a moment.
    User picture

          on Feb 22, 2012 @ 12:19am UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Feb 22, 2012 @ 12:20am UTC * By Aurorablade

    (In revision:638) re #89 error on zone level, coordinites returning out of range even when not.
    User picture

          on Feb 22, 2012 @ 11:57pm UTC * By Pilus

    The error you are getting is because "if currentLevel => targetLevel then" should be "if currentLevel >= targetLevel then"
    User picture

          on Feb 24, 2012 @ 12:41am UTC * By Aurorablade

    (In revision:639) re #89 name and gender in and working. Level range now giving error about accessing gameworlddata
    User picture

          on Feb 24, 2012 @ 12:42am UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Feb 25, 2012 @ 03:44am UTC * By Aurorablade

    (In revision:640) re #89 guild,level,class,race Initial upload, Needs review
    User picture

          on Feb 28, 2012 @ 04:24am UTC * By Aurorablade

    (In revision:645) re #89 mounted,swimming and indoors checks. Some errors will post in comments.
    User picture

          on Feb 28, 2012 @ 04:25am UTC * By Aurorablade

    Race code needs review, its picky.
    Is mounted is done, perhaps need to add check for flight form(though thats a shapeshift not a mount and i already have a 'is flying' check on the dismount function.but not the same safety check on calling a mount..hmmmm)

    Error, zone level
    [23:21:35] [string " local dyn = {..."]:13: attempt to call global 'GHI_GameWorldData' (a nil value)
    [C]: in function `GHI_GameWorldData'
    [string " local dyn = {..."]:13: in main chunk
    (tail call): ?
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:926: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:279: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:188>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:288: in function `Execute'
    ...terface\AddOns\GHM\Objects\GHM_DynamicActionArea.lua:109: in function `func'
    Interface\FrameXML\UIDropDownMenu.lua:706: in function `UIDropDownMenuButton_OnClick'
    [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>


    Cannot figure out why
    User picture

          on Feb 28, 2012 @ 04:31am UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Feb 28, 2012 @ 05:22pm UTC * By Pilus

    Regarding the error, then you can use the new function 'GetCurrentZoneLevel' that I added when changing the world data structure.
    User picture

          on Feb 28, 2012 @ 11:26pm UTC * By Aurorablade

    I changed it to that, I am not sure if i am calling the class or function wrong or what i mean it looks normal.
    User picture

          on Feb 29, 2012 @ 12:13am UTC * By Pilus

    The way you do it would be completely correct in general, but since we are in a dynamic action, then the code is executed inside our execution environment. In there we do not have all the GHI classes available (for security reasons). Instead there is a global function called 'GetCurrentZoneLevel'.

    In other words, you can change
    local levelData = GHI_GameWorldData();
                    local lvlmin,lvlmax = levelData.GetCurrentZoneLevel();

    to
    local lvlmin,lvlmax = GetCurrentZoneLevel();
    User picture

          on Feb 29, 2012 @ 01:27am UTC * By Aurorablade

    oh well DUH didn't note it was a global >.> MY BAD
    User picture

          on Feb 29, 2012 @ 06:44pm UTC * By Aurorablade

    (In revision:648) re #89 equip item, random number, level range
    User picture

          on Feb 29, 2012 @ 06:46pm UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Feb 29, 2012 @ 06:46pm UTC * By Aurorablade

    how did you see the random port ones being done?
    User picture

          on Feb 29, 2012 @ 11:17pm UTC * By Pilus

    I pictured that the random port action got 4 ports out. Similar it got 4 input variables (numbers), being weight1 to weight4.
    An output port is then picked randomly depending on the weights.
    Pseudo code:
    local sum = weight1 + weight2 + weight3 + weight 4
    local r = random(sum)
    if r <= weight1 then
       trigger port 1
    elseif r <= weight1 + weight2 then
       trigger port 2
    elseif r <= weight1 + weight2 + weight3 then
       trigger port 3
    else
       trigger port 4
    end
    User picture

          on Mar 01, 2012 @ 02:07am UTC * By Aurorablade

    (In revision:649) re #89 Random port erro, cannot spot what i am doing wrong (its a noPortguid error)
    User picture

          on Mar 01, 2012 @ 09:17pm UTC * By Pilus

    You can change 'allPortsTriggerScript' to false to avoid the error.
    Also you made some typos in some of the variables, e.g. sclae2
    Lastly, I dont think that it is needed for it to have any output value at all, since that info would not be use full.
    User picture

          on Mar 02, 2012 @ 12:45am UTC * By Aurorablade

    (In revision:652) re #89 Weighted Random port, Percentage Random port, Expression Say/Emote, Message(need to find a good icon for it.)
    User picture

          on Mar 02, 2012 @ 12:46am UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Mar 04, 2012 @ 12:48pm UTC * By Aurorablade

    (In revision:653) re #89 number format needs review, Screen effect
    User picture

          on Mar 04, 2012 @ 02:52pm UTC * By Pilus

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    I have reviewed some of them. (And fixed some bugs in the system meanwhile)
    User picture

          on Mar 05, 2012 @ 10:31am UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    User picture

          on Mar 07, 2012 @ 08:33pm UTC * By Aurorablade

    Okay somehow have confused myself on how to handle openbag..this will end up being overly simple..
    User picture

          on Mar 08, 2012 @ 06:40pm UTC * By Aurorablade

    (In revision:660) re #89 shot at some bag stuff, i think i have also reached the limit of what i can implement on my own.
    User picture

          on Mar 10, 2012 @ 11:39pm UTC * By Aurorablade

    Description changed from h1. Suggested actions: Scr... to h1. Suggested actions: Scr...
    I think i am at my limit for things i can implement confortablely though i can try to help as i can.
    User picture

          on Apr 07, 2012 @ 07:47pm UTC * By Pilus

    Assigned to changed from Aurorablade to -none-
    Status changed from In Progress to Ready for Test
    Sum of Child Work remaining changed from 20.0 to 0.0
    Work remaining changed from 20.0 to 0.0
    The current amount of implemented actions seems fitting. It should now be ready for test.
    User picture

          on Apr 07, 2012 @ 09:55pm UTC * By Aurorablade

    On Dynamic Action ARea:nodes:Hard to click edit/x button, node window may need to be larger

    After so many connections the area field clears and errors.

    Testing:
    Script: Pass
    Icon:Unsure if i tested right, icon of item did not change
    Message:Pass
    Expression: Say: Pass
    Expression:Emote:Pass
    Message:(under the action effect menu) Error: [17:41:18] [string " local dyn = {..."]:13: attempt to call global 'GHI_MiscAPI' (a nil value)
    [C]: in function `GHI_MiscAPI'
    [string " local dyn = {..."]:13: in main chunk
    (tail call): ?
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:882: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:303: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:206>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:312: in function `Execute'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:237: in function `TriggerOutPort'
    [string " local dyn = {..."]:18: in main chunk
    (tail call): ?
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:882: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:303: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:206>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:312: in function `Execute'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:237: in function `TriggerOutPort'
    [string " local dyn = {..."]:18: in main chunk
    (tail call): ?
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:882: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:303: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:206>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:312: in function `Execute'
    ...terface\AddOns\GHM\Objects\GHM_DynamicActionArea.lua:115: in function `func'
    Interface\FrameXML\UIDropDownMenu.lua:706: in function `UIDropDownMenuButton_OnClick'
    [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>


    Equip Item:Pass
    Dismount:Dosn't work, Will fix
    Mount: Pass (should update port descriptions, not sure how)
    Summon Companion: Pass
    Dismiss Companion:Pass

    Sound Actions:Error

    Screen Effect:[17:53:16] [string " local dyn = {..."]:13: attempt to call global 'GHI_MiscAPI' (a nil value)
    [C]: in function `GHI_MiscAPI'
    [string " local dyn = {..."]:13: in main chunk
    (tail call): ?
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:882: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:303: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:206>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:312: in function `Execute'
    ...terface\AddOns\GHM\Objects\GHM_DynamicActionArea.lua:115: in function `func'
    Interface\FrameXML\UIDropDownMenu.lua:706: in function `UIDropDownMenuButton_OnClick'
    [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>

    Find GHI Item:
    [17:54:41] [string " local dyn = {..."]:13: attempt to call global 'GHI_ContainerAPI' (a nil value)
    [C]: in function `GHI_ContainerAPI'
    [string " local dyn = {..."]:13: in main chunk
    (tail call): ?
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:882: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:303: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:206>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:312: in function `Execute'
    ...terface\AddOns\GHM\Objects\GHM_DynamicActionArea.lua:115: in function `func'
    Interface\FrameXML\UIDropDownMenu.lua:706: in function `UIDropDownMenuButton_OnClick'
    [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>


    Open Bag:
    [17:55:55] [string " local dyn = {..."]:14: attempt to call global 'GHI_ContainerAPI' (a nil value)
    [C]: in function `GHI_ContainerAPI'
    [string " local dyn = {..."]:14: in main chunk
    (tail call): ?
    ...terface\AddOns\GHI\ActionExecutors\GHI_ScriptEnv.lua:882: in function `ExecuteScript'
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:303: in function <...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:206>
    ...Ons\GHI\ActionHandlers\GHI_DynamicActionInstance.lua:312: in function `Execute'
    ...terface\AddOns\GHM\Objects\GHM_DynamicActionArea.lua:115: in function `func'
    Interface\FrameXML\UIDropDownMenu.lua:706: in function `UIDropDownMenuButton_OnClick'
    [string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>


    ------------Stopping here for now
    User picture

          on Apr 07, 2012 @ 09:56pm UTC * By Aurorablade

    Assigned to set to Aurorablade
    (In revision:693) re #89 Fixing Dismount
    User picture

          on Apr 07, 2012 @ 11:51pm UTC * By Pilus

    Aurora, could you make a ticket for each of the errors you mentioned above? It is easier to track them that way.
    Please set the milestone of those tickets to "GHI Backlog" and remember to fill in the version and revision in the 'Bug detected in Version' field.
    User picture

          on Apr 08, 2012 @ 06:10pm UTC * By Pilus

    Depends on ticket(s) changed from #87 to -none-
    Assigned to changed from Aurorablade to -none-
    Milestone changed from GHI v.1.99.2 to Concepts
    Status changed from Ready for Test to Ready for review
    Ticket #114, #115, #116, #117 and #118 have been created in regards to the remaining bugs in this.

    Moving this ticket to concepts, as it serves of a good list of all intended actions.
    Time Expenditure
    Loading