DragonPrime - LoGD Resource Community

Modules, Themes and other customizations for your game => Completed Modules for version 1.x.x => Topic started by: lonnyl on September 29, 2004, 10:50:13 AM



Title: 98 converted bladder
Post by: lonnyl on September 29, 2004, 10:50:13 AM
The bladder module for 0.9.8.... works with the outhouse...  and works with the new version of chow.....

code to add to other modules to make food increase players bladder
Code:
if (is_module_active('bladder')) {
            set_module_pref("bladder", (get_module_pref("bladder","bladder") + 1),"bladder");
         }
change the number 1 accordingly...

http://www.pqcomp.com/modules/mydownloads/visit.php?cid=3&lid=36


Title: Re:98 converted bladder
Post by: Sichae on September 29, 2004, 10:54:36 AM
:sighs:

And I thought I was the ruler of the "..."

:hands the crown over to Lonny:


Title: Re:98 converted bladder
Post by: lonnyl on September 29, 2004, 11:01:30 AM
Updated...Small text fix...


Title: Re:98 converted bladder
Post by: lonnyl on September 30, 2004, 06:07:13 AM
updated again.... now empties the player's bladder on every visit to the outhouse and not just the first...


Title: Re:98 converted bladder
Post by: lonnyl on October 12, 2004, 12:34:07 PM
Updated (ver 1.2).... now recognizes and updates odor module... now has peepee dance... and if a player wanders the village having to go too terribly bad will wet their pants... also should be translation ready.


Title: Re:98 converted bladder
Post by: Boofo on October 17, 2004, 10:29:24 AM
Is there supposed to be a graphic with this? I get a little square with no graphic.


Title: Re:98 converted bladder
Post by: lonnyl on October 17, 2004, 10:48:38 AM
Well.... now the zip file inclues images...  :o


Title: Re:98 converted bladder
Post by: Boofo on October 17, 2004, 12:10:12 PM
Thank you, sir. ;) And thanks for the excellent mods. ;)


Title: Re:98 converted bladder
Post by: mProwler on October 23, 2004, 10:37:15 AM
Excellent modules, lonnyl.. installed a few of your new ones last night and am very pleased by them.  However, one thing of note that I feel should be changed.

The bars, for hunger, odor, and bladder, currently use bars based on graphic files.  This isn't the best way to do this.  As with the health, experience, and my new day bars, it should use some sort of CSS trick, to eliminate the need for another IMG.  Here's the code I added/changed in bladder.php, though it works with the other two, as well.

Starting right after the for statement on line 43, I took out the if..else statement, and added these 4 lines..

Code:
if (get_module_pref('bladder')>$i) $len+=2;
$max+=2;

After this, I closed out the for loop, and removed everything from that point all the way down to the first addcharstat() call. I replaced it with the code below.

Code:
      $pct = round($len / $max * 100, 0);
      $nonpct = 100-$pct;
      if ($pct > 100) {
         $pct = 100;
         $nonpct = 0;
      }
      if ($pct < 0) {
         $pct = 0;
         $nonpct = 100;
      }

                $color = "#ff0000";
                $bgcolor = "#777777";

      $bladder .= "<table style='border: solid 1px #000000' bgcolor='$bgcolor' cellpadding='0' cellspacing='0' width='70' height='5'><tr><td width='$pct%' bgcolor='$color'></td><td width='$nonpct%'></td></tr></table>";

This is a much better solution than using graphics, in my opinion.  Hope you find it appropriate to incorporate into the scripts. :)  

Regards,
-mP ;D


Title: Re:98 converted bladder
Post by: lonnyl on October 23, 2004, 11:55:58 AM
Actually I was looking into redoing the bars and also displaying the percentage with text as well for our JAWS users..... so... when I get a chance I will play around with your suggestion seeing as you are figuring the percentage already.....


Title: Re:98 converted bladder
Post by: mProwler on October 23, 2004, 01:08:33 PM
Yeah, the percentage display would be a good thing.  Here's some code for that.. *EDIT* I have included the full case "charstats" statement from my bladder.php file.  If you want to put this in, just replace the entire statement from case "charstats" to break, and insert the settings code.

Insert the following into the "settings" array in _getmoduleinfo().
Code:
        "showcurrent"=>"Show current percentage,bool|1",
         "showbar"=>"Show bladder percentage as a bar,bool|1",

