CityVilleBot (Project DEVIL)


Join the forum, it's quick and easy

CityVilleBot (Project DEVIL)
CityVilleBot (Project DEVIL)
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Try LilyCity HD, it's a real cityville clone
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptyMon Apr 20, 2015 1:52 pm by ertyanna

» expansions cityville hack new 12/12/15
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptySat Feb 14, 2015 9:52 pm by nico

» Biohazard Problem Expansion
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptySat Nov 08, 2014 3:12 pm by CV FO LIFE

» CAN SOMEONE HELP ME?
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptySat Nov 08, 2014 3:09 pm by CV FO LIFE

» hello friends i have new update of cv bot project devil 1.10 update (2.01)
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptySat Nov 01, 2014 12:59 pm by Blue Angel

» [Resolved] codebase-php Error
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptySun Oct 12, 2014 7:22 am by nico

» -_- Which bot is now working ????
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptyThu Oct 09, 2014 7:06 pm by lobobpf6

» bot 1.2 does nt work
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptySun Aug 10, 2014 1:00 am by nathaliafariass

» COMO FUNCIONA
[SOLVED][Bug Population] res_xxxxxxxxxxxx EmptySun Aug 10, 2014 12:38 am by nathaliafariass

Affiliates
free forum


[SOLVED][Bug Population] res_xxxxxxxxxxxx

3 posters

Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  rlff38 Thu Apr 26, 2012 11:10 am

Why some residences have 0 population ? For res_italian_oldapts, the min population is 350/680 (in gamesettings.xml)

[You must be registered and logged in to see this image.]

The currentPopulation in database is stored at 0.

After manually collecting, I get +60 for 2 of them and now the bot show :

[You must be registered and logged in to see this image.]


Last edited by rlff38 on Thu Apr 26, 2012 6:56 pm; edited 1 time in total

rlff38

Posts : 120
Points : 126
Join date : 2011-12-27
Location : France

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  Little Todd Thu Apr 26, 2012 4:09 pm

rlff38 wrote:Why some residences have 0 population ? For res_italian_oldapts, the min population is 350/680 (in gamesettings.xml)

[You must be registered and logged in to see this image.]

The currentPopulation in database is stored at 0.

After manually collecting, I get +60 for 2 of them and now the bot show :

[You must be registered and logged in to see this image.]

They don't really have 0 population.

Current population just does not get set until the first move in occurs. I have a fix. It will be included in the next release.

Little Todd

Posts : 409
Points : 425
Join date : 2012-02-23

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  rlff38 Thu Apr 26, 2012 6:18 pm

Thx Todd

I think a new method xmlsOb::GetResidencesBasePopulation($name) will be welcome in ./codebase-php/GetSettingsFromXml.php

maybe this one :
Code:
    function GetResidencesBasePopulation($name) {
        foreach ($this->gsXML->items->item as $item) {
            if ($item['name'] == $name) {
                if (!isset($item->populationBase)) {
                    $res = $this->GetResidencesBasePopulation( (string)$item['derivesFrom'] ); //recursive callback
                    break;
                }
                $res = (string)$item->populationBase;
                break;
            }
        }
        return $res;
    }

Tested and works perfectly Very Happy

rlff38

Posts : 120
Points : 126
Join date : 2011-12-27
Location : France

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  Little Todd Thu Apr 26, 2012 7:17 pm

rlff38 wrote:Thx Todd

I think a new method xmlsOb::GetResidencesBasePopulation($name) will be welcome in ./codebase-php/GetSettingsFromXml.php

maybe this one :
Code:
    function GetResidencesBasePopulation($name) {
        foreach ($this->gsXML->items->item as $item) {
            if ($item['name'] == $name) {
                if (!isset($item->populationBase)) {
                    $res = $this->GetResidencesBasePopulation( (string)$item['derivesFrom'] ); //recursive callback
                    break;
                }
                $res = (string)$item->populationBase;
                break;
            }
        }
        return $res;
    }

Tested and works perfectly Very Happy

Yes, that function is required in GetSettingsFromXml.php, but a call to that function is needed in the buildings class file. Did you edit the class file also?

Little Todd

Posts : 409
Points : 425
Join date : 2012-02-23

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  rlff38 Thu Apr 26, 2012 8:12 pm

