devolution

Author Topic: Reporting Errors:  (Read 352068 times)

0 Members and 8 Guests are viewing this topic.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #30 on: July 30, 2013, 11:31:16 AM »
After visiting Tailor Shop screen becomes like this:


Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #31 on: July 30, 2013, 11:40:57 AM »
And so I bought 14 ice creams, and one of girls ate them. Without food poisoning.
Maybe I should test it on MC too, but I have a hunch that it won't work as well.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #32 on: July 30, 2013, 12:16:38 PM »
And so I bought 14 ice creams, and one of girls ate them. Without food poisoning.
Maybe I should test it on MC too, but I have a hunch that it won't work as well.

Shops should be fixed, there was a whole mess of errors there. There is no logic that can activate effect on MC at the moment since some of those effects would f$ck up the class and make no sense. I figure we can do with effects working only on girls for 1.0.


Food Poisoning should work now, I thought type was Food with a capital, now it checks against "food" instead.
« Last Edit: July 30, 2013, 12:36:53 PM by Xela »
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #33 on: July 30, 2013, 12:57:04 PM »
Label "tailor_shop" does not exist.
And Hinata still able to enjoy ice cream infinitely without consequences, what a lucky girl  :)

Xela, could you remind me names of shops I should use in items xml?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #34 on: July 30, 2013, 01:12:22 PM »
Label "tailor_shop" does not exist.

Forgot to update db folder, it actually works, DropBox has wrong database version, one sec.

And Hinata still able to enjoy ice cream infinitely without consequences, what a lucky girl  :)

I am going to try it out myself, it should work (code is there and there are no errors), I'll have to track this thing step by step.

Xela, could you remind me names of shops I should use in items xml?

            self.general_store = GeneralStore(18, ['General Store', 'Item Shop'])
            self.cafe = Cafe(18, ['Cafe'])
            self.workshop = WorkShop(18, ['Work Shop'])
            self.witches_hut = WitchesHut(18, ['Witches Hut'])
            self.tailor_store = ItemShop(18, ['Tailor Store'])
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #35 on: September 05, 2013, 09:38:22 AM »
I'm testing my packs and the game today, and I've found one problem already: if a girl has a fullname but doesn't have a name, we have an error.
I believe in such cases we should set name=fullname.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #36 on: September 05, 2013, 10:07:06 AM »
I'm testing my packs and the game today, and I've found one problem already: if a girl has a fullname but doesn't have a name, we have an error.
I believe in such cases we should set name=fullname.

Actually name is implicit (which I think is very logical), fullname isn't so it works as intended. Both nickname and fullname are set to name if absent.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #37 on: September 05, 2013, 01:58:39 PM »
Well, it's one of those things that can confuse pack makers when we talk about characters with short names. At least it's very easy to debug xmls in contradistinction to jsons.
   

Offline Xipomus

  • Full Member
  • ***
  • Posts: 153
Re: Reporting Errors:
« Reply #38 on: September 07, 2013, 05:20:58 PM »
Hey guys,

I've a weird error on the latest git set that you might want to check if you still have it with your version.
After testing a while I know how to recreate it.

It goes as follow. I just load a new game. Turn the day. This goes without issues and I can save too.
I set a girl (I tested with Hinata) set her as a whore and turn the day again.

Then tried to save. Immediately you get the error:
Traceback (most recent call last):
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\execution.py", line 266, in run
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\ast.py", line 646, in execute
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\python.py", line 1172, in py_exec_bytecode
  File "common/_layout/screen_load_save.rpym", line 17, in <module>
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\ui.py", line 237, in interact
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\core.py", line 1813, in interact
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\core.py", line 2336, in interact_core
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\layout.py", line 717, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\layout.py", line 717, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\layout.py", line 717, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\screen.py", line 300, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\layout.py", line 717, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\layout.py", line 174, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\layout.py", line 717, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\layout.py", line 174, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\behavior.py", line 627, in event
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\display\behavior.py", line 211, in run
  File "common/00screen.rpy", line 1228, in __call__
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\loadsave.py", line 228, in save
  File "C:\games\downs\renpy-6.14.1-sdk\renpy-6.14.1-sdk\renpy\loadsave.py", line 47, in dump
PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function failed

