Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple dialog system #343757
10/09/10 21:59
10/09/10 21:59
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline OP
Serious User
PadMalcom  Offline OP
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Hi, today I wrote a simple dialog system for my game. It still might contain some bugs but I thought I'll post it anyway.

The dialog system uses simple txt files which have a special structure.

If you can report any bugs, please do laugh

How to use:
===========================
Init the dialog objects:
initDialogSystem();

Start a dialog:
startDialog("JIMMY","Test001.txt");




Structure of a dialog file:
===========================

Player talks : $Me|TEXT
NPC tals : %NPCNAME|TEXT
Decision panel: &CHOICE1|TARGETLINE[|CHOICE2|TARGETLINE|CHOICE3|TARGETLINE|CHOICE4|TARGETLINE]
End of dialog : §


P.S. Yes, XML would have been better wink

Attached Files
DialogSystem.zip (94 downloads)
Last edited by PadMalcom; 10/09/10 21:59.
Re: Simple dialog system [Re: PadMalcom] #343759
10/09/10 22:28
10/09/10 22:28
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
hey!
i've also written a dialog system!
it's very powerful, but i didn't create choices yet.
i think i will do this now, but here is my first sample of a dialog file:
Code:
;Settings, like NPC name and start element
[Settings]
start=SayHello

;Say something to the player
[SayHello]
type=text
value=Hey Guy!\nYou have to do a small job for me!
termination=key
next=quest_add

;Add the quest
[quest_add]
type=quest_add
file=quests\quest_first.qst
next=quest_setskill

[quest_setskill]
type=skill_set
skill=1
value=1
next=END


i think this is a whole programming language which allows you to create good dialogs with different texts, sounds, choices, ...
i will publish a demo of the system, but i don't know when...


Visit my site: www.masterq32.de
Re: Simple dialog system [Re: MasterQ32] #343762
10/09/10 22:52
10/09/10 22:52
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline OP
Serious User
PadMalcom  Offline OP
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Do you use Lite-C or C-Script? The "next" function is quite nice, I think I'll implement something like that, too laugh And I've to admit, that your code looks much cleaner wink

Re: Simple dialog system [Re: PadMalcom] #343763
10/09/10 23:07
10/09/10 23:07
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
grin i use Lite-C, because you can use the strio.c and it's easier to program.
but i think it will be possible to port it to c-script
the choices are working now...
also you can check if the player has any quest active or has an item or the npc has set a skill
also a very useful function is the command:
Code:
[Settings]
start=Settings
type=command
value=LetACarExplode
next=END



and anywhere in the game:
Code:
function LetACarExplode()
{
    beep();
    beep();
    beep();
    beep();
}



so if you call this Dialog File, the game will be four times!
it's cool to do any effect in game


Visit my site: www.masterq32.de
Re: Simple dialog system [Re: MasterQ32] #343846
10/10/10 19:26
10/10/10 19:26
Joined: Mar 2009
Posts: 146
USA
P
paracharlie Offline
Member
paracharlie  Offline
Member
P

Joined: Mar 2009
Posts: 146
USA
Can you guys create a simple stand a lone .c file so we can take an actual look at it? Would be much appreciated. Thanks, looks fantastic, cant wait to try it.


A8 Commercial
Re: Simple dialog system [Re: paracharlie] #343847
10/10/10 19:30
10/10/10 19:30
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
i thin i will publish a demo of my game in around an hour...
wait for this and you can see the script in action!
the conversation script is nearly standalone, but i think i can convert it to...
i'm also writing on a easy-to-use NPC script editor, so you don't have to write those scripts


Visit my site: www.masterq32.de
Re: Simple dialog system [Re: MasterQ32] #343858
10/10/10 20:58
10/10/10 20:58
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart


Visit my site: www.masterq32.de
Re: Simple dialog system [Re: MasterQ32] #343914
10/11/10 17:36
10/11/10 17:36
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
PadMalcom, I think there're two functions missing in your script: file_count_lines and file_read_line. AFAIK these aren't engine functions either.

Edit:
All right, I've found the functions here.

However, the program crashes when clicking "Maybe". Sometimes it also crashes when exiting. I haven't looked into the reason, but perhaps I've messed up the code by adding the functions or something?

Maybe you could include a demo, to make things easier. laugh

Last edited by Saturnus; 10/11/10 18:19.
Re: Simple dialog system [Re: Saturnus] #345294
10/24/10 20:54
10/24/10 20:54
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline OP
Serious User
PadMalcom  Offline OP
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Hey Saturnus, thanks for the feedback. I'm currently translating the code to be usable with XML-Dialog files. This makes it more dynamic and extendable. In the upcoming version I'll add a demo how to use the "snipped" properly.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1