PDA

View Full Version : Simple Stat choosing



Ikael
February 8th, 2008, 21:20
Hi, this is my first post on this board and I already have question about altering rulesets. Ok here we go,

I want to create simple tool (only one instance) that adds together two stats (like strength + dexterity) that I can choose. I have been studing charsheet_skills.xml where you can select a stat for skill using cyclemapping and find it very good way to do the tool, although haven't managed to make it work.

I already created (copied) two statlabel and stat controls and numbercontrol that sums up both numbercontrols, but when I use onClickDown on statlabel it doesn't cycle the stats. What could be wrong?

Foen
February 10th, 2008, 05:55
Please would you post a few snippets of code? I can't quite understand how you want this to work.

Cheers

Stuart

Ikael
February 10th, 2008, 09:09
Thanks for answering, but don't mind anymore, I made it work. Thou I got another question about it: Current tool is made as skills in d20 ruleset, but I don't need the 'add new instance' option on right click, is there a way to disable that option?

The code itself is copy-pasted and ripped from charsheet_skills.xml and charsheet_skilllist.lua, charsheet_skilllistitem.lua (if this information helps at all)

joshuha
February 10th, 2008, 16:00
Thanks for answering, but don't mind anymore, I made it work. Thou I got another question about it: Current tool is made as skills in d20 ruleset, but I don't need the 'add new instance' option on right click, is there a way to disable that option?

The code itself is copy-pasted and ripped from charsheet_skills.xml and charsheet_skilllist.lua, charsheet_skilllistitem.lua (if this information helps at all)


Remove the <allowcreate /> tag to not allow creation of list items through the radial interface.

Foen
February 10th, 2008, 16:08
There are a few places where new instances can be created. The most obvious one is in the windowlist definition (charsheet_skills.xml, line 490 in my extract), you should remove the <allowcreate /> tag.

The second one is by user-defined menu items, and you should look in the onInit() function in charsheet_skilllist.lua for this. In the default d20 ruleset, that option isn't used (the tag is used instead).

Finally, some lists allow you to create new entries when you press the enter key in the name field of a list item. The default ruleset does this using an onEnter function in the sublabel field in charsheet_skills.xml (line 75 in my copy). You can safely delete this function entirely (and you may also want to delete onDeleteDown as well, which removes an entry from the list).

Hope that helps

Stuart

Ikael
February 10th, 2008, 20:15
Yep, that did the trick. Thank you very much for helping out, I am once again one step closer to my goal, which is kinda far away ahead thou ;)