- Joined
- Oct 3, 2016
- Messages
- 7
- Reaction score
- 0
- First Language
- English
- Primarily Uses
I hope this is the right place for this! I'm trying to create a script that pulls from three different random lists of phrases to construct random sentences for my NPCs, and I've run into a bit of a snag because I'm pretty new at Ruby. Here's what I've got so far (the dialogue is ridiculous, I know)
@name = "Marley"
@message_1 = "I just discovered",
"My favorite band is The",
"I really enjoy",
"I had a nightmare about",
"you look like a bunch of",
"Nobody but me has ever seen",
"Mainstream stuff is for",
"I'm not rude, society just consists of"
@random = rand(7)
@message_2 = " large",
" purple",
" orange",
" grotesque",
" scaly",
" smelly",
@random = rand(5)
@message_3 = " pustules",
" dolls.",
" eggplants.",
" buffalo.",
" airplane hangars",
@random = rand(4)
$game_message.add(@name + ": " + @message_1[@random]+ @message_2[@random]+ @message_3[@random])
I'm just getting back the same four sentences, ("I really enjoy orange eggplant," "My favorite band is The purple dolls," "I just discovered large pustules," and "you look like a bunch of scaly airplane hangars." None of these is particularly ideal. Does anyone have any suggestions or pointers? I'm pretty stuck.
Thanks so much!

@name = "Marley"
@message_1 = "I just discovered",
"My favorite band is The",
"I really enjoy",
"I had a nightmare about",
"you look like a bunch of",
"Nobody but me has ever seen",
"Mainstream stuff is for",
"I'm not rude, society just consists of"
@random = rand(7)
@message_2 = " large",
" purple",
" orange",
" grotesque",
" scaly",
" smelly",
@random = rand(5)
@message_3 = " pustules",
" dolls.",
" eggplants.",
" buffalo.",
" airplane hangars",
@random = rand(4)
$game_message.add(@name + ": " + @message_1[@random]+ @message_2[@random]+ @message_3[@random])
I'm just getting back the same four sentences, ("I really enjoy orange eggplant," "My favorite band is The purple dolls," "I just discovered large pustules," and "you look like a bunch of scaly airplane hangars." None of these is particularly ideal. Does anyone have any suggestions or pointers? I'm pretty stuck.
Thanks so much!









