Creating NPC
#1
Posted 25 April 2004 - 12:08 PM
#2
Posted 25 April 2004 - 01:26 PM
how come you always look so damn cool in every photo I see you in?!?
Speaking of modding, I listened to IER 3 yesterday, so you can have another quote for your signature: how come you sound so damn cool, as well as look it? It's unfair. Seriously.
Still a cyberjock, still hacking the matrix, still unsure of what that means.
TeamBG member - http://www.teambg.eu
#3
Posted 26 April 2004 - 07:36 AM
i don't know what to do.. I will be more thankful if you explain how to create a 'Very' 'Simple' Npc
#4 -Ashara-
Posted 26 April 2004 - 07:53 AM
Start a multiplayer game and create your NPC. Continue playing.
SIMPLE:
Create your cre, put it in override folder. Summon with CLUA console in game.
Otherwise, use Ghrey's tutorial. It is very detailed and it works. If you have troubles installing the mod, lok into the "How to Distribute your mod" section of WeiDU Documentation.
If you are still stuck, please detail step-by-step what you have done (ie exported CHR file and converted to CRE. Changed flags. Creted folder in my BG directory and put CRE there...), and at which point stuff went wrong. Post a snippet of your TP2...etc.
Please, make it easy to help you.
#5
Posted 26 April 2004 - 08:42 AM
(thanks for replying)
#6 -Ashara-
Posted 26 April 2004 - 09:06 AM
Extension to AREA SCRIPT that summons your NPC
Folder with your "raw" files IN your BG2 directory and backup subfolder
tp2 file
setup (renamed WEIDU)
Try to go slow through the Section 3 and Section 4. Do not worry about the phrase "compile the dialogue file/script with your favorit compiler, NI will work fine"
Instead try to create the simplest TP2 -read WEIDU documantation section on it and open Kelsey's one - it is well annotized and try to figure out what does what.
ie try to understand things like that COMPILE actually transfers Ds into DLGs and BAFs into BCS. Once you are comfortable with it write your small TP2 which will contain:
backup
Compiling of your D file
Compiling of your two BAF files (area and override script)
Appending your character to area
appending scripts and dialogues to your CRE
Assignment of dialogue files to DA's - to PDIALOGUE and INTERDIA
#7
Posted 27 April 2004 - 02:35 AM
EDIT:As Andyr pointed out, it's not the death variable for the CreateCreature command.
#8
Posted 27 April 2004 - 11:04 AM
< jcompton > Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"
#9
Posted 28 April 2004 - 01:46 AM
Thanks for pointing out the error.
#10 -Ashara-
Posted 28 April 2004 - 10:35 AM
B-file (or file you are going to use for interparty banter) will go to INTERDIA.2DA
I do advise though learning tp2 as soon as you can.
#11 -Ashara-
Posted 28 April 2004 - 11:10 AM
------------------------
* Section III: Scripts *
------------------------
Possible the shortest step. If you want your NPC to walk up to your PC when they
first meet, you'd write this script:
open a new file in Context (text editor and copy paste this snippet into it. Save the file with a name of your chosing under 8 characters, using extension BAF, for example: J#Vondo.BAF
IF
See([PC])
NumTimesTalkedTo(0)
THEN
RESPONSE #100
Dialogue(Nearest([PC]))
END
Compile it using your favourite compiler, NI works fine, save it, and assign it to
your NPC's .cre file.
DO NOT DO THAT. Instead let us do it in TP2, in Section 4
Then the method to get your NPC into the area is to append a small portion of
script to an existing area script. Let's say we want to add him to the Government
District. We'd need to append a bit to AR1000.bcs. For now let's create a script
called J#AR1000.bcs with the bits we want to add.
OK, again - open an empty file in your text editor, paste the snippet in and save with the extension BAF, here it will be J#AR1000.baf)
IF
Global("J#VondoExists","AR1000",0) //this line indicates that the event of NPC summoning did not happen previously
THEN
RESPONSE #100
SetGlobal("J#VondoExists","AR1000",1) //this line prohibits the event from hapenning more than once
CreateCreature("J#Vondo",[9137.2046],3) this line creates the NPC in the spot on the area map with the coordinates [9137.2046] facing direction 3. To obtain coordinates, when choosing the spawning point, enable CLUAConsole in game and click x, iirc
END
This portion of script will be going into our installation package, and will be
appended to AR1000.bcs by WeiDU when the time is right. See section IV for details
on how this is done.
You gave the game coordinates. When the script will be added to the certain area, you chose the area in which NPC will spawn.
------------------------------
* Section IV: The WeiDU .TP2 *
------------------------------
Most of this is covered in README-WeiDU.txt, so I'll simply write out the .tp2 for
our fake NPC.
DO the following:
1) Open you BG2 Main Directory
2) Create a folder called VondoTheNPC
3) Open the folder called VondoTheNPC and within it create a sunfolder called backup
4) In the folder called VondoTheNPC copy you cre, your baf's and your d's.
5) Go back to your main BG2 directory
6) Copy/paste WeiDU.exe there and re-name it VondoTheNPC-setup.exe
7) in the main BG2 directory create a file called VondoTheNPC-setup.tp2
OPEN the TP2 file in your text editor and see section 4 for what needs to be included into it for your mini-mod to work
----------------------------------------------------------------------------------
BACKUP ~VondoTheNPC\backup~ This line indicates that the files will be backed-up in the subfolder backup in the folder called VondoTheNPC in your main BG2 directory.
AUTHOR ~ghreyfain@spellholdstudios.net~ indicates the author. Feel free to credit yourself
BEGIN ~Vondo the NPC for BG2:ToB~ when you click VondoTheNPC-setup, the WeiDU will show the text you enter between tildas.
// The following is the copying of Vondo's .cre file
COPY ~VondoTheNPC\J#Vondo.cre~ ~override\J#Vondo.cre~ This will move your CRE from your own folder VondoTheNPC to override folder where the game can reach it and use it
SAY NAME1 ~Vondo~ This will give your CRE it's name, as it will be displayed in game.
SAY NAME2 ~Vondo~ This will give your CRE it's name, as it will be displayed in game.
SAY SELECT_COMMON4 ~Blah blah blah.~ [Vondo1] // [Vondo1] is the name of the .wav
file for this sound This is when you add the soundset to your CRE. If you do not have soundset simply delete all these SAYs. If you do not have sound files, the lines will be simply displayed.
SAY SELECT_COMMON5 ~Give the word.~ [Vondo2]
SAY SELECT_COMMON6 ~Point the way.~ [Vondo3]
SAY SELECT_ACTION1 ~I'm on the job.~ [Vondo4]
SAY SELECT_ACTION2 ~As you wish.~ [Vondo5]
WRITE_ASCII - this is your friend, which will allow you to add all the dialogues and scripts to your cre, w/o having to compile them first! Uhm, I do not have the codes hgandy, but Seifer posted the most common ones in the thread which was called Assign DLG files. I will repost it in a sec.
// The following is telling WeiDU to compile the following .d files
COMPILE ~VondoTheNPC\J#Vondo.d~
USING ~~
This magical line will convert your D file for you into DLG! and plae it in the override!
// The following is copying the script file to the override
COPY ~VondoTheNPC\J#Vondo.bcs~ ~override\J#vondo.bcs~
DO INSTEAD The following to compile your bafs and transfer them to override:
COMPILE ~VondoTheNPC\J#Vondo.baf~
USING ~~
COMPILE ~VondoTheNPC\j#ar1000.baf~
USING ~~
// The following is appending what we wrote in J#AR1000.bcs to the bottom of
// AR1000.bcs
No changes to this line
EXTEND_BOTTOM ~Ar1000.bcs~ ~VondoTheNPC\j#ar1000.bcs~
// The following is some .2DA appending for Vondo
This one simply Appends PDIALOGUE. First is SoA files only, second one is both SoA and ToB. If you have a banter file, you will also need to APPEND INTERDIA. vondo is the death variable, J#VondoP, J#VondoJ are your dialogue files, while J#VondoD is the dream script which you did not touch in this tutorial. I will post in the next post the full resulting text of the TP2 file
APPEND ~pdialog.2da~
~vondo J#VondoP J#VondoJ J#VondoD~
UNLESS ~vondo~
UNLESS ~25POST~
APPEND ~pdialog.2da~
~vondo J#VondoP J#VondoJ J#VondoD J#Von25P J#Von25J J#Von25D J#Vond25~
UNLESS ~vondo~
IF ~25POST~
#12 -Ashara-
Posted 28 April 2004 - 11:18 AM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BACKUP ~VondoTheNPC\backup~
AUTHOR ~ghreyfain@spellholdstudios.net~
BEGIN ~Vondo the NPC for BG2:ToB~
COPY ~VondoTheNPC\vondoS.bmp~ ~override\vondoS.bmp~
COMPILE ~VondoTheNPC\J#Vondo.d~
USING ~~
COMPILE ~VondoTheNPC\J#Vondo.baf~USING ~~
COMPILE ~VondoTheNPC\j#ar1000.baf~
USING ~~
COPY ~VondoTheNPC\J#Vondo.cre~ ~override\J#Vondo.cre~
SAY NAME1 ~Vondo~
SAY NAME2 ~Vondo~
WRITE_ASCII 0x34 ~vondoS~ //small portrait
WRITE_ASCII 0x250 ~J#Vondo~ // class script
WRITE_ASCII 0x2CC ~J#Vondo~ //Dialog
WRITE_ASCII 0x280 ~vondo~ // death variable
EXTEND_BOTTOM ~Ar1000.bcs~ ~VondoTheNPC\j#ar1000.bcs~
APPEND ~pdialog.2da~
~vondo J#VondoP J#VondoJ J#VondoD~
UNLESS ~vondo~
UNLESS ~25POST~
APPEND ~pdialog.2da~
~vondo J#VondoP J#VondoJ J#VondoD J#Von25P J#Von25J J#Von25D J#Vond25~
UNLESS ~vondo~
IF ~25POST~
#13
Posted 29 April 2004 - 11:58 AM
APPEND ~pdialog.2da~
~J#Vondo J#VondoP J#VondoJ J#VondoD~
UNLESS ~J#Vondo~
UNLESS ~25POST~
Edit: After looking through your annotations you've made this mistake!
For that APPENDing code to work then the Death Variable has got to be 'J#Vondo' and not 'vondo'. (Obviously without the quote marks). Either that or change the APPENDing to:
APPEND ~pdialog.2da~
~vondo J#VondoP J#VondoJ J#VondoD~
UNLESS ~vondo~
UNLESS ~25POST~
#14 -Ashara-
Posted 29 April 2004 - 12:21 PM
#15
Posted 29 April 2004 - 02:04 PM
I can't recommend that beginning modders do this. It's easy enough to right click on the appropriate line in NI, click "edit as string" and type in the dialog or script name (or use DLTCEP which doesn't require the script or dialog file to be compiled before adding it to the .cre file.)WRITE_ASCII - this is your friend, which will allow you to add all the dialogues and scripts to your cre, w/o having to compile them first! Uhm, I do not have the codes hgandy, but Seifer posted the most common ones in the thread which was called Assign DLG files. I will repost it in a sec.
#16 -Ashara-
Posted 29 April 2004 - 02:19 PM
Editing the script in this case or trying another script is very simple - you open your baf, put edits in, re-run the install and you are ready to re-test; the same with dialogues, pictures etc. You only need to know 4 or 5 ASCII codes.
On the other hand opening NI, finding the script to edit in override, editing it, exporting it back to you custom folder...erm...not exactly my favorite procedure. And god forbidd you have changed the title! May be it's just me, but it takes me a few tries to make sure that the file actually got re-assigned, not rolled back to initial value....
Another HUGE advantage to the novice is that you do not reference him to yet another program and do not have to explain how to compile files in NI, or what you can do in DLTCEP (spelling?). It is all done textually in the same TP2 file. For creating an NPC with 3 dialogues two tools is more than enough. The less you move around between programs, the less is the chance of making errors and learning curve is less steep.
#17
Posted 29 April 2004 - 03:05 PM
And setting the dialogue file, death variable, and script name in NI isn't really too hard.
#18
Posted 29 April 2004 - 03:13 PM
Seif
how come you always look so damn cool in every photo I see you in?!?
Speaking of modding, I listened to IER 3 yesterday, so you can have another quote for your signature: how come you sound so damn cool, as well as look it? It's unfair. Seriously.
Still a cyberjock, still hacking the matrix, still unsure of what that means.
TeamBG member - http://www.teambg.eu
#19 -Ashara-
Posted 29 April 2004 - 08:18 PM
#20
Posted 30 April 2004 - 07:30 AM
and my npc's name is invisible too
what can be done to make them visible?