Author Topic: A few questions for a n00b NPC creator  (Read 16441 times)

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #25 on: August 25, 2013, 07:14:07 AM »
Okay, a test mod NPC is well on the way. I think.

Offline Kaeloree

  • Planewalker
  • *****
  • Posts: 109
Re: A few questions for a n00b NPC creator
« Reply #26 on: August 25, 2013, 07:17:07 AM »
Awesome. :D I intended to do one years ago, but then an NPC happened instead. Whoops.

I've had untraify work for me in the past, but it's been a while. Wisp may be able to shed some light on what went wrong.

Offline Cahir

  • Planewalker
  • *****
  • Posts: 102
  • Gender: Male
Re: A few questions for a n00b NPC creator
« Reply #27 on: August 25, 2013, 07:23:36 AM »
A very very Noob question.

Can I actually make/write new dialogues in DLTCP? :P I mean there is an option of New dialogue there but I can't fill any boxes there.

Yeah, I know it sounds to simple...but thought I ask.

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #28 on: August 25, 2013, 07:46:29 AM »
You can, but to distribute it, you will have to copy the whole dialog.tlk, and the user won't be able to install any other mods before it. In other words, incompatible and clunky.

So, Notepad or Notepad ++ and these tutorials are your friends:
http://forums.pocketplane.net/index.php/topic,25198.0.html
http://forums.pocketplane.net/index.php/topic,25814.0.html

Offline Cahir

  • Planewalker
  • *****
  • Posts: 102
  • Gender: Male
Re: A few questions for a n00b NPC creator
« Reply #29 on: August 25, 2013, 08:07:34 AM »
Bah, I knew it sounds too easy :P

Well then, I did read a lots of tutorials including the ones wrote by polish modders - Zed Nocear, L'f, Lava among others, but I guess I have to grit my teeth and try to code something myself (well, a dialog for a quest I wrote which needs to be coded in fact).

Thank You very much Kulyok! And please do continue, I'll be lurking here :)

Offline kimmuryiel

  • Planewalker
  • *****
  • Posts: 9
Re: A few questions for a n00b NPC creator
« Reply #30 on: August 25, 2013, 01:41:37 PM »
O_o then it must have been the gods themselves who coded the more complicated ones. the bodhinapping is something I always look forward to in a mod as to what the person did with it (like Edwin it was standard until you get to Amaunator's temple and you have to put the charm he gave you with Bodhi's heart)

I guess I'll try creating a new game then XD

I'm not asking for it to be done NOW, but after I have all the rest done, then I'd want to tackle it. I'm looking toward the end of development for my mod and making sure everything will get done :D but I did actually understand what most each line did XD Besides that code, what else is needed for the bodhinapping? XD and which parts call the cre file and which call the d file? XD

I do appreciate all the help you two are giving and what you're willing to do to help :) /hug
« Last Edit: August 25, 2013, 02:55:46 PM by kimmuryiel »

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #31 on: August 26, 2013, 12:51:11 AM »
You'll see some of these code examples and more in the small NPC mod I'm making exactly for these purposes. In a few days, I think.

Offline Wisp

  • Planewalker
  • *****
  • Posts: 1176
Re: A few questions for a n00b NPC creator
« Reply #32 on: August 26, 2013, 05:15:59 AM »
Heheheh. Guess what? untraify didn't work for me, like, at all. With all my .tra and .d Coran files in the root game directory together with Weidu,
weidu --untraify-tra O#Coran.tra
weidu --untraify-tra O#Coran
weidu --untraify-d O#Coran.d
weidu --untraify-d O#Coran
Anyway, if one is to create such a mod, I guess it's to be created from scratch. I'll see if I can put together a quick 'un.
You need to pass --untraify-d and --untraify-tra at the same time.

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #33 on: August 26, 2013, 06:32:45 AM »
(a pleading look) I think we need a smaaaaaaaaaaaaaaallish tutorial in Weidu's readme.
Because neither weidu --untraify-d O#Xan.d --untraify-tra O#Xan.tra nor weidu --untraify-tra O#Xan.tra --untraify-d O#Xan.d seemed to do it for me, either.

Offline Wisp

  • Planewalker
  • *****
  • Posts: 1176
Re: A few questions for a n00b NPC creator
« Reply #34 on: August 26, 2013, 06:49:10 AM »
I can't remember if I did something to fix untraify back when, but are you having this problem with WeiDU 231 or with the current line of beta versions?

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #35 on: August 26, 2013, 07:11:19 AM »
Version 23100.

Offline Wisp

  • Planewalker
  • *****
  • Posts: 1176
