MudBytes
Pages: << prev 1 next >>
Portals, -1 whats the deal?
JohnnyStarr
Wizard






Group: Members
Posts: 823
Joined: Feb 14, 2009

Go to the bottom of the page Go to the top of the page
#1 id:27751 Posted Jun 28, 2009, 3:33 pm

Ok, so i'm trying to figure out why if every documentation about ROM out there states that you
can have a portals V0 set to -1 to have unlimited charges, when the code below (from act_enter.c)
says portal->value[0] == -1 "fades out of existence, then at the end it uses (handler.c)'s extract_obj(portal);?

I mean, yeah, i could change it, but first of all, why does it do this, and second, will i screw up everything?

       
Code (text):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
	if (portal != NULL && portal->value[0] == -1)
        {
            act ("$p fades out of existence.", ch, portal, NULL, TO_CHAR);
            if (ch->in_room == old_room)
                act ("$p fades out of existence.", ch, portal, NULL, TO_ROOM);
            else if (old_room->people != NULL)
            {
                act ("$p fades out of existence.",
                     old_room->people, portal, NULL, TO_CHAR);
                act ("$p fades out of existence.",
                     old_room->people, portal, NULL, TO_ROOM);
            }
            extract_obj (portal);
        }
 
.........................

"It's not the daily increase but daily decrease. Hack away at the unessential." - Bruce Lee
Southlake Window Cleaner

Sandi
Wizard






Group: Members
Posts: 628
Joined: Jun 17, 2006

Go to the bottom of the page Go to the top of the page
#2 id:27760 Posted Jun 28, 2009, 9:59 pm

Why? Because the author couldn't / didn't read the code or check an appropriate area file?

I don't really know, but I do know the DizzyMUD Area Building Guide is much more accurate.

Dizzy Builder's Guide


For legacy reasons, I'd say don't change the code - it's fine. Just remember to set permanent portals to '0', not '-1'.
.........................
The Witch of Tir na nOg

www.tnnmud.com
tnnmud.com 6789

JohnnyStarr
Wizard






Group: Members
Posts: 823
Joined: Feb 14, 2009

Go to the bottom of the page Go to the top of the page
#3 id:27765 Posted Jun 28, 2009, 11:20 pm

once again, thankyou sandi!

yeah, after checking out "Dizzy" I'm totally going to roll with that instead.
.........................

"It's not the daily increase but daily decrease. Hack away at the unessential." - Bruce Lee
Southlake Window Cleaner

Ssolvarain
Sorcerer






Group: Members
Posts: 390
Joined: Nov 14, 2008

Go to the bottom of the page Go to the top of the page
#4 id:27766 Posted Jun 28, 2009, 11:23 pm

-1 is correct for a permanent portal...
.........................
Builder, End of Time eotmud.com:4000
The Rodney Dangerfield of Mudding.

ATT_Turan
Conjurer




Group: Members
Posts: 161
Joined: Jun 10, 2009

Go to the bottom of the page Go to the top of the page
#5 id:27799 Posted Jun 29, 2009, 8:17 am

Ssolvarain said:
-1 is correct for a permanent portal...


You might have built someplace where their code was modified for that to be true, but simply looking at the code that staryavsky posted above shows that, for at least him, it is not.  You can't argue with code  :grinning:

JohnnyStarr
Wizard






Group: Members
Posts: 823
Joined: Feb 14, 2009

Go to the bottom of the page Go to the top of the page
#6 id:27814 Posted Jun 29, 2009, 11:42 am

Hmm, it might be noted that I am using a QuickMud base and not stock Rom2.4
Maybe that is why the above code block is different than the standard rom24.doc in the doc folder? Anyhoo, I guess it dosn't matter, in the end I would have to agree, its all about the code.
.........................

"It's not the daily increase but daily decrease. Hack away at the unessential." - Bruce Lee
Southlake Window Cleaner

Sandi
Wizard






