devolution

Author Topic: Reporting Errors:  (Read 352392 times)

0 Members and 5 Guests are viewing this topic.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #45 on: September 14, 2013, 01:31:31 PM »
You are right, I apologize.

There is no need (like ever), we're all learning from this. I actually though that your code will work as I've tried something like that in IDLE 4 or 5 month ago for training and it did  ??? (due to a single namespace...)

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's kinda a theoretical debate... pickle will store the reference so it will not fail, therefor it can store functions... It's far from useful, as you've said, import of module1 would be required to unpickle in module2, but the same module would import the original function, so the whole thing would be kinda pointless. I am forgetting this very often as I work with IDLE and RenPy where imports of modules you've wrote yourself are rare.

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 ;)

And non of those were developed by Python devs, pickle was, just mimicking those three would be a waste...

------------------------------------------------
We were talking about an error in RenPy and a number of things has to be taken into account:

- RenPy does seem to pickle save functions (even those defined during the game runtime) (everything in init is being loaded every time game is started (new game or load) so it is obvious that all functions defined there are available at all times). Maybe it's because of their "global" namespace or they are using cloud module (that allows to pickle code and therefor anything, but if they did use cloud, lambdas and nested functions should have been saved as well ? :( ) I am not really that interested in how it works at the moment, I just made damn sure that I know what does work and what doesn't.

- Error occurred because of lambda that cannot be pickled by Pickle/cPickle at all (if you try to pickle lambda with the exact same code as you provided above, it will fail in the first module, not the second).

Like what we're doing?

Offline KaiSakurai

  • Newbie
  • *
  • Posts: 30
Re: Reporting Errors:
« Reply #46 on: September 30, 2013, 11:58:59 PM »
Code: [Select]
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/library/screens/pyt - screens - nextday.rpy", line 8, in script
  File "game/library/screens/pyt - screens - nextday.rpy", line 43, in python
  File "game/library/classes - jobs.rpy", line 159, in python
  File "game/library/classes - jobs.rpy", line 186, in python
AttributeError: 'WhoreJob' object has no attribute 'brothel_mod'

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #47 on: October 01, 2013, 01:08:23 AM »
Code: [Select]
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/library/screens/pyt - screens - nextday.rpy", line 8, in script
  File "game/library/screens/pyt - screens - nextday.rpy", line 43, in python
  File "game/library/classes - jobs.rpy", line 159, in python
  File "game/library/classes - jobs.rpy", line 186, in python
AttributeError: 'WhoreJob' object has no attribute 'brothel_mod'

Nice catch... should be "brothelmod" without the underline.
Like what we're doing?

Offline KaiSakurai

  • Newbie
  • *
  • Posts: 30
Re: Reporting Errors:
« Reply #48 on: October 01, 2013, 08:38:36 AM »
ok changed it
yay no more crashes^^
works fine now
b4 it worked fine for about 25 days than it kept crashing....
ope this wont happen again now

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #49 on: October 01, 2013, 08:49:49 AM »
ok changed it
yay no more crashes^^
works fine now
b4 it worked fine for about 25 days than it kept crashing....
ope this wont happen again now

How did it crash?

Misunderstood the post. That bit of code was executed when customers are no longer happy with ranks of your prostitutes. Game should will no longer crash on that error.
« Last Edit: October 01, 2013, 10:23:56 AM by Xela »
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #50 on: October 12, 2013, 12:25:59 PM »
Here you go.
Quote
While running game code:
  File "game/library/screens/pyt - screens - town.rpy", line 5, in script
IOError: Couldn't find file 'content/gfx/interface/buttons/blue_arrow_left.png'.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #51 on: October 12, 2013, 12:42:40 PM »
Here you go.

