Scripting question - My spellbook idea.
Page 1 of 1
Scripting question - My spellbook idea.
Hey ! Remember us talking about my PHB like spellbook idea the other night, the idea branching off of my thread in the suggestions forum? I've run into a block, and I am suffering from severe 'teh dumb, I cannot brain today' mental blocks... on the level of "duh, what's 2+2 again?"
I'm trying to work in the "need a spellbook to memorize spells each day" thing, like what we were talking about that other day. Player slots his or her spells just like in a default NWN module. Player rests. The rest script does it's thing of comparing what spells the player has slotted and memorized to his spellbook. If there's a match, yippee. If no match, the rest script decrements uses of that spell down to zero. Also checks if the PC has possession of someone else's spellbook, and does the same check, but adds in a spellcraft check as per PnP rules to memorize the spell.
In the 'non-spellbook needed' version of the system, adding the spells is easy. The player uses a player-chat command (add nameofspellhere) and the script checks to see if the PC has the spell memorized and ready to go. If so, it adds the appropriate spellname variable to the book item.... Basically like how scribe scroll works here on Aenea. Also, the player can use scrolls on the book item just like they can use scrolls on a sequencer item to add that spell into the sequencer (and then use another chat command to select the new spell, use the book item's special power on themselves to gain a new copy of the scroll for adding the spell to the actual hardcoded nwn spellbook).
Now here's my problem: Level 1 wizards with more spells known than they have spell slots per day and the '2 new spells gained per level' each level up.
I cannot think of a non-clumsy, overly obtuse way to get those spells onto the spellbook item.
Since the rest script decrements spells down to 0 if they don't have the spell on the book as a variable, they cannot get to that point where they can do the chat-command to add the spell in.
I thought about adding in a check to see if the PC had leveled up since last resting.... if they did, then automatically add the new spell's variable to the spellbook item. This is problematic though because... what if the PC doesn't slot their new spell until several 'rests' after they had leveled up?
Likewise, what if 'mid level' they gain a new spell via scroll, and use the scroll the default NWN to add it to the hardcoded spellbook? I could add in yet another check to compare slotted memorized spells to spells listed on the book item... if the slotted spell is "new/not on the list", like above, automatically add the variable name to the spellbook item... BUT..... if the player is using solely "borrowed" spellbooks, I would have to add in yet ANOTHER check to make sure the script doesn't attempt to add the spell to the "borrowed" spellbook, but rather goes ahead with the PHB style spellcraft check to memorize the spell (definitely don't want 'scribbling' in other people's spellbooks.... that would be like Agamemnon borrowing Crid's spellbook and Crid gets his spellbook back with golem design doodles and notes scrawled in every margin.... )
So.... essentially.... I COULD solve the problem with a complicated checks. But I cannot brain today. Does that sound like the only way to accomplish the goal? Or is there a more slick streamlined line of logic to go about it?
Thanks in advance
I'm trying to work in the "need a spellbook to memorize spells each day" thing, like what we were talking about that other day. Player slots his or her spells just like in a default NWN module. Player rests. The rest script does it's thing of comparing what spells the player has slotted and memorized to his spellbook. If there's a match, yippee. If no match, the rest script decrements uses of that spell down to zero. Also checks if the PC has possession of someone else's spellbook, and does the same check, but adds in a spellcraft check as per PnP rules to memorize the spell.
In the 'non-spellbook needed' version of the system, adding the spells is easy. The player uses a player-chat command (add nameofspellhere) and the script checks to see if the PC has the spell memorized and ready to go. If so, it adds the appropriate spellname variable to the book item.... Basically like how scribe scroll works here on Aenea. Also, the player can use scrolls on the book item just like they can use scrolls on a sequencer item to add that spell into the sequencer (and then use another chat command to select the new spell, use the book item's special power on themselves to gain a new copy of the scroll for adding the spell to the actual hardcoded nwn spellbook).
Now here's my problem: Level 1 wizards with more spells known than they have spell slots per day and the '2 new spells gained per level' each level up.
I cannot think of a non-clumsy, overly obtuse way to get those spells onto the spellbook item.
Since the rest script decrements spells down to 0 if they don't have the spell on the book as a variable, they cannot get to that point where they can do the chat-command to add the spell in.
I thought about adding in a check to see if the PC had leveled up since last resting.... if they did, then automatically add the new spell's variable to the spellbook item. This is problematic though because... what if the PC doesn't slot their new spell until several 'rests' after they had leveled up?
Likewise, what if 'mid level' they gain a new spell via scroll, and use the scroll the default NWN to add it to the hardcoded spellbook? I could add in yet another check to compare slotted memorized spells to spells listed on the book item... if the slotted spell is "new/not on the list", like above, automatically add the variable name to the spellbook item... BUT..... if the player is using solely "borrowed" spellbooks, I would have to add in yet ANOTHER check to make sure the script doesn't attempt to add the spell to the "borrowed" spellbook, but rather goes ahead with the PHB style spellcraft check to memorize the spell (definitely don't want 'scribbling' in other people's spellbooks.... that would be like Agamemnon borrowing Crid's spellbook and Crid gets his spellbook back with golem design doodles and notes scrawled in every margin.... )
So.... essentially.... I COULD solve the problem with a complicated checks. But I cannot brain today. Does that sound like the only way to accomplish the goal? Or is there a more slick streamlined line of logic to go about it?
Thanks in advance
MannyJabrielle- Ludicrous Level
- . :
Number of posts : 5927
Main Character : See the "A-Team" thread in the Biographies forum.
DM Name : Dungeon-Master Gaelen
Time Zone : GMT -5:00(EST)
Registration date : 2008-07-05
Re: Scripting question - My spellbook idea.
And yes, I know that was a ramble.... as I said, my brain is shot this evening
MannyJabrielle- Ludicrous Level
- . :
Number of posts : 5927
Main Character : See the "A-Team" thread in the Biographies forum.
DM Name : Dungeon-Master Gaelen
Time Zone : GMT -5:00(EST)
Registration date : 2008-07-05
Similar topics
» New Scripting Question
» Used: Scripting question forum or subforum
» THE Tool for those new to scripting for NWN
» Rearranging my Wizard Spellbook
» Druid Spellbook Additions
» Used: Scripting question forum or subforum
» THE Tool for those new to scripting for NWN
» Rearranging my Wizard Spellbook
» Druid Spellbook Additions
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum