Jump to content

Area Interjection


MacMonkey

Recommended Posts

Posted

Hello,


Please help. I have looked at several NPC mods and I just can't figure out what I am missing...
I would like to have my NPC, the very first time she enters the dock district, say:
"I love the sea air. It reminds me of home."
I have a J file (in my dialogs folder) that reads:
IF ~Global("M2KarmaDocks","GLOBAL",1)~ THEN BEGIN M2KarmaDocks
SAY ~I love the sea air. It reminds me of home~
++ ~Would you like to tell me more?~ DO ~SetGlobal("M2KarmaDocks","GLOBAL",2)~ GOTO M2KarmaDocks1
END
IF ~~ THEN BEGIN M2KarmaDocks1
SAY ~Not right now.~
IF ~~ THEN EXIT
END
I have a .baf file (in scripts) that reads:
IF
InParty("M2Karma")
AreaCheck("AR0300")
Global("M2KarmaDocks","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("M2KarmaDocks","GLOBAL",1)
END
I then take my NPC to the docks for the first time, and no dialogue...What am I missing?
Please help.

MM
Posted

If the .cre runs the compiled .baf file, then I would just edit that to be this:

IF
 InParty("M2Karma")
 AreaCheck("AR0300")
 Global("M2KarmaDocks","GLOBAL",0)
THEN
 RESPONSE #100
  SetGlobal("M2KarmaDocks","GLOBAL",1)
  StartDialogueNoSet(LastSeenBy(Myself))
END

Not that I know exactly if that this actually correct... :p

Posted

You've got everything right; you're just missing the action to prompt your NPC to actually speak. Add a StartDialogueNoSet(Player1) to your action list in the script.

 

If your dialogue was in the banter file instead, you'd use Interact(Player1).

Posted

 

Hello,

Please help. I have looked at several NPC mods and I just can't figure out what I am missing...

I would like to have my NPC, the very first time she enters the dock district, say:

"I love the sea air. It reminds me of home."

I have a J file (in my dialogs folder) that reads:
IF ~Global("M2KarmaDocks","GLOBAL",1)~ THEN BEGIN M2KarmaDocks
SAY ~I love the sea air. It reminds me of home~
++ ~Would you like to tell me more?~ DO ~SetGlobal("M2KarmaDocks","GLOBAL",2)~ GOTO M2KarmaDocks1
END
IF ~~ THEN BEGIN M2KarmaDocks1
SAY ~Not right now.~
IF ~~ THEN EXIT
END
I have a .baf file (in scripts) that reads:
IF
InParty("M2Karma")
AreaCheck("AR0300")
Global("M2KarmaDocks","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("M2KarmaDocks","GLOBAL",1)
END
I then take my NPC to the docks for the first time, and no dialogue...What am I missing?
Please help.

 

MM

 

First, you need to add your joined dialogue to

APPEND ~pdialog.2da~

 

Unless your cre file only has the one single dialogue for your NPC

 

Second you need to add the dialogue to the game

BEGIN M2KarmaJ at the top of your dialogue file

 

 

Third

You miss the trigger to actually start the dialogue -

One way is to simply add

THEN
RESPONSE #100
IncrementGlobal("M2KarmaDocks","GLOBAL",1)
StartDialogueNoSet(Player1)
END

 

A far better way for the case that you have more dialogues planned is to add a dedicated block in your script to start the dialogues and that also checks that the dialogue can really trigger.

 

IF

OR(2) //or any other number of triggers you gather

Global("M2KarmaDocks","GLOBAL",1)

Trigger2 //Trigger3, trigger4 etc

!See([ENEMY])

See(Player1)

!StateCheck(Player1,CD_STATE_NOTVALID)

CombatCounter(0)

!StateCheck(Myself,CD_STATE_NOTVALID)

THEN

RESPONSE #100

StartDialogueNoSet(Player1)

END

 

Having two separete triggers and the additional conditions has the advantage that you do not miss a dialogue, e.g. when the party is ambushed while entering the docks or your NPC or PC is otherwise incapable to talk or another NPC's banter has triggered before...

Posted

First - Thank you so much to everyone that has responded. I really appreciate your time.

 

I have the APPEND ~pdialog.2da~ in my tp2 file with my other dialogue files, and the BEGIN M2KarmaJ at the start of my M2KarmaJ. - Thank you for having me confirm this, as I am sure it is a simple little thing I am missing.

 

I made the following changes:

 

The only way I could get the dialogue to only generate in the docks, was to move the checks to the J file...

 

IF ~Global("M2KarmaDocks","GLOBAL",0) InParty("M2Karma") AreaCheck("AR0300") ~ THEN BEGIN M2KarmaDocks
SAY ~I love the sea air. It reminds me of home~
++ ~Would you like to tell me more?~ DO ~SetGlobal("M2KarmaDocks","GLOBAL",1)~ GOTO M2KarmaDocks1
END
IF ~~ THEN BEGIN M2KarmaDocks1
SAY ~Not right now.~
IF ~~ THEN EXIT
END
This is now my .baf file with the StartDialogue
IF
InParty("M2Karma")
AreaCheck("AR0300")
Global("M2KarmaDocks","GLOBAL",0)
THEN
RESPONSE #100
IncrementGlobal("M2KarmaDocks","GLOBAL",1)
StartDialogueNoSet(Player1)
END

The result is that, if the Player "talks" to Karma (in the docks), she will say her stuff.

 

This is much better than before, but what I want to happen is that, when the party enters the docks, as long as Karma is in the party, she will say her stuff - without prompting.

 

I feel like my .baf file is not being read...any ideas?

 

Again, thank you so much for your time.

 

MM

Posted

First - Thank you so much to everyone that has responded. I really appreciate your time.

 

I have the APPEND ~pdialog.2da~ in my tp2 file with my other dialogue files, and the BEGIN M2KarmaJ at the start of my M2KarmaJ. - Thank you for having me confirm this, as I am sure it is a simple little thing I am missing.

 

I made the following changes:

 

The only way I could get the dialogue to only generate in the docks, was to move the checks to the J file...

 

IF ~Global("M2KarmaDocks","GLOBAL",1) InParty("M2Karma") AreaCheck("AR0300") ~ THEN BEGIN M2KarmaDocks
SAY ~I love the sea air. It reminds me of home~
++ ~Would you like to tell me more?~GOTO M2KarmaDocks1
END
IF ~~ THEN BEGIN M2KarmaDocks1
SAY ~Not right now.~
IF ~~ THEN DO ~SetGlobal("M2KarmaDocks","GLOBAL",2)~EXIT
END
This is now my .baf file with the StartDialogue
IF
InParty("M2Karma")
AreaCheck("AR0300")
Global("M2KarmaDocks","GLOBAL",0)
InParty(Myself)
!See([ENEMY])

See(Player1)

!StateCheck(Player1,CD_STATE_NOTVALID)

CombatCounter(0)

!StateCheck(Myself,CD_STATE_NOTVALID)

THEN
RESPONSE #100
IncrementGlobal("M2KarmaDocks","GLOBAL",1)
StartDialogueNoSet(Player1)
END

The result is that, if the Player "talks" to Karma (in the docks), she will say her stuff.

 

This is much better than before, but what I want to happen is that, when the party enters the docks, as long as Karma is in the party, she will say her stuff - without prompting.

 

I feel like my .baf file is not being read...any ideas?

 

Again, thank you so much for your time.

 

MM

See the red text above - and of course the script block must be in the override baf/bcs of your NPC.cre

Posted

I think you may have identified the problem.....

 

The script block must be in the override bas/bcf of your NPC.cre?

 

(Jargon may have been alluding to this earlier...)

 

Ok. I will now go back and attempt to modify my .cre, and fingers crossed that will alleviate my problem.

 

Thank you again for your help and patience. :)

 

MM

Posted

Ok...I set my .cre override, dialogue, death...

My character now works so much better! Thank you!

 

Unfortunately, I changed my .bas as above and still no luck. :(

 

Any other suggestions?

 

MM

Posted

Respawned the character, and it works perfectly!

 

Thank you so much for all the help. :)

 

MM

Changes on area files or, creature files do not affect saved games. The game loads areas and your party creatures from savegames. You need to respawn the cre or delete the area from your savegame. This is not the case for data that is read continously in game like scripts, items or dialogues.

Archived

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

×
×
  • Create New...