Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ wait states

wait states

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Ithildin   USA  (262 posts)  Bio
Date Wed 15 Sep 2004 07:37 AM (UTC)
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?

Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Wed 15 Sep 2004 11:14 AM (UTC)
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
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #2 on Wed 15 Sep 2004 04:25 PM (UTC)
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?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Wed 15 Sep 2004 04:53 PM (UTC)
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
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Wed 15 Sep 2004 06:21 PM (UTC)
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
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #5 on Wed 15 Sep 2004 08:57 PM (UTC)
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.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Wed 15 Sep 2004 09:46 PM (UTC)
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
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #7 on Wed 15 Sep 2004 10:33 PM (UTC)
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.
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.


24,160 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.