Author Topic: General Discussion  (Read 3821697 times)

0 Members and 32 Guests are viewing this topic.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7215 on: April 28, 2016, 06:20:29 AM »
Yeah, you right. I didn't thought about calling a label inside an event before finishing it  :D

Offline lamoli

  • Hero Member
  • *****
  • Posts: 553
Re: General Discussion
« Reply #7216 on: April 28, 2016, 06:47:29 AM »
Your previously sprites were just fine! Stop trying to improve upon greatness and just make the damn pack :D


I know but when i tryed expressions it went really bad as the polygons of the face wherent right.. now it should work..

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7217 on: April 28, 2016, 07:17:27 AM »
Yeah, you right. I didn't thought about calling a label inside an event before finishing it  :D

Yeap... but please, make dead certain... I mean like really, really, really check that you've returned from the event sequence unless you used (jump=True) argument when registering an event or your even is setup to show a screen using internal mechanics. It will destroy the save/load system if at the end of an event with default settings, you jump away instead of ending it with return. Like:

Code: [Select]
label test_ev_label_1(event):
    "Exit and reenter the location..."
    return
   
label test_ev_label_2(event):
    "Exit and reenter the location."
    $ register_event_in_label("test_ev_label_3", trigger_type="auto", locations=["city_parkgates"], priority=1, dice=100, max_runs=1)
    $ pytfall.world_events.force_event("test_ev_label_3") # This one adds the event to the cache before the next day..
    return
   
label test_ev_label_3(event):
    "All Done!"
    return
   
label meet_beggar_event(event):

    $ beggar = Character('Beggar', color="#c8ffc8", show_two_window=True)

    'You see a girl who comes close to you.'
    show npc beggar_girl_novel
    with dissolve
   
    $ beggar(choice(['Hello, mister! Please, could you spare some coin for hungry beggar?',
                                'Hello, mister! Please, could you spare some coin?',
                                'Hi! Could you buy me something?',
                                'Please, could you spare some coin for hungry beggar?']))

    menu:
        'WTF? Who are you?':
            python:
                random_place = choice([u'library', u'tailor store', u'cafe', u'world peace', u'my sweet home'])
                for steal_amount in [5000, 500, 100, 50, 25, 5]:
                    if hero.take_money(steal_amount, reason="Theft"):
                        break
            beggar 'Oh, I`m just searching my way to [random_place]! I guess it`s there? Thank you, have a nice day!'
            "Somehow your pockets feel a bit lighter..."
           
        'Go buy some food. (-5 gold)':
            if hero.take_money(5, reason="Charity"):
                show npc beggar_girl_smile_novel
                with dissolve
                beggar 'Thanks! ^_^'
            else:
                beggar 'Empty pockets? Too bad. :`('
        'NO!':
            $ beggar(choice(["You're a meanie! >:-(",
                                        "That's too bad...",
                                        "And you looked so promising..."]))

    hide npc
    with dissolve

    return
   

label simple_beach_event(event):
   
    python:
        n = Character(" ")
        img = get_random_event_image("simple_beach")
        renpy.show("event", what=img, at_list=[center])
        renpy.with_statement(dissolve)
        n(choice(["This looks like fun!", "Damn, don't you wish could join them...", "Fun on the beach :)", "Awesome!", "... speachless", "Cute!"]))
    return
   
   
label creatures_beach_event(event):
   
    python:
        n = Character(" ")
        img = get_random_event_image("creatures_beach")
        renpy.show("event", what=img, at_list=[center])
        renpy.with_statement(dissolve)
        n(choice(["This looks like fun!", "Monster Girls are the best?", "What the hell?", "What are they called???"]))
    return
   
label found_money_event(event):
    python:
        amount = randint(10, 100) + hero.level*2 + max(10, hero.luck*4)
        renpy.show("_tag", what=Text("%d"%amount, style="back_serpent", color=gold, size=40, bold=True), at_list=[found_cash(150, 600, 4)])
        hero.say(choice(["Yey! Some money!", "Free Gold, lucky!", "I will not let this go to waste!"]))
        hero.add_money(amount, "Events")
    return
     