Little Todd wrote:Yes, that function is required in GetSettingsFromXml.php, but a call to that function is needed in the buildings class file. Did you edit the class file also?

Yes, near line 357. in Buildings_class.php

Code:
        foreach ($resI as $id=>$item)
        {
            $obj = $this->ld->GetObjectById($id);
            $pop = $obj["currentPopulation"]*10;
            // -- [START] -- ADDED FOR BUG POPULATION
            if($pop == 0)
                $pop = $xmlsOb->GetResidencesBasePopulation($item)*10;
            // -- [END] -- ADDED FOR BUG POPULATION
            $popmax = $xmlsOb->GetResidencesMaxPopulation($item)*10;
            $popstats = $pop." / ".$popmax;
            if ($popmax - $pop == 0) {$full = "(FULL) ";} else {$full = "";}
            $resIN .= '<option value="'.$id.'">'.$full.$item." ($id) : $popstats</option>";
        }
        foreach ($resN as $id=>$item)
        {
            $obj = $this->ld->GetObjectById($id);
            $pop = $obj["currentPopulation"]*10;
            // -- [START] -- ADDED FOR BUG POPULATION
            if($pop == 0)
                $pop = $xmlsOb->GetResidencesBasePopulation($item)*10; //
            // -- [END] -- ADDED FOR BUG POPULATION
            $popmax = $xmlsOb->GetResidencesMaxPopulation($item)*10;
            $popstats = $pop." / ".$popmax;
            if ($popmax - $pop == 0) {$full = "(FULL) ";} else {$full = "";}
            $resNOT .= '<option value="'.$id.'">'.$full.$item." ($id) : $popstats</option>";
        }

and near line 375, in Buildings-DownTown_class.php
Code:
      foreach ($resI as $id=>$item)
      {
      $obj = $this->ld->GetDTObjectById($id);
      $pop = $obj["currentPopulation"]*10;
        // -- [START] -- ADDED FOR BUG POPULATION
            if($pop == 0)
                $pop = $xmlsOb->GetResidencesBasePopulation($item)*10;
        // -- [END] -- ADDED FOR BUG POPULATION
      $popmax = $xmlsOb->GetResidencesMaxPopulation($item)*10;
      $popstats = $pop." / ".$popmax;
      if ($popmax - $pop == 0) {$full = "(FULL) ";} else {$full = "";}
        $resIN .= '<option value="'.$id.'">'.$full.$item." ($id) : $popstats</option>";
      }
      foreach ($resN as $id=>$item)
      {
      $obj = $this->ld->GetDTObjectById($id);
      $pop = $obj["currentPopulation"]*10;
        // -- [START] -- ADDED FOR BUG POPULATION
            if($pop == 0)
                $pop = $xmlsOb->GetResidencesBasePopulation($item)*10;
        // -- [END] -- ADDED FOR BUG POPULATION
      $popmax = $xmlsOb->GetResidencesMaxPopulation($item)*10;
      $popstats = $pop." / ".$popmax;
      if ($popmax - $pop == 0) {$full = "(FULL) ";} else {$full = "";}
        $resNOT .= '<option value="'.$id.'">'.$full.$item." ($id) : $popstats</option>";
      }

But the problem is why the database store 0 if the residence's population = populationBase ?


Last edited by rlff38 on Thu Apr 26, 2012 8:22 pm; edited 1 time in total

rlff38

Posts : 120
Points : 126
Join date : 2011-12-27
Location : France

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  Little Todd Thu Apr 26, 2012 8:17 pm

Problem fixed in v1.2

[PLUGIN] Buildings-DownTown v1.2 (26/04/2112)


Little Todd

Posts : 409
Points : 425
Join date : 2012-02-23

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty RE: res

Post  blwilli12 Fri Apr 27, 2012 10:18 pm

This fixes the residents in the boxes but not the custom houses and the skyscrapers

blwilli12

Posts : 15
Points : 25
Join date : 2011-10-09

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  Little Todd Fri Apr 27, 2012 10:47 pm

blwilli12 wrote:This fixes the residents in the boxes but not the custom houses and the skyscrapers

Can you post a screen shot of the bot and one of the item in game showing the difference?

Thanks.

Little Todd

Posts : 409
Points : 425
Join date : 2012-02-23

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  blwilli12 Sat Apr 28, 2012 12:44 am

Little Todd wrote:
blwilli12 wrote:This fixes the residents in the boxes but not the custom houses and the skyscrapers

