Author Topic: General Discussion  (Read 3821663 times)

0 Members and 24 Guests are viewing this topic.

Offline Thewlis

  • Jr. Member
  • **
  • Posts: 74
  • Its hentai, quiaff?
Re: General Discussion
« Reply #3630 on: September 18, 2014, 04:01:28 PM »
Right, I'm pushing it now. I'm gonna post in the Game Design section about what's actually in and how it all works.

Offline CherryWood

  • Hero Member
  • *****
  • Posts: 643
Re: General Discussion
« Reply #3631 on: September 19, 2014, 04:26:35 AM »
Are you sure of getting rid of this awesome background in favor of that space whatever-thing?  :(
« Last Edit: September 19, 2014, 04:48:46 AM by CherryWood »

Offline Gismo

  • Jr. Member
  • **
  • Posts: 88
Re: General Discussion
« Reply #3632 on: September 19, 2014, 06:00:28 AM »
It's my fault, forgot to change back when push first update )

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #3633 on: September 19, 2014, 07:10:07 AM »
Right, I'm pushing it now. I'm gonna post in the Game Design section about what's actually in and how it all works.

Some items transfer code seem to have vanished (at least partly *prolly just rushed merging with new code and picked "auto-fix errors with mercurial"). I'll take a look at the whole thing as time permits, new school logic looks great.

I tried training (for like 5 mins) but got some minor errors.

Are you sure of getting rid of this awesome background in favor of that space whatever-thing?  :(

You know me nad space stuff  ::) so I didn't complain. But that was a nice background that is worth keeping for some screens.
« Last Edit: September 19, 2014, 08:58:12 AM by Xela »
Like what we're doing?

Offline Thewlis

  • Jr. Member
  • **
  • Posts: 74
  • Its hentai, quiaff?
Re: General Discussion
« Reply #3634 on: September 19, 2014, 09:31:49 AM »
Some items transfer code seem to have vanished (at least partly *prolly just rushed merging with new code and picked "auto-fix errors with mercurial"). I'll take a look at the whole thing as time permits, new school logic looks great.
Damn, I tried so hard to avoid that. I'm sure I used the kdiff3 thing for every conflict  :(

I tried training (for like 5 mins) but got some minor errors.
Ha, I'm always bad at testing things. Send me the error logs or tell me what happened and I'll take a look at it. I held no belief that it was all going to work ok anyway.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #3635 on: September 19, 2014, 11:51:23 AM »
Damn, I tried so hard to avoid that. I'm sure I used the kdiff3 thing for every conflict  :(

(auto-merge used by me)

I'll try to revert back and see what's what.

Ha, I'm always bad at testing things. Send me the error logs or tell me what happened and I'll take a look at it. I held no belief that it was all going to work ok anyway.

Just added a slave girl to the dungeons and clicked next day. None doesn't have endswith method was the error (action set to None and code tried to get actions ending with Course).
Like what we're doing?

Offline Thewlis

  • Jr. Member
  • **
  • Posts: 74
  • Its hentai, quiaff?
Re: General Discussion
« Reply #3636 on: September 19, 2014, 11:59:20 AM »
Ah, I fiddled with the get_girls function in buildings. It can accept an argument now, so instead of:
Code: [Select]
[g for g in building.get_girls() if g.action == "Guard"]
we can simply call:
Code: [Select]
get_girls("Guard")
Was designed to be backwards compatible so passing no argument returns the entire list.

If you pass "Course" to the function it looks for every girl taking a training course, as their action would be "XXX Course" for example. I simply forgot it was possible to assign a girl to a building without an action. I'll push a fix in the next hour or so.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #3637 on: September 19, 2014, 03:58:23 PM »
Damn, I tried so hard to avoid that. I'm sure I used the kdiff3 thing for every conflict  :(

Nothing got broken and best I can tell you didn't change any of the items code. I think you changing some girls to slaves simply revealed previosuly uncaught error.

Like what we're doing?

Offline Thewlis

  • Jr. Member
  • **
  • Posts: 74
  • Its hentai, quiaff?
Re: General Discussion
« Reply #3638 on: September 19, 2014, 05:45:02 PM »
Ah, fair enough. Needed to check that it was restricting course types.

Offline CherryWood

  • Hero Member
  • *****
  • Posts: 643
Re: General Discussion
« Reply #3639 on: September 20, 2014, 07:14:13 AM »
Can some of you please explain the custom event conditioning to me?


I want to create event with a trigger other then "look around" or "auto", for example a location with "Stay" button with it's own "Stay" events. How to do that? I don't understand it from the comments in event class.
« Last Edit: September 20, 2014, 07:23:17 AM by CherryWood »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #3640 on: September 20, 2014, 08:05:58 AM »
Can some of you please explain the custom event conditioning to me?


I want to create event with a trigger other then "look around" or "auto", for example a location with "Stay" button with it's own "Stay" events. How to do that? I don't understand it from the comments in event class.

Creating new event triggers might be a bit tricky (required adding code to event classes).

I think there is a bunch of ways to do what you want with auto trigger:

In the menu with buttons (look around/meet girls etc.) add:

if hasattr(store, "show_my_event_button"):

or

if global_flags.flag("my_event_flag"):
    textbutton "Stay":
        #.......

Then create an event that just sets the flag or variable. Button will be displayed until clicked (you can do what you want with the flag/variable in label where the button leads).

Or you can simply condition the button itself as you see fit, not using the event system at all or create a quest using code by Thewlis. If you do it with event, you can create a label event to remove the button next day/next time the screen is visited, the are examples of that in the frog event.
Like what we're doing?

Offline CherryWood

  • Hero Member
  • *****
  • Posts: 643
Re: General Discussion
« Reply #3641 on: September 20, 2014, 08:45:34 AM »
I was thinking that event system may be good for most stable options like, for example "go swimming" on the beach or "stay" in the tavern, that will always display some regular result (created as event with dice 100 and priority=1) but will be easily expandable with more events (with priority >1) by anyone on top of that, using just one system (event class)
« Last Edit: September 20, 2014, 08:52:10 AM by CherryWood »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #3642 on: September 20, 2014, 10:04:43 AM »
I was thinking that event system may be good for most stable options like, for example "go swimming" on the beach or "stay" in the tavern, that will always display some regular result (created as event with dice 100 and priority=1) but will be easily expandable with more events (with priority >1) by anyone on top of that, using just one system (event class)

Lets call those "Actions" and they are really missing from the game... like going to the beach with a girls on your team or going to cafe. Events system is not exactly built to cover that + actions are prolly all diffrent from one another so we might manage without a python class/complex trigger logic.

(event being something that happens to player while action is driven by player)

How about a drop-down (or up) screen with choices of different actions, very similary to how jobs are made? Can be easiely customized for every screen and stuff...?

Edit: By "jobs" I meant work in Arena/SM. Work could be one of the actions.
« Last Edit: September 20, 2014, 11:11:34 AM by Xela »
Like what we're doing?

Offline Thewlis

  • Jr. Member
  • **
  • Posts: 74
  • Its hentai, quiaff?
Re: General Discussion
« Reply #3643 on: September 20, 2014, 12:48:16 PM »
TBH it wouldn't be too hard to set up a dynamic action list for locations. Just a simple store of location->(button_text, action_name, default_label) that populates on each screen based on a sub-screen. Adapting the events to trigger on the different actions wouldn't be too hard then... I'll see if I can easily come up with a way to do so that wouldn't change too much / be hard to use.

Offline Thewlis

  • Jr. Member
  • **
  • Posts: 74
  • Its hentai, quiaff?
Re: General Discussion
« Reply #3644 on: September 20, 2014, 02:01:42 PM »
I've got a working mock up for custom location actions if we want them.

Currently in the label for the locations, before we show the location-specific screen we put:
Code: [Select]
# If we have no actions
    python:
        if pytfall.world_actions.location("city_beach"):
            pytfall.world_actions.meet_girls()
            pytfall.world_actions.look_around()
            pytfall.world_actions.add("Sunbathe", "sunbathe")
            pytfall.world_actions.finish()

Which creates the actions for the location. The location() function either returns False if the location is already set up, or True and creates a set list of actions for it.

These functions create controls there were considered general enough to have a ease-of-use function:
meet_girls() creates the normal Meet Girls button.
look_around() creates the normal Look Around button.
slave_market() creates the Go Shopping slave market button.
work(flag=None) creates the Work button.

add() adds a new action button, with the arguments:
  • button = The name of the button.
  • action = The string to use as an event trigger, or a screen action.
  • label = The label to go to if no event can be run ("_events_not_found" for Look Around for instance).
  • cost = The cost of triggering the event. 1 by default.
  • flag = The global flag to check for screen actions.
  • null_button = The label to use if the button should be null ("No Slaves Available" for instance).
  • null_condition = The condition to check to see if the button should be null (can be a string, a function or a variable).

In the actual screen we put:
Code: [Select]
use location_actions(pytfall.world_actions("location name")
Which simply adds a vbox that loops through the available actions and adds a textbutton for them. Actions are only added if they have a default label or at least 1 action in the WorldEventsManager.label_cache that uses its action as a trigger if they are an event trigger, else checks its flag.

The WorldEventsManager.run_events() function has been modified to accept "default=None" and "cost=0" arguments as well, so the run_events("auto") calls don't need to be updated.
« Last Edit: September 20, 2014, 03:12:14 PM by Thewlis »