Jump to content

Discussion: How to make an NPC if you are a NOOB.


Recommended Posts

Looks like the Weimer WeiDu readme is the place to begin. I always struggled with learning foreign languages, and it sort of feels like this is essentially what I have to learn here. Hope my brain can find a way to make sense of this different way of organizing info.

Link to comment

(great straightforward tutorial, by the way... the only mention I would make is to remind people not to use MS word, but stick with Notepad, Crimson, ConTEXT, etc.) I agree with theacefes... rather than start with the WeiDU stuff, I found the fastest way to get a concept was to look at the actual code of several mods, then a tutorial, then some more mods, then ask a bunch of questions/read back posts, THEN read the WeiDU documentation. For me it is actually very akin to music composition and theory. There really are three separate learning curves: structure, naming conventions, and usage. It hurt my brain way too much to tackle all of that at once, so I did a parallel to music exploration.

 

I started with reading code and posts talking about bugfixes (listening), then looking at other folks work (comparing songs/styles to find common elements I understood/liked), then questioning active modders and reading back posts (reading up on/interviewing artists and their ideas of composition/songwriting), then IESDP (music notation work), then WeiDU ReadMe + examples (Piston's Harmony/Theory and Machless' History texts combined), then back to questioning modders and trying things out (experimentation and practice), then finally drafting code and posting it up for peple to tear to shreds (performance at your local coffeehouse in front of friends).

 

I still have tons upon tons to learn, but I know that I can do some stuff now, and that is within 6 months (a summer off dedicated to it, perhaps, but still, 6 months. My brain would have melted if I tried to really comprehend either IESDP or the WeiDU documetation unless I had built up some building blocks around them first!

Link to comment
Exactly now let's get back on topic. Anything else? Incorrect code anywhere?

 

 

Thanks for writing this! I'm just starting out and appreciate you tying all the pieces together.

 

One quick question: I notice in your example code that you are checking for "JohnJoined" = 0 before you branch to the ComeBack dialog block, but I don't see how it would ever get set to 0. Wouldn't you have to set this explicitly when the NPC left the party?

 

Also, can you tell a little bit about the difference between the "LOCALS" and "GLOBALS" strings when using the SetGlobal() command? Are you allowed to use any string you want? Is ["JohnJoined", "LOCALS"] different from ["JohnJoined", "GLOBALS"]?

 

--Otis

Link to comment

Short explanation: a GLOBAL variable can be read by all the scripts in the game, regardless of which script set the variable. On the other hand a LOCALS variable (like the name indicates) can only be read by the script that set it.

 

In the IESDP you can find more throughout explanation.

Link to comment
One quick question: I notice in your example code that you are checking for "JohnJoined" = 0 before you branch to the ComeBack dialog block, but I don't see how it would ever get set to 0. Wouldn't you have to set this explicitly when the NPC left the party?

 

If a variable is undeclared then any call to it will return 0 i.e. if you check Global("MyVariable","GLOBAL",0) and "MyVariable" hasn't been set then it will return true.

Link to comment
Short explanation: a GLOBAL variable can be read by all the scripts in the game, regardless of which script set the variable. On the other hand a LOCALS variable (like the name indicates) can only be read by the script that set it.

 

In the IESDP you can find more throughout explanation.

Actually, the Object that contains it...

 

ActionOverride("Jaheira",SetGlobal("LovTalk","LOCALS",40)) Would have Jaheira set her lovetalk to 40 from any script at all.

 

But I am fairly sure

Global("Lovatalk","jaheira",40)

Is not a valid syntax.

Link to comment
Guest avoidable

i bring new meaning to the term noob by adding in features such as stupidity and an incompehensible ability to comprehend. your tutorial is exactly what someone like me needs to enter int othe wonderful world of modding...but its not quite enough. it does not specify which files should be added to what folders for nearinfinity to recognise them. i have found the char one obviously but the dialogue and some others are harder to locate. so much so that i have not been able to complete my basic level npc. ontop of this...will any of these things that i do have horrid effects upon existing mods in our game? i would hate to have to do something complicated.

 

any help would be appreciated

 

jas

Link to comment

Erm, I'm not sure if this answers your question but I'll sure try:

 

You do not "locate" the dialogue files. These you are making yourself (it is your NPC after all). If you follow the instructions in the Dialogue section, you will have your own D file, which (if using Notepad) will look like (surprise) a blue notepad thing, if you did it right. All this stuff goes into a mod folder that you name whatever you want. Then in your Tp2, you compile and copy all this stuff just like the tutorial says.

Link to comment

When you create a new dialogue file you use BEGIN, right? But when you want to add to an already existing dialogue file you APPEND to it. I think WeiDU's readme offers a pretty good description for APPEND:

 

APPEND filename state list END

 

This tells WeiDU to place the given states at the end of the already-existing dialogue filename.

 

Example:

 

APPEND ~BAERIE~

IF ~Global("AerieSeesBunny","GLOBAL",1)~ THEN BEGIN
  SAY ~Look, a bunny!~
  IF ~~ THEN DO ~SetGlobal("AerieSeesBunny","GLOBAL",2)~ EXIT
END

END

 

Unlike with BEGIN you must remember to put an END after the dialogue states you wanted to APPEND.

Link to comment

Archived

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

×
×
  • Create New...