Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Dialogue system (https://forums.graalonline.com/forums/showthread.php?t=134257783)

12171217 01-28-2010 12:38 AM

Dialogue system
 
1 Attachment(s)
Been messing with this for a few hours, I think it looks nice. The script's pretty sloppy, though. It was one of those keep-chucking-****-in-as-you-go-along deals. Hell, it works and it looks nice, though! :P

Sample dialogue file, as you can see "-player" doesn't have to be defined as a character and displays the player:
PHP Code:

CHARACTERS
"Bob" "head9.png"
"Cheese!" "head1000.png"
CHARACTERSEND

DIALOGUE
-playerAhhello Bob.
BobOh heyHow's it goin'?
-
playerJust dandy.
BobI'll be on my way then.
Bob: Boy, don'
t you wish word wrapping worked correctlyI meanI wish it only wrapped at the correct intervals to let words finishI'd write a function myself, but I'm too lazyOh well..
-
playerWhat?
Cheese!: BAAAAAAAAWH!!
-
playerWhat..?
BobRun away!!! =(
DIALOGUEEND 

And the script, it's in weapon form, but could easily be adopted as a class/DBNPC type deal. It's attached as a text file.

And a video because I get bored easily:


If you're interested as to why I make a video for everything I share (See other thread), it's because I like to share the kind of music I like to people subliminally.

Immolate 01-28-2010 12:41 AM

Hahaha, that's pretty nice man. Also, you could just attach it as a text file?

12171217 01-28-2010 12:42 AM

Quote:

Originally Posted by Immolate (Post 1552661)
Hahaha, that's pretty nice man. Also, you could just attach it as a text file?

Didn't think of that, will do.

Also, thank you :3

Rufus 01-28-2010 12:55 AM

Looks pretty good.

DustyPorViva 01-28-2010 12:57 AM

Could use the control GUI's, as they have built-in word-wrapping, and would also allow you to do some fancy scrolling(I disable the scrollbars and use scrollpos to build my own smooth scrolling).

Any intent to add anything more advanced, like player input(yes/no/maybe...)?

Also, most games store dialogue data clientside in a text file, as it's really not sensitive data(what harm is going to come of the player changing what an NPC says?). You could do this and probably simplify the loading.

fowlplay4 01-28-2010 01:01 AM

Looks cool, but if I had to play a server and that popped up at regular intervals when interacting with npcs it would get quite annoying but that's just me. :)

Immolate 01-28-2010 01:13 AM

Quote:

Originally Posted by fowlplay4 (Post 1552673)
Looks cool, but if I had to play a server and that popped up at regular intervals when interacting with npcs it would get quite annoying but that's just me. :)

I seriously think that this looks way better for NPC interaction, than using the default ways, such as the this.chat = "stuff"; variable and say2( "" );

If I ever get the motivation to start my own project, or if Mallow lets me on Final Star, I'd be totally changing the way players communicate with other players and NPCs. I hate how it's done in the default systems.

12171217 01-28-2010 01:59 AM

The idea was to allow player input and have dialogue trees, this is just over an hour of work or so. I might expand upon it, unsure at the moment.

Player input is already pretty much done, it's not much work in the first place, just a series of text files that reference other ones is what I would do. Could be conditional based on different variables the player has and whatnot, setting variables as well.

Also, I think this is loads better for dialog. You can even press M to skip, so people like you can be happy, or maybe press D to quickly advance it, like a say().

I had initially planned on using GUIControls, but I'm relatively old fashioned as far as Graal and GS2 goes and haven't done much with them, I usually do things manually with arrays, I feel more comfortable.

Crow 01-28-2010 04:03 PM

The animation looks stiff. Effects are what makes games cool, even if they are just small effects. If they look nice, they create a nice feeling. I suggest increasing the "speed" of the heads, or adding another form of movement to it (some kind of bounce? might look awkward).

Dnegel 01-28-2010 06:09 PM

Pretty neat. ^^

Edit: Oh yeh, forgot giving rep. >.<

Immolate 01-28-2010 06:12 PM

I have to say I do like the implementation as well and has given me a few ideas for later projects. Bravo. Rep++.

Deas_Voice 01-28-2010 08:09 PM

awesome :eek:

coreys 01-28-2010 09:46 PM

Personally, I'd prefer a scripted method. Maybe something similar to a common way behavior trees are made:
PHP Code:

this.conversation newConversation()
  .
dialogue("Bob""head0.png""Hello, World!")
  .
dialogue(player.nickplayer.headimg"Sup")
  .
question("Bob""head0.png""How you doin?", {"Good""Alright""Bad"})
    .
answer("Good")
      .
dialogue("Bob""head0.png""Awesome. ttyl")
      .
toParent()
    .
answer("Alright")
      .
dialogue("Bob""head0.png""Cool, cool")
      .
toParent()
    .
answer("Bad")
      .
dialogue("Bob""head0.png""Sorry to hear that")
      .
toParent()
    .
toParent()
  .
dialogue(player.nickplayer.headimg"Smell ya later")
  ; 


Immolate 01-28-2010 10:11 PM

Quote:

Originally Posted by coreys (Post 1552818)
Personally, I'd prefer a scripted method. Maybe something similar to a common way behavior trees are made:
PHP Code:

this.conversation newConversation()
  .
dialogue("Bob""head0.png""Hello, World!")
  .
dialogue(player.nickplayer.headimg"Sup")
  .
question("Bob""head0.png""How you doin?", {"Good""Alright""Bad"})
    .
answer("Good")
      .
dialogue("Bob""head0.png""Awesome. ttyl")
      .
toParent()
    .
answer("Alright")
      .
dialogue("Bob""head0.png""Cool, cool")
      .
toParent()
    .
answer("Bad")
      .
dialogue("Bob""head0.png""Sorry to hear that")
      .
toParent()
    .
toParent()
  .
dialogue(player.nickplayer.headimg"Smell ya later")
  ; 


I love this idea but rather than having to keep typing the head filename and name, I think it'd be better to have some functions which defines an object for each participant of the conversation, which contains their specific attributes.

12171217 01-29-2010 12:18 AM

I thought of something like that, Abjorn, but figured it would be easier for LATs to handle it if it was stored in text files with a simple interface, could be done with an editor too.

The new format with trees would look something like this:

PHP Code:

CHARACTERS
"Bob" "head3.png"
CHARACTERSEND

DIALOGUE
LABEL choices
Bob
What should I do?
CHOICE "Go to label poop" linepoop
CHOICE 
"Load a new file" filebloop.txt
CHOICE 
"End dialogue" lineend

LABEL poop
Bob
Ahso you like poop!
-
playerummkay?
GOTO 
choices

LABEL end
DIALOGUEEND 

Choices could be handled just as easily by sending back another array with corresponding choices, most likely parsed again by the server. Would be the easiest, in my opinion. Make have a SETVAR function to set player variables or a RUNFUNC function or something, dunno.


All times are GMT +2. The time now is 06:13 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.