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 #30 on Sat 06 Sep 2003 12:12 AM (UTC)

Amended on Fri 12 Dec 2003 07:33 PM (UTC) by Zeno

Message
Ah, that worked.
Thanks so much for everyone who helped!

One thing, old mobs now have that variable as "8,243,966,800,626,345,332". Why is this?

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

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #31 on Sat 06 Sep 2003 08:46 AM (UTC)
Message
Glad to help. What likely happened was that it was trying to write out to the file, and the variable was null, so it created a random number it pulled from memory. Or, when it was trying to load the mobs without that number, same thing, read in from some random part of memory. Easiest thing to do is make it initialize the variable when it first creates the mob, in create_mobile I think, initialize it as 0, and then later on if the index is not zero, it would set it to whatever the appropriate value is.

Greven

Nobody ever expects the spanish inquisition!

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #32 on Sat 06 Sep 2003 06:02 PM (UTC)
Message
Well, in create_mobile, I already have it set in there as

    mob->numattacks             = pMobIndex->numattacks;
    mob->mvr                    = pMobIndex->mvr;
    mob->speaks                 = pMobIndex->speaks;


So you want me to change it to..

    mob->mvr                    = 0;

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

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #33 on Sat 06 Sep 2003 08:31 PM (UTC)
Message
No, sorry, not create_mobile, my bad, load_mobiles. Should have a section something like this:

	if ( letter == 'C' || letter == 'Z' ) /* Realms complex mob 	-Thoric  */
	{
	    pMobIndex->perm_str			= fread_number( fp );
	    pMobIndex->perm_int			= fread_number( fp );
	    pMobIndex->perm_wis			= fread_number( fp );
	    pMobIndex->perm_dex			= fread_number( fp );
	    pMobIndex->perm_con			= fread_number( fp );
	    pMobIndex->perm_cha			= fread_number( fp );
	    pMobIndex->perm_lck			= fread_number( fp );
 	    pMobIndex->saving_poison_death	= fread_number( fp );
	    pMobIndex->saving_wand		= fread_number( fp );
	    pMobIndex->saving_para_petri	= fread_number( fp );
	    pMobIndex->saving_breath		= fread_number( fp );
	    pMobIndex->saving_spell_staff	= fread_number( fp );
	    ln = fread_line( fp );
	    x1=x2=x3=x4=x5=x6=x7=0;
	    sscanf( ln, "%d %d %d %d %d %d %d",
		&x1, &x2, &x3, &x4, &x5, &x6, &x7 );
	    pMobIndex->race		= x1;
	    pMobIndex->height		= x3;
	    pMobIndex->weight		= x4;
	    pMobIndex->speaks		= x5;
	    pMobIndex->speaking		= x6;
	    pMobIndex->numattacks	= x7;
	    if ( !pMobIndex->speaks )
		pMobIndex->speaks = race_table[pMobIndex->race].language | LANG_BASIC;
	    if ( !pMobIndex->speaking )
		pMobIndex->speaking = race_table[pMobIndex->race].language;

	    ln = fread_line( fp );
	    x1=x2=x3=x4=x5=x6=x7=x8=0;
	    sscanf( ln, "%d %d %d %d %d %d %d %d",
		&x1, &x2, &x3, &x4, &x5, &x6, &x7, &x8 );
	    pMobIndex->hitroll		= x1;
	    pMobIndex->damroll		= x2;
	    pMobIndex->xflags		= x3;
	    pMobIndex->resistant	= x4;
	    pMobIndex->immune		= x5;
	    pMobIndex->susceptible	= x6;
	    pMobIndex->attacks		= x7;
	    pMobIndex->defenses		= x8;
	}
	else 
	{
	    pMobIndex->perm_str		= 10;
	    pMobIndex->perm_dex		= 10;
	    pMobIndex->perm_int		= 10;
	    pMobIndex->perm_wis		= 10;
	    pMobIndex->perm_cha		= 10;
	    pMobIndex->perm_con		= 10;
	    pMobIndex->perm_lck		= 10;
	    pMobIndex->race		= 0;
	    pMobIndex->xflags		= 0;
	    pMobIndex->resistant	= 0;
	    pMobIndex->immune		= 0;
	    pMobIndex->susceptible	= 0;
	    pMobIndex->numattacks	= 0;
	    pMobIndex->attacks		= 0;
	    pMobIndex->defenses		= 0;
	}

