Aller au contenu

Photo

limitingspell selection upon level-up


  • Veuillez vous connecter pour répondre
12 réponses à ce sujet

#1
Batmanis64

Batmanis64
  • Members
  • 84 messages
I would like a custom 2da which limits or removes the ability to add spells to a wizard's book for free upon level up.  I'm wondering which 2da to edit for this kind of thing.

#2
Orion7486

Orion7486
  • Members
  • 161 messages
Have you looked at cls_spgn_wiz.2da? That might be what you need.

#3
Batmanis64

Batmanis64
  • Members
  • 84 messages
I have, but I'm not sure exactly what it does. In addition to limiting spells conferred upon level up, I would like the player to start without the clutter of so many 0-level spells.

#4
Shallina

Shallina
  • Members
  • 1 011 messages
Check NWN2 wiki with the explanation on each field of the 2da. If those information are in one 2da then you can alter them. If it's not in a 2da it's going to be more difficult.

Modifié par Shallina, 13 août 2010 - 11:34 .


#5
Orion7486

Orion7486
  • Members
  • 161 messages
Take a look at row 0 in cls_spgn_wiz. From the look of it, it says when one becomes a 1st level wizard, he gets spells in two levels. 3 in level 0, 1 in first level. If you change the 3 in SpellLevel0 column to 0, then a 1st level wizard should have no spells gained in spell level 0.

#6
Quilistan

Quilistan
  • Members
  • 111 messages

Orion7486 wrote...

Take a look at row 0 in cls_spgn_wiz. From the look of it, it says when one becomes a 1st level wizard, he gets spells in two levels. 3 in level 0, 1 in first level. If you change the 3 in SpellLevel0 column to 0, then a 1st level wizard should have no spells gained in spell level 0.


I think this 2da mentioned is how many spells/level the wizard can have not how many they receive on level up.

If I understand the OP correctly we are looking for a way to stop casters from being able to choose new spells when they level up. This forces them to have to find, or trade them to gain new spells.

#7
_Knightmare_

_Knightmare_
  • Members
  • 643 messages

Quilistan wrote...

If I understand the OP correctly we are looking for a way to stop casters from being able to choose new spells when they level up. This forces them to have to find, or trade them to gain new spells.


If that's the case, it may take some GUI/XML editing to get it to bypass the spell selection screen. I'd start with taking a look at the "levelup_class" and "levelup_spells" series of files. 

#8
Batmanis64

Batmanis64
  • Members
  • 84 messages

Quilistan wrote...

I think this 2da mentioned is how many spells/level the wizard can have not how many they receive on level up.

If I understand the OP correctly we are looking for a way to stop casters from being able to choose new spells when they level up. This forces them to have to find, or trade them to gain new spells.


That's right. 

I'm afraid XML coding is beyond my knowledge at this point, I'll read the Lance Botelle GUI tutorial and see what I can do.  Just from browsing through the levelup_spells, could I bypass the whole selection process from simply deleting <!-- Added Spells Pane -->  through <UIListbox name="AVAILABLE_SPELL_LIST"?  Something tells me it can't be that easy.  I'll do some trial and terror with a custom  "levelup_spells" and see what happens.

#9
Batmanis64

Batmanis64
  • Members
  • 84 messages
Okay, here's what I've done so far: I edited the packspwiz1.2da and made it blank - that removed all of the default spells put into your spell book upon leveling up (except for level-0 spells). So far, so good. Here's the catch: I still have to select some new ones before I can click "next" on the level up gui. All edits I've made to an override levelup_spells.xml don't seem to have any effect. I'd like to somehow change that file to remove the spell selection pane, and make the "next" button active. Not sure how I can do this.

#10
Shallina

Shallina
  • Members
  • 1 011 messages
You can alter the on lvl up script and delete the picked up spell. Not optimal solution, but could be good enought .

#11
Batmanis64

Batmanis64
  • Members
  • 84 messages
I think it comes down to this passage in the levelup_spells.xml:

<UIPane name="CHARGEN_BUTTONS" x=ALIGN_RIGHT y=723 width=520 height=45 >
        <UIButton name="CHOICE_RECOMMEND" strref="113764" x="168" y="0" style="STYLE_MENU_BUTTON_SML"
        OnLeftClick=UIButton_Input_CharGenRecommend("LEVELUP","CHARGEN_SPELLS") ></UIButton>
        <UIButton name="CHOICE_NEXT" strref="113752" x="336" y="0" style="STYLE_MENU_BUTTON_SML"
        OnLeftClick=UIButton_Input_CharGenCommit("LEVELUP","CHARGEN_SPELLS")
        update="true" OnUpdate=UIButton_OnUpdate_CheckCharGenStage("LEVELUP","CHARGEN_SPELLS") ></UIButton>

I'm assuming the 'update="true"' is checking to make sure the spell selections are made before allowing the user to click the "next" button.  I just don't know how to re-write it.

#12
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages
Hi Batmanis64,

I started to look at this and was going to give a suggestion, but then recognised that it was more involved than I first thought. :( My only advise at this stage is to perhaps create your own spell (that does nothing or hooks into something you want to do) and make that as the only available spell for the PC to choose from. However, does having only one spell resolve the situation where a PC may have more than one to choose before continuing?

There may even be a way to force the "NEXT" button to enable from a module script (in a heartbeat?) if the XML script was made accessible with scriptloadable=true in the UIScene, but I don't know how deep the checks go with this XML script. It may be checking every frame and force the NEXT button back to enabled before the player would even see it!

Another angle I would look at is checking which button (and XML script) brought me to the spells listing in the first place and consider looking at that XML script. There may be a way to jump to the next XML script by recoding the button to skip that section.

Lastly, there may even be something on the Vault that has already done something like this. I was going to check, but I cannot access the site at the moment. :(

If I get more time to look at this, I will and let you know. I'll also be keeping an eye on your own findings. :)

Lance.

Modifié par Lance Botelle, 15 août 2010 - 10:10 .


#13
Batmanis64

Batmanis64
  • Members
  • 84 messages
AHA! All I had to do is change:



update="true" OnUpdate=UIButton_OnUpdate_CheckCharGenStage("LEVELUP","CHARGEN_SPELLS") ></UIButton>



to:



update="false" OnUpdate=UIButton_OnUpdate_CheckCharGenStage("LEVELUP","CHARGEN_SPELLS") ></UIButton>



Now the user can click "next" without selecting spells. Then I just "hide" the spell selection panel by situating the coordinates to the edge of the bottom of the screen. Now all I have to do is figure out how to get rid of those initial level-0 spells. Shallina, you were mentioning doing this with scripting. I assume I could use "SetSpellKnown" upon Module Load?