Aller au contenu

Photo

Easy to script class restrictions?


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

#26
WhiZard

WhiZard
  • Members
  • 1 204 messages

FunkySwerve wrote...

ShaDoOoW wrote...

You really want me to react to this Funky? I hope you are not serious.

Funny, that was the first thing I thought when I read your post. I do indeed want you to react to it. Attributing use of deleveling to lack of skill is...silly, is the kindest word I can use to describe it.

Funky


Deleveling isn't purely straight forward either.  RDDs if deleveled incorrectly can become illegal characters from the strength bonus not disappearing.

However 2das also have limitations.  If you require certain feats for taking a prestige class then a character with those feats on equipped items will be able to level up in the prestige class (even though they naturally do not qualify).  Even the race requirement for prestige class can be bypassed when leveling up polymorphed into that race.

#27
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
@Funky   the script you posted does not really compair to what is being talked about.   Your posted code delevels due to them taking a Skill that they are not allowed to take.  That is an entirely diffearant matter then taking the wrong class.  Bioware already has things in place to prevent PC's from taking a  calss, If you do not mind using modified 2da's.   They  do not have anything that I know of to act the same way with preventing skills via scripting.  

The matter to me simply comes down to if using modified 2da is worth the benifit of a more streem line system  to the OP.  You have already answered that as No it is not worth it to you in past posts.  It may hoever be worth it to the OP.   


