Author Topic: Several questions from a newb modder  (Read 2840 times)

Jerdol

  • Guest
Several questions from a newb modder
« on: July 09, 2005, 07:28:58 PM »
I'm a beginning modder, interested in modding mainly for experience in computer programming.  However, I've only gone as far as being able to create an NPC and giving him dialogue before he joins the party.  Now I want to expand my NPC to a "full" one, but am not quite sure how to proceed.

1) My idea for the NPC who's introduced into the game through NPC dialogue and then possibly a cutscene (quite similar to the way Viconia was done).  Specifically, the NPC will talk to and then fight those mean ruffians from the copper Coronet entrance.  How do I go about doing that?

2)  This NPC is intended to have two unique traits, both of which I have absolutely no idea how to do.  The first is that he comes with a weapon that cannot be removed, and cannot equip other weapons.  The second is that his sword gets better as he levels up (he's a Kensai, bonds with sword guy).  How do I do these things?

3)  What ever happened to Forgotten Wars?  I remember it having some great tutorials there.

Thanks for the help in advance.

Offline DrattedTin

  • That Dratted Tin!
  • Planewalker
  • *****
  • Posts: 41

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Several questions from a newb modder
« Reply #2 on: July 09, 2005, 10:07:34 PM »
2) This NPC is intended to have two unique traits, both of which I have absolutely no idea how to do. The first is that he comes with a weapon that cannot be removed, and cannot equip other weapons. The second is that his sword gets better as he levels up (he's a Kensai, bonds with sword guy). How do I do these things?

Chloe does both of these things, I think.  Download her and check her item and script files.  The weapons are upgraded via dialogue in Spellhold, if that's any help in tracking down where it occurs.

Quote
3) What ever happened to Forgotten Wars? I remember it having some great tutorials there.

Forgotten Wars had most of its projects leave and form the Pocket Plane Group, which is where you are now.  FW Studios just recently moved/was evicted and has been re-branded as Spellhold Studios.  www.spellholdstudios.net
Earn Money Sleeping.

Jerdol

  • Guest
Re: Several questions from a newb modder
« Reply #3 on: July 10, 2005, 01:59:29 AM »
A follow-up to question 1.  I figured out how to do dialogues between NPCs, by using EXTERN (by looking up an existing BG2 dialogue), so that's more or less settled.  However, there're are still one thing I can't work out.  How do I get the NPCs to start the dialogue?  I'm guessing this has to do with a script I need to give the NPC who starts the dialogue.  However, after giving him the over-ride script that the Viconia fanatic has, it only changed from him having nothing to say to me to him being busy.  He still doesn't initiate dialogue on sight as I want him to.  How do I fix this?

Offline Bons

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1237
  • Gender: Female
  • Glad Corvis Isn't Dead Club
Re: Several questions from a newb modder
« Reply #4 on: July 10, 2005, 09:53:16 AM »
I'm assuming you're trying to initiate talk with Cohrvale or Bregg when the PC is around? This is an adaptation of the script for the start of Viconia at the stake talking:

IF
   Detect([PC])
   Range(LastSeenBy(Myself),10)
   Global("MyNPCMeeting", "GLOBAL", 0)
   OR(2)
      Allegiance(Myself,NEUTRAL)
      Allegiance(Myself,GOODBUTBLUE)
THEN
   RESPONSE #100
      StartDialogueNoSet(LastSeenBy(Myself))
END


And have a corresponding dialogue state at the top of your NPC's file:

IF ~Global("MyNPCMeeting", "GLOBAL", 0)~ THEN BEGIN Meeting
SAY ~BlahBlahBlah.~
IF~~THEN DO ~ SetGlobal("MyNPCMeeting", "GLOBAL", 1)~ EXTERN COHRVALE Meeting2
END


If you want to start a cutscene instead of dialogue, you could just:

IF
   See([PC])
   Global("MyNPCCutscene", "GLOBAL", 0)
   OR(2)
      Allegiance(Myself,NEUTRAL)
      Allegiance(Myself,GOODBUTBLUE)
THEN
   RESPONSE #100
                SetGlobal("MyNPCCutscene", "GLOBAL", 1)
                StartCutsceneMode()
                StartCutscene("NPCcut1")
END


Where "NPCCut1" is the script for the cutscene encounter.
Newt had always suspected that people who regularly used the word "community" were using it in a very specific sense that excluded him and everyone he knew.

             --Neil Gaiman, Terry Pratchett, "Good Omens"

