Author Topic: Broken script help?  (Read 1057 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Broken script help?
« on: December 04, 2010, 01:45:31 pm »


               Okay, got this script to lock prestige classes.....now it worked just fine for the past year orso...but suddenly it stops working.....I do not know if its a wrong part on my side since I am still ot the greatest in scripting.

The script is meant to lock PRC classes, but it sorta doesnt once the toon has the requirements for it....and thats not really what we are looking for, since we have a token system running for the prestige classes and stuff.

But if anyone can tell me if a script can  "break "after a while or is there something else that can cause this?


Below I will post the script:


#include "_pw_journal_inc"
void main()
{
object oPC = GetEnteringObject();
RestorePersistentJournal(oPC);
ExecuteScript ("cnr_module_oce", oPC);
}
void DisableAllPrestigeclasses(object oPC, int bExistingToo=FALSE)
{
 if(bExistingToo || GetLevelByclass(class_TYPE_SHADOWDANCER,oPC) < 1)
 {
 SetLocalInt(oPC,"X1_AllowShadow",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_HARPER,oPC) < 1)
 {
 SetLocalInt(oPC,"X1_AllowHarper",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_ARCANE_ARCHER,oPC) < 1)
 {
 SetLocalInt(oPC,"X1_AllowArcher",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_ASSASSIN,oPC) < 1)
 {
 SetLocalInt(oPC,"X1_AllowAsasin",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_BLACKGUARD,oPC) < 1)
 {
 SetLocalInt(oPC,"X1_AllowBlkGrd",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_DIVINE_CHAMPION,oPC) < 1)
 {
 SetLocalInt(oPC,"X2_AllowDivcha",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_WEAPON_MASTER,oPC) < 1)
 {
 SetLocalInt(oPC,"X2_AllowWM",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_PALE_MASTER,oPC) < 1)
 {
 SetLocalInt(oPC,"X2_AllowPalema",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_SHIFTER,oPC) < 1)
 {
 SetLocalInt(oPC,"X2_AllowShiftr",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_DWARVEN_DEFENDER,oPC) < 1)
 {
 SetLocalInt(oPC,"X1_AllowDwDef",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_DRAGON_DISCIPLE,oPC) < 1)
 {
 SetLocalInt(oPC,"X1_AllowDrDis",1);
 }
 if(bExistingToo || GetLevelByclass(class_TYPE_PURPLE_DRAGON_KNIGHT,oPC) < 1)
 {
 SetLocalInt(oPC,"DLA_AllowPDK",1);
 }
}

been working on this with some others on it to fix the issue but we sorta created a hole in our walls now....so if someone can tell me whats the issue than?
               
               

               
            

Legacy__Knightmare_

  • Full Member
  • ***
  • Posts: 191
  • Karma: +0/-0
Broken script help?
« Reply #1 on: December 04, 2010, 05:35:46 pm »


               Scripts only will "break" if you did something to break it. They don't do it on there own. Somewhere, somehow, somebody has made an alteration that is now affecting the script results. You may have to narrow down what changes have been made since the script began not working correctly.
               
               

               
            

Legacy_dickloraine

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Broken script help?
« Reply #2 on: December 04, 2010, 05:47:05 pm »


               On the first look, your DisableAllPrestigeclasses function is nowhere in the void main. So it is never executed. Or is this also an include? But then there shouldn't be a main function.
               
               

               
            

Legacy_NorthWolf

  • Full Member
  • ***
  • Posts: 143
  • Karma: +0/-0
Broken script help?
« Reply #3 on: December 04, 2010, 05:53:45 pm »


               As _Knightmare_ said, scripts don't degrade or anything. From what I can see the problem might be really simple, as I'm guessing that's your "onEnter" script: you never actually call "DisableAllPrestigeclasses()". This should work, I'm guessing:

void DisableAllPrestigeclasses(object oPC, int bExistingToo=FALSE){
 if(bExistingToo || GetLevelByclass(class_TYPE_SHADOWDANCER,oPC) < 1)
 SetLocalInt(oPC,"X1_AllowShadow",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_HARPER,oPC) < 1)
 SetLocalInt(oPC,"X1_AllowHarper",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_ARCANE_ARCHER,oPC) < 1)
 SetLocalInt(oPC,"X1_AllowArcher",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_ASSASSIN,oPC) < 1)
 SetLocalInt(oPC,"X1_AllowAsasin",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_BLACKGUARD,oPC) < 1)
 SetLocalInt(oPC,"X1_AllowBlkGrd",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_DIVINE_CHAMPION,oPC) < 1)
 SetLocalInt(oPC,"X2_AllowDivcha",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_WEAPON_MASTER,oPC) < 1)
 SetLocalInt(oPC,"X2_AllowWM",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_PALE_MASTER,oPC) < 1)
 SetLocalInt(oPC,"X2_AllowPalema",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_SHIFTER,oPC) < 1)
 SetLocalInt(oPC,"X2_AllowShiftr",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_DWARVEN_DEFENDER,oPC) < 1)
 SetLocalInt(oPC,"X1_AllowDwDef",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_DRAGON_DISCIPLE,oPC) < 1)
 SetLocalInt(oPC,"X1_AllowDrDis",1);
 if(bExistingToo || GetLevelByclass(class_TYPE_PURPLE_DRAGON_KNIGHT,oPC) < 1)
 SetLocalInt(oPC,"DLA_AllowPDK",1);
}