change it to such:, in the appropriate place, I think its:

	if ( letter == 'C' || letter == 'Z' ) /* Realms complex mob 	-Thoric  */
	{
	    pMobIndex->perm_str			= fread_number( fp );
	    pMobIndex->perm_int			= fread_number( fp );
	    pMobIndex->perm_wis			= fread_number( fp );
	    pMobIndex->perm_dex			= fread_number( fp );
	    pMobIndex->perm_con			= fread_number( fp );
	    pMobIndex->perm_cha			= fread_number( fp );
	    pMobIndex->perm_lck			= fread_number( fp );
 	    pMobIndex->saving_poison_death	= fread_number( fp );
	    pMobIndex->saving_wand		= fread_number( fp );
	    pMobIndex->saving_para_petri	= fread_number( fp );
	    pMobIndex->saving_breath		= fread_number( fp );
	    pMobIndex->saving_spell_staff	= fread_number( fp );
	    ln = fread_line( fp );
	    x1=x2=x3=x4=x5=x6=x7=0;
	    sscanf( ln, "%d %d %d %d %d %d %d",
		&x1, &x2, &x3, &x4, &x5, &x6, &x7 );
	    pMobIndex->race		= x1;
	    pMobIndex->height		= x3;
	    pMobIndex->weight		= x4;
	    pMobIndex->speaks		= x5;
	    pMobIndex->speaking		= x6;
	    pMobIndex->numattacks	= x7;
	    if ( !pMobIndex->speaks )
		pMobIndex->speaks = race_table[pMobIndex->race].language | LANG_BASIC;
	    if ( !pMobIndex->speaking )
		pMobIndex->speaking = race_table[pMobIndex->race].language;

	    ln = fread_line( fp );
	    x1=x2=x3=x4=x5=x6=x7=x8=0;
	    sscanf( ln, "%d %d %d %d %d %d %d %d",
		&x1, &x2, &x3, &x4, &x5, &x6, &x7, &x8 );
	    pMobIndex->hitroll		= x1;
	    pMobIndex->damroll		= x2;
	    pMobIndex->xflags		= x3;
	    pMobIndex->resistant	= x4;
	    pMobIndex->immune		= x5;
	    pMobIndex->susceptible	= x6;
	    pMobIndex->attacks		= x7;
	    pMobIndex->defenses		= x8;
	}
	else 
	{
	    pMobIndex->perm_str		= 10;
	    pMobIndex->perm_dex		= 10;
	    pMobIndex->perm_int		= 10;
	    pMobIndex->perm_wis		= 10;
	    pMobIndex->perm_cha		= 10;
	    pMobIndex->perm_con		= 10;
	    pMobIndex->perm_lck		= 10;
	    pMobIndex->race		= 0;
	    pMobIndex->xflags		= 0;
	    pMobIndex->resistant	= 0;
	    pMobIndex->immune		= 0;
	    pMobIndex->susceptible	= 0;
	    pMobIndex->numattacks	= 0;
            pMobIndex->mvr              = 0;
	    pMobIndex->attacks		= 0;
	    pMobIndex->defenses		= 0;
	}

Just the part for non-complex mobs. If that doesn't work, it means that the value was written into the files, and if so, that something else entirely.

Nobody ever expects the spanish inquisition!

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #34 on Sat 06 Sep 2003 09:42 PM (UTC)
Message
Well, uh, it looks like this right now

        }
        else
        {
            pMobIndex->perm_str         = 13;
            pMobIndex->perm_dex         = 13;
            pMobIndex->perm_int         = 13;
            pMobIndex->perm_wis         = 13;
            pMobIndex->perm_cha         = 13;
            pMobIndex->perm_con         = 13;
            pMobIndex->perm_lck         = 13;
            pMobIndex->race             = 0;
            pMobIndex->class            = 3;
            pMobIndex->xflags           = 0;
            pMobIndex->resistant        = 0;
            pMobIndex->immune           = 0;
            pMobIndex->susceptible      = 0;
            pMobIndex->numattacks       = 0;
            pMobIndex->mvr              = 5;
#ifdef XBI
            xCLEAR_BITS(pMobIndex->attacks);
            xCLEAR_BITS(pMobIndex->defenses);
#else
            pMobIndex->attacks          = 0;
            pMobIndex->defenses         = 0;

Looks a bit different than yours. I wanted 5 to be default when the mob is created.

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

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #35 on Sat 06 Sep 2003 11:08 PM (UTC)
Message
thats for simple mobs, correct? So, either its loading that 8 trillion number when it should be setting it to 5, but I doubt thats its, so whats probably happening is that its setting the 8 trillion number for complex mobs when it has nothing to read in, so you could set it like such:

	if ( letter == 'C' || letter == 'Z' ) /* Realms complex mob 	-Thoric  */
	{
            pMobIndex->mvr                   = 5;
	    pMobIndex->perm_str			= fread_number( fp );
	    pMobIndex->perm_int			= fread_number( fp );
	    pMobIndex->perm_wis			= fread_number( fp );
	    pMobIndex->perm_dex			= fread_number( fp );
	    pMobIndex->perm_con			= fread_number( fp );
	    pMobIndex->perm_cha			= fread_number( fp );
	    pMobIndex->perm_lck			= fread_number( fp );
 	    pMobIndex->saving_poison_death	= fread_number( fp );
	    pMobIndex->saving_wand		= fread_number( fp );
	    pMobIndex->saving_para_petri	= fread_number( fp );
	    pMobIndex->saving_breath		= fread_number( fp );
	    pMobIndex->saving_spell_staff	= fread_number( fp );
	    ln = fread_line( fp );
	    x1=x2=x3=x4=x5=x6=x7=0;
	    sscanf( ln, "%d %d %d %d %d %d %d",
		&x1, &x2, &x3, &x4, &x5, &x6, &x7 );
	    pMobIndex->race		= x1;
	    pMobIndex->height		= x3;
	    pMobIndex->weight		= x4;
	    pMobIndex->speaks		= x5;
	    pMobIndex->speaking		= x6;
	    pMobIndex->numattacks	= x7;

thus, initializing it to 5, and then it will change it if it is supposed to.

Nobody ever expects the spanish inquisition!

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #36 on Sun 07 Sep 2003 05:33 PM (UTC)
Message
Well, that didn't change anything, still a large variable. Oh well, its not a problem, I was just wondering why. All I have to do is change the mobs variable to something lower.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
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,767 views.

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

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.