PDA

View Full Version : Rt click adding items to a list



dstuffle
September 13th, 2013, 04:47
I am trying to add a skills section to a NPC sheet (for the Shadowrun 4th ed rule set). I've made a npc_skills.xml that has the windowclass (npc_skillitem), and in the npc_main.xml have included it, and made genericcontrol and a windowlist to hold them.

When I run the campaign, it starts and brings up the NPC form with no problems. When I rt. click in the skills area, I get the item creation menu. If I click the minimize or close window, the NPC window closes.

The issue comes when I click on the selections on the menu that should create a new skill control. If I click the "Create Item", I'm expecting a new skill item to be made, but nothing happens. If I click the "Create Item in location button, I get a script error, when the .lua script tries to determine which tab I clicked on (the PC skill area has 6 - 8 tabs for skills) when the npc window doesn't have any tabs.

Anyone have some pointers on how to troubleshoot this? I'll be happy to post more detailed code.

I've gone through the Rule set creation tutorial, but it stops before the author would made a user managed windowlist (like weapons, skills, equipment), so it was of no help with this.

If I can get it to even just add & delete a string field, I can expand it from there.

Moon Wizard
September 13th, 2013, 07:31
For most windowlists, you can just specify allowcreate and allowdelete to let the windows automatically be created/deleted via the radial menu without doing anything else custom.

I'd have to see the code for npc_skills.xml and any referenced templates and scripts to really understand what the issue might be. Maybe a ZIP of your ruleset hosted on DropBox or Drive would work best.

Regards,
JPG

dstuffle
September 13th, 2013, 14:41
Maybe I'll strip everything but a text field from the xml, and wipe the scripts, and see if I can get it to work, then reassemble things from there.

Thanks for the reply moon, I may post a zip if beating my head against the wall doesn't work.