General mod Questions thread
System
Administrator Posts: 199
Hello, ladies and gentlemen.
We have decided to merge several threads about different modding questions into one thread. This way you'll be able to find all the needed information in one place.
- Site staff
We have decided to merge several threads about different modding questions into one thread. This way you'll be able to find all the needed information in one place.
- Site staff
Post edited by JuliusBorisov on
1
Comments
Is there an example or a tutorial on changing NPC's existing dialogues? I can pass them through a D and just rewrite-replace them, but I'd rather extend them with my own states etc.
EXTEND_TOP filename stateLabel list [ #positionNumber ] transition list END
But the description of this function does not make any sense to me.
APPEND ~dialog file name~ IF ~returning from Underdark~ THEN BEGIN Chap6NewTalk SAY ~It's good the guild war has stopped~ IF ~~ THEN REPLY ~You can thank me~ GOTO thanks IF ~~ THEN REPLY ~I don't care~ EXIT END END // for APPEND
EXTEND_TOP and EXTEND_BOTTOM allow adding a reply at a given state.
Other kinds of alterations use ALTER_TRANS for fixing or changing the way a reply is coded.
If you have a look at a mod like BG2 Fixpack you'll find a lot of examples of how to change a dialog in order to fix bugs in it, for instance.
Currently I'm getting a fatal parse error if I put this in my tp2: I'd prefer to add both new states at once, too.
You probably need to write your dialog code in a file that you have to pass as argument to COMPILE. You could create a temporary file from the tp2 file for that purpose, if you really don't want to make a permanent d file. This way is described in the WeiDU documentation : look for "<<<<<<<< fileName fileBody >>>>>>>>" for details and an example.
You should be able to add as many states as you want: just write all your states before the END of the APPEND block (second END in you example).
Isaya, you gave me that bit of code yourself. What do you mean one is not supposed to put dialogue stuff in a tp2? But if you say APPEND is enough, I'm willing to give it a try. I'll get back to you on the result.
COMPILE EVALUATE_BUFFER MyDialogStuff.d
Okay, so what is the final syntax? After APPEND goes the ~addition~ or the ~original dlg I'm adding to~?
This is what I've done. I put in my tp2 file this line:
Which stands for addition to Kagain's dialogue number 1. The KAIG_1_#.d file inside looks like this:
IF ~~ THEN BEGIN KAZAKNO1
SAY ~Who cares? You tie that purse back up right now, . It's bad enough we'll never recover the gold you've fed this bum.~
IF ~~ THEN DO ~SetGlobal("KAZAKER_TEACHES","GLOBAL",0) SetGlobal("KAZAKER_PISSED","GLOBAL",1) AddJournalEntry(@0012,INFO)~ EXTERN ~KAZAK_#~ 11
END
IF ~~ THEN BEGIN KAZAKNO2
SAY ~Argh! He couldn't. I'm sick of this tear-jerking. Just try giving that mook any gold *my* axe earned! Come on, we're out of here.~
IF ~~ THEN DO ~SetGlobal("KAZAKER_TEACHES","GLOBAL",0) SetGlobal("KAZAKER_PISSED","GLOBAL",1) AddJournalEntry(@0012,INFO)~ EXTERN ~KAZAK_#~ 11
END
END
Now, this did compile, after I removed from the tp2 the COMPILE line for KAZAK_#.d, which is the dialogue of the NPC I've been talking about. That dialogue is where Kagain gets to cut in with his thing about money; and the reply lines point to EXTERN ~KAGAIN~ KAZAKNO1 and KAZAKNO2. I renamed this in case, for some magical reason, it was the name of the states that caused the problem. I hope this is not confusing. Anyway, those are the states added to KAGAIN.DLG with the above code; but I still get a failure to resolve label if I dare to reference them in the other dialogue. (And no, it's "O" in the name, not "0." I checked.)
So at this point I'm just not compiling that NPC file and only want to see if the appending to KAGAIN actually happened. Well, in Near Infinity right-clicking on the file gives me the option to restore the back-up, so I guess something has changed about Kagain's file - but it's nothing that could be seen; long story short, to see an appended state anywhere on a tree, you've got to give it some (any) trigger.
But the failure to parse bugs me. I see no reason for it. The states do get added to KAGAIN, but somehow compiling the file that quotes those states, KAZAK_#, fails - and the compiling is lower on the list than the update to KAGAIN, so the new bits are already in. (But moving them around doesn't change anything.)
Any ideas?
I think the problem may be due to file-by-file compilation, as opposed to batching it. I.e. you can do
COMPILE ~Fun_at_the_Fair~
to compile all the .d and .baf files it can find in that folder, in a single action. The difference is that WeiDU will load all the files and read the states first, and only then will proceed to actual compilation. (Although don't quote me on that.)
I am, however, a bit puzzled how you could resolve EXTERN ~KAZAK_#~ 11 if the actual kazak_#.d was being compiled after the call to it.
The all-together compiler used all of the d files in the folder, including KAGAIN.D, which I had planned to just edit originally and replace, then abandoned. It was just lying around in the folder. I deleted it, and voila, the mod installed.
Very good!
Now I have only one outstanding error, that weirdness with adding new music. I've already talked about that, but just in case, here is the protocol of Weidu's complaints:
As you can see, music is, apparently, copied over and added, and I absolutely can see no difference between what I do there with MUS and ACM files and the tutorial - it's just several tunes in my case. But the songs somehow don't make it to SONGLIST.IDS, which makes me wonder just what the ADD_MUSIC function does.
The text in my case is:
0x^FF0234244 [Use Kazaker's system]^ 20 pieces
[Use Kazaker's system] is supposed to be colored, with ^ closing the bit. Not working.
An NPC has 3 different dialogs attached to it:
E)THEA.d - Initial dialog
E)THEAP.d - Post-party dialog (this runs after kicking our NPC from the party)
E)THEAJ.d - Join-party dialog (this runs while the NPC is in the party)
Again, note that the name of our dialogs can be at most 8 characters long. You’re free to use any name you want, but it’s a good idea to use your NPC’s name, suffixed by P and J.
And "Z" dialogue has something to do with Dorn - the answer is in actions that follow the single line:
SetDialogue("None")
LeaveParty()
EscapeArea()
When you visit an area for the first time, a copy of the ARE file is attached to your saved game. So any subsequent edits to the base ARE file won't be reflected in your saved game.
By the way, what is the best way to rearrange NPC in an area? Replace the ARE and ship it with the mod or put changes in the area script? The second change seems better compatible with other people's mods, but is it possible to remove NPC without script names by means of a script? For example, countless identical guards or gamesmen. I can't issue a command to them to DestroySelf, because they don't have script names. But I need to remove them from the area.
The main downside of the ARE method seems to be that a player is going to have to start a new game to see the new NPC or not see the old ones.
Use the ALTER_AREA_ACTOR macro in WeiDU. You could set the flag_time_0 through flag_time_23 parameters to 0 to make the actor never appear. Or, even change the CRE file for the actor.
http://www.weidu.org/~thebigg/README-WeiDU.html#sec51
The moderators put all my topics in a heap here, to keep the boards down to an absolute minimum of topics... whether that makes sense or not. So I'll have to ask about colored text in this thread. The closing tag of @argent77 - ^- works, but strangely. Here is one of the lines in question:
THEN REPLY ~^0xFF34E2EA [Use Kazaker's system] ^- 100 gold.~
The idea is that [Use Kazaker's system] will be in yellow letters, and 100 gold in the usual red ones. Instead all I see is
100 gold.
In *white* font.
THEN DO ~StartCutScene() SetGlobal("KAZAKER_TEACHES","GLOBAL",1) FadeToColor([0.0],0) Wait(2) AddexperienceParty(200) AdvanceTime(FOUR_HOURS) ActionOverride(LastTalkedToBy("KAZAKER"),JumpToObject("KAZAKER")) FadeFromColor([50.0],0) ApplySpellRES("SYSTEM_#",LastTalkedToBy("KAZAKER")) Wait(1) ActionOverride("KAZAKER",StartDialogueNoSet(LastTalkedToBy(Myself)))~ EXIT
What this results in is: the weird teleport-away effect still takes place, for some reason the jump doesn't occur, and the NPC doesn't resume the conversation; and the zoom of the game gets locked at the high, cutscene level, even if you start another conversation later. That's just permanent. By the way, I would dearly like my cutscenes without this bird's eye-rise, is there a method?