logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWNX_Patch
Goto page Previous  1, 2, 3 ... 33, 34, 35 ... 42, 43, 44  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Sun Oct 01, 2017 14:27    Post subject: Reply with quote

What if I want to completly remove learning on levels and make scrolls only way to obtain spells? I assume I have to use NWNXPatch_AddKnownSpell on softcoded scroll learning. But do I have to disable ELC?

I'm planning mod with huge changes in magic but I would hate to be forced to write my own ELC system.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Sun Oct 01, 2017 15:02    Post subject: Reply with quote

Valgav wrote:
What if I want to completly remove learning on levels and make scrolls only way to obtain spells? I assume I have to use NWNXPatch_AddKnownSpell on softcoded scroll learning. But do I have to disable ELC?

I'm planning mod with huge changes in magic but I would hate to be forced to write my own ELC system.

Number of spells learned can be modified in new column SpellLearnTable and default 2da file for wizard is cls_splr_wiz.

If you set 0 player won't be allowed to learn any spell on levelup. Scrolls will work and softcoded script duplicates vanilla so you don't need to do anything if you want that for wizard. You can grant players spells from other sources using AddKnownSpell too, as you correctly guessed this function is used by the softcoded script for scroll learning anyway.

ELC will not be a problem in this case. ELC controlls only if number of known spell of given level isn't higher than maximum known spells defined in cls_spkn_*.2da - this is therefore only case of bard and sorcerer, not wizard.

BTW, because of the issue with unlimited casting feature I am planning a small update that will enable unlimited casting another way.

Right now, to avoid adding new column I plan to rename SpellLearnTable to SpellOptTable (or SpellOptionTable) change cls_splr_wiz.2da to cls_spopt_wiz.2da and use this new format:
Code:

2DA V2.0                                                                                                                                                                       
                                                                                                                                                                               
      Level    SpellsLearned    ApplyModifier   Unlimited0   Unlimited1   Unlimited2   Unlimited3   Unlimited4   Unlimited5   Unlimited6   Unlimited7   Unlimited8   Unlimited9
0     1        3                INT             0            0            0            0            0            0            0            0            0            0     
1     2        2                ****            0            0            0            0            0            0            0            0            0            0     
2     3        2                ****            0            0            0            0            0            0            0            0            0            0     
3     4        2                ****            0            0            0            0            0            0            0            0            0            0     
4     5        2                ****            0            0            0            0            0            0            0            0            0            0     
5     6        2                ****            0            0            0            0            0            0            0            0            0            0     
6     7        2                ****            0            0            0            0            0            0            0            0            0            0     
7     8        2                ****            0            0            0            0            0            0            0            0            0            0     
8     9        2                ****            0            0            0            0            0            0            0            0            0            0     
9     10       2                ****            0            0            0            0            0            0            0            0            0            0     
10    11       2                ****            0            0            0            0            0            0            0            0            0            0     
etc...

It is still WIP but I don't see better way to do it...
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
DarkSet



Joined: 06 Jun 2016
Posts: 98

PostPosted: Mon Oct 02, 2017 23:30    Post subject: Reply with quote

Quote:
but I would hate to be forced to write my own ELC system.

is there any way to alter default one or you mean just turn it off and scriplt everything?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Oct 03, 2017 1:15    Post subject: Reply with quote

DarkSet wrote:
Quote:
but I would hate to be forced to write my own ELC system.

is there any way to alter default one or you mean just turn it off and scriplt everything?

default ELC can only be modified with nwnx and it is one of the most complicated stuff there is - definitely not going to mess with it any time soon

better way would be to turn it off and use scripting solution
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Oct 03, 2017 1:41    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.33f

DOWNLOAD

Experimental. 2DA files updated, two new example 2da added, cls_spopt_wiz.2da and cls_spopt_sorc.2da, both 2da will provide unlimited casting of cantrips on all class levels.

Fixes to the plugin:
- fixed issue where recommended button ignored modified value for spells learned and used default
- fixed issue where spontaneous nonlearning class could not get all spells available if he already know one spell of that level

Revisited fixes/features:
- column SpellLearnTable in classes.2da replaced by SpellOptTable -> cls_spopt_*.2da, 2da file now serves more purposes than controlling how much spells can player learn at lvlup
- unlimited casting completely reworked:
-- unlimited casting now uses 2da setting in cls_spopt_*.2da, columns Unlimited0 to Unlimited9
-- prepared spellcasters like wizard will only be able to cast memorized spells, not all known (to balance the fact that wizard has no limit on number of spells learned)
-- unlimited casting will no longer be automatically enabled upon lvl up, character will need to rest (spontaneous) and memorize spells (prepared) to be able to cast them

New fixes and features:
- improved spell learning modifications - builder can disable automatical learning of cantrips at lvl 1 and controll whether ability modifier affect number of spells learned at level, see cls_spopt_wiz.2da

New custom functions:
void NWNXPatch_SetSpellValue(int nSpell, int nConst, string sValue, object oPlayer=OBJECT_INVALID);


Development notes:
Let's start with new function. Ever since I added hidden spells I was wondering how to unhide spell to the player. One thing is to grant the spell to player (doable already) and other to unhide it which was not possible. So, I made this function. Then I realized the same method can be used to modify every spel information, something that was requested here recently. So yes, you can use this function for dynamic spells!

However, this function is reason why this version is experimental. Function wasn't tested thoroughly.

