PDA

View Full Version : Add skill bonus to total.



Leonal
April 17th, 2009, 18:56
Hi,

I've been tweaking around to get a Pathfinder workable version of moon_wizards d20_JPG ruleset usable, but stumbled on a few problems.

I hope there's no problem in me editing it for personal use without asking first. I've used the d20_JPG since I got FG, but my group would like to try to incorporate some of the Pathfinder rules into it.

I tried first to create an extension similar to the one Steev42 (https://www.fantasygrounds.com/forums/showpost.php?p=70397&postcount=6) made to leave the original ruleset as it is, but gave up as I didn't manage to get the skill names from data_common.lua to successfully replace the original ones.

So after managing (I think) to get it to show the correct skill names and also to not utilize halfranks I'm almost there.

What I would like to do, is to add a function that adds a +3 bonus to the skill total. Either to the misc modifier (on top of what's there, if there is), or as an invisible number that gets added to the total, if the skill is checked as a class skill and has at least one rank.

If someone could point me in the right direction of how to set that up I'd greatly appreciate it.

madman
April 20th, 2009, 19:33
off topic
i would love to know what you changed to do the .5 skill point change so i can add it to an extension
for myself maybe we can put an extension together sharing info.


Madman

Leonal
April 20th, 2009, 23:31
Getting it to work in an extension would be great. And having the extension to use only the included lua files, and not the ones in the ruleset would make things easier. Like changing skill names, but that just created duplicates and didn't work well for me.

It was a process of trial and error since I'm rather noobish in xml/lua, but I basically removed or changed anything regarding halfranks to work like the normal skills.


Like this for example from the charsheet_skillranks.lua:
Old


-- Calculate the planned ranks
local ranks = ranknode.getValue();
local halfranks = halfranknode.getValue();

local plannedranks = 0;

if isClassSkill() then
local newranks = value - ranks - halfranks * 0.5;

if newranks >= 0 and newranks == math.floor(newranks) then
plannedranks = newranks;
end
else
local newhalfranks = 2 * (value - ranks - halfranks * 0.5);

if newhalfranks >= 0 then
plannedranks = newhalfranks;
end
end

new

-- Calculate the planned ranks
local ranks = ranknode.getValue();

local plannedranks = 0;

if isClassSkill() then
local newranks = value - ranks * 0.5;

if newranks >= 0 and newranks == math.floor(newranks) then
plannedranks = newranks;
end
else
local newranks = value - ranks * 0.5;

if newranks >= 0 then
plannedranks = newranks;
end
end

madman
April 21st, 2009, 02:05
here is what i have so far, the extension works to change the skills but i can not get the 1 to 1 skill point thing working without script errors.

https://rapidshare.com/files/223807620/pathskills.ext.html

Leonal
April 21st, 2009, 07:09
I tried your extension with FG 2.4 and d20_JPG 3.0.3, but it didn't change the skills when creating a character.

This file works for 1 to 1 skill points in a ruleset, but haven't tried it in an extension yet.
https://rapidshare.com/files/223872046/charsheet_skillranks.lua.html

Moon Wizard
April 21st, 2009, 07:30
I just gave this a run-through, since I was thinking about it. I stripped out all sub-labeling, half-ranks and included +3 bonus for class skills with at least 1 rank.

A couple caveats:
* The skills will be right for characters, but not for NPC auto-complete.
* It seems like maybe sub-labeling should be preserved for Knowledge skills, but I matched what madman had.

I'm not sure if this is how Pathfinder works exactly, but it's what I could piece together from your comments and the web.

https://rapidshare.com/files/223877527/pathfinder_skills.ext.html

Cheers,
JPG

Leonal
April 21st, 2009, 09:26
Wow, thanks alot!
I just tried it and it works great.
One question though, how do I add sublabeling again?^^; It's quite handy to have for profession and crafting skills.

I'll look through what you did and see if I can learn something. :)

Since Pathfinder is still beta, I don't know what the final skill names will be, but it seems like madman has some houseruled in there. Which might not be a bad thing though. I had a talk with one of my players, and agreed on having perception as the old listen and spot.

Updated the extension with "official" skills, and changed it to show CMB (Combat modifier bonus) instead of grapple. Adding the whole combat sheet might be unnecessary, but it's within my knowledge...^^
https://rapidshare.com/files/223933725/pathfinder_skills.ext.html

Moon Wizard
April 22nd, 2009, 02:10
https://rapidshare.com/files/224223708/pathfinder_skills.ext.html

* Added sub-labeling back in for Craft, Knowledge, Perform and Profession.
* Fixed code so that last skill entry that supports sub-labels can not be deleted.
* Fixed bug where duplicate skills were being created when character sheet opened the second time.

I also decided to remove the combat tab changes, because I felt that re-stating the entire combat tab could lead to problems down the road. While the skills section rarely changes, the combat section can change quite a bit from version to version of the ruleset. By not including the combat tab change, it will make this extension more robust to future ruleset changes.

Cheers,
JPG

madman
April 22nd, 2009, 02:16
the only reason i removed the sub labeling is it looks cleaner.
you could still add skills but they come out on one line.

and in beta: perception is the old listen and spot.

and seeing as how moon has found his way to us(Thank You) i was wondering if maybe you could give me some insight on how the abilities and saves are anchored. i can rearrange the npc sheet to do everything that i want.
except to put the abilities in another spot same problem with the saves.
i assume (bad thing to do) it is because they are templates they do not work the same. i have tried to play around with the template anchors with no luck.

i was just trying to move the order of the entries around so that data entry would be smoother.

also i guess i was trying to find out how to make 0 level spells at will for casters.

once again Thank You for you help.

Chris

Here is an example of a stat block

Male cloaker rogue 8 (MM 36)
CE Large aberration
Init +7; Senses darkvision 60 ft.; Listen +23, Spot +23

Defense

AC 30, touch 19, flat-footed 23
(+3 armor, +4 deflection, +6 Dex, +7 natural, –1 size)

hp 111 (14 HD; 6d8+8d6+56)

Fort +7, Ref +14, Will +8

Defensive Abilities evasion, improved uncanny dodge, trap sense +2

Offense

Speed 10 ft.; fly 50 ft. (average)

Melee tail slap +17 melee (1d6+7) and
bite +12 melee (1d4+3)

Special Attacks moan, engulf, sneak attack +4d6

Tactics

Before Combat

During Combat

Morale .

Statistics
Str 24, Dex 23, Con 18, Int 14, Wis 12, Cha 17

Base Atk +10; Grp +21

Feats Alertness, Combat Reflexes, Dodge, Flyby Attack, Improved
Initiative, Mobility

Skills Bluff +12, Escape Artist +13, Hide +22, Knowledge (local) +9,
Listen +23, Move Silently +27, Search + 13, Spot +23

Languages Undercommon

SQ shadow shift, trapfinding

Gear wing clasps of armor +3 (as bracers of armor), ring of protection +2

Special Abilities
Death Roar(Ex)

small things like moving the skills to the front of the sheet, or creating new fields, renaming fields,
are within my power but the listed things are not

Leonal
April 22nd, 2009, 05:25
Thanks again, I really appreciate the help:)

I agree it looks cleaner without sublabeling if you have short skill names, but when you have fixed knowledge skills it makes one long, cropped line instead of having the specified knowledge underneath.

I was mentioning perception since there was perception, and then perception (sound).

Looking forward to trying the second half of Red Hand of Doom with PF rules.

madman
April 22nd, 2009, 14:42
the perception sound is for the races that get a +2 to sound based perception checks

others get taste and feel

anyways
chris

Moon Wizard
April 22nd, 2009, 23:55
Since you guys are more advanced, you can always adjust the skills to meet your needs. For an extension for the general public including people that aren't comfortable tinkering in the code, I think the one I put out there works better for them.

For NPC field layout, look at the templates for npcabilityfield and npcsavefield. They are hard-coded to be right below another specific field. If you want to place them below a different field, then you will need to changed the hard-coded anchor value inside those templates.

For level 0 spells, I'm not sure that you really need to do anything, just don't check them off. I don't think it's really worth the work. If it really bugs you, then you'd have to:
* Modify the spell entry to hide the current spellcounter control for Level 0 spells
* Add a different icon for Level 0 spells for the player to press
* Add code for new icon to output spell
* Update the minisheet as well
* Make sure nothing breaks, or throws errors

Cheers,
JPG

madman
April 25th, 2009, 01:02
well i do not know enough to rearrange the npc sheet.
i can not get the abilities or the saves to relocate without getting them to be
placed over the top of another field.
tried to add offset and rearranging all anchors but i have had no luck.

must be a tag i need to add or remove and i can not find it.

thought about totally redoing the npc sheet and not using the same format.
as the d20 and more like the gurps rule set.

anyway if you can help me
Thanks
Chris

Bidmaron
April 25th, 2009, 04:28
madman, if you want someone to help you, you are going to have to tell what it is you are trying to do. Posting code is often a useful way to get advice on the code.

You are going to have to get familiar with the ruleset modification documentation under the library link and study the Windows and Controls section, particularly on anchors and so on.

I am just learning myself, and it is confusing at first. Just keep trying and observing the change, and remember "/reload ruleset" chat command is your friend.

madman
April 26th, 2009, 09:11
template name="npcabilityfield">
<jpgnumberfield>
<nodrop />
<noreset />
<hideonvalue>0</hideonvalue>
<font>sheettextsmall</font>
<frame>
<name>modifier</name>
<offset>5,2,5,4</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>7,4,7,5</offset>
</keyeditframe>
<script>
function onInit()
setAnchor("top", "specialqualities", "bottom", "absolute", 17);

if anchor then
setAnchor("left", anchor[1], "right", "relative", 5);
else
setAnchor("left", "specialqualities", "left", "absolute", -2);
end

setAnchoredWidth(20);
setAnchoredHeight(18);

if getDatabaseNode().isStatic() then
setFont("chatfont");
end
end

function onDrag(button, x, y, draginfo)
if OptionsManager.isOption("DRGR", "on") then
draginfo.setType("dice");
draginfo.setDieList({ "d20" });
else
draginfo.setType("number");
end
draginfo.setDescription(self.description[1].text[1]);
local bonus = math.floor((getValue() - 10) / 2);
draginfo.setNumberData(bonus);
draginfo.setShortcutData("npc", window.getDatabaseNode().getNodeName());

return true;
end

function onDoubleClick(x,y)
local bonus = math.floor((getValue() - 10) / 2);
ChatManager.DoubleClickNPC("dice", bonus, self.description[1].text[1], {npc = window.getDatabaseNode()});
return true;
end
</script>
</jpgnumberfield>
</template>



im trying to get the anchors arranged so that this group will be between like hd and xp for example.


</script>
<sheetdata>
<columnstringfield name="hd">
<tabtarget next="init" prev="name" />
</columnstringfield>
<columnfieldlabel>
<anchor>hd</anchor>
<static>HD/Type</static>
</columnfieldlabel>


<columnnumberfield name="cr">
<anchor>hd</anchor>
<tabtarget next="xp" prev="hd" />
</columnnumberfield>
<columnfieldlabel>
<anchor>cr</anchor>
<static>CR</static>
</columnfieldlabel>

<columnnumberfield name="xp">
<anchor>hd</anchor>
<tabtarget next="init" prev="cr" />
<description>
<text>XP</text>
</description>
</columnnumberfield>
<columnfieldlabel>
<anchor>xp</anchor>
<static>XP</static>
</columnfieldlabel>


i can do just about everything else but i can not get the templates for saves or abilities to go between two other fields they are always on top,and in between of the fields it does not occupy its own space

i can not get it the right spot because (i think maybe i need to add the abilities individually so that they all have the same vertical anchor somehow)




<npcabilityfield name="strength">
<tabtarget next="dexterity" prev="specialqualities" />
<description>
<text>Strength check</text>
</description>
</npcabilityfield>
<npctoplabel>
<anchor>strength</anchor>
<static>Str</static>
</npctoplabel>
<npcabilityfield name="dexterity">
<anchor>strength</anchor>
<tabtarget next="constitution" prev="strength" />
<description>
<text>Dexterity check</text>
</description>
</npcabilityfield>
<npctoplabel>
<anchor>dexterity</anchor>
<static>Dex</static>
</npctoplabel>
<npcabilityfield name="constitution">
<anchor>strength</anchor>
<tabtarget next="intelligence" prev="dexterity" />
<description>
<text>Constitution check</text>
</description>
</npcabilityfield>
<npctoplabel>
<anchor>constitution</anchor>
<static>Con</static>
</npctoplabel>
<npcabilityfield name="intelligence">
<anchor>strength</anchor>
<tabtarget next="wisdom" prev="constitution" />
<description>
<text>Intelligence check</text>
</description>
</npcabilityfield>
<npctoplabel>
<anchor>intelligence</anchor>
<static>Int</static>
</npctoplabel>
<npcabilityfield name="wisdom">
<anchor>strength</anchor>
<tabtarget next="charisma" prev="intelligence" />
<description>
<text>Wisdom check</text>
</description>
</npcabilityfield>
<npctoplabel>
<anchor>wisdom</anchor>
<static>Wis</static>
</npctoplabel>
<npcabilityfield name="charisma">
<anchor>strength</anchor>
<tabtarget next="babgrp" prev="wisdom" />
<description>
<text>Charisma check</text>
</description>
</npcabilityfield>
<npctoplabel>
<anchor>charisma</anchor>
<static>Cha</static>
</npctoplabel>

<columnfieldlabel>
<anchor>strength</anchor>
<static>Abilities</static>
</columnfieldlabel>


<npcsavefield name="fortitudesave">
<tabtarget next="reflexsave" prev="hp" />
<description>
<text>Fortitude save</text>
</description>
</npcsavefield>
<npctoplabel>
<anchor>fortitudesave</anchor>
<static>Fortitude</static>
</npctoplabel>
<npcsavefield name="reflexsave">
<anchor>fortitudesave</anchor>
<tabtarget next="willsave" prev="fortitudesave" />
<description>
<text>Reflex save</text>
</description>
</npcsavefield>
<npctoplabel>
<anchor>reflexsave</anchor>
<static>Reflex</static>
</npctoplabel>
<npcsavefield name="willsave">
<anchor>fortitudesave</anchor>
<tabtarget next="speed" prev="reflexsave" />
<description>
<text>Will save</text>
</description>
</npcsavefield>
<npctoplabel>
<anchor>willsave</anchor>
<static>Will</static>
</npctoplabel>

<columnfieldlabel>
<anchor>fortitudesave</anchor>
<static>Saves</static>
</columnfieldlabel>

i did not write this i am just trying to make an extension for it

Bidmaron
April 26th, 2009, 12:16
If you will tell us specifically what you want to do, we can probably show you the code for it. What you have posted looks like it's straight out of 3.5e_jpg. I know you are trying to move the saves, but I don't know where you are trying to move them. Without that, I can't show you how (and, since I am no expert yet, even with that, I might not be able to help, as you might notice from some of my posts).

I presume that the "cr" field you moved is working correctly, right?

madman
April 26th, 2009, 15:58
yes, i can move the other fields and create new ones. and they all work just fine and i am using d20_JPG for the extension. and if i could see an example of it wroking anywhere but the bottom of the npc sheet i could figure out how to put it somewhere else but i can not give you an example of the code for it, as i can not make it work. so if it was moved to anywhere, in between two other fields it would work, i want to move saves under the hp field and stats under the special abilities field in the end.

thank for trying to help me with my little escapade.

Chris

Bidmaron
April 26th, 2009, 17:00
I am sure we can figure this out, but the location you want to move the saves to is currently occupied by the languages block. And, pardon me, but why in the world would you ever want to move the stats to the special abilities tab? I think I'm just not understanding you, and therefore won't be able to help you get what you want.

madman
April 26th, 2009, 21:49
this is not the character sheet it is the npc personalities sheet.

Chris

Bidmaron
April 26th, 2009, 23:31
Oops. Let me look at that then.
OK, the problem you're facing is that you have is that the onInit code for the saving throws is forcing them to be after the abilities.
So, the first thing is to move the saving throw blocks up just under hp. While not always required, it helps to see the xml in the order it will be in the window. Then, once you've done that, find the onInit routine of the npcsavefield template (which is above the windowclass in adventure_npcs).
Change this code to:


function onInit()
setAnchor("top",hp,"bottom","relative",17);
if anchor then
setAnchor("left",anchor[1],"right","relative",5);
else
setAnchor("left",hp,"left","absolute",0);
end

setAnchoredWidth(47);
setAnchoredHeight(18);

if getDatabaseNode().isStatic() then
setFont("chatfont");
end
end


That should do it. If you do that, your stats should stay where you want them (I think?) If not, let me know where you want those to be.

madman
April 27th, 2009, 06:12
yeh i tried that already and it does not work here is an example of that code.

https://img7.imageshack.us/img7/2153/npck.th.png (https://img7.imageshack.us/my.php?image=npck.png)

i thought that maybe i could add a tag that creates space between hp and speed, as to create room for the stats and saves so if they were not there the space would be empty.

but i do not know how to add empty space to the code


<columnstringfield name="hd">
<tabtarget next="init" prev="name" />
</columnstringfield>
<columnfieldlabel>
<anchor>hd</anchor>
<static>HD/Type</static>
</columnfieldlabel>

Moon Wizard
April 27th, 2009, 10:17
Bidmaron's answer is the correct approach. However, moving the ability or save fields up creates new problems.

You need to look at the reference to understand absolute vs. relative layout.
https://www.fantasygrounds.com/refdoc/windowcontrol.xcp

For the npcabilityfield template:
It ties directly underneath the "specialqualities" field as you can see in the onInit code for the npcababilityfield template. You just need to change the field that these templates link to. You want to change it to the field you want them to appear under.

However, the layout of the columnstringfield and columnnumberfield templates is specified via hard-coded relative offsets to the anchor field. That means that they will always be stacked right on top of each other, no matter where you move the ability or save fields.

You will need to insert a spacer to make room for the fields, and the spacer will need to use a relative top anchor.

I haven't tested this code, but here's an example of a spacer using relative layout:


<genericcontrol>
<anchored>
<top>
<parent>hd</parent>
<anchor>bottom</anchor>
</top>
<left>
<anchor>left</left>
</left>
<right>
<anchor>right</right>
</right>
<size>
<height>40</height>
</size>
</anchored>
</genericcontrol>


Cheers,
JPG

Bidmaron
April 27th, 2009, 11:42
It's great that one of the jedi knights chimed in and helped us out here. Thanks, moon_wizard. I think we had a case here of the blind leading the blind.

madman
May 4th, 2009, 20:10
thanks for all the help on this.
but i am going to give up on it . as i can not seem to make it work.
but i thank you guys for your time.

and as a side note my players, get some script error with the pathfinder skills mod.

but i forgot to write it down. so i will post it next week after the game.

Thanks Again

Chris

Leonal
May 5th, 2009, 02:52
So far it's been great for me with only a minor problem.

We didn't test this without the PF mod, but when the GM is looking at the player's skills tab while the player is editing there is an error on the player side and he/she is unable to change skills.

madman
May 5th, 2009, 03:41
yes that is the same problem my guys are getting.

it is only when the gm has the sheet open and they change skills?

Moon Wizard
May 5th, 2009, 04:30
Get me the error message, and it should be easy to track down.
JPG

Leonal
May 5th, 2009, 05:51
I wasn't able to duplicate the error with two instances of FG, but I'll ask one of my players to try later today.

rhopp
June 2nd, 2009, 19:31
https://rapidshare.com/files/224223708/pathfinder_skills.ext.html

* Added sub-labeling back in for Craft, Knowledge, Perform and Profession.
* Fixed code so that last skill entry that supports sub-labels can not be deleted.
* Fixed bug where duplicate skills were being created when character sheet opened the second time.

I also decided to remove the combat tab changes, because I felt that re-stating the entire combat tab could lead to problems down the road. While the skills section rarely changes, the combat section can change quite a bit from version to version of the ruleset. By not including the combat tab change, it will make this extension more robust to future ruleset changes.

Cheers,
JPG

Would it be possible to re-host the Pathfinder skills extension? The link in the quoted post indicates that the 10 downloads from Rapidshare have been exhausted. Thanks a bunch!
Bob

Leonal
June 2nd, 2009, 20:56
It could be uploaded to the wiki perhaps...*hint hint*