Re: A few questions for a n00b NPC creator
« Reply #36 on: August 26, 2013, 11:55:49 AM »
I can't reproduce your problem, after copying O#Xan.d and O#Xan.tra to the same directory, weidu --untraify-d O#Xan.d --untraify-tra O#Xan.tra successfully untraifies the D file.

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #37 on: August 26, 2013, 12:27:28 PM »
It worked! Okay, it's not magic(though it must be, because I copy-pasted your command and it worked immediately), it's just I'm so used to traifying files with Weidu outside of the game that I've never even realized I had to do it in the game directory. My apologies for the confusion, and thank you for helping to figure it out!

(But I'm already kind of halfway/thirdway/quarterway to making that study mod NPC, so).

Offline kimmuryiel

  • Planewalker
  • *****
  • Posts: 9
Re: A few questions for a n00b NPC creator
« Reply #38 on: August 26, 2013, 12:56:43 PM »
and I am awaiting either expectantly :) but, in the meantime, taking a break while I wait for dialog to sexually harass my favorite Red Wizard :)

Offline Cahir

  • Planewalker
  • *****
  • Posts: 102
  • Gender: Male
Re: A few questions for a n00b NPC creator
« Reply #39 on: August 26, 2013, 04:15:05 PM »
During a break from BG2-mod-testing-run I thought I will try to code a dialogue....and gals and guys...I think I'm coding :P

Well, it's probably won't work, I suppose, but....there is IF, there is THEN and even END, soooo...it's a progress :)

But..how to add a short banter between Khalid and Jaheira and/or between PC-Jaheira as a reaction for one of dialogue replies, like say some sort of two person interjection.
I can't find such case in other mods .d files - there are only either regular banters or one dialog line interjections - but not for the lack of word banter interjections.

Let's say I have a dialog when first reply depends on CHARNAME class - this I can code ;D.
Then I need to
- trigger short Khalid-Jaheira banter as a result of mage/cleric reply
- trigger short PC-Imoen banter and immediately after the same Khalid-Jaheira banter as above, as a result of bard reply
- trigger the same Khalid-Jaheira banter as a result of other classes reply

Probably I will put some short interjections/banter as a result of consecutive replies, but if I understand how to do this I think I can repeat it.

I'll be very grateful to You modding aces for advice!

Offline Kaeloree

  • Planewalker
  • *****
  • Posts: 109
Re: A few questions for a n00b NPC creator
« Reply #40 on: August 26, 2013, 04:23:33 PM »
CHAIN IF ~/* conditions */~ THEN JAHEIRAJ chainname
~Here is your initial state.~
+ ~/* conditions */~ + ~Here is your first response.~ EXTERN JAHEIRAJ interject1
+ ~/* conditions */~ + ~Here is your second response.~ EXTERN IMOENJ interject 2

CHAIN JAHEIRAJ interject1
~Here's Jaheira's response.~
== KHALIDJ ~Here's Khalid's response.~
EXIT

CHAIN IMOENJ interject2
~Here's Imoen's response.~
EXTERN JAHEIRAJ interject1

Hopefully that makes some sense. :) The only problem you might encounter CLASS_ALL does not account for dual or multiclass combinations, so you'll have to specify them individually.

Offline Cahir

  • Planewalker
  • *****
  • Posts: 102
  • Gender: Male
Re: A few questions for a n00b NPC creator
« Reply #41 on: August 26, 2013, 04:33:01 PM »
Kaeloree big thanks!

Actually it makes a lot of sense to me which is surprising :P

Only thing I do not understand is chainname. How should I understand it? What does it refer to?

EDIT. Unless I misunderstood something CLASS_ALL does account for dual and multiclassing according to http://gemrb.org/iesdp/files/ids/bg2/class.htm

EDIT 2: Ok I do not understand one more thing, what is the difference between conditions after CHAIN IF (...) THEN JAHEIRAJ and the ones after my initial state?
« Last Edit: August 26, 2013, 04:46:03 PM by Cahir »

Offline Kaeloree

  • Planewalker
  • *****
  • Posts: 109
Re: A few questions for a n00b NPC creator
« Reply #42 on: August 26, 2013, 04:53:53 PM »
"chainname" is just the name you are giving to the state. It must be unique, like all state names. "interject1" and "interject2" are the unique identifiers for the subsequent two states.

As for CLASS_ALL, I'm not actually sure that's correct; I've had problems with it in the past where players have reported their dual and multiclasses weren't being recognised. Better to be safe. :)

If your chain has a condition to trigger, you use CHAIN IF ~/* condition */~ THEN DIALOGNAME STATENAME, otherwise if there is no trigger condition (as is the case most of the time), you can save time by writing CHAIN DIALOGNAME STATENAME.

Offline Cahir

  • Planewalker
  • *****
  • Posts: 102
  • Gender: Male
Re: A few questions for a n00b NPC creator
« Reply #43 on: August 26, 2013, 04:56:17 PM »
Sorry for double post but I....overestimated my initial comprehend capabilities.

