[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]  Area Editor
. -> [Folder]  General
. . -> [Subject]  I hope you might know... How to put a pause in this loop....
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: I hope you might know... How to put a pause in this loop....
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
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)

Pages: 1 2  

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Fri 30 Jun 2006 05:16 PM (UTC)  quote  ]
Message
The sentinel flag prevents a mob from moving unless a program moves it around, so it sounds like that's what you want.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Kingsmill   USA  (78 posts)  [Biography] bio
Date Fri 30 Jun 2006 04:40 PM (UTC)  quote  ]
Message
Would I need to mark an option that keeps her from wandering off her designated path, if so how would I do that ?

T.A.N.S.T.A.F.L.
There Aint No Such Thing As Free Lunch,
From the moon is a harsh mistress.
[Go to top] top

Posted by Kingsmill   USA  (78 posts)  [Biography] bio
Date Fri 30 Jun 2006 04:34 PM (UTC)  quote  ]
Message
I might need to use mpsleep instead of mpdelay, and/or put the current code in a loop....
But I'm not sure....

T.A.N.S.T.A.F.L.
There Aint No Such Thing As Free Lunch,
From the moon is a harsh mistress.
[Go to top] top

Posted by Kingsmill   USA  (78 posts)  [Biography] bio
Date Fri 30 Jun 2006 04:31 PM (UTC)  quote  ]
Message
I am thinking about the following code:
look
if inroom($i) == 9902
mpdelay 3
south
look
if inroom($i) == 9904
mpdelay 3
west
look
if inroom($i) == 9903
mpdelay 3
northwest
look
if inroom($i) == 9901
mpdelay 3
south
look
if inroom($i) == 9900
mpdelay 3
east
look at $n
endif
endif
endif
endif
endif
:would it work ? If not how can I change it ?

T.A.N.S.T.A.F.L.
There Aint No Such Thing As Free Lunch,
From the moon is a harsh mistress.
[Go to top] top

Posted by Kingsmill   USA  (78 posts)  [Biography] bio
Date Fri 30 Jun 2006 04:18 PM (UTC)  quote  ]
Message
I think I'm going to use if inroom($i) == room#
instead of the mobiles....

T.A.N.S.T.A.F.L.
There Aint No Such Thing As Free Lunch,
From the moon is a harsh mistress.
[Go to top] top

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Fri 30 Jun 2006 01:48 PM (UTC)  quote  ]
Message
It may not be where things are leading in this thread now, but the mpsleep code is available from http://www.mudbytes.net/index.php?a=files&s=viewfile&fid=509 which includes the bugfix for it as well. I've never used it on a mob that is supposed to wander around, so the results might not be desirable, but this will provide the ability to delay commands in a prog.

SmaugMuds.org: http://www.smaugmuds.org - The Smaug MUDs Community Center

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
[Go to top] top

Posted by Nick Gammon   Australia  (19,470 posts)  [Biography] bio   Forum Administrator
Date Fri 30 Jun 2006 07:09 AM (UTC)  quote  ]
Message
Quote:

While those are rather humurous scenarios, Nick ...


Glad you like them. :)

If that is what he is trying to do, how about simply using the "on time interval" mob prog (whatever its name is, I'm not at my PC right now), and if it is in appropriate room, and sees an appropriate player, moves?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Fri 30 Jun 2006 06:53 AM (UTC)  quote  ]
Message
*L* While those are rather humurous scenarios, Nick, what he originally posted was that the mob that the prog is on enters the room, looks at target (how it finds this target is beyond me, perhaps it should use $r rather than $n...) and if that person is named "Sam" or "Terry" or whatever other name for that stage of the trigger, the mob then moves the direction listed below, repeat ad nausem.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by Nick Gammon   Australia  (19,470 posts)  [Biography] bio   Forum Administrator
Date Thu 29 Jun 2006 09:03 PM (UTC)  quote  ]
Message
Quote:

Say Nick, Do you have any suggested code of some sort in some ressorce ?


Well, since someone mentioned mpsleep, I did what I normally do in this situation and did a Google on that word. There are quite a few hits, the first one on this site (!) so the subject has come up before on this forum. Try that, and see what you find. There will be links to the snippet.

However I repeat my warnings about attempting this. I gather that if the player's name is not Sam you want them to go:


west
northwest
south


I can see a number of problems with this ...


  • During the delay they may move, making them not go where you intended.

  • Once they have moved one room (west) they are no longer in the room with the room program which makes them move, or the mob program, and thus they are out of range anyway of the script.

  • Personally I would find it very annoying if a script started slowly moving me around. For example, I enter the room and it moves me west, so I think "hang on, I am looking around!" - so I got back east. Then it moves me northwest, and I start getting really annoyed. So I move back again. Then it moves me south and I start getting ready to complain to the admins that their game has a bug.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Thu 29 Jun 2006 06:31 PM (UTC)  quote  ]
Message
He hadn't said "mobile being a mobile", he'd said "mobile being mobile".. subtle difference, but.. anyway, I think he's trying to give a mob a specific set 'route' based on a flowchart style set of choices/presences, and he might want to take a look at the way the mayor spec_func was done for that and make one of his own for this mob instead of trying to do it via mobprog, or add in the mpsleep snippet to do what he's after. But yeah, overall, I agree, in general mobs are already quite mobile enough on their own unless you throw the sentinel flag on them.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 29 Jun 2006 05:31 PM (UTC)  quote  ]
Message
I know that mobile means able to move, I just am wondering what you mean in a bigger sense, because mobiles can all already move...

And what do you mean by using rooms instead of mobiles? Sure, you can put programs onto rooms, just use rpedit instead of mpedit.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Kingsmill   USA  (78 posts)  [Biography] bio
Date Thu 29 Jun 2006 05:02 PM (UTC)  quote  ]
Message
Would there be a way to use rooms instead of mobile's for my code ??

T.A.N.S.T.A.F.L.
There Aint No Such Thing As Free Lunch,
From the moon is a harsh mistress.
[Go to top] top

Posted by Kingsmill   USA  (78 posts)  [Biography] bio
Date Thu 29 Jun 2006 05:00 PM (UTC)  quote  ]
Message
When I said a mobile being "mobile" I meant "mobile" like able to move...

T.A.N.S.T.A.F.L.
There Aint No Such Thing As Free Lunch,
From the moon is a harsh mistress.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Thu 29 Jun 2006 04:56 PM (UTC)  quote  ]
Message
What do you mean, have "a mobile be a mobile"?

You can try using SmaugFUSS, which has this command, I believe.

If mpdelay is a command in your codebase, try it out and see what happens. But keep in mind what Nick warned about; if you depend on $n being present and in the meantime the player leaves, $n will no longer refer to the right person.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Kingsmill   USA  (78 posts)  [Biography] bio
Date Thu 29 Jun 2006 04:46 PM (UTC)  quote  ]
Message
Would mpdelay work ???

T.A.N.S.T.A.F.L.
There Aint No Such Thing As Free Lunch,
From the moon is a harsh mistress.
[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.


12,506 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[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]    [Web site powered by FutureQuest.Net]