@SuperFly:   I see FB already pointed out the level problem with the 1/3   The solution I cam up with in the script below is that no classes are restricted untill they take a second class. ( Of cource you will need Shadows 2da's for thescript to work)   Once the second class is take the 1/3 rule is enforced.  So if a Character  was a 12th level fighter before he took a level of rouge.   FIghter/Thief 12/1  would be allowed.   He would just have to take his next 4 levels in thief  before he could level in fighter again.   Fighter/Thief 12/5.

Here is the script if you wanted to try it. .  I hope I understood correctly how shadow set up his 2da's.   So far it is untested.   Just let me know if you have problems with it.  

#include "x3_inc_string"
#include "x0_i0_stringlib"
string sclassVarArray =  "70_AllowBarbarian" // index 0   class ID# 0
                        +",70_AllowBard"     // index 1   class ID# 1
                        +",70_AllowCleric"   // index 2   class ID# 2
                        +",70_AllowDruid"    // index 3   class ID# 3
                        +",70_AllowFighter"  // index 4   class ID# 4
                        +",70_AllowMonk"     // index 5   class ID# 5
                        +",70_AllowPaladin"  // index 6   class ID# 6
                        +",70_AllowRanger"   // index 7   class ID# 7
                        +",70_AllowRogue"    // index 8   class ID# 8
                        +",70_AllowSorcerer" // index 9   class ID# 9
                        +",70_AllowWizard"   // index 10  class ID# 10
                        // All the prestige class are offset by 16.
                        +",X1_AllowShadow"   // index 11  class ID# 27
                        +",X1_AllowHarper"   // index 12  class ID# 28
                        +",X1_AllowArcher"   // index 13  class ID# 29
                        +",X1_AllowAsasin"   // index 14  class ID# 30
                        +",X1_AllowBlkGrd"   // index 15  class ID# 31
                        +",X2_AllowDivcha"   // index 16  class ID# 32
                        +",X2_AllowWM"       // index 17  class ID# 33
                        +",X2_AllowPalema"   // index 18  class ID# 34
                        +",X2_AllowShiftr"   // index 19  class ID# 35
                        +",X1_AllowDwDef"    // index 20  class ID# 36
                        +",X1_AllowDrDis";   // index 22  class ID# 37
void SetclassRestrictions(object oPC);
void RestrictAllclasses(object oPC);
void SetAllowedclasses(object oPC);
int  GetclassArrayIndice(int nclass);

void Setclassrestrictions(object oPC)
{
  if(GetclassByPosition(2,oPC) != class_TYPE_INVALID)
  {
    RestrictAllclasses(oPC);
    SetAllowedclasses(oPC);
  }
}

void RestrictAllclasses(object oPC)
{
  string sclasses = sclassVarArray;
  string sToken;
  while (sclasses !="")
  {
     sToken = StringParse(sclasses,",");
     SetLocalInt(oPC,sToken,TRUE);
     StringRemoveParsed(sclasses,sToken,",");
  }
}
void SetAllowedclasses(object oPC)
{
  int    nclass1 = GetclassByPosition(1,oPC);
         nclass1  = GetclassArrayIndice(nclass1);
  int    nLvl1   = GetLevelByPosition(1,oPC);
  string sclass1Var = GetTokenByPosition(sclassVarArray,",",nclass1);
  int nclass2  = GetclassByPosition(2,oPC);
      nclass2  = GetclassArrayIndice(nclass2);
  int nLvl2    = GetLevelByPosition(2,oPC);
  string sclass2Var = GetTokenByPosition(sclassVarArray,",",nclass2);
  SetLocalInt(oPC,sclass1Var,(nLvl1/nLvl2) > 2 );
  SetLocalInt(oPC,sclass2Var,(nLvl2/nLvl1) > 2 );
}
int  GetclassArrayIndice(int nclass)
{
    return nclass + 16 * (nclass > 10);
}



#28
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

Failed.Bard wrote...

Some things can't be corrected without a delevel either, because Bioware botched the hardcoded parts of them. Pale Masters are a perfect example, they're supposed to require the ability to cast level 3 arcane spells, which Bioware botched and set as needing level 3 in an arcane class.
Since wizards, bards, and sorcerers don't all get level 3 spells at the same level, you can't adjust that to PnP standards with just a 2da tweak.


You can prevent the PaleMaster class from being taken by setting the X2_AllowPalema local int on the PC to anything other then 0     So if you can script your checks you can stop them from taking the class.

#29
Shadooow

Shadooow
  • Members
  • 4 465 messages

FunkySwerve wrote...

ShaDoOoW wrote...

You really want me to react to this Funky? I hope you are not serious.

Funny, that was the first thing I thought when I read your post. I do indeed want you to react to it. Attributing use of deleveling to lack of skill is...silly, is the kindest word I can use to describe it.

Funky

ok maybe its really bull**** and I wrote something I meant differently, is no doubt acaos has a neccesary skill and knowhow to make nwnx solution and I wont be guessing why he didnt. Anyway from player perspective, I have played many PWs and I already seen a lot things done. When it comes to delevels I can say I already seen servers which handled this the 2da way and tried to prevent player from doing the mistake in first place. Thats for me as a player is a better option then being learned "the hard way". When building Im trying to be as much user friendly as possible and I always trying to make things the way the player could say "wow this is nicely done!".

WhiZard wrote...

However 2das also have limitations.  If
you require certain feats for taking a prestige class then a character
with those feats on equipped items will be able to level up in the
prestige class (even though they naturally do not qualify).  Even the
race requirement for prestige class can be bypassed when leveling up
polymorphed into that race.

I thought it works only on skin (which is why it works in polymorph) - are you sure it works with a bonus feats on any other item?

Which is actually a good thing. You could create a "placeholder" feat that you can add on PC's skin just to be able to code something you wouldnt be without it like alignment.
Also when it comes to polymorph, its kind a must to not allow level up polymorphed character and again you either do it the delevel way or you can handle it via 2das -> though its not totally ideal too as its hard to code, but possible, just disable all classes after polymorph and enable them after finished rest or via heartbeat as soon as player unpolymorph again.

#30
Shadooow

Shadooow
  • Members
  • 4 465 messages
BTW just got and interesting idea that maybe some of the "hard way" camp will like.

One could remove all class prerequisities from 2das in order to allow player to take any class without them and script those prerequisities in OnLevelUp script and delevel anyone who doesnt fullfills them.

Best would be to add yur own custom prerequisities into every class like certain quest, gold ammount, guild membership etc. or really knowing the 3rd spell level for become PM etc. Of course these special prerequisities wont be written in class description via TLK, rather hidden somewhere in your forum which adress you have written in server description only.

The best would be to not tell player why is he deleveled or tell him always only one reason, so if he try to become Harper Scout first delevel will teach him he need:
- allertness, now redo levelling process
- "you need iron will feat", again
- "you need also improved parry, just our custom change", again
- "you need at least 4skill ranks in discipline", again
- "you need at least 6skill ranks in lore", again
- "yea 8 persuade dude!", again
- "forgot about search? 4ranks idiot", again
- "what the hell you think you can become harper without being in harper guild?", again

Wow that would be epic fun! I can imagine how im redoing whole levelling up process and distributing all saved skillpoints all over again. (Would be a good idea to delevel anyone who will try to save up skillpoints anyway)
:devil:

In the OP idea, one could be actually deleveled when changing all his sorcerrer/bard spell selection too, very funny.

Modifié par ShaDoOoW, 30 septembre 2011 - 06:41 .


#31
SuperFly_2000

SuperFly_2000
  • Members
  • 1 004 messages
Thanks lightfoot but it is getting too advanced now.

I was hoping for something only scripting and only setting variables....no 2da's.

If it gets more crude then doesn't matter so much for me.

I don't have to make the checks all along the way and also I could go down to 1/4 of the levels needed.

#32
SuperFly_2000

SuperFly_2000
  • Members
  • 1 004 messages
But as I've seen this grow more and more complicated I'm just thinking to maybe restrict the player to only have two classes maximum.

That is at least easily scripted right? ...and doesn't have too many unwanted effects...(?).

Also I know Bioware has some XP penalties for multiclassing...can theese be made larger? ..or how big are they to start with?

#33
SuperFly_2000

SuperFly_2000
  • Members
  • 1 004 messages
Another way that I just came to think of...would be to remove PC's that take prestige classes from the minimum level for lesser class needed (but not from the max 2 classes limit)....if possible to script again. That would solve everything I think.

(I was thinking to NOT have RDD, WM, SD, AA and shifter.)

Modifié par SuperFly_2000, 30 septembre 2011 - 01:04 .


#34
Rolo Kipp

Rolo Kipp
  • Members
  • 2 788 messages
<nodding his head...>

ShaDoOoW wrote...
The best would be to not tell player why is he deleveled or tell him always only one reason, so if he try to become Harper Scout first delevel will teach him he need:
- allertness, now redo levelling process
- "you need iron will feat", again
- "you need also improved parry, just our custom change", again
- "you need at least 4skill ranks in discipline", again
- "you need at least 6skill ranks in lore", again
- "yea 8 persuade dude!", again
- "forgot about search? 4ranks idiot", again
- "what the hell you think you can become harper without being in harper guild?", again

Wow that would be epic fun! I can imagine how im redoing whole levelling up process and distributing all saved skillpoints all over again. (Would be a good idea to delevel anyone who will try to save up skillpoints anyway)
:devil:

In the OP idea, one could be actually deleveled when changing all his sorcerrer/bard spell selection too, very funny.

 
Ahhh... sarcasm. But you do have a few good ideas hiding in there :-)

