[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  wait states

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: wait states
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Wed 15 Sep 2004 10:33 PM (UTC)  quote  ]
Message
i'll get the code once i get off work, but envy was based off of merc, so envy is kind of like an old VW bug compared to smaug. This mud im workin on is about 7 years old and based on envy20. so some things are the same, but mostly smaug is alot more user friendly. i'll get the search function once i get home though.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Wed 15 Sep 2004 09:46 PM (UTC)  quote  ]
Message
OK - how do they implement the search function then?

Their syntax looks like it was taken from SMAUG so chances are they built on top of SMAUG - which would mean that they'd still have those timers since those have been around for a long time.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Wed 15 Sep 2004 08:57 PM (UTC)  quote  ]
Message
Ksilyan,

i'm on an envy codebase. i just recently got the new coder position on a mud. it's differnt from smaug, but kind of the same. i can't find a good envy forum, so i'm thinking of trying to add a timer function into envy from smaug. port one over. or if there are any quick fixes for right now. i don't know, i'll have to look into it more.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Wed 15 Sep 2004 06:21 PM (UTC)  quote  ]
Message
Yeah. The wait state simply delays processing of *future* commands, not ones that have already been processed e.g. your quit command. It is completely useless for what you are trying to do.

How can your SMAUG not have a timer in it? That's how search works - it sets the substate and calls another search later on.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Wed 15 Sep 2004 04:53 PM (UTC)  quote  ]
Message
Can you post the full search function? Smaug's WAIT_STATE adds a "lag" to the player, not a timer.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Wed 15 Sep 2004 04:25 PM (UTC)  quote  ]
Message
hmm..i'm workin on envy, it doesn't have a timer build in to it. it's in a command do_camp. here is a piece of code in do_search.


 if (!found)
    {
      buf2[0] = '\0';
      WAIT_STATE (ch, 2 * PULSE_VIOLENCE);
      strcat (buf2, "Your search reveals nothing.\n\r");
      send_to_char (buf2, ch);
    }


would i hvae to add a timer state to the whole mud itself to make the timer here? or can i work a wait state into it?
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Wed 15 Sep 2004 11:14 AM (UTC)  quote  ]
Message
The wait state is a command delay, not a time delay. You need to use the timer delay to do what you want. I think there are some topics on it, see if you can find any while I look up the code for timer delay.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Wed 15 Sep 2004 07:37 AM (UTC)  quote  ]
Message
When my players quit, I want them to have a little bit of a wait time because they are setting up camp. this also allows if they have a mob hunting them, they can't just log off for awhile. nothing too long, but still need it. i couldn't get this wait state to work. it never did anything. anyone know what i'm doing wrong?



send_to_char ("^CYou search around for a safe place to camp.^w\n\r", ch);
WAIT_STATE( ch, 4 * PULSE_TICK);
send_to_char ("^GYou complete your campsite.^w\n\r", ch);


i've also tried this to see if anything was working:


WAIT_STATE( ch, 3000 );

        send_to_char ("^CYou search around for a safe place to camp.^w\n\r", ch);
WAIT_STATE( ch, 4 * PULSE_VIOLENCE);
send_to_char ("^GYou complete your campsite.^w\n\r", ch);
[/CODE]

any thoughts?

[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,605 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]