First of all, I don't know all the values, some spell informations stored as string in spells.2da are stored in integer format in engine - case of metamagic, conjtype, animtype and more and I don't know which value is what. Values will most likely be 0,1,2,3,4,5 etc. but you will have to figure out yourself.

Also, I don't know how to store null values ie ****. It is possible that trying to set **** will cause crashing or weird behavior. Let me know how it behaves - if it crashes try set "0" instead.

Using the function with OBJECT_INVALID will change the values on server. if this is singleplayer it will also automatically manifest for player playing the module (as he is server), if it is multiplayer, you will need to send the spell value update to the player(s) too. Some values are completely client-side (cast anims etc.) and server doesn't need them, some values are server-side (spellscript etc.) and client doesn't need them. But some values must match between client and server! This is case of spell levels. If you send player that Wail of Banshee is lvl 1 spell, unless server has the same information, player will be unable to cast it anyway! Therefore if you want to use this feature for dynamic spells, I suggest so make several dynamic spells each of different spell level and change only icons, name, anims etc.


As for unlimited casting. I decided it is weird that if you set cantrips to be unlimited and level up as wizard or sorcerer, they could cast them immediately, while they normally have to rest for casting other spells. Therefore, rest will be needed if player levels up and gains access to unlimited spells. In case of wizard, spells have to be also memorized - as otherwise wizard would have big advantage over sorcerer in unlimited casting as he knows much more spells.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Tue Oct 03, 2017 5:37    Post subject: Reply with quote

Thanks
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Tue Oct 03, 2017 11:29    Post subject: Reply with quote

Is there a way to make my own meta-magic?
And what that of additional meta-magic written in hex?
http://pixs.ru/showimage/Imagepng_2927476_27744136.png
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Oct 03, 2017 12:44    Post subject: Reply with quote

Valbor wrote:
Is there a way to make my own meta-magic?
And what that of additional meta-magic written in hex?
http://pixs.ru/showimage/Imagepng_2927476_27744136.png

most likely this is value but in decimal not hexa

custom metamagics are problem because there is no space on radial circle - all slots already taken by vanilla metamagics, making new metamagic would be probably impossible due to this

the workaround is to make automatic metamagic feat or toggle
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Wed Oct 04, 2017 8:17    Post subject: Reply with quote

ShaDoOoW
Divine spells can also add spells?
Use bIgnoreLimit = TRUE?
if this possible -
It turns out quite possible to make a third custom domain in this way?
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Oct 04, 2017 11:20    Post subject: Reply with quote

Antegate wrote:
ShaDoOoW
Divine spells can also add spells?
Use bIgnoreLimit = TRUE?
if this possible -
It turns out quite possible to make a third custom domain in this way?

yes and good catch with custom domain, I didnt realized it can be used for this!

bIgnoreLimit doesn't need to be TRUE, it has to be true only for spontaneous learning classes like bard/sorcerer or their divine copy, cleric, druid, ranger, paladin has no limit on numberof known spells
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Wed Oct 04, 2017 12:30    Post subject: Reply with quote

very cool
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Wed Oct 04, 2017 13:01    Post subject: Reply with quote

it might require reworking domain system from scratch though - make all spells cleric can gain from domains hidden and grant them to player when he gains domain (feat) at lvlup with AddKnownSpell

EDIT: might not be so easy because you also must add Cleric level into the spell and different domains can have same spell on different level - that would be problem and would need to make a copy of the spell on new line.

EDIT2: Thought a bit more on this. Assuming you want to add third domain this could theoretically work - but would require reworking all domains to grant spells on new lines, make them all hidden and add them to player when he acquire feat OnLevelUp. Could work but I assume there might be some issues - untill someone try we won't know. Maybe the better way would be to rework engine code that controll domains and load spells in spellbook for domain based not on domain taken but domain feat acquired - that should provide same effect with almost no extra work needed - only thing that would need to be done is to add domain-feat to each domain not having one.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Thu Oct 05, 2017 10:11    Post subject: Reply with quote

Quote:
EDIT2: Thought a bit more on this. Assuming you want to add third domain this could theoretically work - but would require reworking all domains to grant spells on new lines, make them all hidden and add them to player when he acquire feat OnLevelUp. Could work but I assume there might be some issues - untill someone try we won't know.

I already thought about the processing of domains =))

Quote:
Maybe the better way would be to rework engine code that controll domains and load spells in spellbook for domain based not on domain taken but domain feat acquired - that should provide same effect with almost no extra work needed - only thing that would need to be done is to add domain-feat to each domain not having one.

it's a good idea.
Back to top
View user's profile Send private message
Valgav



Joined: 28 Aug 2010
Posts: 53

PostPosted: Thu Oct 05, 2017 19:36    Post subject: Reply with quote

I have even stranger concept with learning spell schools. Unable to learn spell unless you have feat coresponding to school of that spall. It would even allow some sort of progression.
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Oct 06, 2017 0:06    Post subject: Reply with quote

Valgav wrote:
I have even stranger concept with learning spell schools. Unable to learn spell unless you have feat coresponding to school of that spall. It would even allow some sort of progression.

The hidden spell feature should work for domains (the only issue that can happen is that cleric will be able to use domain-spells for casting spontaneously (which is not possible with vanilla domains).

I don't think it can enable you to simulate spell schools. At least not properly. Thats because you need to send player update for hidden spells using SetSpellValue. But you wont know which spell school he selected untill he finish levelling up. So in practice, player would be able to learn spells of opposing school on first level of the class anyway.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3 ... 33, 34, 35 ... 42, 43, 44  Next
Page 34 of 44

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group