PDA

View Full Version : Help with Spellsheets :)



Kalan
May 31st, 2007, 14:37
Hey gang...rather than beating my head against a wall, figure I'd post here for some assistance :)

Basically - I need the Spellsheet to work slightly differently than it is now. Essentially as near as I can tell, the system I need to emulate is a modified spontaneous caster.

The spellcasting mechanic works as follows:

Jonas knows some spells. He's able to prepare x spells per level per day, and able to cast z number of spells per level per day.

FX: Jonas knows the following first level spells: Magic Missile, Armour, Burning Hands, Cure Light Wounds. As a first level character he's able to prepare 2 first level spells, and can cast 4 first level spells.

I'm kind of thinking the spell list itself is fine - and that all I really need to do is add in a check box to denote that the spell is prepared, and reduce the total number of prepared spells. The rest of it I think will work the same as a spontaneous caster.

If there's someone out there who can point me in the right direction on files to change, and how to change them it'd be great :) Of course - if there's someone who already has this type of system coded up I'd greatly appreciate how you did it :)

Kalan
June 7th, 2007, 10:08
just a little bump in case people missed this in the flurry of posts going on lately ;)

I think I basically just need to add in a second row of "spell slots" to denote prepared spells per level, which reduces as player's tick off which spells they prepare. The casting works just fine, I think I just need to add in how this code works.

so again...any help would be wunderbar :)

Toadwart
June 9th, 2007, 05:37
Hiya Kalan

Have you made progress with this?
Was poking around and can sort of see where to start though I'm not sure I fully grasp the mechanic you are after.

If you add a field like this in charsheet_spells.xml (in the charsheet_spelllistset windowclass):


<spellsprepped name="preppedlevel1">
<anchored>
<to>availablelevel1</to>
<position>below</position>
<size mergerule="replace">
<height>22</height>
</size>
</anchored>
<tabtarget>
<next>availablelevel9</next>
<prev>availablelevel0</prev>
</tabtarget>
</spellsprepped>


and create a template for the field in charsheet_template.xml


<template name="spellsprepped">
<numberfield>
<!--<anchored>
<top mergerule="replace">
<anchor>top</anchor>
<offset>8</offset>
</top>
<size mergerule="replace">
<width>25</width>
<height>22</height>
</size>
</anchored>-->
<frame mergerule="replace">
<name>modifier</name>
<offset>4,1,3,1</offset>
</frame>
<keyeditframe mergerule="replace">
<name>sheetfocus</name>
<offset>4,1,3,1</offset>
</keyeditframe>
<font mergerule="replace">sheetnumbersmall</font>
<!--<script>
function updateVisibility()
local state = modenode.getValue () ~= 0;

if not state and not isVisible() then
setVisible(true);
if window[getName() .. "label"] then
window[getName() .. "label"].setVisible(true);
end
elseif state and isVisible() then
setVisible(false);
if window[getName() .. "label"] then
window[getName() .. "label"].setVisible(false);
end
end
end

function onValueChanged()
window.spelllevellist.applyFilter();
end

function onInit()
modenode = getDatabaseNode().createChild("....castingmode", "number");
modenode.onUpdate = updateVisibility;
updateVisibility();
end
</script>-->
</numberfield>
</template>



That will give you another field to set the 'prepared' spells. However, that field will show up for sontaneous and non-sponaneous casters.
I've also commented out the script for now as it is just copied from the spellsavailable tremplate. Not sure yet what would need to change to support your mechanic.

Kalan
June 9th, 2007, 08:35
thanks a bunch Toad :) I'll give that a whirl and see how it goes.

About the only other thing I think I'd need is something on the spell line to denote whether or not it is prepared. And if that box is checked off, then it shows up on the mini sheet.

I'll keep tryin to dig up how this works...tho I have no real idea where to start (.mod files I can do...these ruleset ones confuse the hell outta me)