devolution

Author Topic: General Discussion  (Read 3821319 times)

0 Members and 39 Guests are viewing this topic.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5325 on: July 30, 2015, 01:40:31 AM »
Nah, I googled that strings are immutable there up to the point that you can't even int them during checks without using an intermediate variable. I can't see how int's limited functionality is useful to anyone except maybe less work for the creator of python.
In delphi you can StrToInt them anytime, freely. It creates a temp variable by itself when needed.
« Last Edit: July 30, 2015, 01:49:17 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5326 on: July 30, 2015, 02:38:04 AM »
Nah, I googled that strings are immutable there up to the point that you can't even int them during checks without using an intermediate variable. I can't see how int's limited functionality is useful to anyone except maybe less work for the creator of python.
In delphi you can StrToInt them anytime, freely. It creates a temp variable by itself when needed.

https://www.youtube.com/watch?v=OGsHshpYkiU

Did you even look at the code and comments that I pushed?  If you meant that a StrToInt() in Delphi does not just convert but also always overwrites temp variable to int while doing it, Python can do that as well if you write your own function, it's just that in my opinion, that would be far less desirable.

https://www.python.org/downloads/

Quote
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> temp = "124"
>>> 200 > int(temp)
True
>>> temp
'124'
>>> temp = int(temp)
>>> 100 > temp
False
>>>

You can download Python 2.7 and try these things, it's very convenient.

There are some holes in Python like in any language but this is not one of them.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5327 on: July 30, 2015, 03:50:45 AM »
Oh yes, it's like instead of a = (b+c)*2 do
a = b+c
a = a*2

And no, StrToInt does not overwrite something. It creates a temporary variable to store results of convertion if you didn't do it by yourself like you have to in python, thus you can check if a > StrToInt(b) without issues and then forget about it forever without borrowing memory by intermediate variable.
Basically, python forces you to int something when it wants it, not when you want it.

I'm pretty sure I don't know enough to make my own functions in python like I do in delphi... Otherwise sex scene checks wouldn't be so huge and repeatable...
« Last Edit: July 30, 2015, 05:27:07 AM by DarkTl »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5328 on: July 30, 2015, 04:10:46 AM »
Come to think of it, the lack of such a common thing as multiline comments in python except multi-line strings which are not even usable as comments in some cases speaks for itself. I enjoy spamming # so much.

They advice to use plugins that can do spamming automatically, or use if false (which is useless if the code throws an error). ffs  ::)
« Last Edit: July 30, 2015, 04:47:03 AM by DarkTl »

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #5329 on: July 30, 2015, 06:15:39 AM »
Dark is right, maids working in different places may have different uniforms, it's not reasonable to expect one overwhelm all others.

I would avoid anything Victorian and it's also almost impossible to tell. I'd expect to see a level 100 prostitute working at the palace in the best part of the town to wear a different set of robes than a level 5 street whore in the slums, working in a shack with two rooms... we just do get too hang up on this things where we're making packs because the choices are limited to the pics we can find. I'd pick something in between.

I can render lots of lingerie/dress types with different fabric like jute/cotton look like.. or velvet/satin..

Maybe the prostitute rank will restrict the wearable items.. like if there s 10 ranks.. 1-5 cotton like fabric.. 5+ velvet/satin.. also they could have different shape even if they look different since the fabric type make em reflective or not..

If your ok that their shape is the same but fabric(reflectiveness) is different.. you could simply give lower stat/skill bonuses on the rank 1-5 cotton.. else ill try to make more kinds of shapes..

That way a low lvl prostitute could never wear what a high lvl can.. but with the option to have it look it like ( as shape not fabric.. like a cheap copy of the top class one ) or restrict completely some of them to high class only..

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5330 on: July 30, 2015, 06:48:40 AM »
Oh yes, it's like instead of a = (b+c)*2 do
a = b+c
a = a*2

And no, StrToInt does not overwrite something. It creates a temporary variable to store results of convertion if you didn't do it by yourself like you have to in python, thus you can check if a > StrToInt(b) without issues and then forget about it forever without borrowing memory by intermediate variable.
Basically, python forces you to int something when it wants it, not when you want it.

I'm pretty sure I don't know enough to make my own functions in python like I do in delphi... Otherwise sex scene checks wouldn't be so huge and repeatable...

LoL

Are you just messing with me? They works exactly the same :)

a > StrToInt(b) in Delphi

and

a > int(b)

in Python behave in exactly the same way... I've given clear examples of that in code and in my posts.

===
Oh yes, it's like instead of a = (b+c)*2 do
a = b+c
a = a*2

Oh no, this is perfectly "Pythonic" Python:

Code: [Select]
a = (b+c)*2
This is directly from Python interpreter I asked you to install:

Code: [Select]
>>> b = "Dark is messing "
>>> c = "with Xelas Mind! "
>>> a = (b+c)*2
>>> print a
Dark is messing with Xelas Mind! Dark is messing with Xelas Mind!
>>>

