STAR TREK 2d20
Page 3 of 4 First 1234 Last
  1. #21
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,513
    Quote Originally Posted by Varsuuk View Post
    I had modified an existing MoreCore attack routine successfully, however - I am not sure how to get a DRAG to target on CT, for example, to work. So I guess I didn't REALLY get it correct

    (An example case is you forgot to target someone and rolled, this lets you drop it on the token or CT entry you wish to check a hit against.

    When I printout rRoll, I see some clues why it would not work but what am I supposed to do to support this?
    1) Make sure that you've assigned the action as a targetable action in GameSystem.targetactions.
    2) Make sure your action scripts maintain draginfo throughout the action chain.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  2. #22
    Thanks Trenloe (and Damned for pointing me to this tutorial)

    I was trying to figure out how to pass back the total from a die roll and banging my head against the computer desk because it kept passing nil values left right and centre (and the rRolls always wanted to be empty too).

    I'm able to see a total if I print it from onRoll, but if I try to get a total of the roll anywhere else, it fires an : attempt to index local 'rRoll' (a nil value) in the manager actions lua of the coreRPG.

    This is what I'm trying to get around and it almost seemed like I had it and then the computer ripped it away from me .
    Anybody want a peanut!

  3. #23
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,724
    Blog Entries
    1
    Once the dice script has finished executing the result doesnt live anywhere that is accessible to your code anymore (except perhaps in the chatwindow ondrag events).

    You have to do all your actions inside THIS SET OF SCRIPTS - you will be doing it in that Step 5 - Resolve Action. You cant do it after - you have to do it as part of the roll.

  4. #24

  5. #25
    Thanks Damned; I can't get that one to work on any ruleset.

    Would it be better (wiser) to call the table to be rolled on from onRoll? That's the only function that seems to allow Actionsmanager.total(rRoll) to actually NOT throw an error at me. From there I can use the total to pop out the message from the table (at least that's what make logical sense in my mind, whether that is the case or not remains to be seen ).

    (thank you for your patience and good advice!)


    edit: do I need to look into OOB's? *panic*
    Last edited by Fezzik Buttercup; March 19th, 2022 at 18:26.
    Anybody want a peanut!

  6. #26
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,724
    Blog Entries
    1
    here is a working build.
    its just called Drop Lowest in your extension list

    to test it type in chat

    /rolld 5d6 2

    working thru this example and then modifying it to roll what you want is going to be helpful
    Attached Files Attached Files

  7. #27
    I can't seem to wrap my head around getting the total out of these, so I'm going with the basic math line and maybe let someone else worry about seeing a roll if they want later on . I'll just work on tables for now and parcing the chat messages to locate critical hits etc.

    Thanks damned!
    Anybody want a peanut!

  8. #28
    What script errors are you getting when you use ActionsManager.total(rRoll)?
    What is the contents of the rRoll variable that you are passing in? (You can use Debug.chat or Debug.console to output the variable before the call.)

    Regards,
    JPG

  9. #29
    In all of the functions, it fails except onRoll (I'm taking a wild guess here its because the only thing the ActionsManager.register... is 'linked' to onRoll?). When I cycle through the other functions with debug (and try to get a .total too) the rRoll is empty :O . The error is on 661 (scripts/manager_actions.lua; attempt to perform arithmetic on field 'result' (a nil value). (line 656)

    I can't call .onRoll() from my other scripts as that gives a 'attempt to indext local 'rRoll' (a nil value). Calling .processRoll works, but the total is spit out only on onRoll, which isn't called directly (just through the ActionsManager (at least that's what it seems to me; my brain hurts )

    Thank you for your patience guys.
    Anybody want a peanut!

  10. #30
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,513
    Quote Originally Posted by Fezzik Buttercup View Post
    In all of the functions, it fails except onRoll (I'm taking a wild guess here its because the only thing the ActionsManager.register... is 'linked' to onRoll?). When I cycle through the other functions with debug (and try to get a .total too) the rRoll is empty :O . The error is on 661 (scripts/manager_actions.lua; attempt to perform arithmetic on field 'result' (a nil value). (line 656)

    I can't call .onRoll() from my other scripts as that gives a 'attempt to indext local 'rRoll' (a nil value). Calling .processRoll works, but the total is spit out only on onRoll, which isn't called directly (just through the ActionsManager (at least that's what it seems to me; my brain hurts )

    Thank you for your patience guys.
    Referring to the steps detailed in post #2 of this thread: performRoll (is this what you're calling processRoll?) is the only function you call externally - and this is to initiate the roll action. Everything else within the action manager LUA file gets called as part of the action process outlined in post #2 - calling those functions externally will give you the errors you're seeing.

    I'd recommend going back and going through the process detailed in the first few posts of this thread - and ensuring you have the ActionsManager.registerResultHandler for your onRoll function - otherwise that function won't be called. And also ensure the roll type you're using doesn't have the same name as an existing roll type in the ruleset you're using. If you still can't get it working, then please post the whole action manager LUA file here.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Product Walkthrough Playlist

Log in

Log in