DragonPrime - LoGD Resource Community

Coding Support => Coding Support Desk => Topic started by: TGTarheel on November 13, 2018, 09:30:52 AM



Title: OK, Why Are My Stats Showing In Someone Else's Bio? (SOLVED - Thanks!)
Post by: TGTarheel on November 13, 2018, 09:30:52 AM
OK...so I am confused.  I have a module I made...and the biostats are not working right...when I view someone ELSE'S bio...it shows MY stat in their biostats...instead of their stat.

Now...I tied to model after the biostats from Dycedarg's Academy...because this works...you do NOT see your stat in their bio, but you do see it in your own.

Here is my code
Code:
case "biostat":
$birdtrain = get_module_pref("birdtrain","aviary",$args['acctid']);
if ($birdtrain < 1 ) { ///we don't have a bird, nothing further needed
break;
}
if ($birdtrain > 0 && $birdtrain < 10) { //non-phoenix birds
$birdname = get_module_pref("birdname");
output("`^Avian Companion: %s`n",$birdname);
break;
}
if ($birdtrain == 10) { //phoenix handled separate due to grammatical issues with allowing the naming of phoenixes
$birdname = get_module_pref("birdname");
if ($birdname == "`\$Ph`^oen`Qix") {
$naming = 0;
} else {
$birdtitle = "`Qthe `\$Ph`^oen`Qix";
$naming = 1;
}
if ($naming == 0) {
output("`^Avian Companion: %s`n",$birdname);
} else if ($naming == 1) {
output("`^Avian Companion: %s, %s`n",$birdname,$birdtitle);
}
}
break; //this breaks phoenix birds, all other birds and no bird break above.

I am not understanding why this is not working in my module, but it does work elsewhere.  Why am I seeing MY stat...when I view someone else's bio?
It has to be something small I am not seeing, but I do not know what it is I am missing...


Title: Re: OK, Why Are My Stats Showing In Someone Else's Bio?
Post by: Anharat on November 13, 2018, 11:00:34 AM
Check which parameters can be passed to get_module_pref and how you use them when getting "birdtrain" and "birdname". You'll figure it out.


Title: Re: OK, Why Are My Stats Showing In Someone Else's Bio?
Post by: Aeolus on November 13, 2018, 03:18:09 PM
Check which parameters can be passed to get_module_pref and how you use them when getting "birdtrain" and "birdname". You'll figure it out.

Yep, saw it straight away. Just because one is in another's bio, does not mean one is getting the right person's pref.


Title: Re: OK, Why Are My Stats Showing In Someone Else's Bio?
Post by: TGTarheel on November 13, 2018, 10:12:52 PM
Not sure I AM figuring it out.

The $args['acctid'] was meant to make it pull the pref for the acct id being viewed, regardless of who is viewing.  Yet it seems to pull the pref for the player viewing...regardless of who is being viewed.

What am I actually missing here?

OY VEY!!

***Slaps forehead***

I think I DO see it now...

OMG am I stupid.  I don't have the $args['acctid'] on the other prefs being fetched!!

I did that and now it works.

Thanks, guys.
You at least made me look...but then I figured it out on my own...but probably would not have figured it out without that nudge from Anharat...

This module is one that replaces Fairy Dragons...with a series of birds of prey that you can train...and then turn in for better birds...until you finally get the Phoenix.  Quite difficult, actually, and tons of fun.
You actually have to train 30 birds before you can get the Phoenix...there's nine birds before the Phoenix, and you have to train a certain number of each one before you can advance to the next one.

It does depend on the Item System, though, the way I have this thing coded.  Technically, you could run the Fairy Dragons with this...but I coded it for my site with the intent that it replace the Fairy Dragons.

© 2018 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines