Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Tue May 21, 2013 4:51 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Sat May 05, 2012 10:23 pm 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
I decided to follow an earlier advice and stuff my variables into classes, like so:

Code:
init python:
    class Aristocracy:
        def __init__ (self, percentage = 5, number = 2000, agricultural_land = 128000, agricultural_land_percentage = 80, cash_crop_land = 20000, cash_crop_land_percentage = 100, pasture_land = 18000, pasture_land_percentage = 90):
            self.percentage = percentage
            self.number = number
            self.agricultural_land = agricultural_land
            self.agricultural_land_percentage = agricultural_land_percentage
            self.cash_crop_land = cash_crop_land
            self.cash_crop_land_percentage = cash_crop_land_percentage
            self.pasture_land = pasture_land
            self.pasture_land_percentage = pasture_land_percentage
        def Pop_Growth (self, growth):
            self.number += growth
            self.percentage = self.number/40000
           
label start:
   
    python:
        Aristocracy = Aristocracy ()   
    $ Aristocracy_Number = Aristocracy.number
    $ Aristocracy_Percentage = Aristocracy.percentage
    "1. Demography of aristocracy is %(Aristocracy_Percentage)d percent, for a total of %(Aristocracy_Number)d people of working age." 
    $ Aristocracy.Pop_Growth(500)
    "2. Demography of aristocracy is %(Aristocracy_Percentage)d percent, for a total of %(Aristocracy_Number)d people of working age." 


The problem here is that if I understood the tutorial right, the second-to-last line should have bumped Aristocracy.number to 2500. But when I run a test, nothing has changed at all. What could have been the problem?

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
PostPosted: Sun May 06, 2012 12:29 am 
Regular

Joined: Tue Mar 22, 2011 2:36 pm
Posts: 72
It need to recount the Aristocracy_Number and Aristocracy_Percentage after Pop_Growth.
Code:
label start:
    python:
        Aristocracy = Aristocracy ()   
    $ Aristocracy_Number = Aristocracy.number
    $ Aristocracy_Percentage = Aristocracy.percentage
    "1. Demography of aristocracy is %(Aristocracy_Percentage)d percent, for a total of %(Aristocracy_Number)d people of working age." 
    $ Aristocracy.Pop_Growth(500)
    $ Aristocracy_Number = Aristocracy.number
    $ Aristocracy_Percentage = Aristocracy.percentage
    "2. Demography of aristocracy is %(Aristocracy_Percentage)d percent, for a total of %(Aristocracy_Number)d people of working age."

_________________
Image
.Traditional Chinese Site.
~Illustrator+Graphic/Web Designer~


Top
 Profile Send private message  
 
PostPosted: Sun May 06, 2012 5:04 am 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
Thanks, and I have more questions:

I created another class using the same setup, this time for the entirety of the Kingdom of Ulmster. Like so:

Code:
     class Ulmster:
        def __init__ (self, percentage = 100, number = 40000, agricultural_land = 160000, agricultural_land_percentage = 100, cash_crop_land = 20000, cash_crop_land_percentage = 100, pasture_land = 20000, pasture_land_percentage = 100):
            self.percentage = percentage
            self.number = number
            self.agricultural_land = agricultural_land
            self.agricultural_land_percentage = agricultural_land_percentage
            self.cash_crop_land = cash_crop_land
            self.cash_crop_land_percentage = cash_crop_land_percentage
            self.pasture_land = pasture_land
            self.pasture_land_percentage = pasture_land_percentage
        def Pop_Growth (self, growth):
            self.number += growth
            self.percentage = self.number/Ulmster.number*100
   
           
     class Aristocracy:
         def __init__ (self, percentage = 5, number = 2000, agricultural_land = 128000, agricultural_land_percentage = 80, cash_crop_land = 20000, cash_crop_land_percentage = 100, pasture_land = 18000, pasture_land_percentage = 90):
             self.percentage = percentage
             self.number = number
             self.agricultural_land = agricultural_land
             self.agricultural_land_percentage = agricultural_land_percentage
             self.cash_crop_land = cash_crop_land
             self.cash_crop_land_percentage = cash_crop_land_percentage
             self.pasture_land = pasture_land
             self.pasture_land_percentage = pasture_land_percentage
         def Pop_Growth (self, growth):
             self.number += growth
             self.percentage = self.number/Ulmster.number*100
           
