devolution

Author Topic: General Discussion  (Read 3821290 times)

0 Members and 44 Guests are viewing this topic.

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5790 on: September 13, 2015, 03:30:40 PM »
I tried some things but couldn't make it work. It's not something I need here and now, more like before the release.

When we give a quest to increase some MC's (or char's) skill or stat to N, we need to track it somehow everywhere (or at least during next day) in order to update the quest when it will be done.
This is especially important for skills because we probably won't show skill number in gui, so updating quest is the only way to tell that the skill is high enough.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5791 on: September 13, 2015, 03:50:10 PM »
That's what the event system is for, isn't it?
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5792 on: September 13, 2015, 04:09:50 PM »
Ok, show me how to track sex skill >= 200 everywhere with the help of the system  :D

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5793 on: September 13, 2015, 05:00:27 PM »
Something like this?:

Code: [Select]
init -9 python:
    register_event("check_skill_yada_yada_yada_event", trigger_type="auto", locations=["all"], run_conditions=["hero.get_skill('sex') >= 200"], priority=101, dice=0, restore_priority=0, max_runs=1)

label check_skill_yada_yada_yada_event(event):
    "Have some moar zex!"
    $ hero.Sex += 200
    return

Remember that events are reevaluated on next day, you'll need to click ND before the event triggers.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5794 on: September 14, 2015, 01:16:50 PM »
Quote
register_event("intro_storyi_entervillage", quest="Medic's Request", trigger_type="auto", locations=["hiddenVillage_entrance"], dice=100, max_runs=1)
Works as soon as you enter the village.

Quote
register_event("intro_storyi_entervillage", quest="Medic's Request", trigger_type="auto", locations=["forest_entrance"], dice=100, max_runs=1)
Works only after you enter the forest the second time.

Both after the next day.
Wtf?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5795 on: September 14, 2015, 01:24:18 PM »
Wtf?

System runs one event at a time to avoid confusion, collision and sideeffects if we try and run more than one event on entry. That's what the priority is for, if you feel that your event should be more important, increase it's priority, if you're are ok with it to be run a couple of entries later, leave it as it is.

No system will be perfect, too many parameters will result in even more confusing code and more complicated system, just roll with how it is. We'll prolly add chained processing at some point but I don't want to deal with that right now.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5796 on: September 14, 2015, 01:29:22 PM »
But there is no event when you enter the forest for the first time. At least I don't see anything.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5797 on: September 14, 2015, 01:32:45 PM »
But there is no event when you enter the forest for the first time. At least I don't see anything.

Events system put the frog on the screen... some event may also run silently, although I do not recall anyone coding a silent event (yet).
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5798 on: September 14, 2015, 01:53:29 PM »
Yeah, it's a bit confusing that you need to wait for a day before the next auto event will become available...
« Last Edit: September 14, 2015, 02:28:18 PM by DarkTl »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5799 on: September 14, 2015, 02:03:44 PM »
Auto-Combat should set the controller every turn, even if it doesn't, it most definitely should. Tis been one f*cked day so I am not going to do anything tonight. Tomorrow I'll take a stab at jobs if I have any energy for focused coding, otherwise I'll know out a couple of items issues as those are easier to deal with.
Lol, just as I thought. They keep fighting on their own even being on your side if you messed up with the controller before  :D


Though I don't mind if all allies will fight automatically in the future while you only can give general directions. There are pretty good jrpg games with such a system.
But it will require a very good AI, of course.

I added graveyard. I won't be able to make it work on my own, ie show somehow dead chars.
« Last Edit: September 14, 2015, 02:25:57 PM by DarkTl »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5800 on: September 14, 2015, 02:37:44 PM »
I'll try to make a simple gui for the graveyard tomorrow. But I will need help with making a list of dead chars and showing them.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5801 on: September 14, 2015, 04:12:58 PM »
Yeah, it's a bit confusing that you need to wait for a day before the next auto event will become available...

If you can confirm this behavior, start an issue cause it's a bug. If the event was evaluated and added to waiting list, it should activate upon next entry to the location, next day should have nothing to do with it.

Basically:

1) It becomes possible for an event conditions to be evaluated as True.
2) When ND is started, all such events are added to active queue, from that queue game will check location, other conditions and reevaluate all events that were placed as active during next day.
3) They are executed upon entering a correct location and other checks. Highest priority first, afterwards you should be able to renter the location and see the second/third event without triggering next day.

Lol, just as I thought. They keep fighting on their own even being on your side if you messed up with the controller before  :D


Though I don't mind if all allies will fight automatically in the future while you only can give general directions. There are pretty good jrpg games with such a system.
But it will require a very good AI, of course.

I added graveyard. I won't be able to make it work on my own, ie show somehow dead chars.

I'd still prefer dead to stay dead unless handled in unique events...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #5802 on: September 14, 2015, 04:19:40 PM »
They will stay dead. I wanted to show names and portraits, unless you want to delete them from the game completely to free some memory.


I have a function that checks if a quest is completed or not.
Quote
        def check_quest_not_finished(self, quest):
            """           
            Will return False if quest is completed or failed, True otherwise.
            """
            if self.is_complete(quest) or self.has_failed(quest):
                return False
            else:
                return True
Can it be rewritten to take any amount of quests names and return True as long as they all are not finished/completed?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5803 on: September 14, 2015, 04:37:50 PM »
They will stay dead. I wanted to show names and portraits, unless you want to delete them from the game completely to free some memory.


I have a function that checks if a quest is completed or not.Can it be rewritten to take any amount of quests names and return True as long as they all are not finished/completed?

Portraits shouldn't be an issue.

Try:

Code: [Select]
        def check_quest_not_finished(self, *quests):
            """           
            Will return False if quest is completed or failed, True otherwise.
            """
            for quest in quests:
                if self.is_complete(quest) or self.has_failed(quest):
                    return False
            return True
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #5804 on: September 15, 2015, 02:38:32 AM »
That func is not going to work. I'll see if I can write one later that does.
Like what we're doing?