SC4 Devotion Forum Archives

Sim City 4 Devotion Tools => Tools - General Discussion => SC4PIM (PIM-X/X-Tool) => Topic started by: M4346 on January 30, 2017, 05:34:28 AM

Title: Error on creation of Opera House desc
Post by: M4346 on January 30, 2017, 05:34:28 AM
Afternoon one and all!

I get the following error when I try to create a .desc file for an Opera House:

Quote[(u'Students', u'(max(SCCSOpera,50*int(1+Volume/40000.)))'), (u'CivicJobs', u'(int(ceil(Students/30.)))'), (u'Jobs1', u'(5+int(CivicJobs*1./8.))'), (u'Jobs2', u'(2+int(CivicJobs*5./8.))'), (u'Jobs3', u'(0+int(CivicJobs*2./8.))'), (u'Radius', u'(40*int(135+0.75*Students**0.4))'), (u'MCost', u'(10*int(13+0.035*Students**0.9))'), (u'PCost', u'(1000*int(20+0.020*Students**1.1))'), (u'BCost', u'(20*int(15+0.025*Students**1.1))'), (u'BaseCapacity', u'(round(3+Volume/(3*15)))'), (u'BiasedBC', u'(int(round(min(500.,BaseCapacity)*max(1.,sqrt(BaseCapacity/500.)))))'), (u'AirPollutionFactor', u'(0.006)'), (u'WaterPollutionFactor', u'(0.004)'), (u'GarbagePollutionFactor', u'(0.003)'), (u'PowerConsumedFactor', u'(0.01)'), (u'WaterConsumedFactor', u'(0.04)'), (u'CalculatedElevation', u'(max(Height,Volume/(Width*Depth)))'), (u'BiasedVol', u'(Volume*min(1,0.51+(Volume/26000.0)**2))')]
ItemOrderForOpera
Traceback (most recent call last):
  File "treeDnD.pyo", line 93, in OnData
  File "SC4PIMApp.pyo", line 2918, in OnDrop
  File "SC4PIMApp.pyo", line 2988, in CreateAnExamplar
  File "<string>", line 0, in ?
NameError: name 'ItemOrderForOpera' is not defined

I think the main error is the issue highlighted in the last line.

Is there any way I can fix this? Or has this been addressed?

Thanks!

M
Title: Re: Error on creation of Opera House desc
Post by: CasperVg on January 30, 2017, 06:54:48 AM
Do you have a config.ini file in the SC4PIM directory? If yes, does it contain the following lines of text? If you have a config.ini with this content and it still crashes, then it might be a bug.

ItemOrderForOpera      = 300
QueryForOpera       = 0x12121201

Title: Re: Error on creation of Opera House desc
Post by: vortext on January 30, 2017, 07:01:25 AM
Yep, had the same issue and can confirm Casper's suggestion fixed it on my end. Though in my case the file is called settings.ini.
Title: Re: Error on creation of Opera House desc
Post by: M4346 on January 30, 2017, 07:08:58 AM
Thanks! I don't have a config.ini file, I have a settings.ini file (not sure why, I reinstalled the SC4PIM to see if that fixes it, it doesn't) so I have added that info to the settings.ini file and it seems to have fixed it!
Title: Re: Error on creation of Opera House desc
Post by: CasperVg on January 30, 2017, 11:21:52 AM
The config and settings.ini files are actually quite interesting. They are interpreted as code by SC4PIM. So if you add the following lines to one of them, an extra window with the title "Hello" will be fired up each time you start SC4PIM. The more you know :P


import wx
app = wx.App(False)
frm = wx.Frame(None, wx.ID_ANY, "Hello")
frm.Show(True)
Title: Re: Error on creation of Opera House desc
Post by: Andreas on January 30, 2017, 12:16:43 PM
IIRC, the "settings.ini" is the default ini file, and the "config.ini" (which is using the very same format) can be used for custom additions and overrides. If you're using a set of custom queries for your lots, you could add some lines like

QueryForResidential = 0x00000001
QueryForCommercial = 0x00000002
QueryForIndustrial = 0x00000003


which are used instead of the default Maxis values.
Title: Re: Error on creation of Opera House desc
Post by: mgb204 on January 30, 2017, 02:02:27 PM
Useful advice right here  :D.

Now I no longer have to manually adjust the item order to be at the top of the parks menu when making test lots, thanks Casper/Andreas.