Jump to content


Photo

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


24 replies to this topic

#16 Roxanne

Roxanne
  • Modders
  • 1179 posts
  • Gender:Not Telling

Posted 17 February 2017 - 08:08 AM

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


Edited by Roxanne, 17 February 2017 - 08:09 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#17 jastey

jastey
  • Gibberlings
  • 6632 posts
  • Gender:Female

Posted 14 March 2017 - 12:27 AM

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.



#18 Roxanne

Roxanne
  • Modders
  • 1179 posts
  • Gender:Not Telling

Posted 14 March 2017 - 01:09 AM

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~


Edited by Roxanne, 14 March 2017 - 01:17 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#19 jastey

jastey
  • Gibberlings
  • 6632 posts
  • Gender:Female

Posted 14 March 2017 - 01:32 AM

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.



#20 Roxanne

Roxanne
  • Modders
  • 1179 posts
  • Gender:Not Telling

Posted 14 March 2017 - 01:36 AM

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.


Edited by Roxanne, 14 March 2017 - 01:37 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#21 jastey

jastey
  • Gibberlings
  • 6632 posts
  • Gender:Female

Posted 14 March 2017 - 02:02 AM

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.



#22 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 5973 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 14 March 2017 - 04:44 AM

@jastey, are you sure it's not WRITE_ASCIIE, or just blarg...(WRITE_EVALUATED_ASCII)


Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.

Here's how to install all the stable mods you ever really could want to Infinity Engine games.


#23 jastey

jastey
  • Gibberlings
  • 6632 posts
  • Gender:Female

Posted 14 March 2017 - 08:39 AM

No, I'm not sure, that's why I'm asking. :)



#24 argent77

argent77
  • Modders
  • 639 posts
  • Gender:Male

Posted 14 March 2017 - 09:16 AM

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


#25 jastey

jastey
  • Gibberlings
  • 6632 posts
  • Gender:Female

Posted 14 March 2017 - 12:22 PM

Great! Thank you.





Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users