label start:
   
    python:
        Aristocracy = Aristocracy ()   
    $ Aristocracy_Number = Aristocracy.number
    $ Aristocracy_Percentage = Aristocracy.percentage
    "1. Demography of aristocracy is %(Aristocracy_Percentage)d percent, for a total of %(Aristocracy_Number)d people of working age." 
    $ Aristocracy.Pop_Growth(500)
    $ Aristocracy_Number = Aristocracy.number
    $ Aristocracy_Percentage = Aristocracy.percentage
    "2. Demography of aristocracy is %(Aristocracy_Percentage)d percent, for a total of %(Aristocracy_Number)d people of working age." 


This returns an error, "AttributeError: class Ulmster has no attribute 'number'"

What has gone wrong?

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
PostPosted: Sun May 06, 2012 5:16 am 
Veteran
User avatar

Joined: Wed Nov 18, 2009 11:17 am
Posts: 359
Location: Germany
Completed: Loren
Projects: PS2
The problem is here:
Code:
self.percentage = self.number/Ulmster.number*100


Classes are objects in python as well, they can have fields on their own. But your code only assigns the number field to instances of the class not to the class itself.
I'm not sure what kind of percentage you want to create, so I can't give you a corrected line.

In addition you shouldn't use variables with the same name as the class like here.
Code:
    python:
        Aristocracy = Aristocracy ()

The convention is to use uppercase for class names and lowercase for variables.

_________________
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase II


Top
 Profile Send private message  
 
PostPosted: Sun May 06, 2012 7:00 am 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
Ah, I see.

What I want to do is this: I've got a ton of formula, like these:

Code:
  $ Serf_Efficiency = Demography_Serf_AV*500/Total_Land_Aristocracy_AV + Serfdom*2
    if Serf_Efficiency >= 100:
        $ Serf_Efficiency = 100
    else:
        pass
    $ Grain_Produced_Serfs = Serf_Efficiency * Agricultural_Land_Aristocracy_AV * (100 + Serf_Grain_Modifier) * 0.0001 * Grain_Acreage
    $ Cash_Crop_Produced_Serfs = Serf_Efficiency * Cash_Crop_Land_Aristocracy_AV * (100 + Serf_Cash_Crop_Modifier) * 0.0001 * Cash_Crop_Acreage
    $ Cattle_Produced_Serfs = Serf_Efficiency * Pasture_Land_Aristocracy_AV * (100 + Serf_Cattle_Modifier) * 0.0001 * Pastureland_Inefficiency * 0.01 * Grain_Acreage
   
    $ Yeomanry_Efficiency = Demography_Yeomanry_AV*500/Total_Aristocracy_Land_AV - Serfdom*2
    if Yeomanry_Efficiency >= 100:
        $ Yeomanry_Efficiency = 100
    else:
        pass
    $ Grain_Produced_Yeomanry = Yeomanry_Efficiency * Agricultural_Land_Aristocracy_AV * (100 + Yeomanry_Grain_Modifier) * 0.0001 * Grain_Acreage
    $ Cash_Crop_Produced_Yeomanry = Yeomanry_Efficiency * Cash_Crop_Land_Aristocracy_AV * (100 + Yeomanry_Cash_Crop_Modifier) * 0.0001 * Cash_Crop_Acreage
    $ Cattle_Produced_Yeomanry = Yeomanry_Efficiency * Pasture_Land_Aristocracy_AV * (100 + Yeomanry_Cattle_Modifier) * 0.0001*Pastureland_Inefficiency*0.01 * Grain_Acreage
   
    $ SOE_Grain_Efficiency = Demography_SOE_Labor_Agriculture_AV*500/Agricultural_Land_State_Owned + State_Property*2
    if SOE_Grain_Efficiency >= 100:
        $ SOE_Grain_Efficiency = 100
    else:
        pass
    $ SOE_Cash_Crop_Efficiency = Demography_SOE_Labor_Cash_Crop_AV*500/Cash_Crop_Land_State_Owned + State_Property*2
    if SOE_Cash_Crop_Efficiency >= 100:
        $ SOE_Cash_Crop_Efficiency = 100
    else:
        pass
    $ SOE_Cattle_Efficiency = Demography_SOE_Labor_Pasture_AV*500/Pasture_Land_State_Owned + State_Property*2   
    if SOE_Cattle_Efficiency  >= 100:
        $ SOE_Cattle_Efficiency  = 100
    else:
        pass
    $ Grain_Produced_SOE = SOE_Grain_Efficiency * Agricultural_Land_State_Owned_AV * (100 + SOE_Grain_Modifier) * 0.0001 * Grain_Acreage
    $ Cash_Crop_Produced_SOE = SOE_Cash_Crop_Efficiency * Cash_Crop_Land_State_Owned_AV * (100 + SOE_Cash_Crop_Modifier) * 0.0001 * Cash_Crop_Acreage
    $ Cattle_Produced_SOE = SOE_Cattle_Efficiency * Pasture_Land_Aristocracy_State_Owned * (100 + SOE_Cattle_Modifier) * 0.0001 * Pastureland_Inefficiency * 0.01 * Grain_Acreage
   
    $ Grain_Produced_Total = Grain_Produced_Serfs + Grain_Produced_Yeomanry + Grain_Produced_SOE
    $ Cash_Crop_Produced_Total = Cash_Crop_Produced_Serfs + Cash_Crop_Produced_Yeomanry + Cash_Crop_Produced_SOE
    $ Cattle_Produced_Total = Cattle_Produced_Serfs + Cattle_Produced_Yeomanry + Cattle_Produced_SOE
    $ Food_Produced_Total = Cattle_Produced_Total + Grain_Produced_Total + Food_Supply_Adjustments
    $ Food_Demanded_Total = Pop + Food_Demand_Adjustments

    if Food_Produced_Total >= Food_Demanded_Total:
        $ Food_Surplus = Food_Base_Supply - Food_Circulated
        $ Food_Imported = 0
        $ Food_Store += Food_Surplus*0.01*Food_Stockpile_Rate
        $ Food_Exported = Food_Surplus*0.01*(100-Food_Stockpile_Rate)
    else:
        $ Food_Surplus = 0
        $ Food_Shortage = Food_Circulated - Food_Base_Supply
        if Food_Shortage <= Food_Store:
            $ Food_Store = Food_Store - Food_Shortage
            $ Food_Shortage = 0
        else:
            $ Food_Imported = Food_Shortage - Food_Store
            $ Food_Store = 0
 


The goal is to derive a large number of variables using base data. For instance, from base land distribution to each class of population, I want to derive how much food said population class would produce, how much they consume, how much is left for surplus, how much tax they pay, what is the general price level and what is the population growth.

I seem to be getting them down pretty well without using classes. But when I try to use classes, everything kind of get messed up.

To clarify the question a bit: How can I "stuff" these formulae into classes?

Help please?

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
PostPosted: Sun May 06, 2012 8:50 am 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
Sorry for double-posting, but just in case my last post was too confusing, here's a condensed example of what I want to do:

Code:
init python:
   
    total = 200
    class Pop:
        def __init__ (self, name, number, percentage):
            self.name = self
            self.percentage = percentage
            self.number = number

label start:
    python:
        aristocracy = Pop("Aristocracy", 20, 10)
        Aristocracy_Percentage = aristocracy.percentage
       
    "Percentage of aristocracy is %(Aristocracy_Percentage)d percent."   


Now what I want to do is to create a formula such that a new percentage of item "Aristocracy" of "total" will be calculated as soon as its "number" variable is changed. If I were using the usual python statement, I would have created a "$ Aristocracy_Percentage = Aristocracy_Number / Total * 100" and call it whenever I want it to change. But I'm absolutely clueless as to how to deal with it in class form.

Thanks beforehands, and apologies for the double-post.

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
PostPosted: Sun May 06, 2012 10:49 am 
Regular

Joined: Tue Mar 22, 2011 2:36 pm
Posts: 72
hmmmm...do you mean something like this? :roll:
Code:
init python:   
    class Aristocracy:
         def __init__ (self, total=200, percentage = 5, number = 2000, agricultural_land = 128000, agricultural_land_percentage = 80, cash_crop_land = 20000, cash_crop_land_percentage = 100, pasture_land = 18000, pasture_land_percentage = 90):
             self.percentage = percentage
             self.total = total
             self.number = number
             self.agricultural_land = agricultural_land
             self.agricultural_land_percentage = agricultural_land_percentage
             self.cash_crop_land = cash_crop_land
             self.cash_crop_land_percentage = cash_crop_land_percentage
             self.pasture_land = pasture_land
             self.pasture_land_percentage = pasture_land_percentage
             
         def Pop_Growth (self, growth):
             self.number += growth
             self.percentage = self.number/Aristocracy.number*100
             
         def AristoPercentage(self, total):
             self.percentage = self.number / self.total * 100
             
label start:
    $ Aristocracy = Aristocracy ()
    "1. Demography of aristocracy is [Aristocracy.percentage] percent, for a total of [Aristocracy.number] people of working age." 
    $ Aristocracy.Pop_Growth(500)
    "2. Demography of aristocracy is [Aristocracy.percentage] percent, for a total of [Aristocracy.number] people of working age." 
    $ Aristocracy.AristoPercentage(200)
    "3. Demography of aristocracy is [Aristocracy.percentage] percent, for a total of [Aristocracy.number] people of working age." 

_________________
Image
.Traditional Chinese Site.
~Illustrator+Graphic/Web Designer~


Top
 Profile Send private message  
 
PostPosted: Sun May 06, 2012 9:51 pm 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
That post hinted that I've been doing setting up my classes wrong, so I'm retrying it again:

Code:
class Pop:
        def __init__ (self, name, percentage, number_labor, number_total, agricultural_land, agricultural_land_percentage, cash_crop_land, cash_crop_land_percentage, pasture_land, pasture_land_percentage, total_agricultural_land, agricultural_efficiency, grain_produced, cash_crop_produced, cattle_produced, food_produced,  food_demanded):
            self.name = name
            self.percentage = percentage
            self.number_labor = number_labor
            self.number_total = number_total
            self.agricultural_land = agricultural_land
            self.agricultural_land_percentage = agricultural_land_percentage
            self.cash_crop_land = cash_crop_land
            self.cash_crop_land_percentage = cash_crop_land_percentage
            self.pasture_land = pasture_land
            self.pasture_land_percentage = pasture_land_percentage
            self.total_agricultural_land = total_agricultural_land
            self.agricultural_efficiency = agricultural_efficiency
            self.grain_produced = grain_produced
            self.cash_crop_produced = cash_crop_produced
            self.cattle_produced = cattle_produced
            self.food_produced = food_produced
            self.food_demanded = food_demanded
        def agricultural_efficiency (self, agricultural_efficiency):
            self.agricultural_efficiency == min (100, self.number_labor * 500 / self.total_agricultural_land)
        def grain_produced (self, grain_produced):
            self.grain_produced == self.agricultural_efficiency * self.agricultural_land * Grain_Acreage * 0.01
        def cash_crop_produced (self, grain_produced):
            self.cash_crop_produced == self.agricultural_efficiency * self.cash_crop_land * Cash_Crop_Acreage * 0.01   
        def cattle_produced (self, grain_produced):
            self.cattle_produced == self.agricultural_efficiency * self.pastoral_land * Cattle_Acreage * 0.01           
                       