Group: Members
Posts: 628
Joined: Jun 17, 2006

Go to the bottom of the page Go to the top of the page
#7 id:27841 Posted Jun 29, 2009, 5:09 pm

From ROM 2.4b, enter.c
Code (text):
1
2
3
4
5
6
7
8
9
10
11
 
	/* charges */
	if (portal->value[0] > 0)
	{
	    portal->value[0]--;
	    if (portal->value[0] == 0)
		portal->value[0] = -1;
	}
 


It would make more sense if it conformed to the behavior of lights and wands, but there it is.
.........................
The Witch of Tir na nOg

www.tnnmud.com
tnnmud.com 6789

teknozwizard
Apprentice




Group: Members
Posts: 25
Joined: Aug 19, 2009

Go to the bottom of the page Go to the top of the page
#8 id:32435 Posted Aug 26, 2009, 11:53 am

If you're using QuickMud, then I can definitely settle this discussion now on one condition:

Code (text):
1
2
3
4
5
6
7
8
9
10
 
if ispc $n 'whereas $n = staryavsky
then
mob echo Portals can be made eternal by leaving the v0 set as 0
mob echo If the portals v0 is set to -1, then it will always disappear after 1 use
mob echo So, leave v0 as 0 and you'll always have an eternal portal! Yay!!!!!
endif
 


:alien:


Basically staryavsky, that was my lame @$$ attempt to say that when our muds Coder/Owner put up QuickMud, I had the same question. I'm used to the value of -1 being the "eternal" modifier. Unfortunately for some reason, QuickMud has it written it, but it doesn't work. After playing around with it for a little while, I realized that I could just leave v0 as 0 without our Coder/Owner changing anything (at least, to my knowledge he hasn't changed anything as Sandi has suggested) and it works perfectly everytime. Ironically enough, I'm 96% sure you could to the same when making containers to never fill, fountains to never dry up, and drink containers to never empty. I hope that answers your question, but I'm fairly certain that I didn't because from what I gathered from the conversation, you guys were talking about the specifics of the actual code behind it.....hrmm...

Sandi
Wizard






Group: Members
Posts: 628
Joined: Jun 17, 2006

Go to the bottom of the page Go to the top of the page
#9 id:32480 Posted Aug 26, 2009, 5:36 pm

Sorry to disappoint, but no, setting V0 to zero just gives you a drink container with no room in it. And fountains don't even check it, they always work.
.........................
The Witch of Tir na nOg

www.tnnmud.com
tnnmud.com 6789

Skol
Sorcerer






Group: Members
Posts: 493
Joined: May 17, 2006

Go to the bottom of the page Go to the top of the page
#10 id:32481 Posted Aug 26, 2009, 5:39 pm

Yeah, I completely rewrote my fountain code due to that, and then added in update to have them fill up with more fluid. Groovy ;).
.........................
-=-=-=-=-=-=-=-
Skol/Dave/Zivilyn

http://www.ansalonmud.com/images/ansalon_banner_2008.jpg
www.AnsalonMUD.com

Ansalon & Rom Builders Guide
Rom Area Sanctuary

Ssolvarain
Sorcerer






Group: Members
Posts: 390
Joined: Nov 14, 2008

Go to the bottom of the page Go to the top of the page
#11 id:32483 Posted Aug 26, 2009, 5:43 pm

So much for the fount of knowledges :P
.........................
Builder, End of Time eotmud.com:4000
The Rodney Dangerfield of Mudding.

teknozwizard
Apprentice




Group: Members
Posts: 25
Joined: Aug 19, 2009

Go to the bottom of the page Go to the top of the page
#12 id:32503 Posted Aug 27, 2009, 3:08 am

Ssolvarain said:
So much for the fount of knowledges :P

Nah, I know what the code I'm working with does. It's cool though. Each mud is uniquely different, which is what makes them cool!

Pages:<< prev 1 next >>
Tags
[+]

Valid XHTML 1.1! Valid CSS!