DICE PACKS BUNDLE
  1. #2341
    Got a question. I'm working on the Shadowrun 5e extension.
    I have rolls working for it, but when I examine the rTarget it is always nil.
    Is there something I need to do other than onLanded to get the rTarget to be populated?
    I have a character in the combat tracker with two NPCs targeted.

    Also when I do get rTarget working, will it roll once for each target or can I get it to do one roll for all targets?

  2. #2342
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,684
    Blog Entries
    1
    Quote Originally Posted by rmilmine View Post
    Got a question. I'm working on the Shadowrun 5e extension.
    I have rolls working for it, but when I examine the rTarget it is always nil.
    Is there something I need to do other than onLanded to get the rTarget to be populated?
    I have a character in the combat tracker with two NPCs targeted.

    Also when I do get rTarget working, will it roll once for each target or can I get it to do one roll for all targets?
    Start at the start.
    Start with performAction do you have rTarget info there?

    Try something like:
    aTargeting = ActionsManager.getTargeting(rActor, nil, rRoll.sType, { rRoll })
    Debug.chat("aTargeting: ", aTargeting);

    Unless you do something new with the roll it will roll once only.

  3. #2343
    Quote Originally Posted by damned View Post
    Start at the start.
    Start with performAction do you have rTarget info there?

    Try something like:
    aTargeting = ActionsManager.getTargeting(rActor, nil, rRoll.sType, { rRoll })
    Debug.chat("aTargeting: ", aTargeting);

    Unless you do something new with the roll it will roll once only.
    aTargeting ends up equaling { #1 = { } } no roll took place on when the code is run.
    I checked the rRoll and it looks fine. It rolls using performAction.

    I'm using the MoreCore ct with a slight change, I added some fields to be displayed on ct_entry.

    Code:
    function performRoll(draginfo, rActor, nSkillDicePool, nDicePoolModifier, nForce, nLimit, nEdgeDice, sSpellName, sSpellPath, bSecretRoll)
    	local rRoll = { };
    	rRoll.sType = "sr5spell";
    	rRoll.aDice = { };
    	rRoll.nMod = 0;
    	rRoll.nSkillDicePool = nSkillDicePool;
    	rRoll.nDicePoolModifier = nDicePoolModifier;
    	rRoll.nEdgeDice = nEdgeDice;
    	rRoll.nForce = nForce;
    	rRoll.nLimit = nLimit;
    	rRoll.sSpellPath = sSpellPath;
    	rRoll.nDicePool = nSkillDicePool + nDicePoolModifier + nEdgeDice;
    	rRoll.sDesc = "[CASTING SPELL] " .. StringManager.capitalize(sSpellName) .. " roll";
    	local count = rRoll.nDicePool;
    	while count > 0 do
    		table.insert(rRoll.aDice, "d6");
    		count = count - 1;
    	end
    	rRoll.bSecret = bSecretRoll;
    --	ActionsManager.performAction(draginfo, rActor, rRoll);
    	Debug.chat(rRoll);
    	aTargeting = ActionsManager.getTargeting(rActor, nil, rRoll.sType, { rRoll })
    	Debug.chat("aTargeting: ", aTargeting);
    end

  4. #2344
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,684
    Blog Entries
    1
    Ive given you bad directions.
    MoreCore has targeting support built into the rolls.
    Have a look at any of the rolls that already use it - any of the damage rolls or attackac or thac0

  5. #2345
    Quote Originally Posted by damned View Post
    Ive given you bad directions.
    MoreCore has targeting support built into the rolls.
    Have a look at any of the rolls that already use it - any of the damage rolls or attackac or thac0
    Looking at attackac and thac0 I see the following related to target, both have it in createRoll.

    Code:
      if sTarget then
        rRoll.nTarget = tonumber(sTarget);
    	Debug.console("nTarget: ", rRoll.nTarget);
        rRoll.sDesc = sDescriptionParam;
    	else
    		rRoll.sDesc = sParams;
      end
    What I don't see is where sTarget is defined.

  6. #2346

  7. #2347
    Still not sure how sTarget is getting set. I'm guessing it's a global variable.

    performRoll calls createRoll.
    createRoll uses the above code to look at sTarget.
    It never initializes it. So I'm guessing it's a global variable.
    I try doing Debug.chat(sTarget) and I get nil.

  8. #2348
    Quote Originally Posted by damned View Post
    Now how does this other Blades roll need to work?
    I'm assuming you mean Resistance Rolls, which instead of a text result would be a Value. That Value would be the equivalent to the same roll you've already done except the output would be the equation [6 - highest-roll]. Or more specifically if the person creates a sheet with a variable called "Stress" (I have no idea where they may be tracking that, but call it C4 for now), it would be [C4 + (6 - highest-roll)] (it increases your Stress level, if you will). Except in the case of where you have "Critical Success" where the value would then become [C4 - 1] (where it decreases your stress level, you lucky dog). All of the other rules for the roll you already made otherwise apply (so if the modifiers reduced the number of dice to 0 or less it is the "unskilled" 2d6 roll taking the lowest of the two dice with no need to check for a Critical Success since it is not allowed in that instance.) If the person working on the sheet for this doesn't want to track Stress that way for some reason then the output would simply need to be either the [6 - highest-roll] result as "Gain x Stress", or for a Critical Success as "Reduce Stress by 1".
    Last edited by zarlor; May 27th, 2020 at 17:58.
    Lenny Zimmermann
    Metairie, LA

  9. #2349
    Quote Originally Posted by damned View Post
    Hey Brotherkelly

    Could you please provide a description of the rolls syntax?
    I have changed /attack to /atkatow to fit with the other rolls.
    I have added these two icons.



    Attachment 36075
    Attack Roll:

    /attack 1d2006+1d6+(p1)+(a)+(b)>TN

    The two different D6's are used so one will explode only if both roll a 6.

    Parameter (p1) is manually entered and is the level of the skill used for the type of attack - Small Arms, Support Weapons, Melee Weapons, etc.

    Ref Field (a) is linked to the primary attribute modifier for the skill being used. This is taken from the Stats block on the front MoreCore tab.

    Ref Field (b) is linked to the secondary attribute modifier (if required) for the skill being used. This is taken from the Stats block on the front MoreCore tab.

    The Target Number (TN) is dependent on the complexity skill being used. Simple Basic is 7 (such as Small Arms), Simple Advanced is 8 (such as Martial Arts).

    Attack Roll.jpg

    Damage Roll

    /btdamage 2d6

    The 2d6 determines the hit location on the target.

    Parameter (p1) is manually filled in with the weapons Damage Value.

    Parameter (p2) is manually filled in with the weapons Damage Type. For this, 1 = Melee, 2 = Ballistic, 3 = Energy, 4 = Explosive

    Parameter (p2) is manually filled in with the weapons Penetration (AP) Value.

    Damage Roll.jpg

    Hopefully this helps explain the rolls for you.

  10. #2350
    ok, I was able to get the ActionManager.getTargeting is now working.
    I had to delete the character from the combat tracker and re-add the character, making sure it had a token and name. if it didn't have those it still didn't work.
    No rolling of dice happens, but I'm getting the targeting information before the roll happens.
    It looks like the targeting is now working. There must have been a disconnect between the combat tracker and the character that was causing the issue.
    I must have done something to break it at some point and didn't notice.
    Thanks, and sorry.

Thread Information

Users Browsing this Thread

There are currently 4 users browsing this thread. (0 members and 4 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
  •  
STAR TREK 2d20

Log in

Log in