label start:
   
    python:
        Aristocracy = Pop("Aristocracy", percentage = 5, number_labor = 2000, number_total = 5000, agricultural_land = 128000, agricultural_land_percentage = 80, cash_crop_land = 20000, cash_crop_land_percentage = 100, pasture_land = 18000, pasture_land_percentage = 90, total_agricultural_land = 166000, agricultural_efficiency = 0, grain_produced = 0, cash_crop_produced = 0, cattle_produced = 0, food_produced = 0,  food_demanded = 100000) 
        Yeomanry = Pop ("Yeomanry", percentage = 17, number_labor = 6800, number_total = 17000, agricultural_land = 32000, agricultural_land_percentage = 20, cash_crop_land = 0, cash_crop_land_percentage = 0, pasture_land = 2000, pasture_land_percentage = 10, total_agricultural_land = 34000, agricultural_efficiency = 100,  grain_produced = 320000, cash_crop_produced = 0, cattle_produced = 3000, food_produced = 323000, food_demanded = 204000)
        Serf = Pop ("Serf", percentage = 60, number_labor = 24000, number_total = 60000, agricultural_land = 0, agricultural_land_percentage = 0, cash_crop_land = 0, cash_crop_land_percentage = 0, pasture_land = 0, pasture_land_percentage = 0, agricultural_efficiency = 72, grain_produced = 921600, cash_crop_produced = 0, cattle_produced = 19440, food_produced = 941040, food_demanded = 720000)


It returned an error

Code:
TypeError: __init__() takes exactly 18 non-keyword arguments (11 given)

While running game code:
 - script at line 60 of D:\Ren'Py\renpy-6.12.0\Test/game/script.rpy
 - python at line 62 of D:\Ren'Py\renpy-6.12.0\Test/game/script.rpy.


What has gone wrong?

EDIT: The situation's changed a little. Post edited to reflect that.

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
PostPosted: Mon May 07, 2012 7:22 am 
Regular

Joined: Tue Mar 22, 2011 2:36 pm
Posts: 72
in Serf, total_agricultural_land is missing

_________________
Image
.Traditional Chinese Site.
~Illustrator+Graphic/Web Designer~


Top
 Profile Send private message  
 
PostPosted: Mon May 07, 2012 10:45 am 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
That's done, thanks!

More problem now, though: What is the correct syntax to "call" these lines? As in, to have the formula kick in and work?

Code:
  def agricultural_efficiency (self, agricultural_efficiency):
            self.agricultural_efficiency = min (100, self.number_labor * 500 / self.total_agricultural_land)

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
PostPosted: Tue May 08, 2012 11:42 pm 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
Or alternatively, I'd be very grateful if anyone could link me to a beginner's guide to classes and class operations. I honestly got a bit lost with the guide linked in the Cookbook.

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
PostPosted: Thu May 10, 2012 6:08 pm 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
... Anyone?

I'm still sort of stumped. I'd be quite grateful if anyone could point me in the right direction.

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
PostPosted: Thu May 10, 2012 6:23 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 10774
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
(1) What - fundamentally - are you trying to do? When do the stats update, and how?

(2) A name should only be used once. You're using the same name for a field and an attribute, or a class and an instance - that's going to lead to problems.

_________________
Another Old-Fashioned Bishoujo Gamer
Supporting creators since 2004; Code > Drama
(When was the last time you backed up your game?)
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face in marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming" - Theodore Roosevelt


Top
 Profile Send private message  
 
