Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Google, Yahoo!

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Could somebody translate for ...
Forum Rules | Mark all | Recent Posts

Could somebody translate for me please?
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jun 11, 2002, 9:26 am   Last edited Nov 24, 2007, 5:00 pm by Samson
Go to the top of the page
Go to the bottom of the page

kilroy
Magician
GroupMembers
Posts122
JoinedMay 1, 2002

Use mobinvis (make it so only immortals can see them) on a scriptmob
(name it.. whatever, its just to hold scripts afterall) and set it to
the room, with no movement... give it a random script, make the
percentage high or low depending on how frequent you want the exits to
change. Now, inside the random script, put in a random fork condition,
and in each of these fork conditions, put an mpopen and mpclose (I think
those are the ones, it lets a movile "dig" or "cover" an exit) with the
desired destination and direction... make SURE you do an mpclose on all
possible exits before the rand fork condition, that way the exits wont
stick... so basically... random execute of the script, mpclose all
directions, then a random fork selection of three possible outcomes, the
first as north to room 2 and west to room 3, the second has west to room
3 and south to room 4, and the third has south to room 4 and east to
room 5... Voila, you have your changing exits. If you want this "shift"
to be made aware to the players, its fun to stick in an emote too, like
"Suddenly the stone walls begin to collapse in a unexpected orderly
fashion. Each brick dances with the next in liquid movements, changing
their once-static foundation, until the entire room has a completely
different appearance."... the only thing is, you'd have to make the room
desc vague enough to support the change of exits.
rand_prog 100
$n enters the room
mpclose all
mpopen n
mpopen se
mpopen sw
else
mpopen s
mpopen ne
else
mpopen nw
mpopen s


Am I on the right track here?
Kilroy
       
Post is unread #2 Jun 11, 2002, 1:34 pm
Go to the top of the page
Go to the bottom of the page

elbryan

GroupMembers
Posts34
JoinedMay 13, 2002

looking at your mobprogram;

rand_prog 100
$n enters the room <--- wont do anything
mpclose all
mpopen n
mpopen se
mpopen sw
else <--- no ifchecks for it to be used
mpopen s
mpopen ne
else <--- again, no ifcheck for it to be used
mpopen nw
mpopen s

You have else statements, but no ifchecks to cause it to decide on which else section to use.

You need multiple ifchecks since you have 3 different options for the mobprogram to take. An ifcheck for the first and second option and then an else for the last option making it the default for when both random ifchecks aren't met.

rand_prog 100
mpclose all
if rand(33)
mpopen n
mpopen se
mpopen sw
else
if rand(66)
mpopen s
mpopen ne
else
mpopen nw
mpopen s
endif
endif

I haven't done much with rand programs, not sure if the lower or higher number needs to be first or second.

I haven't tried the program, but that is the basic outline.

To deal with the vague room description, you could use 'mea' within the mobprogram for each different set of opening to echo to the player the exit information. Only thing is, if they was in the room and did a 'look' they wouldn't see the description.
       
Post is unread #3 Jun 11, 2002, 7:02 pm
Go to the top of the page
Go to the bottom of the page

kilroy
Magician
GroupMembers
Posts122
JoinedMay 1, 2002

Okay
That makes sense with the ifchecks
I will give that a try and see how many times I can crash the mud before I get it working

Thank you

Kilroy
       
Post is unread #4 Jun 11, 2002, 11:00 pm
Go to the top of the page
Go to the bottom of the page

elbryan

GroupMembers
Posts34
JoinedMay 13, 2002

Your welcome.

Glad to help for a change, instead of always asking for it:)

Let me know how it works out. Like I said, I haven't done much with multiple rand checks.
       
Post is unread #5 Jun 12, 2002, 4:34 pm   Last edited Nov 24, 2007, 5:00 pm by Samson
Go to the top of the page
Go to the bottom of the page

kilroy
Magician
GroupMembers
Posts122
JoinedMay 1, 2002

okay -
I put that prog in - and it does not blow up on me - (which is good)
1>rand_prog 100
mpclose all
if rand(33)
   mpopen n
   mpopen se
   mpopen nw
else
if rand(33)
   mpopen s
   mpopen sw
   mpopen se
