Chat how-to up on wiki

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Chat how-to up on wiki

#1 Post by yufra »

The link for "Chats: Beyond Hack and Slash" on the wiki how-to page taunted me as I passed through yesterday, and since I had just spent some time using the Chat code for my module I decided to write a guide. Let me know if there are any issues with it, or simply edit the wiki yourself. Cheers!
<DarkGod> lets say it's intended

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Chat how-to up on wiki

#2 Post by darkgod »

Well done Sir Knight!
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Shoob
Reaper
Posts: 1535
Joined: Mon Jan 22, 2007 6:31 pm
Location: East of the sun, west of the moon

Re: Chat how-to up on wiki

#3 Post by Shoob »

hmmm, I suppose I could write up a guide on how to randomize chats too (makes the game more variable). though I dont know how much time I have to do that.

if you want to know how to do that just use

Code: Select all

 greeting = {"Hi", "Hello", "Good day", "Bonjour", "Greetings"}
hope = {"hope", "trust", "see", "perceive"}
and then to call it:

Code: Select all

newChat{ id="hello",
    text = rng.table(greeting) .. " @playername@! I " .. rng.table(hope) .. " your quest goes well.",
    answers = {
         {rng.table(greeting) .. "!"},
    },
}
notice the use of rng.table(foo) to pick a random string and the use of ".." to combine the strings.
Oliphant am I, and I never lie.

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Chat how-to up on wiki

#4 Post by yufra »

I like the randomization Shoob!
<DarkGod> lets say it's intended

Post Reply