1. Why CHAIN IF (first line) refers to JAHEIRAJ not for example KHALIDJ (it's Khalid who starts the banter)
2. Why there is EXTERN JAHEIRAJ after IMOEN interject? I had in mind that Khalid-Jaheira banter is kind a separate thing than PC-Imoen banter - the latter is not a result of the former. Yes, they trigger one after another but are kind of not connected. I hope You know what I mean :)


Offline Kaeloree

  • Planewalker
  • *****
  • Posts: 109
Re: A few questions for a n00b NPC creator
« Reply #44 on: August 26, 2013, 05:00:37 PM »
Have you read any tutorials about how to use CHAIN?

I suggest you do that, heh.

As for your second question, if you don't want it to occur as part of the same dialog, you will need to script the dialogs to occur consecutively. I suggest you keep it simple and just have it in the one dialogue. The number one rule when writing dialog: keep it simple. If it involves doing something you don't understand, simplify it. :)

Offline Cahir

  • Planewalker
  • *****
  • Posts: 102
  • Gender: Male
Re: A few questions for a n00b NPC creator
« Reply #45 on: August 26, 2013, 05:07:59 PM »
All right, all right, don't kick me when I'm down :) I did read tutorials about CHAIN but it's one of the things I can't grasp. But I'll read it again with fresh mind.

I will try to code this part of dialog tomorrow and put it here. Will be grateful if You can check it then.

Anyway Kaeloree, You're most helpful and I really start to understand a little.

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #46 on: August 27, 2013, 07:44:27 AM »
Okay, while I'm still working on the NPC: are there any basic NPC-related dialogue/script coding things you'd like to be shown? Some specific interjection or dialogue? Well, not _very_ complicated, or I won't be able to perform, but still. :) It's best that you formulate your request as simple and detailed as possible.

Offline Cahir

  • Planewalker
  • *****
  • Posts: 102
  • Gender: Male
Re: A few questions for a n00b NPC creator
« Reply #47 on: August 27, 2013, 11:51:11 AM »
Have you read any tutorials about how to use CHAIN?

I suggest you do that, heh.

As for your second question, if you don't want it to occur as part of the same dialog, you will need to script the dialogues to occur consecutively. I suggest you keep it simple and just have it in the one dialogue. The number one rule when writing dialog: keep it simple. If it involves doing something you don't understand, simplify it. :)

Ok, I did a bit of reading about CHAIN and I think I understand it now, more or less anyway.

Logic said to me that if I need to have two separate banters appear consecutively I need to code them separately, but after I read Your explanation it occurred to me that for IE engine it's no difference if I code them separately using a script that connects them or if I code them as one banter. Either way all dialogue lines will appear on screen one by one, but it's definitely easier for me to code them as one banter. Plain and simple, just needed an explanation that my brain will digest :)

So one more question about it and I think I'll be ready tackle the dialogue :) In Your example You started CHAIN by using EXTERN to JaheiraJ, but if I want Khalid to actually start a banter I should initialize it using EXTERN to KhalidJ, right? And code all lines in Khalid Banter? Am I thinking correctly? Or is it a specific reason why You started CHAIN with Jaheira that I don't understand?

Anyway, You Guys rock! Really.

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #48 on: August 27, 2013, 12:23:36 PM »
One banter is easier than two, naturally. :) You should start the banter with whatever character you want, it doesn't matter. If you want Khalid to start it, then place KHALIDJ instead of JAHEIRAJ. However, if your banter is between PC and Khalid, then any other character(Jaheira or Imoen) should only talk if they are available for dialogue, which usually goes like this:

// and you need a script with it, naturally.
CHAIN IF ~Global("VariableIsPrefixed","GLOBAL",1)~ THEN KHALIDJ chainuniquename
~Hello. <CHARNAME> and I are talking here. Hey!~
DO ~SetGlobal("VariableIsPrefixed","GLOBAL",2)~
END
++ ~Hey.~ EXIT
+ ~InParty("Jaheira") Detect("Jaheira") !StateCheck("Jaheira",CD_STATE_NOTVALID)~ + ~You know, Jaheira is here and she'd like a word.~ EXTERN JAHEIRAJ chainseconduniquename
// Pay attention to actual file names. It's probably not JaheiraJ but JaheiJ or JaheirJ, and if it's Tutu, it starts with a _.

CHAIN JAHEIRAJ chainseconduniquename
~I can speak for myself! Off with you!~
EXIT

Without these conditions? Your game may crash.

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A few questions for a n00b NPC creator
« Reply #49 on: August 29, 2013, 02:30:33 AM »
I remembered: I did code a full Bodhi abduction once, for Nalia romance(okay, twice, for Angelo, but Angelo's case was a rather big quest in itself), and, yes, it was a pain in the ass. Speaking of which, Nalia's romance is traified, but if you're reading this topic and you don't mind traified files, that's where you can steal it from. (Or I'm going to steal my code from Nalia to the test mod NPC, and you'll be able to steal that).

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: