Jump to content

MyNPC [CD_STATE_NOTVALID]


Harutsune

Recommended Posts

Dialogues and their cases seem to be more complicated than german grammars sometimes.. or confusing at least. ;)

I simply want to cut off a certain dialogue (entry to CC cellblock) I interjected into, so I use INTERJECT since I_C_T has been invented to prevent injectors from taking over the action - wrong thought it seems to me..: ;)

 

INTERJECT GUARD3 0 zellentrakt

== HaruJ IF ~IsValidForPartyDialogue("Haru")~ THEN

~Aus dem Weg, dreckiger Sklavenhalter!!~ DO ~EquipMostDamagingMelee()Attack("guard3")~

END

 

With his interjection comes the wellknown bunch of replies instead of an instant attack - why would I have to do it, and ;) why?

That's not true actually, I_C_T has been created so the dialogue wouldn't skip other interjections, however every type of interjection will continue the dialogue unless you end it from the talker's side. Also I don't think it's a good idea to hijack the very first line of dialogue, I'm not even sure how the game would handle that. My suggestion is that you do a normal dialog chain like this:

 

IF ~Global("HaruSeeSlaver1","LOCALS",0)
See("guard3")
IsValidForPartyDialogue("Haru")~ THEN HaruJ slaverchain
~Out of the way, filthy slaver!~
DO ~SetGlobal("HaruSeeSlaver1","LOCALS",1)~
== GUARD3
~What is this, who are you?!~
== HaruJ
~We don't have to answer to your kind, our blades will do the talking from this point forth!~ DO ~EquipMostDamagingMelee()
Attack("guard3")
ActionOverride("guard3",Enemy())~
EXIT

Or something to that effect so that you skip that dialog completely. If you wanted the dialog to start even if the NPC isn't close by you could start by extending the guard's dialog instead of the NPC's.

Link to comment

This situation has no room for a second dialog cause it's way too narrow at the end of the bottleneck which Copper Coronet Cellars are. When player1 opens the door there's only Hendak in a cell on the far side, the guards won't move til the group enters. The guard-initiated dialogue will end in violence, no way out of this. The person I'm doing here is very excited atm cause he, being a former pitfightslave, has got the smell of slavery in his nose, better don't stand in his way... :)

So I'll put a line to the guard that makes him go hostile, ok? ;)

 

The problem I'm actually working on is the beastmaster's key. As soon as the group possesses it, he will take it (done with code from Yasraena's swords) and move to Hendak's celldoor, free him and hurry to the CC mainroom to help the gladiators win the fight. I'm going to try this the same way I solved the vicci-on-a-stake-situation capturing the triggers after opening the door. Wish me luck, please... ;)

 

 

edit:

I got it working until the point where he takes the key another partymember retrieved from the beastmaster's corpse. Then I want him to go to Hendak's door and open it but he does't even try..:

 

IF

HasItem ("MISC4Z",Myself)

GLOBAL("Haru_Hendak_Key","LOCALS",3)

THEN

RESPONSE #100

MoveToPointNoInterrupt([2630.582]) // Hendak's celldoor

OpenDoor("DOOR09")

DisplayStringHead("Haru",~Willkommen zurück in der Freiheit, mein Freund...~)

SetGlobal("HendakReleased","AR0406",2) // from Hendak's script

SetGlobal("Haru_Hendak_Key","LOCALS",4)

END

 

Tried to find some info about MoveToPoint but I failed, are there rules I have to consider? I remembered a similar issue with Morrowind-scripting where I had to make him go to a point he can actually see, but setting it up like that didn't work either.

Strange, in the very beginning the vars were not set up correctly so he took the key as soon as the beastmaster died, but then he moved (MTO Hendak). Since I corrected the script I can try what I want, he never moved again... :)

So what did I overlook?

 

 

edit:

So I got him to go to the door, seems 'ActionOverride' was my friend this time. But there's a big flaw which I absolutely can't understand: Normally in the second block I'd have to ask for 'Global("Haru_Hendak_Key","LOCALS",3)', but if I do (and I did it long time) nothing happens after he got the key. Seems the var has not been set to '3', so I tried 'GT:1' just to check if it is set at all, and it worked.. since the condition will never come false I set the var back to zero, the only issue left is that he'll take the key back if someone would take it, who would ever..? :D Looks like the first block does only one of three things: it gives the item, but the var is not set and the DSH is not shown.

So, what am I doing wrong here, what did I miss to learn about 'SetGlobal'?

 

(above is Yasraena's script checking for item-possession)

IF

Global("Haru_Hendak_Key","LOCALS",2)

!HasItem("MISC4Z",Myself)

THEN

RESPONSE #100

GiveItemCreate("MISC4Z","Haru",0,0,0)

SetGlobal("Haru_Hendak_Key","LOCALS",3)

DisplayStringHead("Haru",~Her mit dem Schlüssel, das werde ich regeln - mir nach!!~)

END

 

IF

HasItem ("MISC4Z",Myself)

GLOBALGT("Haru_Hendak_Key","LOCALS",1)

THEN

RESPONSE #100

ActionOverride("Haru",MoveToPointNoInterrupt([2630.582])

SetGlobal("Haru_Hendak_Key","LOCALS",4)

END

 

IF

HasItem ("MISC4Z",Myself)

GLOBAL("Haru_Hendak_Key","LOCALS",4)

THEN

RESPONSE #100

SetGlobal("Haru_Hendak_Key","LOCALS",5)

Activate("DOOR09")

DisplayStringHead("Haru",~Willkommen zurück in der Freiheit, mein Freund...~)

SetGlobal("HendakReleased","AR0406",2)

SetGlobal("Haru_Hendak_Key","LOCALS",0)

END

 

And now he stands there in front of the door, the key in his pocket, he *could* free the slaves now. I'm pretty certain door09 is the door in question, cause it is asked to be open by Hendak before he sets his var 'HendakReleased' to '2'. Neither 'Activate' nor 'OpenDoor' worked, so I'm out of vocabulary again, or ideas... ;)

Link to comment

First of all, what is the script in question? An area script? An override script? A default script? I think OpenDoor() only works in area scripts or cutscenes, I've never actually used this though, you could try with UseDoor() if it makes any difference or try using Unlock() first. Also since this is a rather delicate situation where you don't really want the other characters to interfere, it should be made into a cutscene anyway. Don't use caps for commands, while I don't think there's a difference between "Global" and "GLOBAL", you should use the proper form anyway and if this is an area script, using "LOCALS" will not work in the same way as in a creature script.

Link to comment

It's the NPC's override-script (and it's assigned of course).

 

I absolutely know I'm a IE-modder-noob and so I'll try to avoid too much manipulation of other files, so if something fails it's just this npc, not a map I destroyed or such (learnt it the hard way with chapter-confussion at cemetery). I want everything (at last) but suck... ;)

 

Meanwhile I tried this combo:

 

Unlock("Door09")

Activate("Door09")

OpenDoor("DOOR09")

 

..with the alltime-result, he just stands there (with the good side-effect that he blocks Hendak from leaving the cell, so the party can follow before he attacks Lehtinan - and the door can still be opened the usual way). Do you have any idea why the first scriptblock above does't work? They are all clones (no, I'm not writing-lazy, just paranoid of mistakes). ;)

 

For Morrowind was an ini-command available that let the focus display a tooltip of anything it was pointed to, I learnt to love this function - is there something similar available for BG? I'd really like to let the map show which door it is... ;)

Link to comment
Unlock("Door09")

Activate("Door09")

OpenDoor("DOOR09")

 

Do you have any idea why the first scriptblock above does't work?

Well for one, Activate() has nothing to do with doors, it simply activates an object which makes it clickable. Two, I'm almost 100% sure that OpenDoor() can not be used in character scripts that way, if it were possible then that should work (maybe you could try with ActionOverride())

 

In either case, do yourself a favor and write a cutscene. Once you kill the guard with the cell key, start the cutscene from the script or the dialog and then make a cutscene script like this:

IF
True()
THEN
RESPONSE #100
	CutSceneId("HaruDoor")
	ActionOverride("Haru",Unlock("Door09"))
	ActionOverride("Haru",OpenDoor("Door09"))
	SetGlobal("HaruUnlockedDoor","GLOBAL",1)
	Wait(5)
	EndCutSceneMode()
END

Link to comment

I'm playing the game (with mods) and practice things I've learnt, interjecting now and then. But there's a thing other mods tought me unexpectedly: it's very easy to make a mod sucking.. so I rolled back and deleted 60% of my mods content because it was not *nessecary* for his char-development, feels much better now (not being considered sucking). ;)

 

New questions:

1. There are dialogues I *have* to I_C_T, just dropping a comment; but often there are the same speeches with different phrase-numbers covering different conditions like a certain NPC is present or the way the group handled things. So if I want him to I_C_T for sure I have to code two or three I_C_Ts in a row just to cover those two or three conditions.. do I have to? Or is there a way to 'batch' this by using 'OR' or such?

 

2. I try to be *very* carefully cause I'd really hate being responsible for destroyed content (regular or modded). But for the second stage of this mod, the quest, I'll need to spawn a messenger, I'd really like to avoid area-appends if possible. Can I spawn the messenger from my NPCs script or *must* this be in an area-script?

Link to comment
So if I want him to I_C_T for sure I have to code two or three I_C_Ts in a row just to cover those two or three conditions.. do I have to? Or is there a way to 'batch' this by using 'OR' or such?
I_C_T statements behave like CHAINs, I don't think you can make OR blocks in those but you can define conditions next to dialogue, that might prove to be more tedious to do than several I_C_Ts however.

 

Can I spawn the messenger from my NPCs script or *must* this be in an area-script?
You can if you really must but it's more complicated than just appending to an existing script. It's not like you can screw something up by doing so, you can always restore the backup if something should go terribly wrong.
Link to comment
So if I want him to I_C_T for sure I have to code two or three I_C_Ts in a row just to cover those two or three conditions.. do I have to? Or is there a way to 'batch' this by using 'OR' or such?
Successive I_C_Ts are the best/simple way to do this. If you for some reason *really* need the choices to be complicated, or add an entire new set of discussions, the way out is to I_C_T and EXTERN on it, so you end up going to a separate state where something like this happens:

 

CHAIN ~myNPCdialogue~ AddedStateWithChoices

~My NPC's initial start of the response~

== ~myNPCdialogue~ IF ~condition1~ THEN ~reply1~

== ~myNPCdialogue~ IF ~condition2~ THEN ~reply2~

== ~myNPCdialogue~ IF ~condition3~ THEN ~reply3~

END

 

and then either tie it back into the original state or terminate it, breaking the old state. Basically, you are creating a variant of MultiSay, where each line is tailored to conditions already set.

 

Can I spawn the messenger from my NPCs script or *must* this be in an area-script?

Area-script is the traditional way to do this, but if you don't mind lading down your NPC script, you actually can have the encounter spawn from the NPC script. A quick example:

 

Added to Garrick's .BCS by BG1 NPC:

/* Garrick Quest encounters */
IF %BGT_VAR%
AreaCheck("%NashkelCarnival%")
Global("X#ArchiSpawn","GLOBAL",0)
CombatCounter(0)
!See([ENEMY])
InMyArea(Player1)
!StateCheck(Myself,CD_STATE_NOTVALID)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
CreateCreature("X#GARAR",[2600.3300],1)
SetGlobal("X#ArchiSpawn","GLOBAL",1)
END

 

%BGT_VAR% can be ignored, it is a blank variable on Tutu, and an active variable that makes sure that this block does not run if for some reason Garrick is made active in the BG2 portion of a BGT game.

 

%NashkelCarnival% is just a variable that is replaced with either the FW or the AR values, dependent on Tutu or BGT install.

Link to comment

Thx for that script (or the 'yes it works'), very nice to know. ;) The reason is I'd like to trigger an encounter area-independent, but appending a script to *every* area seems to be.. tedious(?), and it's a source for errors. So if MyNPC is able to spawn whom-ever I won't screw up any other content, and my mod can't be screwed by others of course (my actual mega-mod-inst. *is* so screwed, even Biowarista end up having 'no valid links or replies', ;) it's a good time to be a little paranoid).

 

I_C_T:

I must confess I do not understand this, seems I am misunderstood, let's look at an example:

Chapter 3, Bodhi's guild is destroyed so we go to Aran to fulfill the contract, he takes us to the docks where we meet Saemon Havarian. So if you look at Saemon's dialogues using InfExlorer and expand all his lines you'll see that he says the same sentence thrice on three different conditions.

If you adventured 'normal' the target-speech has phrase-number 69

If you sided with Bodhi he will say the same but as phrase-number 78

And if a certain NPC is present this phrase will be number 92 (the situation and numbers are all fantasy)

 

MyNPC shall drop one single comment without breaking anything, I'm *not* planning something complicated it's just I've encountered a possibly complicated situation and ask if I can spare some code by stacking the three conditions, for example like this:

I_C_T PPSAEM 69,78,92 mynpc_comment ;)

 

(beg your pardon again for my horrible english)

Link to comment

I think you are right, Skye; I have never seen it used any other way. Then again, this might be something for you to test out, Harutsune. While I have only seen this kind of thing,

I_C_T2 ~%tutu_var%CYTHAN~ 1 X#SharCythandria2
== ~%SHARTEEL_JOINED%~ IF ~InParty("sharteel") InMyArea("sharteel") !StateCheck("sharteel",CD_STATE_NOTVALID)~ THEN @56
END

I_C_T2 ~%tutu_var%CYTHAN~ 0 X#SharCythandria1
== ~%SHARTEEL_JOINED%~ IF ~InParty("sharteel") InMyArea("sharteel") !StateCheck("sharteel",CD_STATE_NOTVALID)~ THEN @57
END

I_C_T2 ~%tutu_var%MARL~ 2 X#SharMARL1
== ~%SHARTEEL_JOINED%~ IF ~InParty("sharteel") InMyArea("sharteel") !StateCheck("sharteel",CD_STATE_NOTVALID)~ THEN @58
END

I_C_T2 ~%tutu_var%MARL~ 1 X#SharMARL2
== ~%SHARTEEL_JOINED%~ IF ~InParty("sharteel") InMyArea("sharteel") !StateCheck("sharteel",CD_STATE_NOTVALID)~ THEN @59
END

 

the official ReadMe for WeiDU sys

 

INTERJECT_COPY_TRANS entryFilename entryLabel globalVariable chainText list

 

I am not sure what "list" means...

 

it might very well be that you could add the same state to several others. Please let me know if it works - I could really use this kind of shortcut, too.

Link to comment

@ Skye

I wasn't *full* of hope, just an idea - maybe something to mention for Mr. Weimer if he's out of ideas what to add.. :D

 

@ cmorgan

I don't understand the code you provide, or to be exact, what the shortcut is. I want to inject into three different d-states (which have the same content) with just on comment. Imagine the comment is pretty large (2k chars), so one ict would take about two pages in your editor - only because I have to make three 'full' ict, instead of making one that fits all three states (and possibly points to the content..). btw. the state-numbers you provide are very surreal atm cause I'm far from traing now (in fact I'm not willing to publish this before finishing the very next walkthru.., erm and *then* I'll give my quest a try..). ;)

So please don't worry if such is not possible, it was just a question about what is possible, I'll keep my comments short enough - and that's it... ;)

 

PS: Thank you for your Crimson Editor Highlighting - it takes some time to setup, but if it's working.. yeah!! Until now I've done one correction: one of the 'select_common' for tp2 was missing. For the future I plan (if I make a clean BG2ToB-install) to add the keywords for all standard .dlg-filenames. ;)

 

Another question (for close future usage):

- Walking thru spellhold-lab atm I'm thinking about Ust Natha - being a former pitfighterslave he will have to refuse fighting the pits in UN - howto do that?

 

- How do I ask for things the player can use? I'd really like to comment 'Al Bundy's Dream Machine' in SH-lab, but don't have no idea howto.

Link to comment
@ cmorgan

I don't understand the code you provide, or to be exact, what the shortcut is.

Sorry - ignore the code above. I was showing that right now we just do it one at a time. But you should try out the idea you had, and test it - the WeiDU ReadMe says that it should be able to take a "list", which could be a "list" of different states to I_C_T into, I think - so your idea might work.

 

PS: Thank you for your Crimson Editor Highlighting - it takes some time to setup, but if it's working.. yeah!! Until now I've done one correction: one of the 'select_common' for tp2 was missing. For the future I plan (if I make a clean BG2ToB-install) to add the keywords for all standard .dlg-filenames. ;)

 

That's strange - it should already have that. Here are my personal versions, and I know they do have it in place - perhaps it is time to update it. These versions include area names, DVs, dalogue files, etc. for Tutu, BG2, and BGT. It also includes most mod-added dvs, etc, so that you can tell if you are accidentally using one defined by other folks in another mod. The .KEY files only are here, plus a .clr file if you want an immediate separation of BG2 and Tutu and BGT resources by color.

 

 

 

Anything you do find not covered, please let me know, and I will add it!

Link to comment

Thank you for providing some hope my idea 'could' work at last - but I fear I'm not one of those being able to test it, still a N00b ;) . I'm *so* happy I've found a style of securely working code, but still shaking like hell on every minor change if it might work too - sorry, but I promise to be more helpful.. ..'later'... ;)

 

CE_HL

I copied yours over mine - not much of a difference on my present code, still missing d-HL for Hendak, Tolgerias, Firkraag etc. which are still plain text atm. I tried to generate a list from my safe-copy's override, but there are only 400+ .dlg-files, so I took a look at WeiDU's mass-exporter with no success.. 'weidu *.dlg' doesn't work, weidu complains about the asterix. If I had a list of .dlg-files I could make the command manually, but since the purpose of this is to get the list...

 

So if I were told how to make WeiDU's mass-exporter work I'd do it and provide the new content tomorrow (with a billion underscores of course). ;)

Link to comment

OH! I see - you mean the ingame nonjoinable cast of characters! No, there isn't anything like that. I left those out, as I have moved to crossplatform variables for Tutu, where most of my modding has been. No point in creating a bunch of %TUTU_VAR%TOLGER %TUTU_VAR%Tolger %TUTU_VAR%tolger entries when only I am going to use them. I will take a look, though; perhaps it is a good addition to make, now that I have started up on the BG2 side of things. Let me see what I can do.

 

Currently it is mod added Joinable NPCs and joinable NPCs only.

Link to comment

Archived

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

×
×
  • Create New...