Author Topic: General Discussion  (Read 3821681 times)

0 Members and 40 Guests are viewing this topic.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7395 on: May 06, 2016, 03:05:54 PM »
Weight choice, when the more the weight, the more the chance to select the element. An example from one websiteAs you can see, weights are 100% in total.

You'll have to recompile Ren'Py to add numpy to it cause large parts of it are written in C and then do so after every Ren'Py upgrade. What are you trying to do?

===>>
Edit:
Ah ok:

https://lemmasoft.renai.us/forums/viewtopic.php?f=4&t=26531#p323010

I still don't get a question about skills over 100. I wonder why they didn't just add it to normal random module... seems like there is solid demand for it, I found over 10 ways across many boards suggesting many ways to do the same thing...
« Last Edit: May 06, 2016, 03:14:48 PM by Xela »
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7396 on: May 06, 2016, 03:16:52 PM »
Yeah, I want to use skills values (which are unlimited) as weights. So I wonder if weight sum should be 1 in total, like in every python example about the weighted choice, or I can use raw skill values and the function will figure it out.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7397 on: May 06, 2016, 03:20:18 PM »
Yeah, I want to use skills values (which are unlimited) as weights. So I wonder if weight sum should be 1 in total, like in every python example about the weighted choice, or I can use raw skill values and the function will figure it out.

They are not really unlimited, there are caps on them, just really high once. I think they are defined in initialization file somewhere and all set to the same value.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7398 on: May 06, 2016, 03:48:02 PM »
5000. That's lower than I thought  :D

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7399 on: May 06, 2016, 05:44:17 PM »
5000. That's lower than I thought  :D

LoL? We could make it 50 000 and use steps of 10 or make it 5 and go full out floats :D

Drag and drop interface is coming along nicely, code is really clean this time, I feel like we can add any amount of extra magic to it without confusing anything. I want to add some basic info as really small icons to portraits, maybe just the types (warrior/service/manager) and status (slave/free), prolly should make them larger and add a grid underneath, prolly from bestiary, it looks cool now.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7400 on: May 06, 2016, 06:32:17 PM »
https://lemmasoft.renai.us/forums/viewtopic.php?f=4&t=26531#p323010
Might be taken from https://www.renpy.org/wiki/renpy/doc/cookbook/Making_random_choice_with_some_outcomes_more_likely_than_others
Anyway, I tried it like
Quote
        skills = ["sex", "oral", "anal"]
        if not(ct("Virgin")) or check_lovers(hero, char) or char.disposition >= 750:
            skills.extend(["vaginal"])
        skills_values=[]
        for t in skills:
            skills_values.append([t, char.get_skill(t)])
        total = sum([t[1] for t in skills_values])
        import random
        r = random.uniform(0, total)
        s = 0.0
        for k, w in skills_values:
            s += w
            if r < s: return k
        return k
and it works weirdly. It might be unsuitable for cases when the sum of chances is not 1.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7401 on: May 06, 2016, 07:11:52 PM »
I found an option that might work better, try it out when you can. (just pushed the func)
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7402 on: May 06, 2016, 07:38:31 PM »
Ok... that's enough. Stills loads to do but base is setup.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7403 on: May 07, 2016, 05:16:41 AM »
Yeah, it works. But it cannot handle cases when all weights are 0, in which case it probably should return None (fixed it).
« Last Edit: May 07, 2016, 05:18:31 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7404 on: May 07, 2016, 06:19:25 AM »
Yeah, it works. But it cannot handle cases when all weights are 0, in which case it probably should return None (fixed it).

Oki :) I promised that I'll take a stab of coming up with a simple "shooting range" concept for Ren'Py tonight. Gonna see if I can write a passable UDD in pytfall lab...

Edit:
LoL, I just realized that I haven't written a UDD with input ever since training on that stupid ship and the music thing. I wonder if I still got the ship somewhere.
« Last Edit: May 07, 2016, 06:43:16 AM by Xela »
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7405 on: May 07, 2016, 07:37:03 AM »
Shooting range? Like, for BEs?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7406 on: May 07, 2016, 07:47:55 AM »
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7407 on: May 07, 2016, 02:28:25 PM »
)$%$)(%*$)(*()$#*%)($*%)(

Spent two hours trying to figure out why our in poly func works for you and doesn't work for me only to find out that it matters a lot in which order you feed it the coordinates! Basically you can have 4 points and draw very different polygons with them... which is something I knew but forgot :D
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7408 on: May 07, 2016, 02:50:22 PM »
Lol. And I once had to rewrite coordinates because at first I wrote them while launching the game in non native window mode, ie after changing window size manually with mouse, which totally messes up them  :D

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7409 on: May 07, 2016, 03:18:48 PM »
Lol. And I once had to rewrite coordinates because at first I wrote them while launching the game in non native window mode, ie after changing window size manually with mouse, which totally messes up them  :D

My fault as well... I should have used renpy native function in favor of pygame variant because renpy version accounts for crap like window size.
Like what we're doing?