Games not at fault, my dropbox crashed and I did not notice :(
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #52 on: October 12, 2013, 01:11:42 PM »
Omg, why the game has huge masturbating Rukia instead of brothel picture?  ???

Quote
  File "game/library/screens/pyt - screens - arena_inside.rpy", line 7, in script
  File "game/library/screens/pyt - screens - arena_inside.rpy", line 7, in python
  File "game/library/classes - support.rpy", line 1293, in python
  File "game/library/screens/pyt - screens - arena_inside.rpy", line 484, in python
AttributeError: 'NoneType' object has no attribute 'name'
After selecting reputation ladder.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #53 on: October 12, 2013, 01:33:09 PM »
Omg, why the game has huge masturbating Rukia instead of brothel picture?  ???

LoL, sorry... forgot to replace it before uploading, I've been toying with animations...


After selecting reputation ladder.

Flow in screen design, it's really easy to fix, I'll get on it. I didn't get this error because my game generates 350 random girls and Arena is always full.
« Last Edit: October 12, 2013, 01:37:46 PM by Xela »
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #54 on: October 12, 2013, 01:48:57 PM »

I guess it's because db copy doesn't have enough girls too.

And I have no idea how to start a fight.
« Last Edit: October 12, 2013, 01:51:53 PM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #55 on: October 12, 2013, 02:04:20 PM »

I guess it's because db copy doesn't have enough girls too.

And I have no idea how to start a fight.

Only dogfights work now and that's not nearly enough people for that... Why don't you just put all of your random/unique characters in char/rchar folders, you'll have hundreds of girls that way, I can write adjust a script to generate 300 of that green elf otherwise...

Errors are fixed, new file is uploaded.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #56 on: October 12, 2013, 02:22:04 PM »
Sure, I'll do it. But shouldn't the game be workable with just one random girl, as we agreed?

I guess even all my characters are not enough for 3vs3 dogfight, its screen is still empty.
Don't see any problems with 1vs1 and 2vs2 so far, except the fact that you can take 3 party members there (dogfight indeed, no rules  :D )
« Last Edit: October 12, 2013, 02:25:44 PM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #57 on: October 12, 2013, 02:50:53 PM »
Sure, I'll do it. But shouldn't the game be workable with just one random girl, as we agreed?

That code is supposed to be first real method of PyTFallWorld class but it doesn't exist yet. Right now it's handles differently.

I guess even all my characters are not enough for 3vs3 dogfight, its screen is still empty.
Don't see any problems with 1vs1 and 2vs2 so far, except the fact that you can take 3 party members there (dogfight indeed, no rules  :D )

I have NO random characters other than those that you've created, for every one loaded into the game, 30 will appear. Arena should be full with 50 or so characters just wishing they were part of ladders/lineups.

Don't see any problems with 1vs1 and 2vs2 so far, except the fact that you can take 3 party members there (dogfight indeed, no rules  :D )

No... you actually can't, I have disabled the method responsible for checking startup conditions, the problem is that in development version, MC is so freaking powerful that no team in dogfights would dear to accept the challenge... Does the animated post fight screen work btw?
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: Reporting Errors:
« Reply #58 on: October 12, 2013, 03:15:46 PM »
I copied unique ones only, it's about 47 characters, apart from those that already there. 3vs3 works fine after I added random ones too, but looks like it requires much more than 50 characters.

Don't see any problems with animation either. At first victory comes from right, then two blue stripes appear from up and down, if you want details.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: Reporting Errors:
« Reply #59 on: October 12, 2013, 03:31:12 PM »
I copied unique ones only, it's about 47 characters, apart from those that already there. 3vs3 works fine after I added random ones too, but looks like it requires much more than 50 characters.

Like I've said, for every random girl, game will generate 30, so you'll have plenty to fill the arena.

Don't see any problems with animation either. At first victory comes from right, then two blue stripes appear from up and down, if you want details.

Oki, I wanted to know if it all works on different computer, ATL used to be bugged in RenPy but they were supposed to kill all bugs by now. I haven't previously used it on a large scale.
Like what we're doing?