Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: Stuck trying to create a random sentence generator for my NPC events
- Original author: KaliYuga
- Original date: October 2, 2016
- Source thread: https://forums.rpgmakerweb.com/threads/stuck-trying-to-create-a-random-sentence-generator-for-my-npc-events.69163/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > Learning Ruby and RGSSx
Summary
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",
Archived First Post
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!
Protected download
@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!
Protected download
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadReferenced Images / Attachments
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
1
view
Topic Summary
Loading summary...
