Jump to content

(and more questions) Don't want my NPC to initiate dialogue if PC is hiding in shadows


jastey

Recommended Posts

PDIALOG.2DA (or other 2da files if referenced in CAMPAIGN.2DA) kicks in whenever:

- NPC joins party (JOIN dialogue set)

- NPC is kicked from party (POST dialogue set)

- game is loaded and NPC is in party (JOIN dialogue set)

 

So generally SetDialog() should be only used on CREs outside the party. This way dialogue is not reset unless NPC joins the party.

You can overcome the second condition (e.g. if you want your NPC who left party in BG1 part appear in BG2 with the default dialogue - same as when he started in BG2) by either

a) if NPC leaves on his own with dialogue DO~LeaveParty() SetDialogue(theoneforBG2)

or if you have no contol over this (e.g.in a transition cutscene)

b) put something like this in the NPC override script which is read even if NPC is not (yet) in party: - covers the case where the exact starting location of NPC in BG2 is not determined

IF

Global("EndofBG1","Global",2)

Global("IamNewHere","Locals",0)

!InParty(Myself)

THEN

RESPONSE #100

SetGlobal("IamNewHere","Locals",1)

SetDialogue(theoneforBG2)

OtherResetStuffIfNeeded

END

Link to comment

How would I change a string in a .spl?

I made a spell to set Ajantis' name to "Sir Ajantis" in BGII and it's a modified copy from Anomen's. How do I change the string to "Sir Ajantis"? I tried something like

 

COPY ~AjantisBG2\bgt_eet_continuity\c#ajtle.spl~ ~override/c#ajtle.spl~
WRITE_ASCII 0x9e @33 //~Sir Ajantis~

 

But it doesn't compile.

Link to comment

How would I change a string in a .spl?

I made a spell to set Ajantis' name to "Sir Ajantis" in BGII and it's a modified copy from Anomen's. How do I change the string to "Sir Ajantis"? I tried something like

 

COPY ~AjantisBG2\bgt_eet_continuity\c#ajtle.spl~ ~override/c#ajtle.spl~

WRITE_ASCII 0x9e @33 //~Sir Ajantis~

 

But it doesn't compile.

An alternative?

I am using script instead of spell in my mod

SetName(@33)

 

PS - are you sure about the offset? In my version it would be 0xce

 

Anyway, I would use

WRITE_ASCII 0x9e ~Sir Ajantis~

Link to comment

Ah, if SetName does the same then I'll use that. The offset might be different because i deleted one of the effects of Anomen's spell (the change alignment). For my spell, it is 9eh.

Thank you!

 

Still, if anyone could answer how to edit the spell string so I'll know it in teh future, that would still be appreciated.

Link to comment

Ah, if SetName does the same then I'll use that. The offset might be different because i deleted one of the effects of Anomen's spell (the change alignment). For my spell, it is 9eh.

Thank you!

 

Still, if anyone could answer how to edit the spell string so I'll know it in teh future, that would still be appreciated.

WRITE_ASCII 0x9e ~Sir Ajantis~

 

I am no coding expert but I seem to remember that you cannot use tra reference in WRITE_ASCII, it would try to write @33 which it chokes on. Should not matter, as you probably would not translate that anyway.

Link to comment

Only in far away future for a possible Russion translation (which probably will never be done).

WRITE_ASCII 0x9e ~Sir Ajantis~ compiles but the spell in the game says "No such index" (StringRef #544368979) so I guess the syntax is wrong for this purpose, too. I'll use SetName.

Link to comment

I assume you're using opcode 103 or 290 to change his name or title?

 

In that case you can simply use SAY:

SAY 0x9e @33  // Sir Ajantis
It's equivalent to

WRITE_LONG 0x9e RESOLVE_STR_REF(@33) // Sir Ajantis
However, I would recommend to use ALTER_SPELL_EFFECT if you want to change an effect parameter dynamically to avoid using a wrong offset:

COPY ~AjantisBG2/bgt_eet_continuity/c#ajtle.spl~ ~override~
  LPF ALTER_SPELL_EFFECT
  INT_VAR
    match_opcode  = 103   // Change Name
    parameter1    = RESOLVE_STR_REF(@33)  // Sir Ajantis
  END
Link to comment

Archived

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

×
×
  • Create New...