else
if rand(34)
   mpopen se
   mpopen n
   mpopen sw
endif
endif
endif

yet nothing happens (I took it right off of elbryan's example)

Now the room is proto, as is the mob.
Would that affect the progs?

I also saw there is an openpassage and closepassage mpcommand
if I have a room devoid of exits - with the mob in there set to open and close passages, is that another work around?
or is elbryan's example correct, but perhaps misformatted?

Any Ideas?

THanks
Kilroy

ps. I used my own brand of fuzzy logic and used the rand 33+33+34=100
I dont know if that is correct or not
       
Post is unread #6 Jun 12, 2002, 9:30 pm   Last edited Nov 24, 2007, 5:00 pm by Samson
Go to the top of the page
Go to the bottom of the page

kilroy
Magician
GroupMembers
Posts122
JoinedMay 1, 2002

Alright guys - I think that I might be onto something here
but I know that I am also confusing the absolute crap outa myself.

This is what I have sofar.
[393hp 718m 147mv] rpedit list
1>entry_prog 100
mpclosepassage 17509 0
mpclosepassage 17509 2
mpclosepassage 17509 6
mpclosepassage 17509 7
mpclosepassage 17509 8
mpclosepassage 17509 9

2>rand_prog 100
if rand(33)
  mpopenpassage 17509 17510 0
  mpopenpassage 17509 17505 9
  mpopenpassage 17509 17511 7
else 
if rand(33)
  mpopenpassage 17509 17503 2
  mpopenpassage 17509 17512 6
  mpopenpassage 17509 17506 8
else
if rand(34)
  mpopenpassage 17509 17506 8
  mpopenpassage 17509 17510 0
endif
endif
endif

the Room itself has no natural exits
the closepassage works
it is just the random function to open the passages
Now - If I do a similar thing to the rand
except on an entry prog kinda like this:
2>entry_prog 50
mpopenpassage 17509 17506 8

3>entry_prog 50
mpopenpassage 17509 17505 9


that tells me that I have the 50% chance of BOTH of those firing, only 1 firing, or NONE firing - and that would really suck

Please could somebody shed some light for me?

Thanks
Kilroy the confused
       
Post is unread #7 Jun 12, 2002, 11:28 pm
Go to the top of the page
Go to the bottom of the page

elbryan

GroupMembers
Posts34
JoinedMay 13, 2002

I just played around with the program on my mud and got it to work. Here's my code:
>entry_prog 100
mpclosepassage 40300 0
mpclosepassage 40300 1
mpclosepassage 40300 2
mpclosepassage 40300 3
if rand(33)
mpopenpassage 40300 40000 0
else
if rand(66)
mpopenpassage 40300 42500 1
else
if rand(100)
mpopenpassage 40300 40200 2
else
mpopenpassage 40300 40100 3
endif
endif
endif

I just noticed that it never did open the final passage for direction 3 in the last else statement.

Hope this helps a bit.
       
Post is unread #8 Jun 13, 2002, 7:44 pm
Go to the top of the page
Go to the bottom of the page

kilroy
Magician
GroupMembers
Posts122
JoinedMay 1, 2002

Well elbryan,
You sir are a genius

It did not occur to me that you could have a random prog within the entry prog, and BY GOLLY as you say IT WORKS

I setup a test area and setup the prog in 8 rooms - and I was totallly lost very quickly

hehehe
I am a sadistic bastard, But I have set the rooms descriptions to appear as though they are in a desert sandstorm.

This "sandstorm" will only be a few rooms around - but it should be a bit of a challenge to the players - mid level area very definately


Thanks.
Kilroy.
       
Post is unread #9 Jun 13, 2002, 10:32 pm
Go to the top of the page
Go to the bottom of the page

elbryan

GroupMembers
Posts34
JoinedMay 13, 2002

Your very welcome.

Just a little note. You can use any of the ifchecks within any program. (see ifchecks, ifchecks2 ifchecks3, ifchecks4).

If you wanted to be real creative with your program, you could have it check the players intellegince and if it was a certain # or higher, you could fork the program to make it easier to navigate for them than forsomeone with less intellegence.

The ifchecks can make mudprograms do almost anything imaginable.
       
Pages:<< prev 1 next >>