First and foremost, feedback on why you can't choose a class. It annoys me to have to dig through a class description and then compare it to my character (because I run a whole stable of them) to figure out what feat/skill I'm lacking. Generally, I have the data somewhere in this cavernous skull, but that's not the same thing as it occupying my forebrain :-P

In the default levelup process, there is no feedback. It would have to be scripted into an alternative levelup process.

On saved skillpoints... I prefer soft limits over forcing anything. I would prefer that you make the skill points as advantageous at low levels as saving them up is to high levels. That way the player makes his own trade-off choice.

I think (from this and other posts) that you prefer *no* restrictions...
I once ran a challenge campaign with 8 men for 6 months (we were floating in the Indian ocean, so I had a captive audience =). They could create 2 characters of any race/class/level they wished as long as the group as a whole made sense. They chose high-level drow. So I, um *neutralized* Lolth :-) I promised a 50% mortality rate restoring Her. I delivered. 
No restrictions can be interesting, even fun. But then, so is madness ;-)

I prefer context and framework, story and relationship.  By the end of that campaign, so did 8 battle-hardened sailors :-)

Oops. Rambling. Sorry. Old wizards are not known to be terse :-P

<...as he tries to keep his eyes open>

#35
Shadooow

Shadooow
  • Members
  • 4 465 messages
