The Dawn Of Time
The Official Forums for the Dawn Of Time Mud Codebase
 
Log in Register FAQ Memberlist Search The Dawn Of Time Forum Index Goto the Official Dawn Website

My First Mobprog with DoT

 
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Mobprog Questions
View previous topic :: View next topic  
Author Message
jswilson



Joined: 24 Aug 2012
Posts: 11
Location: Ephrata, PA

PostPosted: Mon Oct 07, 2013 7:49 pm    Post subject: My First Mobprog with DoT Reply with quote

I am making a mobprog that will allow some of my mobs to share some rumours with the players when asked. I am going to use a speech trigger for the word "rumour". I would prefer to use a SAYTO, but that kind of trigger doesn't seem to be available. Anyway, I want the mob to respond randomly with one rumour from a list of rumours that I will update to correspond with in-game events.

What is the best way to get a pseudo-random selection of rumors in my prog. I would like to have it just pick a random number from 1 to 5, and choose the corresponding rumour, but It looks like i can only do a random check for numbers equal to or less than a percentile value.

Does this mean I have to do something like:

Code:

if rand 5
    say {rumour 1}
else
    if rand 5
       say {rumour 2}
else
   if rand 5
        say {rumour 3}
else
   if rand 5
        say {rumour 4}
else
   if rand 5
        say {rumour 5}
else
    say "Sorry, I haven't heard anything lately."

endif


Is this the best way to do this?

EDIT: I should probably also have the mobs respond to the american spelling of 'rumor' so players don't have to play annoying syntax guessing games.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jswilson



Joined: 24 Aug 2012
Posts: 11
Location: Ephrata, PA

PostPosted: Fri Oct 11, 2013 12:58 pm    Post subject: Reply with quote

Okay, so here is what I finally came up with. I loaded this onto my barkeep mob in the new town I am building, and tested it. The majority of the time I end up with the last response, but the other response pop up often enough. I may need to play with the rand numbers a bit to even things out. Any suggestions?

Code:

if rand 5
    say We are running a bit low on supplies here in town.
else
    if rand 5
        say Allot of new refugees have been arriving lately.
    else
        if rand 5
            say There is something strange creeping around in the cellar.
        else
            if rand 5
                say If you are new in town, and need training or gear, head over to the customs office.
            else
                if rand 5
                    say A mysterious old woman recently arrived in town. Some people are calling her a profit.
                else
                    say Sorry, I haven't heard anything new lately.
                endif
            endif
        endif
    endif
endif
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Mobprog Questions All times are GMT + 13 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2005 phpBB Group
Theme created by Vjacheslav Trushkin