Author Topic: A Beginner's Guide to NPC creation with WeiDU  (Read 174800 times)

YouMustGatherYourParty

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #325 on: August 19, 2010, 02:51:36 PM »
Quote
GlobalLT("Chapter","GLOBAL",1)
Not possible. The game starts in chapter 1 - there's no chapter 0/prologue.

Aha, i see, thanks for the explanation.  :)

/YouMustGatherYourParty

AJ

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #326 on: September 23, 2010, 01:31:20 AM »
and now im confused...it didnt work i got lost at the .CRE file maybe im not supposed to try making NPC's...

Offline Mobius572

  • Planewalker
  • *****
  • Posts: 11
  • Gender: Male
  • A God among Men
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #327 on: November 25, 2010, 12:48:08 PM »
I'm not sure on the TP2 though, somebody help me out?-
"Death comes swiftly.  FEEL ITS ICY BREATH!"-Sarevok Anchev

Pomacanthus

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #328 on: January 13, 2013, 01:38:37 PM »
Baffling. Sorry, this is not a noobs guide at all. It is quite obvious that a lot of assumptions are made about the new 'modders' knowledge here.

Offline Kaeloree

  • Planewalker
  • *****
  • Posts: 109
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #329 on: January 13, 2013, 05:10:28 PM »
Perhaps if you asked some questions, we'd be able to help you?

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6235
  • Gender: Female
  • The perfect moment is now.
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #330 on: January 13, 2013, 11:28:33 PM »
It is workable, if you just try to "turn off" your head and just do every line in the tutorial diligently, without thinking - i.e. create a blank text file in the Notepad, later rename it to jondo.dlg via Total Commander, then open and edit it via F4, and do all the other instructions in the tutorial to the letter - not thinking, not criticizing, not trying to do better, just doing. It's tedious, yes, but it's a very good start.

Anonymous Mouser

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #331 on: March 12, 2013, 12:36:54 PM »
Very helpful tutorial. I used it in conjunction with other tutorials to make a workable joinable NPC.

However, I'm running into an irritating issue. The NumTimesTalkedTo(0) and NumTimesTalkedToGT(0) variables aren't working for me. My NPC will start the same, first conversation every time she's clicked on without going to the NumTimesTalkedToGT(0) block of text.


Here are some examples of my code, the text obviously changed.

This is the first block:

Code: [Select]
BEGIN M#JUlbra

APPEND ~M#JUlbra~
IF ~NumTimesTalkedTo(0)~ THEN BEGIN Greeting
SAY ~Hello~
IF ~~ THEN REPLY ~Hi.~ GOTO control
IF ~~ THEN REPLY ~Go away.~ GOTO gamble
IF ~~ THEN REPLY ~I don't have time for such a stupid person.~ EXIT
END

This is the last block that should be the second conversation:

Code: [Select]
IF ~NumTimesTalkedToGT(1)~ THEN BEGIN Second
SAY ~My, my, is curiousity eating you yet?~
IF ~~ THEN REPLY ~What did you do exactly?~ GOTO explain
IF ~~ THEN REPLY ~Still not sure.~ GOTO goodbye
IF ~~ THEN REPLY ~What are your talents exactly?~ GOTO talents
END
END

The last block/second conversation is not firing, even when I change the code to this:

Code: [Select]
IF ~NumTimesTalkedToGT(0)~ THEN BEGIN Second
SAY ~My, my, is curiousity eating you yet?~
IF ~~ THEN REPLY ~What did you do exactly?~ GOTO explain
IF ~~ THEN REPLY ~Still not sure.~ GOTO goodbye
IF ~~ THEN REPLY ~What are your talents exactly?~ GOTO talents
END
END

A little help would be greatly appreciated.

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6235
  • Gender: Female
  • The perfect moment is now.
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #332 on: March 12, 2013, 01:33:34 PM »
NumTimesTalkedToGT(0) is what you need, yes. It definitely works for me in Assassinations, for one.  However, while it works well for non-joinable quest NPCs, with a joinable NPC, you might run into problems with keeping score later(not to mention your current problem). I would rather advise you

1) to use a Global variable for that:
IF ~Global("PrefixedVariableFirstDLG","GLOBAL",0)~ f
SAY ~Hello~
++ ~Hi.~ DO ~SetGlobal("PrefixedVariableFirstDLG","GLOBAL",1)~ + control
++ ~Go away.~ DO ~SetGlobal("PrefixedVariableFirstDLG","GLOBAL",1)~ +  gamble
IF ~~ THEN REPLY ~I don't have time for such a stupid person.~ DO ~SetGlobal("PrefixedVariableFirstDLG","GLOBAL",1)~ EXIT
END

IF ~Global("PrefixedVariableFirstDLG","GLOBAL",0)~ second
...

2) Try use shorthand for scripting(the sort I wrote above; also, if you go to http://www.pocketplane.net/oneday and download, say, Coran, his code is a good template, too).

3) If you're serious about your NPC, at some point you might need to register a unique prefix for ALL your filenames and variable names here to prevent incompatibilities:
http://forums.blackwyrmlair.net/index.php?showtopic=113
You definitely shouldn't be using M#, because it's a conflicting prefix, unfortunately.


EDIT: And you probably will get better results if you post EXACT code you have a problem with, because rephrasing it probably loses something in the process(perhaps the very error).

Anonymous Mouser

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #333 on: March 12, 2013, 02:51:01 PM »
Awesome! Thank you for the tips. And setting the global variable worked like a charm.

tibicina

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #334 on: May 16, 2014, 01:34:13 PM »
Two questions. I created a working, installable NPC. Got her to spawn correctly, created and assigned her a kit, and have created custom items for her. I've read that they can be assigned to her (and installed) via the tp2, but want to be sure that it'll work to have the actual item files in an internal "items" folder inside my mod folder when I install. The game, essentially, will be adding the items to the override at install, but I'm anxious about whether the tp2 will look for the items.

The other question, which may really not be a beginner question is how to get her to "level up" at joining if she's brought into the party after level 1. I've observed other NPC mods do this and am willing to take a stab at messing with coding if necessary. She has a kit assigned to her already installed, so the game knows what to do with her as she levels, but I don't know how to code the actual command to add levels similar to my PC, if that makes sense...

Thanks!!  ;D

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6235
  • Gender: Female
  • The perfect moment is now.
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #335 on: May 17, 2014, 12:26:26 AM »
XP code is easy - if you download Branwen tutorial NPC mod from http://www.pocketplane.net/oneday , you'll see XP adjustments in her main script(everything is commented, you'll find it easily).

As for custom items, this is my preferred way of dealing with these: install them in the game first, then open your NPC's cre file via Near Infinity or DLTCEP, and choose these items(since they're installed already, you'll be able to equip them). This way you needn't add them to the .cre via .tp2(you can, but it's more of a headache. But that's just me).

 

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