label found_item_event(event):
    python:
        # amount = max(200, (randint(10, 100) + hero.level*2 + max(10, hero.luck*4)))
        items_pool = list(item for item in items.values() if "Look around" in item.locations)
        found_item = choice(items_pool)
        renpy.show("_tag", what=ProportionalScale(found_item.icon, 100, 100), at_list=[found_cash(150, 600, 4)])
        hero.say(choice(["Yey! Found something! ([found_item.id])", "[found_item.id] Might be useful!", "[found_item.id]! Lucky?", "-[found_item.id]- Never look a gift horse in the mouth :)"]))
        hero.inventory.append(found_item)
    return


As you see, we return from all of our base events. You can jump 1 000 000 times in between or even call other labels, but when you are done with the event that you did not jump to (as I've said, you can add jump=True and then do whatever the hell you want, even forcing the day to end will work perfectly) all saves, even those that are made 100 days from your event's end, will load to just before your even had started.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7218 on: April 28, 2016, 07:39:34 AM »
BTW how to force the day to end? I just thought it could be a cool feature in some places.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7219 on: April 28, 2016, 08:42:38 AM »
Code: [Select]
jump next_day # (yeah, it is that simple :D)
Just don't forget that it must be from an event that you jumped to or started using a screen/menu. There is no way to do this from within a default event setup at the moment. You also should hide/scene whatever is showing at the moment.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7220 on: April 28, 2016, 09:43:07 AM »
I show a picture
Quote
show expression t.show("00AA-sx-eb-c8-l4-ns-p3-s5-sj-p2.jpg", resize=(800, 600)) as x at truecenter with dissolve
then use our function to imitate dizziness at the background
Quote
$ double_vision_on("bg girl_room_4")
The moment I do it the first picture disappears. It shouldn't. Suggestions?  :)
« Last Edit: April 28, 2016, 09:47:28 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7221 on: April 28, 2016, 09:59:27 AM »
Pull from the hub and try:

Code: [Select]
$ double_vision_on("bg girl_room_4", clear_scene=False)
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7222 on: April 28, 2016, 10:13:39 AM »
Got a splitting headache so if I am not in shape to add anything meaningful to businesses tonight, it might be worth trying to rewrite existing sfx, updating them to modern code and maybe adding some options.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7223 on: April 28, 2016, 03:58:58 PM »
I don't like default renpy scrollbar, I mean the looks of it. It's barely visible and tiny compared to usual windows style. It was more or less ok for library books since there is a clear white background, but at the bestiary screen for example it looks kinda meh.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7224 on: April 28, 2016, 04:42:33 PM »
Ren'Py has a lot of default scrollbars... it's not worth worrying about atm.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7225 on: April 28, 2016, 04:58:06 PM »
So I wrote usual
Quote
$ t_spr = chars["Tsunade"].get_vnsprite()
show t_spr  at center with dissolve
I suddenly got
Quote
  File "game/library/events/StoryI/naruto_quests.rpy", line 101, in script
    show t_spr at center with dissolve
Exception: Image 't_spr' not found.

I replaced it with
Quote
show chars["Tsunade"].get_vnsprite() at center with dissolve
and got
Quote
  File "game/library/events/StoryI/naruto_quests.rpy", line 101, in script
    show chars["Tsunade"].get_vnsprite() at center with dissolve
KeyError: u'"Tsunade"'
The hell? It worked dozens times before  :D
« Last Edit: April 28, 2016, 05:06:00 PM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7226 on: April 28, 2016, 05:16:01 PM »
It should not have worked, ever.

Code: [Select]
show image_tagShows an image that was defined as a part of Ren'Py internal image tracking system. Unless it was declared as such, it should not have worked.

Code: [Select]
show expression displayablewas what you were supposed to be using...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7227 on: April 29, 2016, 01:05:50 AM »
My bad, had a hell of a day yesterday -_-

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7228 on: April 29, 2016, 05:31:19 AM »
Yeah, I know what you mean :)
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7229 on: April 29, 2016, 05:43:29 AM »
Let's see.. Can we freely change slave/free status in the code? It won't cause any issues? For instance we have two characters and two ways to finish an event. Depending on the way, one of them will be free and another one will be slave.