The following is the full commented code from my bladder.php.  Simply replace this section in function bladder_dohook().
Code:
   case "charstats":
      // reset lengths
      $len=0;
           $len2=0;
      
      $max=40; // maximum value of bladder
      $bladderval = get_module_pref('bladder'); // get current value of bladder
           for ($i=0;$i<$max/2;$i+=1){
         if ($bladderval>$i) $len+=2;
      }

      // calculate percentage
      $pct = round($len / $max * 100, 0);
      $nonpct = 100-$pct;
      if ($pct > 100) {
         $pct = 100;
         $nonpct = 0;
      } elseif ($pct < 0) {
         $pct = 0;
         $nonpct = 100;
      }
      
      // define color variables, reset bladder string
      $color = "`$";
                $barcolor = "#ff0000";
      $barbgcol = "#777777";
      $bladder = "";

      // get module settings
      $showcur = get_module_setting("showcurrent");
      $showbar = get_module_setting("showbar");
      
      // set output string
      if (!$showcur && !$showbar) $bladder .= "`b`\$hidden`b";
      if ($showcur) $bladder .= "`b$color$pct%`b";
      if ($showbar) {
         if ($showcur) $bladder .= "<br />";
         $bladder .= "<table style='border: solid 1px #000000' bgcolor='$barbgcol' cellpadding='0' cellspacing='0' width='70' height='5'><tr><td width='$pct%' bgcolor='$barcolor'></td><td width='$nonpct%'></td></tr></table>";
      }

      // add bladder to character stats
      setcharstat("Vital Info","Bladder",$bladder);
   break;


This code replaces everything in the case "charstats" statement.

Regards,
-mP ;D


Title: Re:98 converted bladder
Post by: Boofo on October 23, 2004, 02:49:29 PM
Where does the bottom code go exactly and what gets replaced?


Title: Re:98 converted bladder
Post by: mProwler on October 23, 2004, 06:15:52 PM
Erm, the bottom code goes after the $pct calculation from the first changes I posted.  I'm sure lonnyl can make more sense of this, so if you can't get it to work, I'd just wait for a new release of the module.

If needed, I'd be happy to post a copy of the scripts I'm using, with my changes incorporated.

Regards,
-mP 8)


Title: Re:98 converted bladder
Post by: Boofo on October 23, 2004, 07:13:53 PM
Erm, the bottom code goes after the $pct calculation from the first changes I posted.  I'm sure lonnyl can make more sense of this, so if you can't get it to work, I'd just wait for a new release of the module.

If needed, I'd be happy to post a copy of the scripts I'm using, with my changes incorporated.

Regards,
-mP 8)

Can you pm them to me. please?


Title: Re:98 converted bladder
Post by: mProwler on October 23, 2004, 09:48:21 PM
I posted the code into the original message. :)

-mP


Title: Re:98 converted bladder
Post by: Boofo on October 23, 2004, 09:59:18 PM
I posted the code into the original message. :)

-mP

Very nice, thank you. ;)

Did you do the other ones, too, by chance? ;)


Title: Re:98 converted bladder
Post by: lonnyl on October 24, 2004, 08:02:29 AM
Thanks Mprowler for saving me the time to get that coded.....
Updated to Ver 1.3 now Jaws Compatible.....


Title: Re:98 converted bladder
Post by: lonnyl on December 21, 2004, 08:25:16 AM
Updated to ver 1.31.....

Small improvement to reduce sql queries....


Title: Re:98 converted bladder
Post by: lonnyl on January 30, 2005, 09:23:50 AM
Ok.... Updated and Uploaded..... with new download links...

Please update yours.

http://www.pqcomp.com/modules/mydownloads/visit.php?cid=3&lid=36

Sorry guys.... don't want to basically spam the board... I'll take a break...  :o


Title: Re:98 converted bladder
Post by: MetalDragon42 on March 25, 2005, 03:41:14 AM
Some of my players have been asking if there can be some where to go to potty in the  Main villiag  as it  dose not have a link to the forest where to outhouse is, and as far as I can see theres no way to turn it on like you can on the other villiages I have the new map mod running and the players  dont like the idear of having to move across the map to get to a town with a link to the forest before thay can go pee pee.

if it is to much of a pain to do I will just tell em to live with it and hold it till thay can go :P


Title: Re:98 converted bladder
Post by: lonnyl on March 25, 2005, 05:45:56 AM
Actually it would be quite simple to create a module for the inn..... take a look at the house expansion pack and specifically the housebathroom.....

I might code this in the near future if no one else does....

-EDIT-
and I guess we have the lonnycastle.php running in the capital village and there is a bathroom there, so I have never had a player ask for this.....


Title: Re:98 converted bladder
Post by: lonnyl on March 25, 2005, 05:59:26 AM
It's only take a few minutes.... this is almost done (I simply am adding it to the bladder module with an admin on/off setting)..... I'll get it released after tests are done.


Title: Re:98 converted bladder
Post by: lonnyl on March 25, 2005, 06:09:14 AM
Done.... Ver 1.4

http://www.pqcomp.com/modules/mydownloads/visit.php?cid=3&lid=36

Now adds "The Head" to the Inn if turned on in settings.  
You will need to turn it on if you want to use it as it is off by default.