Yea, Im not very good in explaining what I have on my mind. I think that this sarcastic post described it better than thousands words.

Though the feedback thing is really a positive (if it would tell you everything you are missing) redoing the whole levelling up process which can take a while if you are not planning the character beforehand is a significant disadvantage.

#36
WhiZard

WhiZard
  • Members
  • 1 204 messages

ShaDoOoW wrote...

WhiZard wrote...

However 2das also have limitations.  If
you require certain feats for taking a prestige class then a character
with those feats on equipped items will be able to level up in the
prestige class (even though they naturally do not qualify).  Even the
race requirement for prestige class can be bypassed when leveling up
polymorphed into that race.

I thought it works only on skin (which is why it works in polymorph) - are you sure it works with a bonus feats on any other item?


Nope, works for any equipped item, and ELC seems to check after the equipped items are registered in their places.  This means characters can hook dodge, mobility, whirlwind attack, and just need expertise and weapon focus naturally for WM (spring attack is actually not required).

#37
Rolo Kipp

Rolo Kipp
  • Members
  • 2 788 messages
<smiling...>

ShaDoOoW wrote...
Yea, Im not very good in explaining what I have on my mind. I think that this sarcastic post described it better than thousands words.

Sarcasm is a form of humor, and humor is a sure indication of intelligence. Being able to marshal your thoughts in such a short post proves this.

Don't agree that deleveling is lame, but I agree with the annoyance factor of re-levelling vs. preventing erroneous levels in the first place. :-)

Though the feedback thing is really a positive (if it would tell you everything you are missing) redoing the whole levelling up process which can take a while if you are not planning the character beforehand is a significant disadvantage.

Yup. Completely agree.
Though... there have been times I wished I could hit the "reset" button and re-define a character who wasn't *quite* what I had been hoping for.
Skeaver Demonsbane started that way. Pretty much brainless tank with a berzerker tendency around demons... but I stuck with him and now he's one of my more fun (if terribly shallow) avatars. He solved the problem of traps by simply surviving whatever happens... Like Clint in "Any Which Way..." he rather likes pain :-) The boy is cray-cray.

<...ruefully>

Modifié par Rolo Kipp, 30 septembre 2011 - 04:47 .


#38
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

Lightfoot8 wrote...

@Funky   the script you posted does not really compair to what is being talked about.  

You're right, it doens't 'compair' to what's being talked about, it IS what's being talked about.

Your posted code delevels due to them taking a Skill that they are not allowed to take.  That is an entirely diffearant matter then taking the wrong class. 

No, it isn't a entirely different matter. It's a nearly identical matter, which is precisely why deleveling works to address it.

Bioware already has things in place to prevent PC's from taking a  calss, If you do not mind using modified 2da's.   They  do not have anything that I know of to act the same way with preventing skills via scripting.  

That is certainly true. I'm well aware of this, as you might've guessed from reading my post, since I remarked that the delevel method 'saves you using 2das'. I was not, as you seem to think, discussing only illegal-skill deleveling, but all deleveling - I simply offered it as an example of code, to make a point to Shad, as you will also see if you go back and read my posts.

The matter to me simply comes down to if using modified 2da is worth the benifit of a more streem line system  to the OP.  You have already answered that as No it is not worth it to you in past posts.  It may hoever be worth it to the OP.

No, I did NOT answer 'no' to that - I expressly said the exact same thing you are saying:

It's not a question of lacking knowledge or skill, but of weighing different alternatives.


Shad was the one disparaging one method without considering another, not me. If you're going to criticize someone's post, it would behoove you to READ it first.

Funky

#39
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

ShaDoOoW wrote...

BTW just got and interesting idea that maybe some of the "hard way" camp will like.

One could remove all class prerequisities from 2das in order to allow player to take any class without them and script those prerequisities in OnLevelUp script and delevel anyone who doesnt fullfills them.
 
Best would be to add yur own custom prerequisities into every class like certain quest, gold ammount, guild membership etc. or really knowing the 3rd spell level for become PM etc. Of course these special prerequisities wont be written in class description via TLK, rather hidden somewhere in your forum which adress you have written in server description only.

The best would be to not tell player why is he deleveled or tell him always only one reason, so if he try to become Harper Scout first delevel will teach him he need:
- allertness, now redo levelling process
- "you need iron will feat", again
- "you need also improved parry, just our custom change", again
- "you need at least 4skill ranks in discipline", again
- "you need at least 6skill ranks in lore", again
- "yea 8 persuade dude!", again
- "forgot about search? 4ranks idiot", again
- "what the hell you think you can become harper without being in harper guild?", again

Wow that would be epic fun! I can imagine how im redoing whole levelling up process and distributing all saved skillpoints all over again. (Would be a good idea to delevel anyone who will try to save up skillpoints anyway)
:devil:

In the OP idea, one could be actually deleveled when changing all his sorcerrer/bard spell selection too, very funny.

That sarcasm would've been much more effective if what you proposed didn't ALSO require custom 2das. Brilliant! :lol:

Funky

Modifié par FunkySwerve, 01 octobre 2011 - 06:00 .


#40
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

SuperFly_2000 wrote...

But as I've seen this grow more and more complicated I'm just thinking to maybe restrict the player to only have two classes maximum.

That is at least easily scripted right? ...and doesn't have too many unwanted effects...(?).

Also I know Bioware has some XP penalties for multiclassing...can theese be made larger? ..or how big are they to start with?

This isn't complicated at all, really, I promise. Some people in this thread seem intent on painting it that way for whatever reason, but it can be as simple as this:

void main() {
    object oPC = GetPCLevellingUp();
    int nclass1 = GetLevelByPosition(1, oPC);
    int nclass2 = GetLevelByPosition(2, oPC);
    int nclass3 = GetLevelByPosition(3, oPC);
    int nDiff12 = abs(nclass1-nclass2);
    int nDiff13 = abs(nclass1-nclass3);
    int nDiff23 = abs(nclass2-nclass3);
    if (nDiff12 > 4 || nDiff13 > 4 || nDiff23 > 4) {
        FloatingTextStringOnCreature("You must keep all your classes within 4 levels of each other!", oPC, FALSE);
        DelevelPC(oPC);//using the previously posted function
    }
}

You'll have to be more specific about what you want (the above is just an example), but it takes hardly any code at all. Note that the above would block them taking ANY 2nd or 3rd class once they hit level 5 in a single class, so you might want to make provision to allow them to level up such classes even if it'd break the 'within 4' restriction, though that'd get a little more involved - just depends on what you want.

Funky

#41
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

ShaDoOoW wrote...
ok maybe its really bull**** and

Bingo!

  Thats for me as a player is a better option then being learned "the hard way". When building Im trying to be as much user friendly as possible and I always trying to make things the way the player could say "wow this is nicely done!".

I agree that way has more polish, which is why we don't use many delevels, though it's not much of an issue from a practical standpoint - such delevels are typically rare and one-time occurances, and the inconvenience to the player is minimal.  None of that justifies pushing an entire unrelated plugin on someone just looking for a simple script - someone you've now managed to leave with the impression that this very simple thing is incredibly complicated.

Funky

Modifié par FunkySwerve, 01 octobre 2011 - 08:01 .


#42
KMdS

KMdS
  • Members
  • 26 messages
Quick question as to why the need to limit or restrict the various levels/classes a player has. Is the actual need due to some undesired benefit players exploit. I have over the years developed many ways to restrict many of the exploits players abuse, though I have never released any to the community. At this time I am willing to begin releasing a few.

Modifié par KMdS, 01 octobre 2011 - 10:57 .


#43
Shadooow

Shadooow
  • Members
  • 4 465 messages

KMdS wrote...

Quick question as to why the need to limit or restrict the various levels/classes a player has. Is the actual need due to some undesired benefit players exploit. I have over the years developed many ways to restrict many of the exploits players abuse, though I have never released any to the community. At this time I am willing to begin releasing a few.

What someone consider an exploit someone else can see as an feature. These techniques definitely doesnt fall into exploit definition.

#44
KMdS

KMdS
  • Members
  • 26 messages
Actually,my queastion is directed to superfly as he is making the original comment/request. I take no position on anything else posted here. It just wanted to ask if there was some deeper reason for his question.  The better the information on the request the better the possibility of a relevant answer.

Modifié par KMdS, 01 octobre 2011 - 11:40 .


#45
Failed.Bard

Failed.Bard
  • Members
  • 774 messages

FunkySwerve wrote...

This isn't complicated at all, really, I promise. Some people in this thread seem intent on painting it that way for whatever reason, but it can be as simple as this:

void main() {
    object oPC = GetPCLevellingUp();
    int nclass1 = GetLevelByPosition(1, oPC);
    int nclass2 = GetLevelByPosition(2, oPC);
    int nclass3 = GetLevelByPosition(3, oPC);
    int nDiff12 = abs(nclass1-nclass2);
    int nDiff13 = abs(nclass1-nclass3);
    int nDiff23 = abs(nclass2-nclass3);
    if (nDiff12 > 4 || nDiff13 > 4 || nDiff23 > 4) {
        FloatingTextStringOnCreature("You must keep all your classes within 4 levels of each other!", oPC, FALSE);
        DelevelPC(oPC);//using the previously posted function
    }
}
Funky


  I would add a check to that to make sure they have levels in the second and third class positions before comparing those levels, but aside from that what Funky posted is similar to the comparisons I do in my mod (Aside from mine being > 7).

#46
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

SuperFly_2000 wrote...
Also I know Bioware has some XP penalties for multiclassing...can theese be made larger? ..or how big are they to start with?


From the game manual......

EXPERIENCE FOR MULTIclass CHARACTERS

If your multiclass character’s classes are nearly the same level (all
within 1 level of each other), then he can balance the needs of his
classes. Your multiclass character suffers a -20% XP penalty for
each class that is not within 1 level of his most experienced class.
These penalties apply from the moment the character adds a class
or raises a class’s level too high. For instance, a 4th-level wizard/
3rd-level rogue gets no penalty, but if that character raises his
wizard level to 5th, then he’d receive the -20% penalty from that
point on until his levels were nearly even again.

I know of no way to effect the built in XP system to change the amount of the XP penalties.  Most of the systems that I have seen that mess with XP, simply set the module XP to 0%, then add scripts to give XP out in a way they want it done.

SuperFly_2000 wrote...

Another way that I just came to think of...would be to remove PC's that take prestige classes from the minimum level for lesser class needed (but not from the max 2 classes limit)....if possible to script again. That would solve everything I think.

(I was thinking to NOT have RDD, WM, SD, AA and shifter.)


Not allowing the PC to take the Prestiage class is simple.   It also does not need any 2da edits.  The default Bioware 2da's are already set up for this.   You would just need to add the following to your OnClientEnter script.
You will also need to set a Local on the PC so you can figure out what class they leveled up in OnLevelUp.

