PDA

View Full Version : Don't know where its getting it.......



Samarex
January 4th, 2016, 09:58
Hello All,
Working on some stuff in a D20 Modern based ruleset. I am adding 2 new stats Education and Social Rating. I got them both in and the die Rolling with Modifiers added works fine. The only thing I cant figure out where it gets it from is when you do a Stat check Education is fine it comes up "Education Check" but when I do a Social Rating check it comes up "Socrating Check"
Where do I find the area to get it to output "Social rating Check"?

Thanks
Samarex

P.S
To make it simple I have just copied the D20-Modern ruleset and Renamed it to the new ruleset. So everything is the standard Modern Ruleset.

Samarex
January 4th, 2016, 10:29
So I think I might have found where it gets it. This is from the "manager_action_ability.lua"



function getRoll(rActor, sAbilityStat, nTargetDC, bSecretRoll)
local rRoll = {};
rRoll.sType = "ability";
rRoll.aDice = { "d20" };
rRoll.nMod = ActorManager2.getAbilityBonus(rActor, sAbilityStat);

rRoll.sDesc = "[ABILITY]";
rRoll.sDesc = rRoll.sDesc .. " " .. StringManager.capitalize(sAbilityStat);
rRoll.sDesc = rRoll.sDesc .. " check";

rRoll.bSecret = bSecretRoll;

rRoll.nTarget = nTargetDC;

return rRoll;
end


The Bold is what I think generates the message. but looks like it just takes whatever you named the stat and capitalizes the first letter. is there a way to get it to take the stat identifer and look it up in the strings_35e.xml and report the string name assigned to that stat?

dulux-oz
January 4th, 2016, 10:29
Is the new social rating entryfield called "socrating"? The code might be getting the output from the name of the object.

Samarex
January 4th, 2016, 11:40
Is the new social rating entryfield called "socrating"? The code might be getting the output from the name of the object.

Yes thats what it is named

damned
January 4th, 2016, 11:52
rename the object to SocialRating....

Samarex
January 4th, 2016, 12:42
Thanks Damned
That Works. Not 100% what I wanted but it will work for now

Having a space Social Rating would be nice. But this is good for now....

Thanks again guys

damned
January 4th, 2016, 12:52
you may have to rework your code but this is taken from the Maelstrom Ruleset and I had a similar issue.

this is a code snippet from the character sheet:

<number_charabilitytemp_physical name="Missile Skill" source="abilities.missile-skill.temp">
<anchored to="missile-skill" offset="12,0" />
</number_charabilitytemp_physical>

you can see my data has a node (db location) defined and a friendly name.

this is the number_charabilitytemp_physical template:

<template name="number_charabilitytemp_physical">
<basicnumber>
<tooltip><text>Current Ability Score. Click to Edit. Double Click to Roll. Roll under this value (- Armour Penalty) for Success.</text></tooltip>
<rollable />
<anchored position="right" width="32" />
<default>40</default>
<script>
function action(draginfo)
local nodeWin = window.getDatabaseNode();
if nodeWin then
local sMyName = nodeWin.getChild(".name").getValue()
local sSkill1 = self.getValue();
local sSkill2 = self.getName();
local nTotal1 = getValue();
Debug.console("nTotal1:" .. nTotal1 .. "!");
local nPenalty = window.penalty.getValue();
Debug.console("nPenalty:" .. nPenalty .. "!");
local nTotal = nTotal1 - nPenalty;
Debug.console("nTotal:" .. nTotal .. "!");
local sDesc = sMyName .. ": [ABILITY] " .. sSkill2 .. " check [TARGET " .. nTotal .. "]";
Debug.console("sDesc:" .. sDesc );

local rRoll = { sType = "ability", sDesc = sDesc, aDice = {"d100","d10"}, nMod = 0 };
ActionsManager.performAction(draginfo, rActor, rRoll);

end
return true;
end

function onDragStart(button, x, y, draginfo)
return action(draginfo);
end

function onDoubleClick(x,y)
return action();
end
</script>
</basicnumber>
</template>

If you see the lines on bold - I collect both the value for use in determining the result and the name for use in posting to the chat window....