Starfinder Playlist
Page 6 of 10 First ... 45678 ... Last
  1. #51
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,674
    Blog Entries
    1
    Quote Originally Posted by ShakyLuigi View Post
    Well, i've slapped it on the Forge!

    At the same time I fixed the combat tracker, so the relevant info is transfered correctly.

    And that's about it for this time.

    Happy gaming!
    Added to the list!

    https://www.fantasygrounds.com/forum...s-on-the-Forge

  2. #52
    Quote Originally Posted by ShakyLuigi View Post
    Well, i've slapped it on the Forge!

    At the same time I fixed the combat tracker, so the relevant info is transfered correctly.

    And that's about it for this time.

    Happy gaming!
    If you're interested in some assistance with this ruleset, I'd be happy to chip in as I can. If you've got a link to the repo, I can submit PR's against it. Looks like you put this ruleset in the vault on the forge. Would already like to add some contributions around item fields and the like.
    Or better yet...join the Fantasy Grounds Unofficial Developers Guild discord server and we can put a channel in for this ruleset!
    https://discord.gg/qpCeDvekKa

  3. #53
    Quote Originally Posted by damned View Post
    Hey Shaky my approach to coding opposed rolls is either:

    if you must have actual dice rolls then you roll the targets opposed roll first and store that in db field, then you make the attacking roll and compare against the opposed roll result and then reset the value to 0

    otherwise just use math.random(#) to adjust the target value by a roll (equivalent) amount.
    I am going to try and have a look at opposed rolls, as I feel that is the next logical step for this ruleset.

    I've been trying to get my head around on how to build something like this, and I think I have a general idea how it basically should be.

    1. Choose target.
    2. Roll attack roll (starting with opposed attack rolls, as this is the easiest to understand). The attack roll will generate a value SL.
    3. The target will defend themselves with an attack roll. This will also generate a value SL.
    4. Compare SL values. The highest is the winner.
    5. Calculate damage.

    I got a little so far. I've managed to find the target as value in the combat tracker.

    Step 2 is also fine. And I think I will be able to save the SL no problem. But then comes the next step.
    I would like there to come up a prompt for the target (either NPC or PC), where the player (or GM, as is apprioate) add necessary information and roll the dice.
    And then produce results in chat as normal.

    Where would I start to look and learn how to create a prompt like this? Is it even possible?

  4. #54
    You need to pass your first roll information into another roller.

    local rRollProt = { sType = "armour", sDesc = "Protection Roll", aDice = aDice, nMod = nMod, nTotalDamage =nTotal, sDefender = sDefender};
    ActionsManager.performAction(nil, nil, rRollProt);

    This is located in my damage roll handler. Here I pass my roll result and the path for my defender node into my armour roll. it is found by:

    local nodeDefender = ActorManager.getCTNode(rTarget)
    local sDefender = DB.getPath(nodeDefender)

    Once in my armour roller I do my operation to apply the damage reduction. Then I send it into my msgOOB.

  5. #55
    Quote Originally Posted by bayne7400 View Post
    You need to pass your first roll information into another roller.

    local rRollProt = { sType = "armour", sDesc = "Protection Roll", aDice = aDice, nMod = nMod, nTotalDamage =nTotal, sDefender = sDefender};
    ActionsManager.performAction(nil, nil, rRollProt);

    This is located in my damage roll handler. Here I pass my roll result and the path for my defender node into my armour roll. it is found by:

    local nodeDefender = ActorManager.getCTNode(rTarget)
    local sDefender = DB.getPath(nodeDefender)

    Once in my armour roller I do my operation to apply the damage reduction. Then I send it into my msgOOB.
    Okey, I think I have the general idea.

    rRollProt has all of the necessary info to calculate an opposed roll. rRollProt is sent to a different script, let's say script B.
    Now the info is saved in script B (is my guess). The defender rolls an opposed roll, running script B. Is this correctly understood?

    If so, then here is my next question. How would I make sure that the correct "defender" is rolling an opposed combat roll?
    Would I have to build the script, so that it checks who rolls against the rTarget that is saved in rRollProt?
    Am I on the right track, or am I missing something?

  6. #56
    I'm having trouble wrapping my head around what you suggested.
    Is there a ruleset or scripts I can have a look at to try and understand how one would do this?

  7. #57
    Ok you understand what a roll handler is right? It is where you take the output of your roll, manipulate it and may or may not display the results in the chat box.

    If you do then inside that handler you need to make your opposed roll. Inside your new rRoll (your table) , pass the first rolls information that you need. If it is a node like your Source or Target node pass it as a string..

    Then inside the handler for your roll you just setup manipulate both roll data as required. Make any changes to the DB and pass the output into chat. If a Client is changing the DB outside of his character sheet you will need to use msgOOb to make any DB changes.


    the local rRollProt above is just a table i used to setup a protection roll.

  8. #58
    Thanks for trying to help me. I have zero background from scripting or coding. I don't know any code-languages. My day job is quality assurance in a mayonaise factory. Just to give an impression of my level of understanding codes.
    Trying to explain my problem, without really understanding everything is hard. But again, thanks for trying to help me.


    I think I understand what a roll handler is. A script that gets info from a roll and you generate a result from it. You can also get other necassary info (like modification number, or damage from a weapon) to get the result you want.
    Easy peasy.

    But I know I am having trouble understanding DB commands.
    I just don't get having PC A attacking NPC B, and then having B "invited" into the rollhandler in a new roll. The info is overwrited when I am doing a new roll.
    In Warhammer, both parties roll an attack which generate level of successes. These two numbers are compared and the highest is the winner. If you are attacking and win you give damage. If you defend and win you gain an advantage. Not sure if this is relevant for the coding, but that's how it should work.

    I tried creating a function where if you had a target, the rRoll and rTarget info would be transfered into a new script. And in that script I wanted the defender to roll and compare the info. But what happend there, the new roll overwrote the old info. Not sure how I would "save" the info for future use IE the defending party.

    After writing this, I think the question would be: How can I have two rolls be handled in the same roll handler?

  9. #59
    That's what the second roll handler is for. You pass the first roll info with the new roll into the second handler. Trenloe has a post in the workshop where he sets up rolls. Maybe start there. Not at home at the moment or I would go look for.it.

  10. #60
    Thanks. I found the thread and have been reading through it.

    And then it hit me.
    I am using the "Ruleset Wizard" to build the ruleset. And a lot of the roll info and handler is automated here, and I only have to write the script that evaluates the roll.
    Perhaps there is a something that is lost in translation for me when you're trying to explain me how to script the handler? I never got the hang of creating a dice roll until I started using "Ruleset Wizard".

    Otherwise, I found this link in Trenloes dice thread:

    https://www.fantasygrounds.com/modguide/scripting.xcp

    And I found the part about Handler Functions. Is that the right way to go?

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 Character Create Playlist

Log in

Log in