SetLocalInt(oPC,"X1_AllowDrDis",1);
   SetLocalInt(oPC,"X2_AllowWM",1);
   SetLocalInt(oPC,"X1_AllowShadow",1);
   SetLocalInt(oPC,"X1_AllowArcher",1);
   SetLocalInt(oPC,"X2_AllowShiftr",1);
 
SetLocalInt(oPC,"class1",GetLevelByPosition(1, oPC));


Your on level script wold need to be more like this.  

void main()
{
    object oPC = GetPCLevellingUp();
    int nclass1 = GetLevelByPosition(1, oPC);
    int nclass2 = GetLevelByPosition(2, oPC);
    int nclass3 = GetLevelByPosition(3, oPC);
    string sclassName;
    int nCurrentXP;
    int bDelevel;

   // Check to see if they have taken a third class
   if (nclass3)
   {
        FloatingTextStringOnCreature("You are only allowed to have two classes!", oPC, FALSE);
        bDelevel = TRUE;//using the previously posted function
   }
   //else check to see if they have a class in the second level
   // If they do not no no other checks are needed.
   else if(nclass2)
   {
     // The code here is ran if they have two classes.
     // Due to the fact that prestige classes can break the level spread rules,
     // We need to know what class they leveled in. So the need for the Locals.
     if (GetLocalInt(oPC,"class1")!= nclass1)
     {
        // They leveled in class 1.
        if (nclass1/nclass2 > 3)
        {
           sclassName =  GetStringByStrRef(StringToInt(Get2DAString("classes","Name",GetclassByPosition(2,oPC))));
           FloatingTextStringOnCreature("classes have to be within one third of each other"
                     +" You have to take another Level in "+sclassName+" first.", oPC, FALSE);
           bDelevel = TRUE;
        }
     }
     else
     {
       // they leveled in class 2.
       // if it is a base class it will have to follow the rule.
       // and be taken within the first 4 levels. No restriction on when the
       // first level for a pres class can be taken.
       if (nclass2 == 1 && nclass1 >3 && GetclassByPosition(2,oPC) < 11)
       {
          FloatingTextStringOnCreature("You can no longer take a second base class", oPC, FALSE);
          bDelevel = TRUE;
       }
       else if (nclass2/nclass1 > 3)
       {
         sclassName =  GetStringByStrRef(StringToInt(Get2DAString("classes","Name",GetclassByPosition(1,oPC))));
         FloatingTextStringOnCreature("classes have to be within one third of each other"
                  +" You have to take another Level in "+sclassName+" first.", oPC, FALSE);
         bDelevel = TRUE;
       }
     }
   }

   // Delevel the PC if needed if not store the new first class local.
   if ( bDelevel)
   {
     nCurrentXP = GetXP(oPC);
     int nHD = GetHitDice(oPC);
     SetXP(oPC,nHD * (nHD - 1) * 500 - 1);
     // Give the XP back so they can relevel.
     DelayCommand(0.5, SetXP(oPC,nCurrentXP));
   }
   else SetLocalInt(oPC,"class1",nclass1);


Funkys posted script is just way to simplistic.   For one it would force the PC to take 3 classes without the checks that Faild Bard pointed out. It also does not handle the Pres classes the way you wanted them. 

Modifié par Lightfoot8, 04 octobre 2011 - 01:42 .


#47
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

FunkySwerve wrote...

Lightfoot8 wrote...

@Funky   the script you posted does not really compair to what is being talked about.  

You're right, it doens't 'compair' to what's being talked about, it IS what's being talked about.

Your posted code delevels due to them taking a Skill that they are not allowed to take.  That is an entirely diffearant matter then taking the wrong class. 

No, it isn't a entirely different matter. It's a nearly identical matter, which is precisely why deleveling works to address it.

Shad was the one disparaging one method without considering another, not me. If you're going to criticize someone's post, it would behoove you to READ it first.

Funky


You either missed entirely what I was criticizing Or you did not read your own post.   Let me recap.  

FunkySwerve wrote...

...Sorry, but that's nonsense. We use delevels. It's not a question of lacking knowledge or skill, but of weighing different alternatives. Below, by way of example, is some code from the beginning of our levelup. It was written by acaos, and uses a Delevel function he also wrote. So, would you like to remove that foot from your mouth now, or are you seriously going to suggest that the guy who's written the lion's share of linux nwnx plugins lacks knowledge and building skill?...

Funky

 
It sounds to me that you are posting the code to prove that shadow is wrong.   No I am not saying that shadow is right, Mainly just because I dissagree with his use of words like "Lame" ect.   If he would replace them with frases like "Is not allways the best method". I do not think any of us would dissagree with his posts.  

But since your posted code by acaos could not even be done by the method he was talking about, It proved nothing about how he would have handled the case of  restriction based on class.  There is also no time line as to when he wrote the code.   If it was written before the first patch,  and it matched exactly the case at hand, It still proves nothing because the method being discused was not avaliable at the time.   Third Even if the case matched, We have no Idea what constraints acros was writting under, was it for a mod without haks? , Did he know about the other options at the time he wrote it?  Did other factors like having to delevel due to lore restrictions,  sway him to just do everything with delevling?  Is it just a safty check incase one of the class restriction vars slipped by not being set correctly? 

In short,  posting code someone else wrote is hearsay and proves  nothing.

Modifié par Lightfoot8, 02 octobre 2011 - 04:19 .


#48
WhiZard

WhiZard
  • Members
  • 1 204 messages

Lightfoot8 wrote...

SuperFly_2000 wrote...
Also I know Bioware has some XP penalties for multiclassing...can theese be made larger? ..or how big are they to start with?


From the game manual......

EXPERIENCE FOR MULTIclass CHARACTERS

If your multiclass character’s classes are nearly the same level (all
within 1 level of each other), then he can balance the needs of his
classes. Your multiclass character suffers a -20% XP penalty for
each class that is not within 1 level of his most experienced class.
These penalties apply from the moment the character adds a class
or raises a class’s level too high. For instance, a 4th-level wizard/
3rd-level rogue gets no penalty, but if that character raises his
wizard level to 5th, then he’d receive the -20% penalty from that
point on until his levels were nearly even again.

I know of no way to effect the built in XP system to change the amount of the XP penalties.  Most of the systems that I have seen that mess with XP, simply set the module XP to 0%, then add scripts to give XP out in a way they want it done.
 


But scripting these in is no problem either.  The system uses 10 * 2da values (row character level, column creature CR) * XP slider * penalties.  Party size is easy to get by script (add up all associates), and multiclass issues are also easy enough to calculate.

#49
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

WhiZard wrote...
But scripting these in is no problem either.  The system uses 10 * 2da values (row character level, column creature CR) * XP slider * penalties.  Party size is easy to get by script (add up all associates), and multiclass issues are also easy enough to calculate.


Nice.  I never knew the formula.    The only thing I see missing is how party size factors into it.   I am pretty sure it is not an even spread.  i.e   (10* 2da *Slider * -Penatilty) /nPartySize 

Do you know how the party size effects the XP?  

.  

#50
WhiZard

WhiZard
  • Members
  • 1 204 messages

Lightfoot8 wrote...

WhiZard wrote...
But scripting these in is no problem either.  The system uses 10 * 2da values (row character level, column creature CR) * XP slider * penalties.  Party size is easy to get by script (add up all associates), and multiclass issues are also easy enough to calculate.


Nice.  I never knew the formula.    The only thing I see missing is how party size factors into it.   I am pretty sure it is not an even spread.  i.e   (10* 2da *Slider * -Penatilty) /nPartySize 

Do you know how the party size effects the XP?  

.  


It's on the wiki under experience point.  The reported is 4/(3+ party size), though someone did post on the talk page that this never goes below 50% (party of 5 or higher).  The party size does include the party leader.