Author Topic: Dual class not working  (Read 246 times)

Offline KTG

  • Jr. Member
  • **
  • Posts: 62
Dual class not working
« on: September 03, 2017, 09:53:25 PM »
The other day I played around a bit with DC, downloading the Village of Hommlet and the latest DC engine, 2.77.  I poked around a bit in the editor, but mostly, I was looking at character creation in the module.  I soon found what appears to be at least two issues with dual-classing (aka Change Class).  Being a complete noob to DC, I could be missing something, but when I tried it I found:
1. There were many options to change class to, several of which did not make sense.  It looked as if you could dual class to become various multi-class choices.
2. When I dual classed to one of the options that DID make sense, my character became a level 0 MU (I did pick MU) with 0 XPs.  When I tried to memorize spells, I had none.  When the party gained some XPs, that character still had 0.
The part that does work is that it recognizes human as the race that should get the Change Class option in a Training Hall.  Thinking it may be an old module built on an older version of the engine, I tried the same thing in the latest 2.77 version.  I copied the TemplateDesign.dsn to my own test module and duplicated the above situation with the same results.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: Dual class not working
« Reply #1 on: September 03, 2017, 10:05:49 PM »
The latest DC engine is 3.08.
http://dianneandpaul.net/UAF/DungeonCraft_308.7z

There are additional versions that have debugging
enhancements.  They won't hurt you but they worn't
help you either.

I have no idea whether any of the more recent versions
will help your problem.  I don't even understand your
problem (Because of my ignorance, not your description).
Therefore, we have no choice but to wait for Manikus to
return after Labor Day. 

I am happy that someone cares enough to report a problem.
Thank you.

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2170
    • Nol Drek's Web Site
Re: Dual class not working
« Reply #2 on: September 04, 2017, 12:52:13 AM »
I'm using editor 3.07 and Engine 3.14.

I just took a party of Humans into a training hall. Most of the characters could only change class to "$$Help". Two of them could change class to Cleric/Fighter, Cleric/Fighter/Magic-User, and other multi-class combinations. Changing class to Magic-User made them level 0 with 0 XP and no spells to memorize.

The two characters who were allowed to Dual Class did not have a 17 or 18 in the prime requisite of the target classes, which they should need, according to the AD&D rules.

Is there a script that handles "Change Class" in a Training Hall event or is this in the source code?
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1951
Re: Dual class not working
« Reply #3 on: September 04, 2017, 07:19:47 PM »
$$Help sounds like a useful class, particularly for a party that is short of cash ... did you try changing any of them to that class?

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2170
    • Nol Drek's Web Site
Re: Dual class not working
« Reply #4 on: September 04, 2017, 09:37:24 PM »
I did switch some characters to Dual Class $$Help. the class gets 11 Special Abilities, which sounds good except most of them are like the following:

Special Ability = Updates1_06,"added SA class_Sweep to Fighter, Paladin and Ranger classes"
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Dual class not working
« Reply #5 on: September 07, 2017, 12:49:32 PM »
There is no "change class" script. This appears to be one of those things that slipped through the crackss when we unburdened the engine with the baseclass/class databases.

I will look into this. No mini-mod required. ;)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Dual class not working
« Reply #6 on: September 19, 2017, 01:28:55 PM »
Paul has added a new Hook that allows for a script to control the list of classes that can be changed to. I've written a script to work with the new engine. I'm still testing it, so not quite ready for a "new as of engine 3.17 post", but thought that I would share it in case somebody else want to play with it. ;)

You need engine 3.17
http://www.dianneandpaul.net/UAF/DungeonCraft_317.7z
You also need editor 3.15
http://www.dianneandpaul.net/UAF/DungeonCraftEditor_315.7z

Now, add a new Special Ability called "ChangeClass".
Give this SA a script called "CanChangeToClass".
Enter the following code:
Code: [Select]
$VAR me; $VAR cls; $VAR cur; $VAR align;
$VAR STR; $VAR INT; $VAR WIS; $VAR DEX; $VAR CON; $VAR CHA;
me = $IndexOf($CharacterContext());cls = $GET_CHAR_CLASS(me);cur = $ClassContext();
STR = $GET_CHAR_LIMITED_STR(me);INT = $GET_CHAR_LIMITED_INT(me);
WIS = $GET_CHAR_LIMITED_WIS(me);DEX = $GET_CHAR_LIMITED_DEX(me);
CON = $GET_CHAR_LIMITED_CON(me);CHA = $GET_CHAR_LIMITED_CHA(me);
align = $GET_CHAR_ALIGNMENT(me);
// basic
$IF ($GREP("/",$ClassContext()) || $GREP("Help",$ClassContext()) || (cls == cur))
{$RETURN "N";};
// check of current prime req -> must be 15 or higher
$IF ((cls == "Cleric") && (WIS <# 15)) {$RETURN "N";};
$IF (cls == "Druid")
{$IF ((WIS <# 15) || (CHA <# 15)) {$RETURN "N";};};
$IF ((cls == "Fighter") && (STR <# 15)) {$RETURN "N";};
$IF ((cls == "Magic User") && (INT <# 15)) {$RETURN "N";};
$IF ((cls == "Paladin") && (STR <# 15)) {$RETURN "N";}; // CHA not checked as must be 17+
$IF (cls == "Ranger")
{$IF ((STR <# 15) || (INT <# 15) || (WIS <# 15)) {$RETURN "N";};};
$IF ((cls == "Thief") && (DEX <# 15)) {$RETURN "N";};
// check of proposed prime req -> must be 17 or higher
$IF ((cur == "Cleric") && (WIS <# 17)) {$RETURN "N";};
$IF (cur == "Druid")
{$IF ((WIS <# 17) || (CHA <# 17)) {$RETURN "N";};};
$IF ((cur == "Fighter") && (STR <# 17)) {$RETURN "N";};
$IF ((cur == "Magic User") && (INT <# 17)) {$RETURN "N";};
$IF (cur == "Paladin")
{$IF ((align != "0") || (STR <# 17) || (WIS <# 17)) {$RETURN "N";};};
$IF (cur == "Ranger")
{$IF ((STR <# 17) || (INT <# 17) || (WIS <# 17)) {$RETURN "N";};};
$IF ((cur == "Thief") && (DEX <# 17)) {$RETURN "N";};

When this script is worked out, I will tackle the issue with changing to a Magic User and not getting any spells. I suspect it is a script issue.

Of special interest to at least Steve, this script can easily be modified to show special class options for a setting such as Dragonlance. :D
This should also allow me to add the Thief-Acrobat as it was intended and may even be the start of the real solution to adding Bards...but will need to do some thinknig and testing.
« Last Edit: September 19, 2017, 01:30:33 PM by manikus »

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: Dual class not working
« Reply #7 on: September 19, 2017, 03:23:13 PM »
Now that I see what you have proposed, I think we
should re-think.

There should be two hooks:

CLASS/CanChangeToClass
CLASS/CanChangeFromClass

That would get rid of ALL those '$IF" statements
and five of six of the $GET_CHAR...() statements.

Eg:  to change to Cleric
Code: [Select]
$VAR me;
$VAR WIS;
me = $IndexOf($CharacterContext());
WIS = $GET_CHAR_LIMITED_WIS(me);
$IF (WIS <# 15) {$RETURN "N";};

To change from Fighter:
Code: [Select]
$VAR me;
$VAR STR;
me = $IndexOf($CharacterContext());
STR = $GET_CHAR_LIMITED_STR(me);
$IF (STR <# 17) {$RETURN "N";};

And the engine would call both.
« Last Edit: September 19, 2017, 03:25:02 PM by Paul R. Stevens »

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Dual class not working
« Reply #8 on: September 19, 2017, 04:20:45 PM »
Whatever you think is best.

Personally, I think it looks like more work to do a bunch of little scripts , declaring the same variable many times instead of once.

The other issue that comes to mind, and I can't tell what you are intending from your examples, would we then have a bunch of scripts since ther are only two Hooks? How would the event know to look at all of these new SAs? Would the event just look for all SAs that have the appropriate Hooks?

I am not trying to nix your idea, just pointing out what comes to mind. I can just copy-and-paste, so it is not really any extra work for me at all. :D


Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: Dual class not working
« Reply #9 on: September 19, 2017, 06:11:58 PM »
My vision:

Every class that allowed 'to' or 'from' changes
would have a Special Ability.  I would call it
'ChangeClass<class>'.  For example, "ChangeClassRanger".
I would not give such a Special Ability to '$$Help'.

The Special ability for Cleric, for example, would
have a script named 'CanChangeClassTo' and a script
named 'CanChangeClassFrom'.

That seems to make reasonable, intuitive sense.
Changing to or from a class is an ability of that class.
Cleric has ability "ChangeClassCleric" and bard has
ability "ChangeClassBard", etc.  The scripts are
very simple, easily understandable, and easy for a
newcomer to extrapolate into a newly defined class.

Now, when a fighter wants to change to a cleric, the
engine will first call any fighter's scripts named
'CanChangeClassFrom'("Cleric") and, if successful, will
call any cleric's scripts named 'CanChangeClassTo'("Fighter").
Notice the plural.....'scripts'.  You could have additional
Special Abilities (perhaps added temporarily during
gameplay) that would modify the ability to change class.
You cannot do that now.

And we would change the return parameter to be positive
("Y") instead of negative ("N") so that the absence of a
script implies a negative response (So $$Help is
automatically not legal).

Notice that the parameter (in parenthesis) is not used in
your scheme.  But I included it so that someone could
define more complex algorithms that might have restrictions
based on both the 'from' and 'to' classes.  Such 'class interactions'
would wind up extremely messy in the present scheme.
For example, a fighter could change to a ranger only if the
sum of the primary abilities is be 28 or more and only if the
fighter is at least 34 years old.  But he could change to a
Cleric without the age restriction.

Special Abilities are wonderful.  If you can wrap your head
around  them.  A challenge for me.

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: Dual class not working
« Reply #10 on: September 19, 2017, 06:47:58 PM »
Quote
bunch of little scripts

It is called 'factoring'.  Commonly thought of
as a good thing.

See:
https://en.wikipedia.org/wiki/Decomposition_(computer_science)

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Dual class not working
« Reply #11 on: September 19, 2017, 07:18:23 PM »
I was (as in the past tense) concerned about the naming of the SAs, since now we are required to use ChangeClass. IF there were required SA names for the new scheme, that would be a step in the wrong direction.

What you propose makes perfect sense to me, and I will be happy to write the scripts for when implemented.

As to the factoring, no arguing with that. Take my comment as snarky if you like, since you now were offereing short scripts after I had written a (relatively) long one. ;)

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: Dual class not working
« Reply #12 on: September 19, 2017, 07:41:09 PM »
I will have that (and the new colored font escape
character) tomorrow.  Thankfully, hooks are easy to
implement.  Easier to implement than to use, I bet.

AND.....

All those numbers.  They probably belong as parameters
in the SpecialAbility definition.  But I won't insist that it
is better that way.

Also, I notice that your script does not make any checks
for character alignment or race.
« Last Edit: September 19, 2017, 07:46:21 PM by Paul R. Stevens »

Offline Paul R. Stevens

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2229
Re: Dual class not working
« Reply #13 on: September 19, 2017, 10:31:22 PM »
Engine Version 3.18 is released.
Documentation for Change Class hooks updated.

Neither the modified color escape character nor the
new Change Class Hooks are tested.

I have no idea how to document the escape character feature.

Offline manikus

  • Skriptor
  • Administrator
  • Hero Member
  • *****
  • Posts: 9809
Re: Dual class not working
« Reply #14 on: September 20, 2017, 12:31:54 PM »
Woot! I will get on testing this right away. After goind home yesterday, I re-did my script into many scripts in order to get ready for the new Hooks. I discovered that I indeed had missed multiple alignment requirements. There are no race references because in the defualt DC, only humans can change class and they can be all of the classes if their abilities scores and alignment allow it.

As for where to document the new escape character feature. Where do we document the current escape character? I will find out where we do that and get back to you, as that seems the likely spot.