Jump to content

Scripting and Character level


wolpak

Recommended Posts

Does anyone know how the game resolves character level and scripting?

 

IE, let's say I want something to occur at level 2

 

IF
CheckStatGT(Player1,2,LEVEL)
THEN
RESPONSE #100
Blah Blah Blah
END
How is this managed with multiclass and dual class? Are they considered cumulative? Does this just check the first class? Does LEVEL2 refer to the second class and LEVEL3 the third?
Link to comment

Does anyone know how the game resolves character level and scripting?

 

IE, let's say I want something to occur at level 2

 

IF

CheckStatGT(Player1,2,LEVEL)

THEN

RESPONSE #100

Blah Blah Blah

END

 

How is this managed with multiclass and dual class? Are they considered cumulative? Does this just check the first class? Does LEVEL2 refer to the second class and LEVEL3 the third?

The "GT" stands for "Greater Than" in that, and so everything that happens in that script happens only after level 3 and and up. Of course you should also check and set a GLOBAL if you actually want to use that for a one time things.

And yeah, the multi'es and duals use the primary level of the character as the only factor in that calculation for the LEVEL. And second as the LEVEL2, and third on LEVEL3.

Link to comment

Thanks for the feedback. Yeah, I just put a snippet of code, I am aware of variables needing to be switched on.

 

A second question, one I'll look to test, but if someone already knows it:

 

0x40C3 XP(O:Object*,I:XP)
Returns true if the specified object has experience points equal to the number specified.

 

Is that total experience for MC and DC, or just primary class?

Link to comment

LEVEL ordering depends on the background multiclass name. So a fighter/mage and a mage/fighter will have the mage levels in the same stat.

 

XP for dc: current, for mc: total.

Link to comment

LEVEL ordering depends on the background multiclass name. So a fighter/mage and a mage/fighter will have the mage levels in the same stat.

 

XP for dc: current, for mc: total.

As far as I know, class.ids only has an entry for "FIGHTER_MAGE". I was under the impression that this meant that, for any class that is both only a fighter and a mage, fighter is class, and mage is class2. Is this assumption wrong? That is, for example, does dual class order matter?

 

Edit: I'm just thinking of bgee. Maybe in other games there is a mage_fighter in class.ids

Link to comment

 

LEVEL ordering depends on the background multiclass name. So a fighter/mage and a mage/fighter will have the mage levels in the same stat.

As far as I know, class.ids only has an entry for "FIGHTER_MAGE". I was under the impression that this meant that, for any class that is both only a fighter and a mage, fighter is class, and mage is class2.

 

You have to read the above again, but that's exactly what he actually said. Just using other words.
Link to comment

 

 

LEVEL ordering depends on the background multiclass name. So a fighter/mage and a mage/fighter will have the mage levels in the same stat.

As far as I know, class.ids only has an entry for "FIGHTER_MAGE". I was under the impression that this meant that, for any class that is both only a fighter and a mage, fighter is class, and mage is class2.
You have to read the above again, but that's exactly what he actually said. Just using other words.
Which: that it depends on the class.ids entry, or it depends on (eg) dual class order?

 

Edit: duh. I get it

Link to comment

I know there's an OriginalClass bit in the BG2 .CRE file. TobEx enables scripts to read it. (But alas, TobEx doesn't allow for scripts to edit it, and the EEs don't allow for scripts to read *or* write it.)

 

My understanding is, if your class is FIGHTER_MAGE and the OriginalClass bit is set to zero, the game knows you are multiclass. If the OriginalClass bit is set to a number corresponding to a class, then the game know a) that you are dual-class, and b) which class is 1st and which is 2nd.

Link to comment

There are several "original class" bits, but yes, you are correct.

 

Oh! Do you, perchance, know where they are? I found one near the "fallen paladin" and "fallen ranger" bits, but when I changed it on a character, it did not have the desired effect of switching him from multiclass to dual-class.

Link to comment

Oh! Do you, perchance, know where they are? I found one near the "fallen paladin" and "fallen ranger" bits, but when I changed it on a character, it did not have the desired effect of switching him from multiclass to dual-class.

.cre file format: 0x0010 4 (dword) :
  • bit 3 Original class was Fighter
  • bit 4 Original class was Mage
  • bit 5 Original class was Cleric
  • bit 6 Original class was Thief
  • bit 7 Original class was Druid
  • bit 8 Original class was Ranger
  • bit 9 Fallen Paladin
  • bit 10 Fallen Ranger
A multiclass char is indicated is by the absence of any of the "original class" flags being set.
Link to comment

Ah - by "there are several different bits" you meant different bits to set at the 0x0010 offset. Yeah, that's what I was working with. I rolled a multiclass fighter/mage PC, leveled up to 4/3, then opened the save file in NI and set the OriginalClass to fighter. Loaded up the save, gave myself some XP... and both classes kept leveling up. :(

 

Eh, this is a pipe dream anyway, that a modder or dev will create a Script Action that enables in-game conversion from MC to DC...

Link to comment

Did the char have everything required for a legal dualclass?

 

I'll just add the usual:

It would be easy for GemRB, but until there is a serious interest (like a mod wanting to use it), there's no point for us to add it. Too much unused stuff could creep into the engine if we had no minimal standards.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...