Register forum user name Search FAQ

Gammon Forum

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 ➜ Adding new mob variable

Adding new mob variable

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 3  

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #15 on Mon 01 Sep 2003 06:07 PM (UTC)
Message
In my first post, I said "I've put it in mob_index_data and char_data (in mud.h)" And value2 works fine, I've already tested it on players.

    unsigned long long  mvr;

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #16 on Mon 01 Sep 2003 06:11 PM (UTC)
Message
what about x8?

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #17 on Mon 01 Sep 2003 06:13 PM (UTC)
Message
Hmm, that could be why. How/where would I add the x8?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #18 on Mon 01 Sep 2003 06:19 PM (UTC)
Message
should be at the begining of the load_mobiles, the line:

int x1, x2, x3, x4, x5, x6, x7, x8;

should become

int x1, x2, x3, x4, x5, x6, x7;
unsigned long long x8;

If x8 is used anywhere else, you might need to make a seperate vaiable for this, something like

int x1, x2, x3, x4, x5, x6, x7, x8;
unsigned long long x9;

and change the line to read
sscanf( ln, "%d %d %d %d %d %d %d %llu",
&x1, &x2, &x3, &x4, &x5, &x6, &x7, &x9 );

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #19 on Mon 01 Sep 2003 06:24 PM (UTC)

Amended on Mon 01 Sep 2003 06:25 PM (UTC) by Zeno

Message
What about this line?

            ln = fread_line( fp );
            x1=x2=x3=x4=x5=x6=x7=x8=0;
            sscanf( ln, "%d %d %d %d %d %d %d %llu",
                &x1, &x2, &x3, &x4, &x5, &x6, &x7, &x9 );

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #20 on Mon 01 Sep 2003 06:28 PM (UTC)
Message
I'm not sure I understand what your asking. All that line does is reset the values back to zero so that if something is not read in properly, it will set the x's with 0 instead of what they were previously declared as. If you don't use x9 before that, it will be set to 0 automatically. If you want to be safe, add x9 to that list.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #21 on Mon 01 Sep 2003 06:32 PM (UTC)
Message
So far, its still not working. I'll explain exactly what happens. I sign on the mud, copyover/reboot, mset the variable to 5, savearea, stat the mob, its still at 5, then copyover/reboot, loadarea, then stat the mob again. Its back to 0. Whats not working? Loading it, saving it, or we don't know?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #22 on Mon 01 Sep 2003 06:44 PM (UTC)
Message
Well, you can eliminate a few things by checking your area file to see if the value of 5 is where its supposed to be. If not, then its not writing to the file. I assume that you have the prototype flag on, so just check the appropriate line. If it is in the file, then the problem might be that it is being loaded into the mob index data, but not the mobs it self, you need to check create_mobile to move the data from the mob index into the inividual instances of the mob.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #23 on Mon 01 Sep 2003 06:52 PM (UTC)
Message
Argh, I don't see the variable. I set the value to 10, savearea, and open the area file. Then I close it, set it to 20, savearea, and open the area file again. Nothing changed, and I never did see the variable. I'll keep trying.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #24 on Mon 01 Sep 2003 07:02 PM (UTC)
Message
ok, to recap, the mob is set to prototype, and you mset its mvr to 10. Then you savearea. Then, you open the file with a text editor, go down to the mob you were editing, and the line is reading, what? 0? nothing at all? -1?

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #25 on Mon 01 Sep 2003 07:04 PM (UTC)
Message
Nothing at all, I think. Right now I'm having a little different trouble.

gcc -c  -O -g3 -Wall -Wuninitialized    -DSMAUG     act_comm.c
In file included from /usr/include/bits/types.h:31,
                 from /usr/include/sys/types.h:31,
                 from act_comm.c:19:
/usr/lib/gcc-lib/i386-redhat-linux/3.2/include/stddef.h:201: syntax error before "typedef"

This is new to me. I reverted the old change back to normal and I still get the error. Something wrong with my host?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #26 on Tue 02 Sep 2003 06:49 AM (UTC)
Message
Fixed that problem, whoops. Now, I set the mob variable to 7, savearea, and check the mob. I'm not really sure whats what, but I don't see a 7.

1140851715 0 0 S
1 0 0 0d0+0 0d0+0
10 0
101 101 5
#1302
shopkeeper~
A shopkeeper~
A shopkeeper stand here, selling things

So its not even saving to it?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Boborak   USA  (228 posts)  Bio
Date Reply #27 on Tue 02 Sep 2003 08:56 AM (UTC)

Amended on Tue 02 Sep 2003 09:00 AM (UTC) by Boborak

Message
What you just posted is half of one mob and the other half of another. Each mob section starts at the #vnum. Make sure you're looking at the right mob. It would likely be the last number on the line.

Just a suggestion: mset the value to something totally unique, like (123454321) then do a search for that in the area file.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #28 on Tue 02 Sep 2003 04:50 PM (UTC)
Message
Ugh, sorry about that. I've been sick the last few days, and I can't think straight, lol. Ok, I set it to 987 and savearea, searched in the area file, found nothing.

#1302
shopkeeper~
A shopkeeper~
A shopkeeper stand here, selling things
~
~
1140850691 0 0 S
1 0 0 0d0+0 0d0+0
0 0
101 101 1

At least were getting somewhere. -_-

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #29 on Thu 04 Sep 2003 06:46 AM (UTC)

Amended on Thu 04 Sep 2003 06:48 AM (UTC) by Greven

Message
Ok, so do you know which line it is supposed to be printing out? I beleive that the one you are using is for a "complex" mob, which is defined, at least in mine, as:

	if ( pMobIndex->perm_str != 13	||   pMobIndex->perm_int   != 13
	||   pMobIndex->perm_wis != 13	||   pMobIndex->perm_dex   != 13
	||   pMobIndex->perm_con != 13	||   pMobIndex->perm_cha   != 13
	||   pMobIndex->perm_lck != 13
	||   pMobIndex->hitroll  != 0	||   pMobIndex->damroll    != 0
	||   pMobIndex->race	 != 0
	||   pMobIndex->attacks	 != 0	||   pMobIndex->defenses   != 0
	||   pMobIndex->height	 != 0	||   pMobIndex->weight	   != 0
	||   pMobIndex->speaks	 != 0	||   pMobIndex->speaking   != 0
	||   pMobIndex->xflags	 != 0   ||   pMobIndex->numattacks != 0
	||   pMobIndex->vip_flags !=0)
	  complexmob = TRUE;
	else
	  complexmob = FALSE;

Which, as you notice, does not include your mvr variable. So, you might need to add it to this list to define it as a complex mob, like such:
	if ( pMobIndex->perm_str != 13	||   pMobIndex->perm_int   != 13
	||   pMobIndex->perm_wis != 13	||   pMobIndex->perm_dex   != 13
	||   pMobIndex->perm_con != 13	||   pMobIndex->perm_cha   != 13
	||   pMobIndex->perm_lck != 13
	||   pMobIndex->hitroll  != 0	||   pMobIndex->damroll    != 0
	||   pMobIndex->race	 != 0
	||   pMobIndex->attacks	 != 0	||   pMobIndex->defenses   != 0
	||   pMobIndex->height	 != 0	||   pMobIndex->weight	   != 0
	||   pMobIndex->speaks	 != 0	||   pMobIndex->speaking   != 0
	||   pMobIndex->xflags	 != 0   ||   pMobIndex->numattacks != 0
	||   pMobIndex->vip_flags !=0   
	||   pMobIndex->mvr        != 0)
	  complexmob = TRUE;
	else
	  complexmob = FALSE;

If it is not considered "complex", as in none of the above variables are set, then it will not write it out.

Looking at your last post, it is simple mob, as it has the "S" here:

#1302
shopkeeper~
A shopkeeper~
A shopkeeper stand here, selling things
~
~
1140850691 0 0 S
1 0 0 0d0+0 0d0+0
0 0
101 101 1


Of it were a complex mob, it would have been a C, I beleive. That is why it is not being written out. So add your variable to the list on that ifcheck, and it should then write it out.Hope that helps.

Greven

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
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.


78,762 views.

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

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.