Author Topic: class Adding - Probably Noob Issue  (Read 622 times)

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
class Adding - Probably Noob Issue
« on: August 25, 2011, 06:49:49 am »


               Heya.

First off, I did read several posts on adding classes. The concept of it is simple enough, and I thought I had a grasp on how to work it in. However, when I went for a test on this knowledge, I hit a snag.

I have added the class "Merchant" on line 43 of classes.2da. This line uses existing templates for bonus feats and saves, but I created cls_feat_merch, cls_pres_merch, and cls_skill_merch. At first I pointed the NAME column of the Merchant's line to the same numbers as "ooze" - which worked anyway - but then made a custom tlk file to eliminate possible confounding causes for the problem.

That's where I got. The problem that's persisting is that the class is available without meeting any of the requirements right from level 2. In cls_pres_merch I tried a few iterations of:

4          ScriptVar    VAR       TL_AllowMERCH   0      

As it was anotated in a post I found with Omnibus, but to no effect. As for all the other classes, I'm not seeing the column where this variable is defined (rather, many columns use the abbreviated version but this variable seems never to use the full constant given).

I'd like to know if anyone can see what's going wrong here.
               
               

               


                     Modifié par Hardcore UFO, 25 août 2011 - 05:50 .
                     
                  


            

Legacy_Alex Warren

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #1 on: August 25, 2011, 06:59:10 am »


               

4          ScriptVar    VAR       TL_AllowMERCH   0

This checks for "TL_AllowMERCH" local int on PC and if it equals 0 it allows the class.

You will need something (OnEnter script?) to set this to something other than 0 to disable the class.
               
               

               
            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #2 on: August 25, 2011, 07:09:36 am »


               Oh, I see. If I have:

4          ScriptVar    VAR       TL_AllowMERCH   1

Would it be disabled by default? That would be much simpler - I would just script the OnLevelUp check for the requirements.
               
               

               
            

Legacy_Alex Warren

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #3 on: August 25, 2011, 07:11:58 am »


               I guess so, but I've never tried it this way.
               
               

               
            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #4 on: August 25, 2011, 07:18:07 am »


               Thanks for the information! '<img'>
               
               

               
            

Legacy_Androrc

  • Full Member
  • ***
  • Posts: 188
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #5 on: August 25, 2011, 10:22:52 am »


               

Hardcore UFO wrote...

Oh, I see. If I have:

4          ScriptVar    VAR       TL_AllowMERCH   1

Would it be disabled by default? That would be much simpler - I would just script the OnLevelUp check for the requirements.


Yes, but you shouldn't need to do that, the class should need that variable to be allowed plus any other requirements. What are the other requirements you have set?
               
               

               
            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #6 on: August 25, 2011, 01:12:30 pm »


                          LABEL        ReqType   ReqParam1        ReqParam2 
0          Persuade     SKILL     12                         2             
1          Appraise     SKILL     20                           6    
 2          Lore            SKILL     7                             4            
3          SkillFocAppraise    FEAT     404            ****      
4          ScriptVar    VAR       TL_AllowMERCH   0     

Is what I used in the test, but I haven't changed it since the original post yet.
               
               

               


                     Modifié par Hardcore UFO, 25 août 2011 - 12:14 .
                     
                  


            

Legacy_Alex Warren

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #7 on: August 25, 2011, 02:03:47 pm »


               Heh, are you sure that in your classes.2da on line 43 in PreReqTable column you have cls_pres_merch.

We should have start with that '<img'>
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #8 on: August 25, 2011, 03:24:52 pm »


               So that the variable name makes sense I would change
TL_AllowMERCH

to

TL_RejectMERCH

otherwise the variable performs opposite to what its name suggests. When that variable is TRUE, it rejects advancement into the class.
               
               

               
            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #9 on: August 25, 2011, 04:48:13 pm »


               The line for the class in classes.2da looks like this:

43         Merchant           16777217  16777219  16777218  8154     IR_X1_HARPER   6        CLS_ATK_3          CLS_FEAT_MERCH    CLS_SAVTHR_WIZ     CLS_SKILL_MERCH    CLS_BFEAT_BARB     8                ****             ****              1             0             25    8     19    10    6     17    CHA           0X00            0X0               0                class_TYPE_MERCHANT           (...CR Levels...)           CLS_PRES_MERCH    40         0           0                0                10          1          