PostPosted: Thu May 10, 2012 6:28 pm 
Veteran
User avatar

Joined: Wed Nov 18, 2009 11:17 am
Posts: 359
Location: Germany
Completed: Loren
Projects: PS2
Sorry, I don't know any online tutorials. But I can recommend "Learning Python" by O'reilly. It's pretty good and should be accessible for beginners as well.

_________________
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase II


Top
 Profile Send private message  
 
PostPosted: Thu May 10, 2012 6:39 pm 
Veteran

Joined: Sat Feb 26, 2011 9:36 am
Posts: 264
Location: Κωνσταντινούπολη, Βασιλεύα των Ρωμαύων
Projects: Rzeczpospolita Polska 1647
PyTom wrote:
(1) What - fundamentally - are you trying to do? When do the stats update, and how?


My original plan was to have a huge block of formulae that are called at the beginning of every turn to calculate every single variable. Without using classes, this gets... predictably cumbersome. Like this:

Code:
 $ Agricultural_Land_Aristocracy = 80
    $ Agricultural_Land_Serf = 0
    $ Agricultural_Land_Yeomanry = 20
    $ Agricultural_Land_Craftsman = 0
    $ Agricultural_Land_Industralized = 0
    $ Agricultural_Land_State_Owned = 0
   
    $ Agricultural_Land_Aristocracy_AV = 128000
    $ Agricultural_Land_Serf_AV = 0
    $ Agricultural_Land_Yeomanry_AV = 32000
    $ Agricultural_Land_Craftsman_AV = 0
    $ Agricultural_Land_Industralized_AV = 0
    $ Agricultural_Land_State_Owned_AV = 0
   
    $ Cash_Crop_Land_Aristocracy = 100
    $ Cash_Crop_Land_Serf = 0
    $ Cash_Crop_Land_Yeomanry = 0
    $ Cash_Crop_Land_Craftsman = 0
    $ Cash_Crop_Land_Industralized = 0
    $ Cash_Crop_Land_State_Owned = 0
   
    $ Cash_Crop_Land_Aristocracy_AV = 20000
    $ Cash_Crop_Land_Serf_AV = 0
    $ Cash_Crop_Land_Yeomanry_AV = 0
    $ Cash_Crop_Land_Craftsman_AV = 0
    $ Cash_Crop_Land_Industralized_AV = 0
    $ Cash_Crop_Land_State_Owned_AV = 0
   
    $ Pasture_Land_Aristocracy = 90
    $ Pasture_Land_Serf = 0
    $ Pasture_Land_Yeomanry = 10
    $ Pasture_Land_Craftsman = 0
    $ Pasture_Land_Industralized = 0
    $ Pasture_Land_State_Owned = 0
   
    $ Pasture_Land_Aristocracy_AV = 18000
    $ Pasture_Land_Serf_AV = 0
    $ Pasture_Land_Yeomanry_AV = 2000
    $ Pasture_Land_Craftsman_AV = 0
    $ Pasture_Land_Industralized_AV = 0
    $ Pasture_Land_State_Owned_AV = 0

    $ Total_Land_Aristocracy_AV = 166000
    $ Total_Land_Serf_AV = 0
    $ Total_Land_Yeomanry_AV = 34000
    $ Total_Land_Craftsman_AV = 0
    $ Total_Land_Industralized_AV = 0
    $ Total_Land_State_Owned_AV = 0


Doable, but I'm quite sure without a streamlined backbone, every time I want to add or remove something it will shake up the entire network of variable connections. Not to mention with the addition of a few other population demographic groups, for instance, the whole thing will quickly become a jumbled mess.

Which is why I tried to go with classes, hoping that by putting everything under a class and then assign a formula that applies to every instances (sic?) in said class. Problem is, I don't know how to do that.

^ Could I have a link?

_________________
One Province Minor - 120 class variables and still counting!

Because there is no such thing as too many variables.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group