Jump to content


Photo

Chrysta technical help requests


  • Please log in to reply
14 replies to this topic

#1 Sir Kalthorine

Sir Kalthorine

    Order of Radiant Ugliness

  • Modder
  • 2188 posts

Posted 15 November 2002 - 12:50 PM

Note: Most of these problems are probably not WeiDU related - but there may be a WeiDU way of solving them, so I thought I'd be cheeky and ask here!

Time for a few more requests for technical help and assistance - most of which I am sure will have experienced modders banging ther heads against the nearest wall, as well as bringing forth choruses of "search the forums and read the tutorials / RTFM". Well I can promise that I have already tried doing all of that without much success, and so I am forced to reveal my ignorance in all its glory! :)

This thread is a repeat of the very same post I just put up on the "Chrysta forum" - apologies for being ultra-cheeky and asking here as well, but I am nothing if not persistent in asking for help! ;) Obviously I don't expect people to post answers here and in the Chrysta forum... in fact I would prefer there rather than here... but I am just trying to increase my chances of getting good help as much as possible. And everyone here is just so helpful!! (effective grovel, n'est pas?) :)

*sigh* well, here we go with the first coupla hiccups:

PROBLEM 1: Is there a way to easily restrict thieving skill points?

Chrysta will probably be a "tweaked" pure thief. At the moment I am restricting her thieving skills by applying a penalty (25% or 50%) to most skills, and artificially setting the points for "Pick Pockets" and "Detect Illusion" to zero. This is an imperfect solution though for a number of reasons:
  • The penalties are not "transparent", i.e. they are applied to the scores that appear on the character record screen, but NOT on the level-up screen - so a player cannot tell what their final scores are.
  • Players are not blocked from putting points in Pick Pockets and Detect Illusion, but the points don't count since the effective points score is then artificially set to zero.
  • The penalties are only applied to points invested by the player and not to innate bonuses (e.g. DEX & racial bonuses).
So what I would like to know is if there is a way to do either one (or preferably both) of the following:
  • Instead of a couple of the penalties, apply the reduced thief points per level restriction that an assassin has (i.e. 15 points on level up). The only problem is - I can't find where in the game the points are reduced! I assumed that it must be somewhere in the kit-related .2da files, but I am darned if I can find it! Can anyone help me out here?
  • Is it possible to completely "block" or even remove the Pick Pockets and Detect Illusion abilities? I have a horrible feeling that as she will be a thief kit this is a hard-coding problem I won't be able to circumvent, but I would really like to at least prevent people from putting (wasted) points into these abilities.
So, anyone got any ideas?

................................................................................................................

PROBLEM 2: How do I refer to custom spells in compiled game scripts?

I am going to be using a custom spell I have christened "Chrysta Title" (filename SPTITLE.SPL) to change the name of Chrysta's "class" to Nature's Assassin. I am doing it this way since I am now going to be giving Chrysta her various powers by scripting rather than designing an "proper" custom kit (for reasons given in other posts). The custom spell is designed (having found the relevant hex offset for the title name string by using Near Infinity) and copied over to the override directory by a standard WeiDU .tp2 file entry, i.e.
COPY ~Chrysta/SPTITLE.SPL~ ~override/SPTITLE.SPL~
SAY NAME1 ~Chrysta Title~
SAY 0x9E ~Nature's Assassin~
I then used Near Infinity to check the spell existed and had all the right strings in the right places. So I thought the next step would be easy, i.e. write a script entry to change the title:
IF
    !Global("TitleChanged","GLOBAL",1)
THEN
    RESPONSE#100
        ActionOverride(ApplySpellRes(Myself,"SPTITLE"))
        SetGlobal(("TitleChanged","GLOBAL",1)
END
But when I try to compile this using the TeamBG script editor and then decompile it to check all I get is:
IF
    !Global("TitleChanged","GLOBAL",1)
THEN
    RESPONSE#100
        ActionOverride(ApplySpellRes(Myself,0))
        SetGlobal(("TitleChanged","GLOBAL",1)
END
I have tried using "ReallyForceSpell(Myself,"SPTITLE")" instead and still a 0 reference to the spell.

So what am I missing here that is REALLY REALLY OBVIOUS??

................................................................................................................

PROBLEM 3: Chrysta is just WAY too eager to join the group!

A silly problem this, but at the moment the "ChJoin.bcs" script which acts as the Chrysta.CRE override script before she joins contains:
IF
    InteractingWith([PC])
    NumTimesTalkedTo(0)
THEN
    RESPONSE #100
    StartDialogue("CHRYSTA",Nearest([PC]))
END
I understood this to mean that Chrysta won't speak to a PC unless spoken to first. But EVERY TIME I start a game, even when there isn't any line of sight to a member of the party, she starts walking towards the party and initiates dialog. Whuhu?? I have also tried:
IF
    See([PC])
    Range(Nearest([PC]),5)
    NumTimesTalkedTo(0)
THEN
    RESPONSE #100
    StartDialogue("CHRYSTA",Nearest([PC]))
END
Again, she chases the party even from the other side of the dungeon until she catches up and starts a dialog. THIS WOMAN WON'T LEAVE ME ALONE!!! :D

But seriously... what might be going wrong here? The ChJoin script is compiling properly and is sitting in the override directory, and the Chrysta.CRE file has ChJoin.bcs listed as the override script (I have checked with Near Infinity).

................................................................................................................

I hope someone can shed some light on my teething problems. In the meantime, I will just sit here and whimper... :blink:

KACH_TS.jpg Chrysta... could helping her to uncover her past threaten your own future?

"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka


#2 -jcompton-

-jcompton-
  • Guest

Posted 15 November 2002 - 12:58 PM

For #3: Don't use NumTimes, it seems to be problematic in scripts. Use a flag.

IF
variable=0
See([PC])
THEN
RESPONSE #100
set variable=1
Dialogue([PC])

#3 Sir Kalthorine

Sir Kalthorine

    Order of Radiant Ugliness

  • Modder
  • 2188 posts

Posted 15 November 2002 - 01:05 PM

For #3: Don't use NumTimes, it seems to be problematic in scripts. Use a flag.

IF
variable=0
See([PC])
THEN
RESPONSE #100
set variable=1
Dialogue([PC])

This is probably a really stupid question... but can I assume that if a variable has not been used previously in the game and a script checks its value, then if that particular variable is unnamed or not specified then it is assumed to be 0 (FALSE)?

In other words, do I have to bother to set all the variables I am going to use to zero at the start of the game?

KACH_TS.jpg Chrysta... could helping her to uncover her past threaten your own future?

"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka


#4 cirerrek

cirerrek
  • Member
  • 193 posts

Posted 15 November 2002 - 03:44 PM

1) Can your give Chrysta an undroppable item that reduces some of her thieving skills to zero? Something like Imoen's belt?

2) Uhm, I think you have the object and the spell name turned around

160 ApplySpellRES(S:RES*,O:Target)

3) I am pretty sure that a variable that hasn't been set is considered to be zero

You can IncrementGlobal("variablename","AREA", #) or DecrementGlobal("variablename","AREA",#) or SetGlobal("variablename","AREA",#) to get it to whatever you like.

Thanks,
Cirerrek

#5 -jcompton-

-jcompton-
  • Guest

Posted 15 November 2002 - 04:15 PM

Yes, any not-currently-defined variable is assumed to be zero. Similarly, a timer that has not yet been defined is considered to be _not expired._

If you mod PST, you have to set up all of your variables ahead of time in the VAR.VAR file, but not so for the other games.

#6 -Ghreyfain-

-Ghreyfain-
  • Guest

Posted 15 November 2002 - 04:45 PM

Actually, there is no DecrementGlobal(), just do IncrementGlobal() with a negative number.

#7 -Ghreyfain-

-Ghreyfain-
  • Guest

Posted 15 November 2002 - 04:52 PM

IF
    !Global("TitleChanged","GLOBAL",1)
THEN
    RESPONSE#100
        ActionOverride(ApplySpellRes(Myself,"SPTITLE"))
        SetGlobal(("TitleChanged","GLOBAL",1)
END

But when I try to compile this using the TeamBG script editor and then decompile it to check all I get is:
IF
    !Global("TitleChanged","GLOBAL",1)
THEN
    RESPONSE#100
        ActionOverride(ApplySpellRes(Myself,0))
        SetGlobal(("TitleChanged","GLOBAL",1)
END
I have tried using "ReallyForceSpell(Myself,"SPTITLE")" instead and still a 0 reference to the spell.

So what am I missing here that is REALLY REALLY OBVIOUS??


The first block should be:

IF
!Global("TitleChanged","GLOBAL",1)
THEN
RESPONSE#100
ActionOverride(Myself,ApplySpellRES("SPTITLE",Myself) // Check ACTION.IDS to see how to arrange these things. ApplySpellRES() requires the spell filename first, then the target. ActionOverride() requires a target to override, then the action to execute. As it was, you were telling "ApplySpellRes()" to execute an action.
SetGlobal(("TitleChanged","GLOBAL",1) // Watch out for double brackets.
END


PROBLEM 3: Chrysta is just WAY too eager to join the group!


You don't need to add anything to her script for her to stand still and do nothing. In her dialogue file you'd have the condition NumTimesTalkedTo(0) though.

As for the thieving skill points thing, I am totally clueless.

Edit: This quoting system is really funky.

#8 Chaos Incarnate

Chaos Incarnate
  • Member
  • 1 posts

Posted 15 November 2002 - 05:31 PM

If you mod PST, you have to set up all of your variables ahead of time in the VAR.VAR file, but not so for the other games.

Yes, that's what I'm currently doing: adding new variables to VAR.VAR and writing dialogue.

#9 cirerrek

cirerrek
  • Member
  • 193 posts

Posted 15 November 2002 - 05:48 PM

Whoops, you are correct, Ghreyfain. There is no DecrementGlobal(), sorry about the disinformation.

Cirerrek

#10 Sir Kalthorine

Sir Kalthorine

    Order of Radiant Ugliness

  • Modder
  • 2188 posts

Posted 16 November 2002 - 12:36 AM

Thanks for all the help team! Status:

Problem 1: No real joy - I can set Pick Pockets & Detect Illusion scores to zero, but I really wanted a way to block/remove the skills completely. As far as reducing thief points scores is concerned, it looks like I will have to start Chrysta as an assassin to get the "only 15 points per level" thing working, since no one really knows how that is implemented!

Problem 2: Solved!! Thanks for all the help!

Problem 3: Still annoying me loads. The darn girl just won't stay put! Maybe I am using the wrong scripts... I have to say I am rather confused about all the different script names available. Just what IS the difference between all these:
  • Override Script
  • Class Script
  • Race Script
  • General Script
  • Default Script
and, more importantly, when does each come into play and which has priority... particularly when an NPC first joins?

KACH_TS.jpg Chrysta... could helping her to uncover her past threaten your own future?

"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka


#11 hlidskialf

hlidskialf

    Incarnation of the Eternal Ale Warrior

  • Modder
  • 2510 posts

Posted 16 November 2002 - 06:45 PM

Thanks for all the help team! Status:

Problem 1: No real joy - I can set Pick Pockets & Detect Illusion scores to zero, but I really wanted a way to block/remove the skills completely. As far as reducing thief points scores is concerned, it looks like I will have to start Chrysta as an assassin to get the "only 15 points per level" thing working, since no one really knows how that is implemented!

Problem 2: Solved!! Thanks for all the help!

Problem 3: Still annoying me loads. The darn girl just won't stay put! Maybe I am using the wrong scripts... I have to say I am rather confused about all the different script names available. Just what IS the difference between all these:

  • Override Script
  • Class Script
  • Race Script
  • General Script
  • Default Script
and, more importantly, when does each come into play and which has priority... particularly when an NPC first joins?

The differences between the different scirpts it priority. Override script takes precedence over Class, Class over Race, etc...
Make sure that your cre doesn't have any other scripts assigned except the ones you want set.

The great wolf Fenrir gapes ever at the dwelling of the gods.


#12 Dyara

Dyara
  • Member
  • 262 posts

Posted 17 November 2002 - 12:45 AM

Problem 1: No real joy - I can set Pick Pockets & Detect Illusion scores to zero, but I really wanted a way to block/remove the skills completely. As far as reducing thief points scores is concerned, it looks like I will have to start Chrysta as an assassin to get the "only 15 points per level" thing working, since no one really knows how that is implemented!

I´ve asked someone who has written more than hundred kits for BG2, some of these were thief kits with the same problem. He said there´s no way to block or remove the skills. All you can do is to tell the player that he shouldn´t put points in these skills.

#13 Sir Kalthorine

Sir Kalthorine

    Order of Radiant Ugliness

  • Modder
  • 2188 posts

Posted 17 November 2002 - 08:02 AM

The differences between the different scirpts it priority. Override script takes precedence over Class, Class over Race, etc...  Make sure that your cre doesn't have any other scripts assigned except the ones you want set.

Thanks - that was the problem! A rogue "DPLAYER3.BCS" in the default script slot was the culprit - now happily solved! :)

I´ve asked someone who has written more than hundred kits for BG2, some of these were thief kits with the same problem. He said there´s no way to block or remove the skills. All you can do is to tell the player that he shouldn´t put points in these skills.

Cheers Dyara - I feel a lot better now I know I haven't missed something obvious! I don't mind going with my current solution provided there isn't a better one...

Now on with the dialog-writing. Shouldn't take long :blink: LOL!

KACH_TS.jpg Chrysta... could helping her to uncover her past threaten your own future?

"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka


#14 -Ghreyfain-

-Ghreyfain-
  • Guest

Posted 17 November 2002 - 10:10 PM

The differences between the different scirpts it priority. Override script takes precedence over Class, Class over Race, etc...  Make sure that your cre doesn't have any other scripts assigned except the ones you want set.

Thanks - that was the problem! A rogue "DPLAYER3.BCS" in the default script slot was the culprit - now happily solved! :)


You should also note that DPlayer3.bcs is automatically assigned to player-made PCs, and DPlayer2.bcs is assigned to anyone who joins the party in-game. All others are removed, with the exception of the Override slot.

So while Chrysta is out-of-party she may use InitDlg.bcs in the Race slot to initiate dialogue, Chrysta.bcs as her override script, and WTASight.bcs in the Default slot, just as a generic "if you attack me I'll attack you" script.

#15 Sir Kalthorine

Sir Kalthorine

    Order of Radiant Ugliness

  • Modder
  • 2188 posts

Posted 19 November 2002 - 06:09 AM

Thanks for all the help team! My lack of modding experience has made me feel very much like the new kid on the block - and you've all been amazingly helpful!

KACH_TS.jpg Chrysta... could helping her to uncover her past threaten your own future?

"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka