ID:1979396
 
(See the best response by NullQuery.)
mob
NPC
Slimes
Slides=list(
1="Hi",
2="Want to make out?",
3="Let's do this!!",
)
Interact(mob/NPC)
if(NPC.DialogueSlide>=length(Slides))
NPC.CloseDialogue()
return
NPC.Dialogue(src)
mob
var
DialogueSlide=0
Slides=list()

mob
verb
Interact()
usr<<"You have interaction!!"
//set hidden=1
for(var/mob/NPC in get_step(src,src.dir))
NPC.Interact(src)
mob
proc
Dialogue(mob/NPC)
src.DialogueSlide++
winshow(src,"Dialbox.Text",1)
if(src.DialogueSlide>0)
winshow(src,"Goback.Button",1)
if(src.DialogueSlide<length(Slides))
winshow(src,"Continue.Button",1)
if(src.DialogueSlide==length(Slides))
winshow(src,"Finish.Button",1)
if(src.DialogueSlide>1)
winshow(src,"ContinueButton",0)
winset(src,"CommonDial.Text","text='[NPC[src.DialogueSlide]]")
return
CloseDialogue(mob/NPC)
src.DialogueSlide++
winshow(src,"Dialbox.Text",0)
winshow(src,"Goback.Button",0)
winshow(src,"Finish.Button",0)
return

I've been looking at quite a few threads on winset and winshow as well as various dialogue formats. I honestly feel like it might be the dmf that's the problem. I set up a label for the Dialbox, a button for each of the three buttons, the output box to say what happened, and an info box, just in case the Interact() macro isn't working. I keep getting this runtime/loop error that keep going on.

runtime error: Maximum recursion level reached (perhaps there is an infinite loop)
To avoid this safety check, set world.loop_checks=0.
You wouldn't be getting that error from winset. It looks as though you've got an infinate loop somewhere else in the code (It's nowhere in what you posted).
I've been thinking that maybe I'm not getting it to the right mob. I know in another program that I've been making I had two types of icons. The one I made for that NPC, and the one that came from creating the dialogue for that NPC. Maybe it's not binding?
Your slime's Interact() refers to the player as "NPC". I don't see any infinite loops here though.
What could be wrong then? It has to be related to this somehow, maybe how it's being applied?
For starters it would be helpful if you compiled your code with debug mode enabled. To do this, go to the "Build" menu in the topright menu bar of Dream Maker and click "Preferences for <your project name here>". Then check "Generate debugging information".

This will provide more information when an error occurs, including the file and line where the problem occurs. This may allow you to solve this problem on your own, or you could post the new runtime error and the file and line it points out to us.
runtime error: list index out of bounds
proc name: Dialogue (/mob/proc/Dialogue)
source file: Windows.dm,28
usr: Guest-3601548860 (/mob)
src: Guest-3601548860 (/mob)
call stack:
Guest-3601548860 (/mob): Dialogue(Slimes (/mob/NPC/Slimes))
Slimes (/mob/NPC/Slimes): Interact(Guest-3601548860 (/mob))
Guest-3601548860 (/mob): Interact()

winset(src,"CommonDial.Text","text='[NPC[src.DialogueSlide]]")
This is line 28 in Windows.dm.
I think I know what the problem is now. It's probably the first src needing to be usr, but I'm going to need to look over this tomorrow. Do you know what I'm suppose to do with the call stack? I'm not really sure what's important about call stack.
Best response
You should NEVER use usr in a proc, with the exception of events like Click(), DblClick(), etc.

The value of usr may be unpredictable and lead to other problems down the line.

This should be your fixed code, but I can't confirm:
mob
NPC
Slimes
Slides=list(
1="Hi",
2="Want to make out?",
3="Let's do this!!",
)
Interact(mob/NPC)
if(NPC.DialogueSlide>=length(Slides))
NPC.CloseDialogue()
return
NPC.Dialogue(src)
mob
var
DialogueSlide=0
Slides=list()

mob
verb
Interact()
usr<<"You have interaction!!"
//set hidden=1
for(var/mob/NPC in get_step(src,src.dir))
NPC.Interact(src)
mob
proc
Dialogue(mob/NPC)
src.DialogueSlide++
winshow(src,"Dialbox.Text",1)
if(src.DialogueSlide>0)
winshow(src,"Goback.Button",1)
if(src.DialogueSlide<length(Slides))
winshow(src,"Continue.Button",1)
if(src.DialogueSlide==length(Slides))
winshow(src,"Finish.Button",1)
if(src.DialogueSlide>1)
winshow(src,"ContinueButton",0)
winset(src,"CommonDial.Text","text='[NPC.DialogueSlide]") // changed NPC[src.DialogueSlide] (which seems to make no sense in this context) to NPC.DialogueSlide
return
CloseDialogue(mob/NPC)
src.DialogueSlide++
winshow(src,"Dialbox.Text",0)
winshow(src,"Goback.Button",0)
winshow(src,"Finish.Button",0)
return
One thing I can't figure out: Who is the interactor and who is the interactee? In Dialogue() and CloseDialogue() it's fairly clear that src is the player and NPC is the NPC. I'm not sure from looking at your Interact() verb, and the way it's overridden for slimes, that that's the case there. In the slimes' Interact(), it looks as if the argument to the proc is the player--so why you called the var "NPC" is baffling, and confusing.
Well I was having mob/Player be the player, and mob/NPC be each of the NPC that the players would be having conversations with. More specifically, that I'm treating the mob/NPC inside the parentheses as arguments to be filled by whatever creature/instances the Interact(*) is in.
I've messed around. Looking at several other codes from other people and I got a partial solution. In the codes that are posted here, I have three "***.Text" for the text box. I thought that I could keep the names that I given them, but apparently it won't work otherwise. Is there a way to go around this? Or is there a reason why I can't?
I'm not sure I follow what you're saying there. Mostly my question is whether your arguments and var names in the various procs are correct.

It seems as if in the Interact() verb that each NPC has, it's meant to be called as a proc rather than a verb, and the argument it's given is meant to be the player who called the verb.

To avoid confusion, I strongly suggest a different way of handling this.

// this proc is called by the Interact verb
mob/NPC/proc/DoInteraction(mob/player/M)
if(M.DialogueSlide >= length(Slides))
M.CloseDialogue()
return
M.Dialogue(src)

mob/verb/Interact()
for(var/mob/NPC/NPC in get_step(src, dir))
NPC.DoInteraction(src)

The main difference here is that the name and purpose are clarified.
I can't say that I see any difference with or without that. There's a few things that are bugging me. Mostly that instead of the element, I'm getting the '/list' instead. I have a few ideas, but before I can test them out, I need to figure out how to get the output in the interface working. It would be the output that "usr<<"*"" would be going to, right?
Right, if you don't use output() then by default all direct output goes to the default output control.

It's outputting /list because it's not really designed to print out each item one by one. What you need to do is output each item in the list one at a time.
I figured it out. I feel so dumb, but it's actually sometime that NullQuery helped me noticed. So, what I ended up doing for showing the proper strings, I put in:
winset(src,"default.Text","text=[NPC.Slides[src.DialogueSlid e]]")

I figured it was something like this being the problem, but I was only looking at a different part of the code. What I meant Lummox, is that when I went into the window option in the interface codes, I created an output box so that say I wanted a verb that gives the result of "usr<<"Hello [usr]", that box will display Hello [usr]. The box giving the output or the output that I listed above. What am I doing wrong?

I also realized that some characters are not working well in the NPC's dialogue. For example apostrophes. I think it was C++ where a \ was needed before some symbol in order for the following character to be considered not for a system predefined usage. What is it for byond?
You need to give the output a name, and then do output(text,"outputName")
output() is what you want, as Rushnut said. If you do want to set text with winset() however, what you need to do is run url_encode() on any text so it's properly escaped.

The easiest way to handle winset() is to simply call list2params() with your parameter list, which does the encoding for you.
Ah. I'm not really sure about what to do with what you said Lummox. I'll try it out later, but I did manage to get the output window displaying information by clicking the default button by editing the output box. Most likely because I didn't label the output to anything.
mob/verb
Interact()
for(var/mob/NPCS in get_step(src,src.dir))
if(src==NPCS)
NPCS.Interact(src)
else
return

I figure that this wouldn't work considering that who's really getting the direction is the NPCS on the third line, but ideally I want to add something so that whenever there is no NPCS mob around the player, this verb doesn't go on an infinite loop. I probably could remove the macro for the verb and make it invisible, but I really would like to learn the correct vars/procs.