Author Topic: OnEnter script not seeming to work  (Read 379 times)

Legacy_Peepsy

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
OnEnter script not seeming to work
« on: March 26, 2012, 02:04:50 am »


               The code: 
http://pastebin.myrror.net/3121

The issue here is that the GetIsRemovedSkill() is always returning FALSE, even when it should be returning true. I've tried replacing the if statement for one that just manually checks the numbers but it does not work either. I think the issue may be somewhere with the nSkillConstant in the for loop, but am unsure. Any help is appriciated. 
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
OnEnter script not seeming to work
« Reply #1 on: March 26, 2012, 05:28:26 am »


               You're passing a number other than those in this switch into it, then.

27        switch (nSkillToCheck) {
28            case 6: return TRUE;
29            case 8: return TRUE;
30            case 9: return TRUE;
31            case 12: return TRUE;
32            case 14: return TRUE;
33            case 15: return TRUE;
34            case 22: return TRUE;
35            case 26: return TRUE;
36        }
Add debug to find out what number you're passing it - for example, a default case with something like:

default: SendMessageToPC(GetFirstPC(), "nSkillToCheck:" + IntToString(nSkillToCheck)); return FALSE;
I suspect there's a problem with one of your 2da reads that leads a 0 to be passed, but I didn't bother looking too carefully, because setting up debug properly will solve this one easily.

Funky
               
               

               


                     Modifié par FunkySwerve, 26 mars 2012 - 04:30 .
                     
                  


            

Legacy_Peepsy

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
OnEnter script not seeming to work
« Reply #2 on: March 26, 2012, 06:05:56 am »


               I do not understand what you mean, Funky. I'm sorry, I'm a bit dense.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
OnEnter script not seeming to work
« Reply #3 on: March 26, 2012, 06:17:06 am »


               I went about this in a different way on my server, setting all skills to 0 instead, and then letting the characters level up to 2nd level right away so they could pick the skills based on the modified lists.

 Granted, that foesn't help you with your current script dilemna, but it does provide an option for you if you were to decide to go about it a different way.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
OnEnter script not seeming to work
« Reply #4 on: March 26, 2012, 08:44:30 am »


               

Peepsy wrote...

I do not understand what you mean, Funky. I'm sorry, I'm a bit dense.


Add the default line I posted to that switch, at the bottom. It will send the playtester pc a message telling them what number is being passed into that function. This is how you do basic debug code - isolate the symptom (you have), and track it backwards until you find the problem causing it.

Once you've done that, we can take it from there. LMK if that's still not clear enough - I'm happy to elaborate further.

Funky
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
OnEnter script not seeming to work
« Reply #5 on: March 27, 2012, 04:40:21 am »


               I do not understand why you are doing some of the things you are doing in the posted script.   They only make since if you have changed the "SkillsTable" entry in classes.2da. Is this the case?  If it is not the case it looks like you are overworking the problem.   The entire 'for loop' is unneeded.  'i' will end up being equal to nSkillCount every time,  nSkillConstant will also end up being equal to nSkillcount.   The 2da line for the skill in skills.2da by default have to be the same as the line in  cls_skill_*.2da.



A little more information about how you have your 2da's set up is needed.     
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
OnEnter script not seeming to work
« Reply #6 on: March 27, 2012, 07:38:07 am »


               

Lightfoot8 wrote...

I do not understand why you are doing some of the things you are doing in the posted script.   They only make since if you have changed the "SkillsTable" entry in classes.2da. Is this the case?  If it is not the case it looks like you are overworking the problem.   The entire 'for loop' is unneeded.  'i' will end up being equal to nSkillCount every time,  nSkillConstant will also end up being equal to nSkillcount.   The 2da line for the skill in skills.2da by default have to be the same as the line in  cls_skill_*.2da.



A little more information about how you have your 2da's set up is needed.     


Not quite; there are three skills that are ineligible for certain classes (animal empathy, perform, and UMD). Animal empathy takes the top (zeroeth) line, which means all classes besides druid, ranger, or shifter will automatically have all their lines off by at least one.

But Lightfoot is right that the loop is unnecessary.  All you need to do is use the "SkillIndex" column to get your row number for skills.2da
               
               

               


                     Modifié par WhiZard, 27 mars 2012 - 06:54 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
OnEnter script not seeming to work
« Reply #7 on: March 27, 2012, 08:15:31 am »


               I am searching the class skills and there are some misspellings for the "Label" column.  For example rogue has "CraftArrmor".  You can avoid these issues by using the "SkillIndex" column instead.
               
               

               
            

Legacy_Peepsy

  • Jr. Member
  • **
  • Posts: 55
  • Karma: +0/-0
OnEnter script not seeming to work
« Reply #8 on: April 06, 2012, 11:26:02 am »


               I appreciate the help, and got this working thanks to you guys. Sorry for being unresponsive. Battling other demons! Hah.