Ignoring it goes back to the main screen, but the game isn't saved.
Sometimes and going about the city, it suddenly works again and i can save again for a while. Just not load (haven't been able to find what fixes it temporarly).

I looked on the internet about the error only thing i found is about multiprocessing.
http://stackoverflow.com/questions/11287455/how-do-i-avoid-this-pickling-error-and-what-is-the-best-way-to-parallelize-this

i don't know if you changed the save code or where it is.
Just thought to mention it.

Should i find out, where the error comes from i'll let you know.

Xip

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #39 on: September 08, 2013, 04:02:06 AM »
I've a weird error on the latest git set that you might want to check if you still have it with your version.

Great catch, that error is still around.

Should i find out, where the error comes from i'll let you know.

That's kinda what I do around here :)

I think it's once again Matt's fault... small bit of code he wrote 4 month ago has really created more trouble than it was worth...

------------------------------------------------------------
And it's fixed >)
« Last Edit: September 08, 2013, 04:13:59 AM by Xela »
Like what we're doing?

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: Reporting Errors:
« Reply #40 on: September 13, 2013, 05:10:32 AM »
Sounds like a variable the game tries to save is set to a function. This can happen easily if one forgets to add the parentheses so the function is called.

For example, this might cause such an error:
Code: [Select]
variable_that_is_saved = somefunction
The following code was probably what the programmer intended to do:
Code: [Select]
variable_that_is_saved = somefunction()

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #41 on: September 13, 2013, 05:19:33 AM »
Sounds like a variable the game tries to save is set to a function. This can happen easily if one forgets to add the parentheses so the function is called.

For example, this might cause such an error:
Code: [Select]
variable_that_is_saved = somefunction
The following code was probably what the programmer intended to do:
Code: [Select]
variable_that_is_saved = somefunction()

Oh, it's a possibility but that's not what happened. RenPy uses cPickle/Pickle modules to save data and those cannot save lambdas unless those are caught with code (that was used on screen). Basically, Next Day had nothing to do with that, just entering girlassign screen was enough. The reason it disappeared after a while and game could be saved again is that RenPy removed images that were using lambda from it's cache as no longer required.
Like what we're doing?

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: Reporting Errors:
« Reply #42 on: September 13, 2013, 04:39:18 PM »
What do you mean with:
Quote
unless those are caught with code (that was used on screen)

Lambdas are functions and AFAIK pickle can never save a function. In other words, lambdas can not be pickled, just like classes, methods, functions, private attributes and probably other stuff.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #43 on: September 13, 2013, 05:25:47 PM »
What do you mean with:
Lambdas are functions and AFAIK pickle can never save a function. In other words, lambdas can not be pickled, just like classes, methods, functions, private attributes and probably other stuff.

That would have made Pickle/cPickle modules near completely useless :)

No, classes, methods (being part of classes), functions and almost everything else can be pickled just fine. Lambda and nested functions cannot be pickled but I've read that there are ways to catch them with code (serialize them before pickling).

From the documentation:

Quote
The following types can be pickled:

    None, True, and False
    integers, long integers, floating point numbers, complex numbers
    normal and Unicode strings
    tuples, lists, sets, and dictionaries containing only picklable objects
    functions defined at the top level of a module
    built-in functions defined at the top level of a module
    classes that are defined at the top level of a module
    instances of such classes whose __dict__ or the result of calling __getstate__() is picklable (see section The pickle protocol for details).


Code: [Select]
variable_that_is_saved = somefunction
Can be pickled without any errors...
« Last Edit: September 13, 2013, 06:11:09 PM by Xela »
Like what we're doing?

Offline rudistoned

  • Full Member
  • ***
  • Posts: 229
Re: Reporting Errors:
« Reply #44 on: September 14, 2013, 07:22:53 AM »
You are right, I apologize.

What I should have said is this: It is not possible to pickle functions, classes, methods and so on themselves. The are pickled by reference, not by "value".
If you do this
Code: [Select]
import pickle

def somefunction():
    print "hello"

f = open("delme.bin", "wb")
pickle.dump(somefunction, f)
f.close()
and then, in another file, do this
Code: [Select]
import pickle

f = open("delme.bin", "rb")
somefunction = pickle.load(f)
f.close()
you will get this
Code: [Select]
Traceback (most recent call last):
  File "/home/rudi/Desktop/delme2.py", line 4, in <module>
    somefunction = pickle.load(f)
  File "/usr/lib/python2.7/pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "/usr/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/lib/python2.7/pickle.py", line 1090, in load_global
    klass = self.find_class(module, name)
  File "/usr/lib/python2.7/pickle.py", line 1126, in find_class
    klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'somefunction'

So, if pickle cannot import the pickled function, you can't unpickle it. However, if pickle can import the function, so can you (usually), so why pickle it in the first place? That's why I generally think of functions, classes, ... as unpickleable.


That would have made Pickle/cPickle modules near completely useless :)
I would not put it like that. Most data storage methods I know don't allow you to store custom objects. For example, JSON, XML and SQL work like that. Those are far from useless ;)