Author Topic: General Discussion  (Read 3821255 times)

0 Members and 41 Guests are viewing this topic.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5805 on: September 15, 2015, 05:58:09 AM »
For graveyard I mean something like this. I found a more or less decent tombstone and also edited existing panels for chars names that we use in gui, making them a bit darker and grayer, they are in the repo. Above names panels there should be character's portrait in grayscale.
One name panel is for the name, other for the date (we do have calendar  :) ).


So when you go to the graveyard and select the option to check dead ones, you see that tombstone and can use arrows to look at other characters.
I suppose only chars with disposition>0 or hired chars should be added into that list.

For now it's just for fun. Eventually we might find a more practical use for dead chars (not resurrection).

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5806 on: September 15, 2015, 02:16:13 PM »
I wonder what is the best way to show big amounts of text in library. Our usual means are not an option.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5807 on: September 15, 2015, 04:31:46 PM »
I wonder what is the best way to show big amounts of text in library. Our usual means are not an option.

There are too many good ways, prolly not one you may call "best".

1) You can bind text to a variable like:

temp = "Some really long string"
show expression Text(temp, **google renpy text properties/style for a lot of options)

2) Screens are a very easy/convenient way:

screen show_text():
    text temp size 15 color black yada, yada, yada (parameters again)

This will be the easiest way of you need a cool background as well. You can use add/frame/window for that.

3) NVL Sayer, that works ok as well, we had an example of Nigerian Spam letter at some point if you still remember presented in that way :)

===
There are prolly more but these three are definitely the best Ren'Py has to offer. Other options are prolly class/func but that would be an overkill.
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5808 on: September 15, 2015, 07:01:21 PM »
I've knocked out a few issues, see the comments for more specific info.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5809 on: September 16, 2015, 02:54:18 AM »
I'm sorry to say it, but it's not how I need quest checking function to work  :)

 Currently it returns False as long as at least one is completed/failed. I need it to return False when all quests were failed or completed, and True otherwise.

Basically, I need to use it to check if all miniquests that are parts of some big quest were finished or not, and if they are, advance that big one to the next stage. And when I do it for every single quest separately, checks become really huge and confusing.
« Last Edit: September 16, 2015, 02:59:22 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5810 on: September 16, 2015, 03:36:17 AM »
I see... Ok, I'll rewrite the function again when time permits.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5811 on: September 16, 2015, 06:32:27 AM »
I'm not sure how to deal with paragraphs. Strings usually cannot contain the sign of the transition to the next line. There are types of data that can, but I'm not sure that renpy supports them.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5812 on: September 16, 2015, 07:28:32 AM »
We have a russian spammer in general discussion  ::)

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5813 on: September 16, 2015, 11:50:50 AM »
I'm not sure how to deal with paragraphs. Strings usually cannot contain the sign of the transition to the next line. There are types of data that can, but I'm not sure that renpy supports them.

Take a look at \n in python strings. You can also form a list of an OrderedDict and analyze it. This thing starts with setting up some parameters on what's required.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5814 on: September 16, 2015, 02:16:25 PM »
I don't understand how to keep a screen on the screen, so to speak  :)
I built a testing screen with a button that will close it and return you where you need to be. When I call that screen as soon as I enter the location (show screen), it works. But when I call it via matrix, I return to the main menu.

I suppose this is because we also have this part in all locations
Quote
        while True:

            result = ui.interact()

            if result[0] == 'jump':
                gm.start_gm(result[1])
            if result[0] == 'control':
                renpy.hide_screen("pyt_academy_town_entrance")
                if result[1] == 'return':
                    break
which I don't quite understand.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5815 on: September 16, 2015, 02:37:11 PM »
You don't have to do this for simpler screens, there are other ways that can be used depending in circumstances.

The ui.interact loop is one of the more complicated ways, basically it's a command cycle, screens use Return() action to return lists of strings through the ui.interact so basically, this:

Code: [Select]
while 1:
    $ result = ui.interact()

Means wait for something to Return() a value. Game is obviously paused with this automatically and will wait for such a return indefinitely.

Code: [Select]
if result[0] == "something":
Then we just analyze the result which from screens actions Return(["something", "action_1"]) for example so:


Code: [Select]
if result[0] == "something":
    if result[1] == "action_1":
        # Execute some code

After the code is executed and in case you do not jump/somewhere or return to a called label, while loop will got to the next iteration and ui.interact will pause the game again.


===
This is the most complicated command cycle you may need to build in Ren'Py, it's usually a huge overkill for simpler stuff.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5816 on: September 16, 2015, 03:01:14 PM »
Hm. I don't understand how to place a text inside a frame. I mean, I have an image and I need to output text within its borders.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5817 on: September 16, 2015, 03:12:49 PM »
You can look for code in other places where we place texts in frames, like tooltips/quests/next day reports.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5818 on: September 17, 2015, 04:09:01 AM »
Viewport has a scrollbar. When I try to add it, it appears right in the center. When I try to use side "tr" or side "r", nothing really happens. I have run out of ideas. It already should be at right by default, no idea why it likes center so much.
Quote
    viewport:
        mousewheel True
        draggable True
        scrollbars "vertical":
            side "tr"
        xpos 303
        ypos 30
        xysize (675, 670)
« Last Edit: September 17, 2015, 04:18:38 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5819 on: September 17, 2015, 04:29:04 AM »
I'd have to see the whole code, maybe some container is misplacing it. Side is a container in itself so you cannot use it like you're trying. You can declare a side with two positions and put a viewport and scrollbar in it separately.

But your way should be workable as well.
Like what we're doing?