Author Topic: General Discussion  (Read 3821759 times)

0 Members and 21 Guests are viewing this topic.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5835 on: September 17, 2015, 01:37:01 PM »
Prolly tomorrow. If it's reasonable, I'll write a class.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5836 on: September 17, 2015, 01:49:31 PM »
You can use older way with a side and YScrollBars like in the example in screen language. That will definitely work
You mean something like
Quote
    side "c r":
        viewport id "lib_text":
            xpos 306
            ypos 30
            xysize (675, 670)
            mousewheel True
            draggable True
            text "%s" %string_to_show size 15 color black font "Fonts\EBGaramond-Regular.ttf"
        vbar value YScrollValue("lib_text")
?
Because it doesn't work as intended too.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5837 on: September 17, 2015, 04:11:43 PM »
Works for me...

Code: [Select]
screen testing_vp():
    add Solid("#FFFFFF", xsize=600) xalign 0.5
    side "c r":
        xsize 600
        xalign 0.5
        viewport id "lib_text":
            xsize 600
            draggable True
            mousewheel True
            text "Some Really Long String "*1000 size 14 color "#000000"
        vbar value YScrollValue("lib_text")
       
label start:
    call screen testing_vp
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5838 on: September 17, 2015, 04:20:56 PM »
Quote
    add "content/gfx/frame/library_page.jpg" at truecenter
    textbutton "Enough with it" action (Hide("library_show_text", transition=dissolve), Jump("library_read_matrix")):
        xalign 1.0
        yalign 1.0
    side "c r":
        viewport id "lib_text":
            xpos 306
            ypos 30
            xysize (675, 670)
            text "%s" %string_to_show size 15 color black font "Fonts\EBGaramond-Regular.ttf"
        vbar value YScrollValue("lib_text")
If by "works" you mean usual "scrollbar at the freaking center", then it works for me too, I guess...

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5839 on: September 17, 2015, 04:25:15 PM »
Add the xysize to side as well. Move positioning to it and remove it from viewport.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5840 on: September 18, 2015, 04:40:54 AM »
Seeing how many posts there remain without an answer, you probably should report bugs by creating issues at the renpy repo.

I have to say, screen language is pretty complex since it doesn't have examples. Well, almost. There is like 1 example per 20 functions  :)
Unlike python, which has tons of examples for every possible case.
« Last Edit: September 18, 2015, 04:49:17 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5841 on: September 18, 2015, 05:28:43 AM »
Yeah... you're not the one to say this, OldHuntsman has the exact same complain about Ren'Py SL, at first I told him that there are guides but it turns out that there aren't any that explain the whole thing properly. There are guides for bits and pieces but even those are mostly outdated. I ended up explaining the basics over skype.

We have a lot of examples in the code but those are usually either very complex or require understanding of data structure in the game, still, a lot of stuff can be found in the code.

===
The trouble with highest level scripts such as SL and ATL is that they offer too many options and possibilities for very few lines of code, that is usually close to impossible to document. We had a discussion about that on lemma, where I provided examples where even the Ren'Py devs couldn't immediately give me the best advice for more complex stuff and suggested more complicated solutions instead of using higher level scrips.
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5842 on: September 18, 2015, 08:48:31 AM »
I've cleaned up library code a bit, we now have a simple class and a func. Class methods that add headers and text also take all properties that Ren'Py text does so it is possible to overwrite and customize every single header/paragraph separately. {} inside of the texts should also work.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5843 on: September 18, 2015, 01:29:47 PM »
Where is the code that decides what you can find while looking around? It's not unusual to have rare and expensive items, that's clearly an overkill.

I think it might use items with "exploration" location. But they are supposed to be well guarded by mobs, not just lie around in random city location.
« Last Edit: September 18, 2015, 01:40:16 PM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5844 on: September 18, 2015, 02:08:53 PM »
Where is the code that decides what you can find while looking around? It's not unusual to have rare and expensive items, that's clearly an overkill.

I think it might use items with "exploration" location. But they are supposed to be well guarded by mobs, not just lie around in random city location.

In the base events.rpy file. It's a very old code that predates any kind of exploration, the fact that I wrote it in 5 mins very soon before the release doesn't help either :) I just felt like a couple of random events were appropriate.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5845 on: September 18, 2015, 02:13:21 PM »
Oh, great. It could be any item at all.
I'll add a new location to items for looking around option.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5846 on: September 18, 2015, 05:36:09 PM »
Yeap. At @ release, we would not have cared since it was extremely unlikely a low level player getting a decent item at all.

We'll obviously have to recode it for the beta.
« Last Edit: September 18, 2015, 06:07:14 PM by Xela »
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5847 on: September 20, 2015, 06:43:36 AM »
Alright, so how do I form a list of items with "Look around" location?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5848 on: September 20, 2015, 09:40:11 AM »
Depends on how you want it to work, you can come up with some guidelines and I'll update it myself.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5849 on: September 20, 2015, 09:48:08 AM »
Well, actually I was referring to your code where you check items_pool = list(item for item in items.values() if item.price <= amount). So I suppose it should be  if "Look around" in item.location() or something?