Aller au contenu

Photo

OnEnter script not seeming to work


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

#1
Peepsy

Peepsy
  • Members
  • 28 messages
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. 

#2
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
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 .


#3
Peepsy

Peepsy
  • Members
  • 28 messages
I do not understand what you mean, Funky. I'm sorry, I'm a bit dense.

#4
Failed.Bard

Failed.Bard
  • Members
  • 774 messages
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.

#5
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

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

#6
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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.     

#7
WhiZard

WhiZard
  • Members
  • 1 204 messages

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 .


#8
WhiZard

WhiZard
  • Members
  • 1 204 messages
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.

#9
Peepsy

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