Just download it and try for yourself. Past this I can only try to explain this in Russian...
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5331 on: July 30, 2015, 06:53:50 AM »
Come to think of it, the lack of such a common thing as multiline comments in python except multi-line strings which are not even usable as comments in some cases speaks for itself. I enjoy spamming # so much.

They advice to use plugins that can do spamming automatically, or use if false (which is useless if the code throws an error). ffs  ::)

This part I don't understand,

"""
Comment Line 1
Comment Line 2
"""

are ml comments, they are not interpreted as strings.

===
I can render lots of lingerie/dress types with different fabric like jute/cotton look like.. or velvet/satin..

Maybe the prostitute rank will restrict the wearable items.. like if there s 10 ranks.. 1-5 cotton like fabric.. 5+ velvet/satin.. also they could have different shape even if they look different since the fabric type make em reflective or not..

If your ok that their shape is the same but fabric(reflectiveness) is different.. you could simply give lower stat/skill bonuses on the rank 1-5 cotton.. else ill try to make more kinds of shapes..

That way a low lvl prostitute could never wear what a high lvl can.. but with the option to have it look it like ( as shape not fabric.. like a cheap copy of the top class one ) or restrict completely some of them to high class only..

I don't like this idea, they should be able to wear what they please. It looks like the pack is going to be great in any case, just render whatever you see fit.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5332 on: July 30, 2015, 07:41:12 AM »
LoL

Are you just messing with me? They works exactly the same :)

a > StrToInt(b) in Delphi

and

a > int(b)

in Python behave in exactly the same way... I've given clear examples of that in code and in my posts.
My initial code was
if hero.gold >= int(temp).
It didn't worked, throwing something about unicode strings and stuff, until I googled it and changed it to
$ python_BS = int(temp)
if hero.gold >= python_BS

Oh no, this is perfectly "Pythonic" Python:

Code: [Select]
a = (b+c)*2
And that was an analogy, not actual example.

This part I don't understand,

"""
Comment Line 1
Comment Line 2
"""

are ml comments, they are not interpreted as strings.
Nope. It's not comments, it's docstrings.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5333 on: July 30, 2015, 07:51:59 AM »
My initial code was
if hero.gold >= int(temp).
It didn't worked, throwing something about unicode strings and stuff, until I googled it and changed it to
$ python_BS = int(temp)
if hero.gold >= python_BS

I'll need to see this error and the code that leads to it. This:
Code: [Select]
if hero.gold >= int(temp)
and/or
Code: [Select]
if hero.gold >= int("4342")
are perfectly fine. Always! You can count on this to work as long as your temp is assigned to something that can be converted to an integer.

And that was an analogy, not actual example.

There is no actual example... it works just like it does with Delphi. Internal rules when converting weird stuff like hexes are prolly different but behavior is the same.

Nope. It's not comments, it's docstrings.

Docstrings only if provided as the very first thing after declaration of a class, module or function. In all other cases, they are the very definition of multiline comment and are completely ignored by parsers and interpreters.

Edit: Keep in mind that those are Python so you cannot use it in Ren'Py script. You need to declare the multiple line comment to be Python.

« Last Edit: July 30, 2015, 07:56:53 AM by Xela »
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5334 on: July 30, 2015, 08:04:25 AM »
The code is gone of course. It was "unsupported operand type(s) for -=: 'int' and 'unicode'" error.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5335 on: July 30, 2015, 08:14:53 AM »
The code is gone of course. It was "unsupported operand type(s) for -=: 'int' and 'unicode'" error.

But that was not caused by the:

Code: [Select]
if hero.gold >= int(temp):
    # ...

You said yourself that Delphi would not have converted the variable with this line, so the next line:

Code: [Select]
hero.gold -= temp
was basically same as:

Code: [Select]
100000 -= "2000"
(for example).

When you reassigned the variable to be an integer, it was working but the error was caused by trying to extract string from an integer. That is not an acceptable operation.

You could have done:

Code: [Select]
hero.gold -= int(temp)
and it would have worked fine. Most languages work in a fairly similar way, I don't believe that you'd expect Delphi to act differently here either.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5336 on: July 30, 2015, 09:12:54 AM »
Hm, if you say so. I don't remember the code, so I might missed int as you assumed, but as far as I remember, I didn't. We'll see when I recode give gold to free girls option based on free input without using your examples for a start.

You said once that the images function tries all tags first, then first tag + one of each tags taken from the end of taglist. Is it still true? Because it's not the best algorithm for more than 3 tags.
If you have gm.set_img("2c vaginal", "indoors", "partnerhidden", "gay") and you don't have indoors, you at least should try to show 2c vaginal+partnerhidden+gay.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5337 on: July 30, 2015, 11:12:36 AM »
Depends on the situation, I'll see if I can write a new lookup option like you describe.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5338 on: July 30, 2015, 11:51:37 AM »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5339 on: July 30, 2015, 12:05:50 PM »
How to call MC setup screen? I can't find it.