void main()
{
object oPC = GetEnteringObject();
RestorePersistentJournal(oPC);
DisableAllPrestigeclasses(oPC);
ExecuteScript ("cnr_module_oce", oPC);
}
               
               

               


                     Modifié par NorthWolf, 04 décembre 2010 - 05:54 .
                     
                  


            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Broken script help?
« Reply #4 on: December 04, 2010, 06:06:42 pm »


               thank you all, am gonna try this out and let you guys know the results!
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Broken script help?
« Reply #5 on: December 04, 2010, 06:12:25 pm »


               Error, no right bracket on expression ->  if(bExistingToo || GetLevelByclass(class_TYPE_SHADOWDANCER,oPC) < 1)



Which makes no sense to me since it worked for me earlier without any trouble!
               
               

               
            

Legacy_420

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Broken script help?
« Reply #6 on: December 04, 2010, 06:19:10 pm »


               

Who said that I wrote...

Error, no right bracket on expression ->  if(bExistingToo || GetLevelByclass(class_TYPE_SHADOWDANCER,oPC)

Which makes no sense to me since it worked for me earlier without any trouble!

That happens sometimes, try cutting the lines, compiling then readding the linse.

-420
               
               

               
            

Legacy_NorthWolf

  • Full Member
  • ***
  • Posts: 143
  • Karma: +0/-0
Broken script help?
« Reply #7 on: December 04, 2010, 08:34:58 pm »


               For some reason my post keeps correcting the code to be... incorrect. I have no clue why. The problem is with capitalization of the "GetLevelByclass" function. The word "class" should be capitalized at the start, but the forums seem to hate the capital C.

Just go through and fix the capitals if you copied and pasted.
               
               

               


                     Modifié par NorthWolf, 04 décembre 2010 - 08:43 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Broken script help?
« Reply #8 on: December 04, 2010, 08:56:41 pm »


               All the consts should have the word 'class' in all caps too (like this, without the spaces: C L A S S. Forum probably thinks you're trying to define a class and is blocking it. Or...something. '<img'>

Funky
               
               

               


                     Modifié par FunkySwerve, 04 décembre 2010 - 08:57 .
                     
                  


            

Legacy_NorthWolf

  • Full Member
  • ***
  • Posts: 143
  • Karma: +0/-0
Broken script help?
« Reply #9 on: December 04, 2010, 10:21:37 pm »


               Oh, wow. Just noticed that. That's a really weird bug/protection/whatever it is.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Broken script help?
« Reply #10 on: December 04, 2010, 10:39:56 pm »


               Aslo dont forget to leave the

#include "_pw_journal_inc"

At the top of the script.
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Broken script help?
« Reply #11 on: December 06, 2010, 06:26:57 pm »


               it still does the same really....still the same error or I made a reading error....



//::::::::::::::::::::: OnClientEnter script :::::::::::::::::::::::::::::::::::



#include "_pw_journal_inc"



void DisableAllPrestigeclasses(object oPC, int bExistingToo=FALSE){

if(bExistingToo || GetLevelByclass(class_TYPE_SHADOWDANCER,oPC) < 1)

SetLocalInt(oPC,"X1_AllowShadow",1);

if(bExistingToo || GetLevelByclass(class_TYPE_HARPER,oPC) < 1)

SetLocalInt(oPC,"X1_AllowHarper",1);

if(bExistingToo || GetLevelByclass(class_TYPE_ARCANE_ARCHER,oPC) < 1)

SetLocalInt(oPC,"X1_AllowArcher",1);

if(bExistingToo || GetLevelByclass(class_TYPE_ASSASSIN,oPC) < 1)

SetLocalInt(oPC,"X1_AllowAsasin",1);

if(bExistingToo || GetLevelByclass(class_TYPE_BLACKGUARD,oPC) < 1)

SetLocalInt(oPC,"X1_AllowBlkGrd",1);

if(bExistingToo || GetLevelByclass(class_TYPE_DIVINE_CHAMPION,oPC) < 1)

SetLocalInt(oPC,"X2_AllowDivcha",1);

if(bExistingToo || GetLevelByclass(class_TYPE_WEAPON_MASTER,oPC) < 1)

SetLocalInt(oPC,"X2_AllowWM",1);

if(bExistingToo || GetLevelByclass(class_TYPE_PALE_MASTER,oPC) < 1)

SetLocalInt(oPC,"X2_AllowPalema",1);

if(bExistingToo || GetLevelByclass(class_TYPE_SHIFTER,oPC) < 1)

SetLocalInt(oPC,"X2_AllowShiftr",1);

if(bExistingToo || GetLevelByclass(class_TYPE_DWARVEN_DEFENDER,oPC) < 1)

SetLocalInt(oPC,"X1_AllowDwDef",1);

if(bExistingToo || GetLevelByclass(class_TYPE_DRAGON_DISCIPLE,oPC) < 1)

SetLocalInt(oPC,"X1_AllowDrDis",1);

if(bExistingToo || GetLevelByclass(class_TYPE_PURPLE_DRAGON_KNIGHT,oPC) < 1)

SetLocalInt(oPC,"DLA_AllowPDK",1);

}



void main()

{

object oPC = GetEnteringObject();

RestorePersistentJournal(oPC);

DisableAllPrestigeclasses(oPC);

ExecuteScript ("cnr_module_oce", oPC);

}

               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Broken script help?
« Reply #12 on: December 06, 2010, 06:46:21 pm »


                Are the caps correct in your script.  
 
//::::::::::::::::::::: OnClientEnter script :::::::::::::::::::::::::::::::::::
     class   

#include "_pw_journal_inc"

void DisableAllPrestigeClasses(object oPC, int bExistingToo=FALSE){
if(bExistingToo || GetLevelByClass(class_TYPE_SHADOWDANCER,oPC)
SetLocalInt(oPC,"X1_AllowShadow",1);
if(bExistingToo || GetLevelByClass(class_TYPE_HARPER,oPC)
SetLocalInt(oPC,"X1_AllowHarper",1);
if(bExistingToo || GetLevelByClass(class_TYPE_ARCANE_ARCHER,oPC)
SetLocalInt(oPC,"X1_AllowArcher",1);
if(bExistingToo || GetLevelByClass(class_TYPE_ASSASSIN,oPC)
SetLocalInt(oPC,"X1_AllowAsasin",1);
if(bExistingToo || GetLevelByC lass(class_TYPE_BLACKGUARD,oPC)
SetLocalInt(oPC,"X1_AllowBlkGrd",1);
if(bExistingToo || GetLevelByC lass(class_TYPE_DIVINE_CHAMPION,oPC)
SetLocalInt(oPC,"X2_AllowDivcha",1);
if(bExistingToo || GetLevelByC lass(class_TYPE_WEAPON_MASTER,oPC)
SetLocalInt(oPC,"X2_AllowWM",1);
if(bExistingToo || GetLevelByC lass(class_TYPE_PALE_MASTER,oPC)
SetLocalInt(oPC,"X2_AllowPalema",1);
if(bExistingToo || GetLevelByC lass(class_TYPE_SHIFTER,oPC)
SetLocalInt(oPC,"X2_AllowShiftr",1);
if(bExistingToo || GetLevelByC lass(class_TYPE_DWARVEN_DEFENDER,oPC)
SetLocalInt(oPC,"X1_AllowDwDef",1);
if(bExistingToo || GetLevelByC lass(class_TYPE_DRAGON_DISCIPLE,oPC)
SetLocalInt(oPC,"X1_AllowDrDis",1);
if(bExistingToo || GetLevelByClass(class_TYPE_PURPLE_DRAGON_KNIGHT,oPC)
SetLocalInt(oPC,"DLA_AllowPDK",1);
}

void main()
{
object oPC = GetEnteringObject();
RestorePersistentJournal(oPC);
DisableAllPrestigeClasses(oPC);
ExecuteScript ("cnr_module_oce", oPC);
}
 
               
               

               
            

Legacy_Baragg

  • Sr. Member
  • ****
  • Posts: 496
  • Karma: +0/-0
Broken script help?
« Reply #13 on: December 07, 2010, 12:34:26 am »


               You may need to set the TRUE on the Disable call.



You have DisableAllPrestigeclasses(oPC);



Where I think it should be DisableAllPrestigeclasses(oPC, TRUE);
               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Broken script help?
« Reply #14 on: December 07, 2010, 09:13:37 am »


               Yes I noticed it when I put in that last post! Thanks so much for your help guys!!