Jerdol

  • Guest
Re: Several questions from a newb modder
« Reply #5 on: July 11, 2005, 02:31:52 AM »
Thanks very much for the help.  It actually turns out my problem was not with the script, but with the dialogue.  I had started the first line with "If~~ THEN...", instead of putting a condition.  I now realize that "IF ~~ THEN" does not always activate, but never activates - unless specifically directed by another block.  So I changed the first line to "IF ~TRUE()~ THEN..." and now it works.
I figured out the solution mainly by looking through other dialogues (specifically, the amnish guards the first time you enter the gov district at night, and the peope in the inn in the gate district).  Thanks for the help anyways, though, and for taking time to teach newb modders the ropes.

Jerdol

  • Guest
Re: Several questions from a newb modder
« Reply #6 on: July 11, 2005, 09:23:40 PM »
Some fresh questions, which I believe are all that stand between me and the completion of my first mod :) (minus "additives" like banter, interjections & a quest).

1)  How do I compile scripts and items?

2)  Regarding an item, I "made" mine in DLTCEP (I took an existing item and changed the name and description), and after writing the description it updated dialogue.tlk with the string.  So my question is:  Will the fact that my comp assigned it numbered dialogue make the item function on my comp (which DLTCEP gave that dialogue) but screw-up on another comp?  If yes, than how do I fix it?

3)  Regarding the first part of my original second question:  I figured out how to make the weapon unmovable, but is there a way to prevent the character from equipping other weapons?

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: Several questions from a newb modder
« Reply #7 on: July 11, 2005, 09:31:33 PM »
1. Use a .tp2 file.  You don't need to compile items but you do need to copy them from your mod directory to the override directory.
2. Once again, use a .tp2 file.  When you copy an item, you can also assign a name and description, etc.
3. dunno.

I suggest downloading some mods and looking through their code rather than looking at BioWare's code.  Uncompiled code looks different than compiled code.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline Bons

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1237
  • Gender: Female
  • Glad Corvis Isn't Dead Club
Re: Several questions from a newb modder
« Reply #8 on: July 11, 2005, 09:55:02 PM »
Re: the IF ~True~ THEN fix - this could be a makeshift solution. There's no control to keep that state from repeating when the NPC is called to start dialogue again.

Scripts and items:

In your tp2, script compiling possibilities could be:

EXTEND_TOP ~AR0000.bcs~ ~mymod/scripts/ar0000append.baf~  // This is for when you need to tack on something like a spawn to an existing script.

COMPILE ~mymod/scripts/mynpc.baf~ // This makes WeiDU compile your new BAF into a BCS


For items in your tp2 : (This will add the new strings for the item to the dialog.tlk on install.)

COPY ~mymod\items\batter.itm~ ~override\batter.itm~
SAY NAME1 ~Item~ //Unidentified string
SAY NAME2 ~Pancake Batter~ //Identified string
SAY DESC ~Pancake Batter
A perfect prop for your Shemp's slapstick.

STATISTICS

Usable by Stooges
Target: 1 Creature
20% chance to cause Confusion for 3 rounds.~


As for the weapon equip prevention, you could either script for all other weapons to be dropped, or maybe stick an unmoveable blank item in the other weapon slots?
Newt had always suspected that people who regularly used the word "community" were using it in a very specific sense that excluded him and everyone he knew.

             --Neil Gaiman, Terry Pratchett, "Good Omens"

Jerdol

  • Guest
Re: Several questions from a newb modder
« Reply #9 on: July 11, 2005, 11:44:28 PM »
Thankx.  It turns out my problem is not with the compilation of the script, but with the script itself (a cutscene).

Code: [Select]
IF
True()
THEN
RESPONSE #100
CutSceneId("Barghter")
Attack("Ruffian")
Wait(1)
ActionOverride("Ruffian",Kill(Myself))
EndCutSceneMode()
END

It's based off cutscene45a, which is what the assassin uses to kill Sanik in Brynlaw.  Here, I use it to make Barghter (my poorly named NPC) to kill "ruffian" (the DV of Amalas in the copper Coronet).  For some reason, the cutscene mode turns on, but Barghter doesn't attack Amalas.  He just waits a second, and then the cutscene ends.  What am I doing wrong?

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: Several questions from a newb modder
« Reply #10 on: July 12, 2005, 12:07:01 AM »
Show us how you're calling the cutscene. (and verify the name of this cutscene you're creating, in the process.)
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: Several questions from a newb modder
« Reply #11 on: July 12, 2005, 12:08:23 AM »
No, wait, I see it now.

