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
➜ Stacking timers again.
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #15 on Sat 02 Jul 2005 08:17 AM (UTC) |
Message
| Why not use wait states? I mean, you are really only trying to delay the character, so why not just lag his output a little? I'm sure the fletch command on Avatar works that way.
You type (or similar):
fletch arrows barbed
fletch arrows barbed
fletch arrows barbed
fletch arrows barbed
fletch arrows barbed
And you are rewarded with a nice non-cancelable (that a word?) stack of fletch commands.
Also, I believe the next one will not be analyzed until out of the wait state, so people in the room wont get spammed all at once either.
Best thing about this is your avoid all of the timer mumbo-jumbo that is really irrelevant for this type of thing. If you don't want it to be able to be canceled, don't use a timer. Use a waite state instead.
For the unknowing, wait states can be set via WAIT_STATE(x), where x is the number you specify to wait (in ticks? I'm not sure)
Hoped that helpped ya in some way. Maybe you can still avoid all of the timers :) |
~Nick Cash
http://www.nick-cash.com | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #16 on Sat 02 Jul 2005 10:52 PM (UTC) |
Message
| The problem with wait-states is that they're truly not cancellable and aren't a good way of implementing command queues - which normally can be 'flushed'. That being said if the idea here is to make something truly not cancellable, it could be done with wait-states although the timer approach is more general. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Spike
(27 posts) Bio
|
Date
| Reply #17 on Sun 03 Jul 2005 02:25 AM (UTC) |
Message
| Thanks for the suggestion about wait states, but stacking timers is defiently what I'm looking for. I wish I could just use wait states and be done with it. Mind guiding me a bit Ksilyan as you can see I'm lost on the inner workings of add_timer. | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #18 on Sun 03 Jul 2005 02:30 AM (UTC) |
Message
| Even if I prefer the timer solution, what is wrong with wait states? If your intention is to make it completely non-cancellable, what do you get with timers that you don't get with wait states? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #19 on Sun 03 Jul 2005 02:50 AM (UTC) |
Message
| The only marked advantage that I can see to used non-cancellable queueing timers rather than wait_state is that you could allow a special command or character to wipe the queue, since the command buffer is actually interpretted instead of left sitting on the descriptor data. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #20 on Sun 03 Jul 2005 02:58 AM (UTC) |
Message
| Well, that's exactly why I would prefer the timer solution myself, but Spike seems to not want the queue to be cancellable at all. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Spike
(27 posts) Bio
|
Date
| Reply #21 on Sun 03 Jul 2005 03:43 AM (UTC) |
Message
| Oh no no, dont get me wrong I'm not sure if I stated but I believe I did, I stated it in the begining I was just using dig as an example. The whole point of this thread was stackable timers, and I figured in order to make them stackable you had to make them no cancelable via typing anything....wich is the only way because if you left it to where you can cancel it by typing anything it surely wouldnt be stackable. | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #22 on Tue 05 Jul 2005 05:52 PM (UTC) |
Message
| You have to make them not cancelable but that's just the beginning. You also have to make one start when the previous one finishes, meaning you'll have to keep a record of them somewhere, with e.g. a queue. I think you should perfectly understand how a single timer works, though, before trying to tackle stacking them.
All of this being said, the wait-state approach would probably work for every skill as well, albeit less elegantly. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Spike
(27 posts) Bio
|
Date
| Reply #23 on Wed 06 Jul 2005 04:02 AM (UTC) Amended on Wed 06 Jul 2005 04:03 AM (UTC) by Spike
|
Message
| I'll give up on this for now, I'm just as stuck as I ever was.
Thanks anyway | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #24 on Wed 06 Jul 2005 05:37 PM (UTC) |
Message
| Well, ok, but still, what's wrong with using wait states? Many commands have a 'beats' property which is how long to "lag out" the character. You could set that for the skills you want delayed/stacked and your problem should be solved. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #25 on Wed 06 Jul 2005 06:17 PM (UTC) |
Message
| Yes, wait states could provide what you are looking for quite easily, without all of the timer stuff. It is a little less dynamic (if you planned to have a command to cancel them), but overall it should work well.
IF you look through the code I think you will find that wait states are used quite a bit for lots of things (espeically if you want to be mean to your players...) :P |
~Nick Cash
http://www.nick-cash.com | 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.
62,605 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top