The formatting is awful, but yes I made sure that cls_pres_merch, cls_feat_merch, and cls_skill_merch were in the appropriate columns. They are largely based on existing tables and meant as nothing definite, mechanics wise, just for testing.
               
               

               
            

Legacy_Androrc

  • Full Member
  • ***
  • Posts: 188
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #10 on: August 26, 2011, 01:56:27 am »


               

henesua wrote...

So that the variable name makes sense I would change
TL_AllowMERCH

to

TL_RejectMERCH

otherwise the variable performs opposite to what its name suggests. When that variable is TRUE, it rejects advancement into the class.


I would just change the variable to 1 rather than 0, like he did.

Hardcore UFO wrote...

The line for the class in classes.2da looks like this:

43
        Merchant           16777217  16777219  16777218  8154    
IR_X1_HARPER   6        CLS_ATK_3          CLS_FEAT_MERCH    
CLS_SAVTHR_WIZ     CLS_SKILL_MERCH    CLS_BFEAT_BARB     8              
 ****             ****              1             0             25    8
    19    10    6     17    CHA           0X00            0X0          
    0                class_TYPE_MERCHANT           (...CR Levels...)  
       CLS_PRES_MERCH    40         0           0                0    
          10          1          

The formatting is awful, but
yes I made sure that cls_pres_merch, cls_feat_merch, and cls_skill_merch
were in the appropriate columns. They are largely based on existing
tables and meant as nothing definite, mechanics wise, just for
testing.


Are you 100% sure that you've updated your hak with the most recent version of the 2da files? I know it sounds silly, but these things do happen.

Anyway, I would use line 50 rather than 43, since BioWare's reserved index starts there, so the previous lines may have some hardcode associated to them that makes them buggy for normal use, who knows.
               
               

               


                     Modifié par Androrc, 26 août 2011 - 12:56 .
                     
                  


            

Legacy_Hardcore UFO

  • Full Member
  • ***
  • Posts: 157
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #11 on: August 26, 2011, 02:07:09 am »


               I haven't had a chance to get to this today, so I'll update you soon. As for updating haks, I did not because I was testing this by way of override folder.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #12 on: August 26, 2011, 02:40:13 am »


               

Androrc wrote...

henesua wrote...

So that the variable name makes sense I would change
TL_AllowMERCH

to

TL_RejectMERCH

otherwise the variable performs opposite to what its name suggests. When that variable is TRUE, it rejects advancement into the class.


I would just change the variable to 1 rather than 0, like he did.


Bad idea. None of the other variables for prestige classes work this way. Better to be consistent.
               
               

               
            

Legacy_Androrc

  • Full Member
  • ***
  • Posts: 188
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #13 on: August 26, 2011, 02:42:15 am »


               

henesua wrote...

Androrc wrote...

henesua wrote...

So that the variable name makes sense I would change
TL_AllowMERCH

to

TL_RejectMERCH

otherwise the variable performs opposite to what its name suggests. When that variable is TRUE, it rejects advancement into the class.


I would just change the variable to 1 rather than 0, like he did.


Bad idea. None of the other variables for prestige classes work this way. Better to be consistent.


Changing to "Reject" would also create an inconsistency. I don't see the difference in this regard.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
class Adding - Probably Noob Issue
« Reply #14 on: August 26, 2011, 03:58:32 am »


               One issue affects how the code functions and the other is purely a matter of making the code easier for a human to read. You can't tell the difference? Really?

Please, don't pick an argument just because its the internet.

[Edit] I'd like to retract some of that, but I don't like self-censorship in a public forum. So I'll leave the above as it stands. I should not have simply assumed Andorc was picking a fight just to troll. Sorry about that. It was unfair, and I was in the wrong.

Anyway. Its a form versus function thing. If you change the required value of the variable you change the way it functions. If you change its name the functionality remains the same, while it becomes easier to read for a human being.
               
               

               


                     Modifié par henesua, 26 août 2011 - 03:43 .