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
➜ MPSLEEP code Behavior
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #15 on Thu 04 Aug 2005 08:57 PM (UTC) |
Message
| The problem mine was crashing was that one of the numbers that was used to index an array was up near a million, where the array is 3 slots. With an if check 1 line above for > 2, it was still a million.
if ( value < 3 )
{
ch_printf(ch, "Value: %d", value);
}
Would produce:
Value: 1532423
I dunno, I assume it is memory corruption, who knows. This was my crashing. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #16 on Thu 04 Aug 2005 09:43 PM (UTC) |
Message
| Yeah, I've never had a crash related to mpsleep.
Oh there were more than 1 place to change it to <=, I didn't know that. Well I added the rest (3 total) and still no difference. I'll trying ripping mpsleep from SwFoTE. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Gohan_TheDragonball
USA (183 posts) Bio
|
Date
| Reply #17 on Thu 04 Aug 2005 11:45 PM (UTC) Amended on Thu 04 Aug 2005 11:55 PM (UTC) by Gohan_TheDragonball
|
Message
| I finally took some time in fixing mpsleep, the problem with it is that if you put an mpsleep inside of an ifcheck, they do not work, this will fix it:
you need to change the code inside the function mprog_driver, it is inside the while(TRUE) part, it should start out with something like /*mpsleep - Check if we should sleep -rkb */
change:
if ( !str_prefix("mpsleep", cmnd))
to:
one_argument( cmnd, arg );
if (!str_cmp(arg, "mpsleep"))
inside that if statement below mpsleep->single_step = single_step
change:
/* Time to sleep */
cmnd = one_argument( cmnd, arg);
if (arg[0] == '\0')
mpsleep->timer = 4;
else
mpsleep->timer = atoi(cmnd);
to:
/* Time to sleep */
cmnd = one_argument( cmnd, arg);
if (cmnd[0] == '\0')
mpsleep->timer = 4;
else
mpsleep->timer = atoi(cmnd);
That should fix it up. At least it did on mine. On a side note, I also applied all previous fixes listed like changing < to <= in the FOR statements and changing the boolean in the mpsleep structure to bool ifstate[MAX_IFS][DO_ELSE+1]. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #18 on Fri 05 Aug 2005 12:45 AM (UTC) |
Message
| Ahh, thanks Gohan. That fixed it for me. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Gogoicarus
Japan (15 posts) Bio
|
Date
| Reply #19 on Tue 12 Feb 2008 09:54 AM (UTC) |
Message
| I realize this is the granddaddy of dead-threads, but rather than start a new one I thought I'd add it here.
I'm having problems where while MPsleep works just fine with delays on mobs and objects, when placed in a room, it just croaks out the rest of the prog after it is supposed to sleep. Same MPsleep code is being used.
Here's a sample prog:
<i>>act_prog p gets the stone circlet from the stone man
if level($n) < 50
mpechoat $n You feel a cold chill as you touch the shackle...Something...
mpechoaround $n $n shudders, touching the shackle. Something...
mpforce $n put shackle man
else
mpechoat $n You remove the shackle from the man's ankle, suddenly feeling
mpechoat $n something...
mpechoaround $n $n removes the shackle and gets an odd look in their eye...
mpsleep 2
mpechoat $n &rThis shackle you now hold is one of the five artifacts of the
mpechoat $n lands. In your travels you have seen that this world existed
mpechoat $n long before we mortals were here to walk it.
mpsleep 3
mpechoat $n The stone man whose movements were restricted by this shackle
mpechoat $n moved to turn himself into a God while the Gods themselves were
mpechoat $n trapped in mortal form. He opened the doorway to the realm of
mpechoat $n the Gods themselves, filling the earth with furious fire, and
mpechoat $n the old Gods felt his intrusion into their domain...
mpsleep 5
mpechoat $n &wYou feel as though there is more to this story, but no more
mpechoat $n speaks to your heart, here...
endif
</i>
What the player sees after the MPsleep bug gets through with it is...
>You get the stone shackle from the stone man.
You remove the shackle from the man's ankle, suddenly feeling
something...
And that's it. Nothing else. Since this is rather plot intensive, you can see my problem.
|
Star wars 'is a good movie.' | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #20 on Tue 12 Feb 2008 10:05 AM (UTC) |
Message
| Neither of the branches of the if (that is, if he is level 50 or lower) say "You get the stone shackle from the stone man.".
The act_prog is on "gets the stone circlet from the stone man".
That is not the same as the stone shackle. |
- Nick Gammon
www.gammon.com.au, www.mushclient.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.
65,915 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