Jump to content

Photo

Talkable NPCs


  • Please log in to reply
23 replies to this topic

#1 Eskimojoe

Eskimojoe

    Junior

  • Members
  • Real Name:Joe
  • Location:Portage, MI

Posted 19 March 2013 - 06:11 AM

First and foremost I am using 2.5 build 24 and the classic tileset. I am attempting to utilize talking npcs. I have the script saved as a txt document with .z as the file extension. Now when I attempt to compile I get this...

Pass 1: Parsing
Pass 2: Preprocessing
Pass 3: Building symbol tables
tmp, line 27: Error S09: Variable DIR_UP is undeclared.
tmp, line 28: Error S09: Variable DIR_DOWN is undeclared.
tmp, line 30: Error S09: Variable DIR_LEFT is undeclared.
tmp, line 31: Error S09: Variable DIR_RIGHT is undeclared.

So am I correct in assuming that before I can compile this I have to buile my npc tiles and then edit before compiling and set these variables? Also which other variables need to be set pre compiling? And lastly for now do I need to set this once for each individual npc in my qst? I am new to scripting and so have absolutely no idea what I am doing. Any and all help will be appreciated.

Edit: Thanks Moscow that did it. Now I have another question. How do I set the variables?

Edit: Thanks Lord Settra! That sounds pretty straight forward I will give it a try.

Edited by Eskimojoe, 19 March 2013 - 11:16 AM.


#2 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 19 March 2013 - 08:25 AM

Put this line at the top of the script file:
import "std.zh"

#3 Rastael

Rastael

    Wizard

  • Members
  • Real Name:Raphael
  • Location:Austria

Posted 19 March 2013 - 10:22 AM

You mean the "D"-Variables?

For the NPC-script, you need to create a FFC (Freeformcombo) on the screen (press "F7" to create one). If you edit the FFC, there are three pages (for flags etc.). At the 3rd page, you can set the D-Variables.
(my english is not that good, so I hope, you can understand this. If not, I will make some screenshots to show you)

#4 MoscowModder

MoscowModder

    Sometimes lurking. Rarely posting.

  • Members
  • Location:Wisconsin

Posted 19 March 2013 - 01:09 PM

For future reference, there are two completely different things related to scripts that are called D-variables.

What Lord Settra! is talking about is FFC arguments, labeled D0 through D7. The script should have comments at the top telling you what each one does (not all have to be used).

The other "D-variables" are Screen->D[] variables, used to store states (like whether or not a special trigger has been hit). You'll occasionally have a script that wants you to put the number of a "screen variable" or "d variable" in one of the D# arguments mentioned above; just put a number between 0 and 7 that's not used for a similar purpose on that screen.

#5 Eskimojoe

Eskimojoe

    Junior

  • Members
  • Real Name:Joe
  • Location:Portage, MI

Posted 20 March 2013 - 03:06 AM

I have made the ffc however it is still not working. I can walk right through it as if it were not even there and can not talk to it.
Would someone who has the patience and the time please explain what each thing on the ffc (f7) screen does? Or at least the minimum to get a working ffc npc? Please and thank you.
I get the first five arguments because those are explained multiple times in multiple places. It is all the rest of it.

Sorry about that Russ. http://www.purezc.co...showtopic=43826 this is the script I am using.

Edited by Eskimojoe, 20 March 2013 - 03:39 AM.


#6 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 20 March 2013 - 03:15 AM

For the first issue, FFCs can't be made solid, so you'll have to put your NPC on top of an unwalkable combo. For the second, we really can't help you much with a script when we don't even know what script you're using. Can you link to the script you're using?

#7 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 20 March 2013 - 03:29 PM

are you sure you have to use a script for a npc?because i hear of a way using warps...

#8 Jamian

Jamian

    ZC enthusiast

  • Members

Posted 20 March 2013 - 03:47 PM

It's possible but considerably more complicated.

I recommend the "Signpost" script for talking NPCs and signs. Very easy to set up, and works like a charm.

#9 nicklegends

nicklegends

    Trofessional Pransposer

  • Contributors
  • Real Name:Ed
  • Pronouns:He / Him

Posted 20 March 2013 - 03:48 PM

QUOTE(coolgamer012345 @ Mar 20 2013, 01:29 PM) View Post

are you sure you have to use a script for a npc?because i hear of a way using warps...

The warp method is a remnant from when ZC didn't have scripting. It's generally considered to be easier to use a script for NPCs nowadays, but you don't have to.

#10 beneficial

beneficial

    Junior

  • Members

Posted 20 March 2013 - 04:01 PM

Scripts also make things look seamless while when using warps you cab tell that the player was warped

#11 coolgamer012345

coolgamer012345

    🔸

  • Members
  • Location:Indiana, USA

Posted 20 March 2013 - 05:51 PM

well it may not have to be perfect......oh well i like using warps anyway...

#12 Eskimojoe

Eskimojoe

    Junior

  • Members
  • Real Name:Joe
  • Location:Portage, MI

Posted 20 March 2013 - 05:56 PM

New question. If I were to go with Joe123s' signpost script how exactly would I go about getting rid of Joe123s' talking npc script?
Need help please and thank you.

#13 Eskimojoe

Eskimojoe

    Junior

  • Members
  • Real Name:Joe
  • Location:Portage, MI

Posted 21 March 2013 - 03:35 PM

Update I got it to work. Now can anyone tell me how I can use multiple strings to a npc?

#14 beneficial

beneficial

    Junior

  • Members

Posted 21 March 2013 - 03:44 PM

I'm the string editor go to the string that you want. At the bottom there are two drop down menus. The one with the "next string"button us the one you want. If your string you want to link to I'd the next one clock that button. If not then you have to use the drop down menu

#15 Eskimojoe

Eskimojoe

    Junior

  • Members
  • Real Name:Joe
  • Location:Portage, MI

Posted 21 March 2013 - 04:08 PM

I did that however it is not working with the npc. Npc only says first string.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users