Title: Re:98 converted bladder
Post by: MetalDragon42 on March 25, 2005, 07:57:11 AM
Thanks lonnyl what would we do with out you :),  I just thoult though I also have lonnycastle.php running and I lost my mind and forgot you could go there (been up all night redoing our site and forum themes lol) but some of my players are on the younger side anyways so its probaly good that thay have a few places thay can go  ;)


Title: Re:98 converted bladder
Post by: Excalibur on May 29, 2005, 01:33:00 PM
Now adds "The Head" to the Inn if turned on in settings.  
You will need to turn it on if you want to use it as it is off by default.
There's a problem with "The Head". It hasn't any control on the use of it, so a player could use it in combo with basement modulo of Lonny Castle to get infinite turns (drinking wine has 1/3 percent chance to get a free turn).

So a modification is needed to avoid this.
After line 129:
Code:
   if ($op == "tinkle"){
you need to add:
Code:
       set_module_pref("usedouthouse",1);

and change lines 146~148:
Code:
       output("`2You step into the Head.  The odor in here just about knocks you over. ");
        output("Best to get your business done and get back to more enjoyable activities. `n");
        addnav("Tinkle","runmodule.php?module=bladder&op=tinkle");
to:
Code:
       if (get_module_pref("usedouthouse")==0){
           output("`2You step into the Head.  The odor in here just about knocks you over. ");
           output("Best to get your business done and get back to more enjoyable activities. `n");
           addnav("Tinkle","runmodule.php?module=bladder&op=tinkle");
        }else{
           output("`2You really don't have anything left to relieve today!");
        }


Title: Re:98 converted bladder
Post by: lonnyl on June 01, 2005, 06:20:41 AM
Thanks Excal.... updated..... please run module updates....


Title: Re: 98 converted bladder
Post by: pilatus on October 26, 2006, 11:23:35 AM
I have a problem with The Head, it only allowed me to go once, now it always say
Quote
      
You really don't have anything left to relieve today!
Running 1.1.0 with no mods special mods outside the bladder one.


Title: Re: 98 converted bladder
Post by: Talisman on October 26, 2006, 12:36:43 PM
I have a problem with The Head, it only allowed me to go once, now it always say
Quote
      
You really don't have anything left to relieve today!
Running 1.1.0 with no mods special mods outside the bladder one.

The outhouse is programmed to only allow one visit a day, and it doesn't care what any modules such as the bladder module might have to say about that.  What you're reporting is normal game behaviour...


Title: Re: 98 converted bladder
Post by: pilatus on October 27, 2006, 09:31:40 AM
I can't go in The head, even after days, irl and ingame time. But I can still go in the outhouse in the forest.

So in a new day with a 50% bladder I went to the Head , it tells e I have nothing left. then I go directly to the outhouse and there my char can relieve himself.


Title: Re: 98 converted bladder
Post by: Talisman on October 27, 2006, 11:01:46 AM
Depending on what lonny's intentions were, either all occurences of 'usedouthouse' in lib/bladder.php need to be changed to 'emptied', or 'usedouthouse' needs to be reset at newday.


Title: Re: 98 converted bladder
Post by: pilatus on October 27, 2006, 02:55:31 PM
thank you, I hadn't looked at the code yet. Only installed this game some days ago.
Changed it to this, you can tinkle now, but not sure if everything else works like intended.
Quote
<?php
   global $session;
   $op = httpget('op');
   page_header("The Head");
  if ($op == "tinkle"){
    set_module_pref("emptied",true);
      output("You use the fine facilities here.`n");
      if (get_module_pref('drunkeness','drinks')>0){
      $drunktmp=get_module_pref('drunkeness','drinks');
      $drunktmp*=.9;
      set_module_pref('drunkeness',$drunktmp,'drinks');
      set_module_pref('bladder',0,'bladder');
      output("`&You feel a little more sober!`n`0");
    }else{
      if (get_module_pref('bladder') > 0){
        output("`&You feel a little better now.`n");
        set_module_pref('bladder',0,'bladder');
      }else{
        output("`&Try as you might, you cannot summon even a drop.`n");
      }
      }
   }else{
    if (get_module_pref("emptied")==0){
      output("`2You step into the Head.  The odor in here just about knocks you over. ");
      output("Best to get your business done and get back to more enjoyable activities. `n");
      addnav("Tinkle","runmodule.php?module=bladder&op=tinkle");
    }else{
      output("`2You really don't have anything left to relieve today!");
    }
   }
   addnav("Back to the Inn","inn.php");
   page_footer();
?>


Title: Re: 98 converted bladder
Post by: The General on January 13, 2007, 05:37:18 AM
The option for changing how much is added to a players bladder on a new day doesn't work. I also only saw one small bit of flavour text ("You need to go to the potty really bad") and a news item when my bladder reached 100%

© 2017 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