Can you post a screen shot of the bot and one of the item in game showing the difference?

Thanks.

[You must be registered and logged in to see this image.]



the wintercastle without the fix gave a 0 pop and with the fix the pop is show right as in the pic above but as you can see the second custom house and the japanese skyscraper is showing 0 pop as seen in the pic above. The pic shows the building in question are shown bellow.

[You must be registered and logged in to see this image.]

blwilli12

Posts : 15
Points : 25
Join date : 2011-10-09

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  Little Todd Sat Apr 28, 2012 1:42 am

blwilli12 wrote:
Little Todd wrote:
blwilli12 wrote:This fixes the residents in the boxes but not the custom houses and the skyscrapers

Can you post a screen shot of the bot and one of the item in game showing the difference?

Thanks.

[You must be registered and logged in to see this image.]



the wintercastle without the fix gave a 0 pop and with the fix the pop is show right as in the pic above but as you can see the second custom house and the japanese skyscraper is showing 0 pop as seen in the pic above. The pic shows the building in question are shown bellow.

[You must be registered and logged in to see this image.]

Thanks,

I will work on getting a fix.

Little Todd

Posts : 409
Points : 425
Join date : 2012-02-23

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  rlff38 Wed May 02, 2012 11:31 pm

For CustomResidence:

in Buildings-DownTown_class.php,
~LINE 584 FIND:
Code:
$pop = $obj['currentPopulation']*10;
ADD AFTER ON A NEW LINE (IF NOT EXIST):
Code:
if ($pop == 0) {$pop = $this->xmlsOb->GetResidencesBasePopulation($obj['itemName'])*10;}


For Skyscraper:

in Buildings-DownTown_class.php,
~LINE 673 FIND:
Code:
$pop = $obj['currentPopulation']*10;
ADD AFTER ON A NEW LINE (IF NOT EXIST):
Code:
if ($pop == 0) {$pop = $this->xmlsOb->GetResidencesBasePopulation($obj['itemName'])*10;}



For testing, try adding a new CustomResidence & Skyscraper and run the bot (on plugin page, right click->refresh)


Last edited by rlff38 on Thu May 03, 2012 7:45 am; edited 1 time in total

rlff38

Posts : 120
Points : 126
Join date : 2011-12-27
Location : France

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re:

Post  blwilli12 Thu May 03, 2012 4:42 am

got this error when putting line of code in for the skyscrapers

Fatal error: Call to a member function GetResidencesBasePopulation() on a non-object in C:\Program Files (x86)\CVBot - Project DEVIL\Plugins\Buildings\Buildings_class.php on line 562

blwilli12

Posts : 15
Points : 25
Join date : 2011-10-09

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  rlff38 Thu May 03, 2012 7:36 am

blwilli12 wrote:got this error when putting line of code in for the skyscrapers

Fatal error: Call to a member function GetResidencesBasePopulation() on a non-object in C:\Program Files (x86)\CVBot - Project DEVIL\Plugins\Buildings\Buildings_class.php on line 562

It's for Buildings-DownTown_class.php, not Buildings_class.php







But if you want the same for building_class.php only, try to add this line if not exist :
Code:
if($pop == 0) {$pop = $xmlsOb->GetResidencesBasePopulation($obj['itemName'])*10;}

rlff38

Posts : 120
Points : 126
Join date : 2011-12-27
Location : France

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re:

Post  blwilli12 Thu May 03, 2012 12:52 pm

ok that line of code fix the problem.

Thank you

P.S the custom houses and skyscraper collection is only on the buildings plugin after the 1.5.6 update

blwilli12

Posts : 15
Points : 25
Join date : 2011-10-09

Back to top Go down

[SOLVED][Bug Population] res_xxxxxxxxxxxx Empty Re: [SOLVED][Bug Population] res_xxxxxxxxxxxx

Post  rlff38 Thu May 03, 2012 5:20 pm

blwilli12 wrote:ok that line of code fix the problem.

Thank you

P.S the custom houses and skyscraper collection is only on the buildings plugin after the 1.5.6 update

I don't think that, because the version 1.5.6 shows only what you have in downtown's plugin.
You can try to build a new custom residence and/or skyscraper in downtown. Very Happy

rlff38

Posts : 120
Points : 126
Join date : 2011-12-27
Location : France

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum