Author Topic: Controlling available classes via script?  (Read 357 times)

Legacy_Verilazic

  • Sr. Member
  • ****
  • Posts: 263
  • Karma: +0/-0
Controlling available classes via script?
« on: April 02, 2015, 12:50:51 am »


               

I had an idea to control what classes are available for the player to level up with in my module, but here's the tricky thing: I'd want to change what's available at different times within the module. For example, let them choose their first 3 levels at will, then force them to level up as a cleric the next 3 times, then de-level them and let them level however they choose.


 


The only way I know of to adjust available classes is through modifying classes.2da, is that it? Can anyone think of a way of having 2 different classes.2da that are used at different times? Or should I just start a Chapter 2 at the point where I want to adjust it?



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Controlling available classes via script?
« Reply #1 on: April 02, 2015, 01:46:10 am »


               

You can do it by catching it in the onlevelup event. You'd need to de-level them if they chose a class that was not available. Since that's the case you'd want to have a way to tell them what they are allowed to pick to keep the frustration down.   Have you seen the CCS system?  It does that sort of thing. I borrowed pieces of that for the way I'm handling training requirements and class restrictions.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Controlling available classes via script?
« Reply #2 on: April 02, 2015, 05:55:07 am »


               

If you are just going to delevel them anyway, you could use LevelUpHenchman() (after giving enough XP to level up to the desired level).



               
               

               
            

Legacy_Verilazic

  • Sr. Member
  • ****
  • Posts: 263
  • Karma: +0/-0
Controlling available classes via script?
« Reply #3 on: April 02, 2015, 01:20:07 pm »


               


You can do it by catching it in the onlevelup event. You'd need to de-level them if they chose a class that was not available. Since that's the case you'd want to have a way to tell them what they are allowed to pick to keep the frustration down.   Have you seen the CCS system?  It does that sort of thing. I borrowed pieces of that for the way I'm handling training requirements and class restrictions.




 


I hadn't seen that before. I'll check it out, thanks. And I'm guessing that OnLevelUp() is called after the player finishes the levelup process, not at the moment they reach enough xp?


 




If you are just going to delevel them anyway, you could use LevelUpHenchman() (after giving enough XP to level up to the desired level).




 


You can use that on a PC? Iiiiinteresting.


               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Controlling available classes via script?
« Reply #4 on: April 02, 2015, 02:04:37 pm »


               

Yes. It happens after. That's one drawback. That's why I was suggesting you make it clear somehow what classes are allowed. In CCS if the player levels up in a class not trained in it delevels with a message so he/she can try again.



               
               

               
            

Legacy_Verilazic

  • Sr. Member
  • ****
  • Posts: 263
  • Karma: +0/-0
Controlling available classes via script?
« Reply #5 on: April 03, 2015, 02:30:50 pm »


               

I'll do that. I'm doing weird specific stuff with this module, so it's no big deal to add one more explanation for the player. Thanks!