Author Topic: General Discussion  (Read 3788618 times)

0 Members and 12 Guests are viewing this topic.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7695 on: May 23, 2016, 01:22:59 AM »
Yeah... maybe it's worth moving event recalculation to next day... Assumption there is that we reevaluate event cache daily, while when you're clicking next day without returning to main screen, that doesn't happen and during my testing there wasn't even an option to just keep clicking next day... it sent you to main screen automatically.

I never reviewed the events system after that option was added or updated it's logic accordingly. It should work now, maybe even reliably but it may be worth taking a look at/testing extensively one more time, event system is not as "dependable" as I believed it to be after my own testing, due to changes to GUI/Gameflow logic and by the looks of it to code somehow (tpd renamed to tdp).

We'll see, I'll take another quick look at the code right now. If nothing obvious pops up, I am leaving it be until there is time to review.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7696 on: May 23, 2016, 04:30:43 AM »
Yeah, I think it works now.

When you are being attacked after using looking around option, you have to manually hide location screen, like hide screen main_street, otherwise all gui will remain there, right in the BE.
But if you don't know where the battle was started, ie locations=["main_street", "city_parkgates", "forest_entrance"], you don't know which screen should be hidden. What am I supposed to do then? Can't BE automatically hide gui by itself, for that matter?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7697 on: May 23, 2016, 04:34:39 AM »
Yeah, I think it works now.

When you are being attacked after using looking around option, you have to manually hide location screen, like hide screen main_street, otherwise all gui will remain there, right in the BE.
But if you don't know where the battle was started, ie locations=["main_street", "city_parkgates", "forest_entrance"], you don't know which screen should be hidden. What am I supposed to do then? Can't BE automatically hide gui by itself, for that matter?

Hide? Prolly not... we can maybe run in on top of everything blocking input... you can always:

pytfall.world_events.get(name).label_cache I think, it should store where you can from.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7698 on: May 23, 2016, 04:57:46 AM »
Ok, I can
$ scr = pytfall.world_events.get("events_thugs_robbery").label_cache
...
jump expression scr

How am I supposed to hide and show scr screen? Hide screen expression scr doesn't work.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7699 on: May 23, 2016, 06:20:11 AM »
Clear the layers.

Code: [Select]
scene
renpy.scene(layer="screens")

I'll move the debug screen to a special layer when i can, cause it will disappear as well when you do this. You can jump/return to label cache when you're done with your event.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7700 on: May 23, 2016, 06:39:43 AM »
I cannot manually return background after BE like we usually do if I don't know location due to multiple locations in events arguments. I mean, I can jump to pytfall.world_events.get("events_thugs_robbery").label_cache. But right after BE and before jumping I have to show appropriate background, ie the background before BE started.


I can do it by manually checking pytfall.world_events.get("events_thugs_robbery").label_cache and comparing it to known locations. But it's a nightmare to do for the whole game forever  :D
Ideally there should be a variable = last used background. So after BE I just write show bg last_used_bg.

Otherwise BE pretty much cannot be used properly for random location inside VN mode.
« Last Edit: May 23, 2016, 06:57:02 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7701 on: May 23, 2016, 07:07:03 AM »
I think we keep names of the background on a rule bg + label name... did you try:

Code: [Select]
scene expression "bg " + event.label_cache
renpy.scene(layer="screens")

?
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7702 on: May 23, 2016, 08:19:49 AM »
Yeap, it works.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7703 on: May 23, 2016, 02:34:54 PM »
I added a small event, it probably could be written more elegantly, but whatever  :)

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7704 on: May 24, 2016, 07:44:51 AM »
Tired of writing lines for now, guess I'll quickly make another pack while SE is not ready for content...

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7705 on: May 26, 2016, 02:32:03 AM »
I wrote a function to automate BE calls a bit, but it gives a weird error
Quote
  File "game/library/interactions/GM - negative.rpy", line 64, in script
    python:
  File "game/library/interactions/GM - negative.rpy", line 67, in <module>
    result = run_default_be(enemy_team, background=back)
  File "game/library/interactions/function - interactions (GM).rpy", line 388, in run_default_be
    battle.start_battle()
  File "game/library/be/core.rpy", line 163, in start_battle
    renpy.with_statement(self.start_sfx)
  File "game/library/be/screens.rpy", line 192, in execute
    screen battle_overlay(be):
  File "game/library/be/screens.rpy", line 192, in execute
    screen battle_overlay(be):
  File "game/library/be/screens.rpy", line 195, in execute
    frame:
  File "game/library/be/screens.rpy", line 199, in execute
    has viewport:
  File "game/library/be/screens.rpy", line 202, in execute
    has vbox
  File "game/library/be/screens.rpy", line 203, in execute
    for entry in reversed(battle.combat_log):
NameError: name 'battle' is not defined

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7706 on: May 26, 2016, 04:58:27 AM »
Yeah, I've been meaning to get it rewired but it's a bit of manual works passing the object around...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7707 on: May 26, 2016, 09:14:32 AM »
MC's gold can be negative. Most likely it's true for characters too.

So you can't write hero.gold -= randint(500, 1000), you always have to
g = randint (500, 1000)
if hero.gold <= g:
   hero.gold = 0
else:
   hero.gold -= g

Can't it be forbidden globally for gold to be negative?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #7708 on: May 26, 2016, 09:19:02 AM »
Can't it be forbidden globally for gold to be negative?

Technically, yes. But MC is allowed to go negative (owe money) in a bunch of cases, chars as well. We don't really have a "debt" field which could prolly help solving this issue...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #7709 on: May 26, 2016, 10:14:29 AM »
Really? What kind of cases?