Amalas's DV is "amalas." His CRE filename is ruffian, but you basically only ever care about CRE filename in-game when you're doing CreateCreature. So you want Attack("amalas").
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Jerdol

  • Planewalker
  • *****
  • Posts: 5
Re: Several questions from a newb modder
« Reply #12 on: July 12, 2005, 03:17:57 AM »
IT WORKS!!!  I am now inches away from completing my first mod!  All I need to do is add the dialogue for after he kills Amalas in which you actually get him into the party, and the whole weapons thing.  And the weapons thing looks like it won't be hard, now that I've discovered the FAQ at the end of Sim's complete scripting guide.

Thanks a lot for helping me.  I am now getting the hang of weidu (I hope), and am about to be a certified modder (although still a lousy one).  :):):):D:):):)

Offline Jerdol

  • Planewalker
  • *****
  • Posts: 5
Re: Several questions from a newb modder
« Reply #13 on: July 16, 2005, 10:30:55 PM »
Some new questions:

1)  I was looking over Blue's banter tutorial, and there's something I didn't understand.  Firstly, the CHAINs didn't look like they make sense, as they didn't specify a block name within their repective files.  Secondly, the APPENDS look like they're the kinds of things that belong in .tp2 files, not dialogue files.  Is there something I'm missing?

2)  How do I make interjections?

3)  Not a question of modding, per se, but still annoying.  When creating an NPC .cre file from scratch, how do I figure out what his stats should be?

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: Several questions from a newb modder
« Reply #14 on: July 17, 2005, 07:06:45 AM »
Some fresh questions, which I believe are all that stand between me and the completion of my first mod :) (minus "additives" like banter, interjections & a quest).

1)  How do I compile scripts and items?

2)  Regarding an item, I "made" mine in DLTCEP (I took an existing item and changed the name and description), and after writing the description it updated dialogue.tlk with the string.  So my question is:  Will the fact that my comp assigned it numbered dialogue make the item function on my comp (which DLTCEP gave that dialogue) but screw-up on another comp?  If yes, than how do I fix it?

3)  Regarding the first part of my original second question:  I figured out how to make the weapon unmovable, but is there a way to prevent the character from equipping other weapons?

1. No need to compile items.
Script compiling with dltcep is like: writing the script then saving it. It will use WeiDU to actually compile it. But if you distribute the mod in weidu format, you will package the uncompiled script and it will be compiled at install time.
2. If you don't want to use tp2 for items/spells, you can export the item into .tbg format and bunch the tbg's into .iap. Actually, DLTCEP can use weidu to compile dialogs/scripts packed into an iap.
But nowadays everyone does it in the WeiDU way which makes the mod installs a bit more compatible with other mods.
3. The best you can do is a script in the creature which drops any other weapon equipped.

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: Several questions from a newb modder
« Reply #15 on: July 17, 2005, 07:12:26 AM »
Some new questions:

1)  I was looking over Blue's banter tutorial, and there's something I didn't understand.  Firstly, the CHAINs didn't look like they make sense, as they didn't specify a block name within their repective files.  Secondly, the APPENDS look like they're the kinds of things that belong in .tp2 files, not dialogue files.  Is there something I'm missing?

2)  How do I make interjections?

3)  Not a question of modding, per se, but still annoying.  When creating an NPC .cre file from scratch, how do I figure out what his stats should be?
1/2: -
3: probably the best way is: create a character using the character generator of the game :)
Even if you got some stat preferences, you can later modify them.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Several questions from a newb modder
« Reply #16 on: July 17, 2005, 07:14:01 AM »
3. The best you can do is a script in the creature which drops any other weapon equipped.
Kindrek equips an undroppable copy of his halberd in all of his slots to make a similar thing.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

domi_ash

  • Guest
Re: Several questions from a newb modder
« Reply #17 on: July 18, 2005, 03:40:08 PM »
Quote
2)  How do I make interjections?

Here is a small primer on interjections writting from this thread; There is also a tutorial on INTERJECT in WeiDU documentations by JC iirc: http://forums.gibberlings3.net/index.php?act=ST&f=62&t=2822&st=0#entry27965

Quote
Interjections in its simplest incarnation are CHAINs only "inserted" into the existing text.

Here is an example of a simple interjection and below is the explanation of what's going on:

