Jump to content


Making NPC's from Greyfan's outlines


  • Please log in to reply
8 replies to this topic

#1 -Minotaur-

-Minotaur-
  • Guest

Posted 12 May 2004 - 07:28 AM

SPECIAL NOTE: I just now posted this thread up in "Tutorials" - Messed up and SHOULD have put it here, then tried and failed to delete it from the wrong place.

SORRY!
----------------------------------------------------------------------

Hi all,

After doing a LOT of reading on "How To Make A Simple NPC" from Ghreyfan, plus everything else I can get my hands on, I wrote one up.

Crashed System.

Edited fixed.

Crashed System.

Edited fixed AGAIN.

Game won't even start.

Uninstalled everything, RE-Installed everything have New NPC ready but afraid to install again... THINK the problem lies SOMEWHERE in COMPILING... Pounded head upon desk, came here...

Soooo.....

I think I am fairly hopesless...I gave up on trying to install major mods because, except for "Check the bodies" I can't work 'em. That is fine. All I REALLY want to do is make a few new NPC's and maybe give him/her/it a quest or two.

REQUEST (begging)

Can I post Ghrey's original "How too" along with my questions as to where I think I am screwing up here in the forum?

OR can I post what CODE I have written (FROM his outline) and have someone tell me where I am getting lost?

PLEASE and Thanks.

Currently Desperate - - Minotaur

#2 -Ashara-

-Ashara-
  • Guest

Posted 12 May 2004 - 07:39 AM

Try this thread: it has an annotated explanation to parts III and IV or Grey's tutorial geared towards a novice in coding and an example of codes should like, the discussion of common errors etc.


http://www.shsforums...?showtopic=7798

#3 Riklaunim

Riklaunim
  • Member
  • 375 posts

Posted 12 May 2004 - 08:09 AM

I've made 6 supersimple NPCs basing on G. tutorial :) with one exception - I've changed the ARE files to place NPCs on them :) You can see them in my "Crazy Remixes" [link]

#4 Idobek

Idobek

    Pocket Plane Gibberling

  • Member
  • 429 posts

Posted 12 May 2004 - 01:18 PM

I've made 6 supersimple NPCs basing on G. tutorial :) with one exception - I've changed the ARE files to place NPCs on them :) You can see them in my "Crazy Remixes" [link]

Why, oh why, oh why, did you feel the need to replace the area files?

#5 Riklaunim

Riklaunim
  • Member
  • 375 posts

Posted 13 May 2004 - 10:48 AM

Because I screwed up somethig or else and the tutorial appending didn't wanted to work :P

#6 -Minotaur_In_maze-

-Minotaur_In_maze-
  • Guest

Posted 18 May 2004 - 10:55 AM

Okay folks,

A couple of questions if I may. As I said, I have been using Ghreyfan's Guide to try to make myself an NPC or two - and getting nowhere fast. Some parts I seem to be getting (I think) okay, but others... So, I am hoping that if I post my problems in step by step format, SOMEONE can tell me where I am going goofy. (PLEASE?)

Alright, Ghreyfan used "Vondo" for his example and explained that everything boiled down to a series of If/Then commands. He Also stated that one needed to make a "blank D file" by making a text file and renaming it (probably character's name, for simplicity.) Okay, (and by the way, I am doing this in notepad...I understand there is something involving WeiDU that I later need to cut/paste this into - but what exactly escapes me) so following the example I did the following:

BEGIN MI1Auric
If ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~Mayhap to ye' <SIRMAAM>! They call me Auric Maplebeard.~
IF ~GlobalLT("Chapter","GLOBAL",3)~ THEN REPLY ~Mayhap to you as well Auric. What brings you to this tavern, and are you available for hire?~ GOTO InquireHistory
If ~~ THEN REPLY ~Mayhap to you Auric, have you any information to share about this place?~ GOTO Inquire Information
IF ~~ THEN REPLY ~Mayhap Auric Maplebeard, but I have never encountered your like before, though dwarves are known to me. What manner of creature are you?~ GOTO InquireType
IF ~~ THEN REPLY ~Mayhap and greetings. I am <CHARNAME>! My group and I are seeking rescue of a friend from a renegade wizard named Irenicus and could use an extra hand. Are you interested in joining me?~ GOTO InquireJoin
IF ~~ THEN REPLY ~No time to talk now, dwarf.~ GOTO GoAway
END

IF ~~ THEN BEGIN InquireHistory
SAY ~A tale of woe, but of heroism! One of a band of adventurers be I. We'd been on a mission for the 'Taurs of Slathminos and had the bad fortune indeed to encounter an explosive element with transdimentional properties...Or something like that, I didn't git t' hear all the details. Anyway, the cursed thing blew and scattered me band all to hell and gone; if even the others still live. In any event this element that I spoke of dropped me, none to gently might I add, into a barn North of here. Times being what they are, I found my way here to the Sea Bounty in search of ale. S'far as hire goes, I'll join with ye' for a fair split of the take... Though I am looking for an item of my own that I think is 'round here somewheres.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~ EXIT

IF ~~ THEN BEGIN InquireInformation
SAY ~Not be knowin' much m'self I'm sorry t' tell ye'. I am lookin' fer an item of some import t' me that I sense is somewhere within this realm. Looking f' fortune and glory as well, goes without sayin', s'long as I am here anyway...~

IF ~~ THEN BEGIN InquireType
SAY ~ A Penance Dwarf be I; and up until recently I be handling the dishonor of it right well if I do say so meself. Oh, ye' look confused. Ye' should be, my kind is rare. We Penance Dwarves are...a bonding, I'm told. A depraved -if ya ask me- symbiosis between the living and dead that be created by the powerful unholy magiks of necromancers upon us dwarves that died with deliberate dishonor. -SIGH- Cowardice, extremes of cruelty, gluttony or lust in life; lovers of torture and the pain of others, harsh betrayers of our own kind... Only the worst of the dwarven race are said to have been called back from the spirit realm and, they tell me, even then only in times of the direst of need. Our lost souls are then bonded to bodies of the recently dead who had been proud upholders of dwarven honor...and used as fodder in battle. T'was explained t' me that the point is fer us to be learning the meaning of the honor of the race. In me own case, I was called back to fight in the Dwarven service against an army of Drow who'd seen fit to invade. Hmft! We won th' day, then the handful of us who'd survived the battles and tribulations that we were summoned upon to contain were then cast out - to wander until death takes us back into her fold.~

IF ~~ THEN BEGIN InquireJoin
SAY ~S'long as I am here I might as well travel with ye' for a time. Perhaps I will find an item of mine that I sense is somewhere in this realm now.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~ EXIT

IF ~~ THEN BEGIN GoAway
SAY ~Fine, I remain here then.~
IF ~~ THEN EXIT
END

-------------------------THEN FOR REJOIN---------------------


IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue
SAY ~So ye' return then <CHARNAME>! What is it you want of me?~
IF ~~ THEN REPLY ~I could use a strong and ready sword hand. Join with me.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~
EXIT

IF ~~ THEN REPLY ~Only passing by to see if you were still around, Auric.~ GOTO RefusedAgain
END
IF ~~ THEN BEGIN RefusedAgain
SAY ~No matter, I have plenty t' contemplate on as I am. I shall remain here for a time and indulge in some of this excellent Elf firewine.~
IF ~~ THEN EXIT
END

------------------------------

The MAIN question I have (just now, and Other than "Is this code even CLOSE!") is: Are the tilde's and spaces and block layout right? I mention this as this is the first hurdle and it would be depressing to go through 70 pages of code just to find my only problem was having an extra space where it shouldn't be.

THANX for listening/looking

#7 Rastor

Rastor

    Yes, I really am a dragon. Yes, I am a jerk. Live with it.

  • Member
  • 2001 posts

Posted 18 May 2004 - 11:07 AM

Minotaur, that is not valid coding.

BEGIN MI1Auric
If ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~Mayhap to ye' <SIRMAAM>! They call me Auric Maplebeard.~
IF ~GlobalLT("Chapter","GLOBAL",3)~ THEN REPLY ~Mayhap to you as well Auric. What brings you to this tavern, and are you available for hire?~ GOTO InquireHistory
If ~~ THEN REPLY ~Mayhap to you Auric, have you any information to share about this place?~ GOTO Inquire Information
IF ~~ THEN REPLY ~Mayhap Auric Maplebeard, but I have never encountered your like before, though dwarves are known to me. What manner of creature are you?~ GOTO InquireType
IF ~~ THEN REPLY ~Mayhap and greetings. I am <CHARNAME>! My group and I are seeking rescue of a friend from a renegade wizard named Irenicus and could use an extra hand. Are you interested in joining me?~ GOTO InquireJoin
IF ~~ THEN REPLY ~No time to talk now, dwarf.~ GOTO GoAway
END


InquireInformation here is coded as two words. You cannot have that. Change it to "InquireInformation."

IF ~~ THEN BEGIN InquireHistory
SAY ~A tale of woe, but of heroism! One of a band of adventurers be I. We'd been on a mission for the 'Taurs of Slathminos and had the bad fortune indeed to encounter an explosive element with transdimentional properties...Or something like that, I didn't git t' hear all the details. Anyway, the cursed thing blew and scattered me band all to hell and gone; if even the others still live. In any event this element that I spoke of dropped me, none to gently might I add, into a barn North of here. Times being what they are, I found my way here to the Sea Bounty in search of ale. S'far as hire goes, I'll join with ye' for a fair split of the take... Though I am looking for an item of my own that I think is 'round here somewheres.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~ EXIT


You cannot have a DO ~~ EXIT following a SAY. That needs to be changed to:

IF ~~ THEN BEGIN InquireHistory
SAY ~A tale of woe, but of heroism! One of a band of adventurers be I. We'd been on a mission for the 'Taurs of Slathminos and had the bad fortune indeed to encounter an explosive element with transdimentional properties...Or something like that, I didn't git t' hear all the details. Anyway, the cursed thing blew and scattered me band all to hell and gone; if even the others still live. In any event this element that I spoke of dropped me, none to gently might I add, into a barn North of here. Times being what they are, I found my way here to the Sea Bounty in search of ale. S'far as hire goes, I'll join with ye' for a fair split of the take... Though I am looking for an item of my own that I think is 'round here somewheres.~ 
IF ~~ THEN DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~ EXIT
END

IF ~~ THEN BEGIN InquireInformation
SAY ~Not be knowin' much m'self I'm sorry t' tell ye'. I am lookin' fer an item of some import t' me that I sense is somewhere within this realm. Looking f' fortune and glory as well, goes without sayin', s'long as I am here anyway...~

IF ~~ THEN BEGIN InquireType
SAY ~ A Penance Dwarf be I; and up until recently I be handling the dishonor of it right well if I do say so meself. Oh, ye' look confused. Ye' should be, my kind is rare. We Penance Dwarves are...a bonding, I'm told. A depraved -if ya ask me- symbiosis between the living and dead that be created by the powerful unholy magiks of necromancers upon us dwarves that died with deliberate dishonor. -SIGH- Cowardice, extremes of cruelty, gluttony or lust in life; lovers of torture and the pain of others, harsh betrayers of our own kind... Only the worst of the dwarven race are said to have been called back from the spirit realm and, they tell me, even then only in times of the direst of need. Our lost souls are then bonded to bodies of the recently dead who had been proud upholders of dwarven honor...and used as fodder in battle. T'was explained t' me that the point is fer us to be learning the meaning of the honor of the race. In me own case, I was called back to fight in the Dwarven service against an army of Drow who'd seen fit to invade. Hmft! We won th' day, then the handful of us who'd survived the battles and tribulations that we were summoned upon to contain were then cast out - to wander until death takes us back into her fold.~


Both of those are invalid because there is nowhere listed for the dialogue to go. You need to add code to the bottom of both of these states that tell the game where to go. Also, you need to have END statements, otherwise WeiDU will choke.

IF ~~ THEN BEGIN InquireJoin
SAY ~S'long as I am here I might as well travel with ye' for a time. Perhaps I will find an item of mine that I sense is somewhere in this realm now.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~ EXIT


You need an END statement after this.

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue
SAY ~So ye' return then <CHARNAME>! What is it you want of me?~
IF ~~ THEN REPLY ~I could use a strong and ready sword hand. Join with me.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~
EXIT

IF ~~ THEN REPLY ~Only passing by to see if you were still around, Auric.~ GOTO RefusedAgain
END
IF ~~ THEN BEGIN RefusedAgain
SAY ~No matter, I have plenty t' contemplate on as I am. I shall remain here for a time and indulge in some of this excellent Elf firewine.~
IF ~~ THEN EXIT
END


That is fine. No problems with it.

The MAIN question I have (just now, and Other than "Is this code even CLOSE!") is: Are the tilde's and spaces and block layout right? I mention this as this is the first hurdle and it would be depressing to go through 70 pages of code just to find my only problem was having an extra space where it shouldn't be.


Make the changes that I indicated and it should work fine. Leave a reply if you have any additional problems.
Home of Kitanya, Improved Asylum, more...

Posted Image

#8 minotaur_in_maze

minotaur_in_maze

    Modding Prima-Dona

  • Member
  • 906 posts

Posted 18 May 2004 - 05:05 PM

[quote name='Rastor' date='May 18 2004, 06:57 PM']
[QUOTE]IF ~~ THEN BEGIN InquireInformation
SAY ~Not be knowin' much m'self...

IF ~~ THEN BEGIN InquireType
SAY ~ A Penance Dwarf be I....

Both of those are invalid because there is nowhere listed for the dialogue to go. You need to add code to the bottom of both of these states that tell the game where to go. Also, you need to have END statements, otherwise WeiDU will choke.

[QUOTE]IF ~~ THEN BEGIN InquireJoin
SAY ~S'long as I am here I might as well travel with ye' for a time. Perhaps I will find an item of mine that I sense is somewhere in this realm now.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~ EXIT
[/QUOTE]

You need an END statement after this.

[QUOTE]IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue
SAY ~So ye' return then <CHARNAME>! What is it you want of me?~
IF ~~ THEN REPLY ~I could use a strong and ready sword hand. Join with me.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~
EXIT
[/QUOTE]
First off, THANK YOU for the help/advice thus far Rastor (and everybody)! :)

Now then. I changed the spacing in InquireInformation (actually this was a problem in my Word Wrap but I thank you for pointing it out. :) )

I also changed the IF ~~ THEN DO business after SAY in the way directed. I missed that one.

On the two sections where you mention the code is not valid, (edited for space) you mention I must add a GOTO code at the bottom to tell the game where to GO -FROM- the ending? So, if I wrote it:

------------------------------------------------
SAY ~yadda yadda yadda.~ GOTO Exit
END
------------------------------------------------

Would this work? Should work for either if I am reading it correctly. I am a bit confused, even After going back and rereading Ghreyfan's work. As far as WeiDU choking, I am still figuring WeiDU out. I know I have to open it and rename the newly made file - after that put in all the IF/THEN code, then ................. ? Will work it out. :)

The last I am still confused about...where you said I needed to add an END statement. To clarify, change it - The InquireJoin - so as to read:

--------------------------------------
IF ~~ THEN BEGIN InquireJoin
SAY ~S'long as I am here I might as well travel with ye' for a time. Perhaps I will find an item of mine that I sense is somewhere in this realm now.~ DO ~SetGlobal("AuricJoined","LOCALS",1) JoinParty()~ EXIT
End
--------------------------------------

Again, I wish to say THANK YOU Rastor and Everyone for your help/advice. I am a total newbe and know nothing. In advance let me apologize for my upcoming, I am sure, somewhat dim questions. All I can say in my defense is that I am WILLING and able to learn and will give back as much as I am able to the group in the future.

Minotaur In Maze - More questions on the way for after this I get REALLY confused. :lol:

Edited by minotaur_in_maze, 18 May 2004 - 05:10 PM.

* * * * * *
They say the world is going to Hell.

They are wrong.

The world IS Hell! Always has been, always will be; except perhaps for the five percent or so of the population who can afford differently.

And, if one must reside in Hell, it is far better to do it as a minion of the Devil than as a member of the damned.
* * * * * *
LOVE SUCKS: It makes fools and slaves of us all.
But being alone and unloved is worse.
- Nancy A. Collins "Thin Walls"
* * * * * *

#9 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 18 May 2004 - 06:53 PM

------------------------------------------------
SAY ~yadda yadda yadda.~ GOTO Exit
END
------------------------------------------------


SAYs can't have transitions. You need to use IF ~~ THEN GOTO somestate or, if you want to end the dialog, IF ~~ THEN EXIT