Please, note, this example uses IsValidForPartyDialogue("Kivan") throughout. It is not a good command, use the combination of:
InParty(“Kivan”) !Dead(“Kivan”) !StateCheck("Kivan",STATE_SLEEPING)

INTERJECT_COPY_TRANS ~_KELDDA~ 0 X#KivanKeldath
== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Fair is your temple and full of hope, priest.~
== ~_KELDDA~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~And have you forsaken hope, my son?~
== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~I have hope but it lies beyond this plane, Keldath Ormlyr~
== ~_KELDDA~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Gaze upon the sun as it rises, elf. It is born anew every morn - here and everywhere in this world... on this plane. Rejoice, for you are blessed by its rays.~
END

INTERJECT_COPY_TRANS

that's the command that seeks out the specific "state" on the file named:
~_KELDDA~

Please, note that if you are interjecting after a STATE that has a single action woth one DO function after it, you should be using (ie a DO something and EXIT state)

INTERJECT_COPY_TRANS2

In SHORTHAND INTERJECT_COPY_TRANS will be I_C_T and guess what will I_C_T2 stands for?


And here is this state (or simply the number of the line after which you want to interject:

0

if you look into the _KELDDA.D you will see:

IF WEIGHT #3 /* Triggers after states #: 1 2 6 even though they appear after this state */
~True()
~ THEN BEGIN 0 // Here is your state number! IE, you will be asking to insert your lines after that particular phrase.
SAY #77961 /* ~Welcome! The traveling adventurer is never turned away from a house of Lathander, as we strive to aid all who make a difference in the Realms. If you are battle-worn we can extend a number of necromantic restorations, whatever your need. A small donation is all the compensation that we require. If you wish nothing then let me tell you of the madman Bassilus.~ */
//Here is where the shown code will stick in Kivan - Keldoth conversation
IF ~~ THEN REPLY #77962 /* ~What kind of aid can you give us?~ */ DO ~StartStore("_TEM3402",LastTalkedToBy(Myself))
~ EXIT
IF ~!Dead("bassilus")
~ THEN REPLY #77963 /* ~We don't require any help at the moment. ~ */ GOTO 8
IF ~Dead("bassilus")
~ THEN REPLY #77963 /* ~We don't require any help at the moment. ~ */ EXIT
END


X#KivanKeldath
simply the name of the interjection. They should be unique and start with your prefix, since WeiDU will transform it into a GLOBAL.

== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Fair is your temple and full of hope, priest.~

and here is the syntax - it is exactly the same as the CHAIN. Make sure that the condition IF-THEN is the same throughout. Please, note that traditionally J-files are used for handling interjections. All J file names are listed in PDIALOGUE.2DA file you can access via NI (in 2DA folder)


Where can you take the D files to look up their names (I already listed the states)?

It is done in a few stages:
1) open NI and find the CRE of the character which you interject with. F.ex: Elminster. You will find a bunch of CRE's for him; the ones that are from BG1 are the ones that have _ in front of them. Since I want to interject with Elminster in Chapter 3, I pick the _ELMIN3.CRE. When you open it up you will see that the dialogue assigned to him is _ELMIN3.DLG.
2) Write down the name of the dlg file.
3) open WeiDU. After the command line enter the command:
weidu _elmin3.dlg
the _elmin3.d will be created in the BG2 main folder.


EXTEND_BOTTOM

Is another useful command that allows you to add whatever you want after a STATE. For example, if I wanted to add PC replies after ~_KELDDA~ 0 it would look like:

EXTEND_BOTTOM ~_KELDDA~ 0
IF ~~ THEN REPLY ~Whatever~ EXIT
END


Other useful commands for D-files are:

ADD_TRANSACTION_TRIGGER
ADD_STATE_TRGGER
INTERJECT
JOURNAL
ADD_TRANS_ACTION
REPLACE_STATE_TRIGGER

Useful Reading:

Sim's Complete Scripting Guide (scripting!)
Ghreyfain's A Beginner's Guide to NPC Creation with WeiDU (explains file structure very well and gives simple examples of SAY dialogues)
Blue's and JC's Road to Banter (covers CHAIN in detail)
Japeth's State Weights (covers WEIGHTs)
JC's Another look at WEIGHTs (covers WEIGHTs)
Rastor's romance Authoring Tutorial (shows how to combine D and BAF to run a standard romance sequence with timered dialogues, dream scripts and flirts)
WeiDU Documentation (the bestselling mystery novel)

 

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)?: