Author Topic: General Discussion  (Read 3821660 times)

0 Members and 35 Guests are viewing this topic.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8670 on: October 21, 2016, 05:37:56 PM »
Yeah... forget about it... both logic and gui code for transfer are mental, logic cause I wrote it years ago and gui cause Gismo tried to align stuff. It warrants a complete rewrite.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8671 on: October 21, 2016, 05:51:47 PM »
Hmm. We use raw names of slots in some places, like the shop filter. Sadly, "Smallweapon" slot name is a terrible name to be used in gui. Especially now, when we have stuff like Tower Shield in that slot.
I'm going to mass rename a few slots, like left hand instead of smallweapon for example, unless you can add gui-only names to slots.
« Last Edit: October 21, 2016, 06:26:55 PM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8672 on: October 21, 2016, 07:17:01 PM »
unless you can add gui-only names to slots.

We can now do just that. I don't believe you can mass rename slots, smallweapon might work but if you mr something like weapon, we're fucked...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8673 on: October 22, 2016, 03:47:28 AM »
Yeah, the plan was to mass rename smallweapon as a unique name, and based on it track down all places where slots should be renamed.

I wonder what will happen if autoequipment system will use an item with "jump_to_label" field. It probably should be forbidden.

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8674 on: October 22, 2016, 03:55:08 AM »
Remind me what all effects are supposed to be doing please, I think most of them are idle. You can use trait.effects field, it will only apply the effect. What unique name were you going to use for smallweapon?
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8675 on: October 22, 2016, 05:33:08 AM »
Should have been:

Code: [Select]
    {
    "id": "Optimist",
    "desc": "She is very cheerful and is rarely in a bad mood. She enjoys what she does, a lot.",
    "blocks": ["Pessimist"],
    "effects": ["Optimist"],
    "character_trait": true
    },

some effects might not do anything useful atm.
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8676 on: October 22, 2016, 05:51:18 AM »
You mean like these "crutches"?
Quote
        def __setattr__(self, key, value):
            if key in self.STATS:
                if key == 'disposition':
                    # This is a temporary crutch:
                    if last_label.startswith("gm_"):
                        if key == "disposition":
                            value = value + hero.charisma / 2

                    if self.__dict__['effects']['Sibling']['active']:
                        if self.__dict__['effects']['Introvert']['active']:
                            value = value + int((value + self.__dict__["stats"]['disposition'])*0.2)
                        elif self.__dict__['effects']['Extrovert']['active']:
                            value = value + int((value - self.__dict__["stats"]['disposition'])*0.6)
                        elif self.__dict__['effects']['Impersonal']['active']:
                            value = value + int(round((value - self.__dict__["stats"]['disposition'])*0.1))
                        else:
                            value = value + int(round((value - self.__dict__["stats"]['disposition'])*0.4))
                    elif self.__dict__['effects']['Introvert']['active']:
                        value = value - int((value - self.__dict__["stats"]['disposition'])*0.2)
                    elif self.__dict__['effects']['Extrovert']['active']:
                        value = value + int((value - self.__dict__["stats"]['disposition'])*0.2)
                    elif self.__dict__['effects']['Impersonal']['active']:
                        value = value - int(round((value - self.__dict__["stats"]['disposition'])*0.3))
I'm not sure they are working atm.
« Last Edit: October 22, 2016, 05:53:31 AM by DarkTl »

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8677 on: October 22, 2016, 06:12:07 AM »
I thought it was deleted...

This is a crutch:

 
Code: [Select]
                   # This is a temporary crutch:
                    if last_label.startswith("gm_"):
                        if key == "disposition":
                            value = value + hero.charisma / 2

Rest of that code should be rewritten to look more reasonable or maybe moved to Stats but that logic/approach is sound.
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8678 on: October 22, 2016, 07:21:53 AM »
Ok, I vastly improved that code bit and restored the interactions disposition increment animation. It should work and work much better than before. I am not actually 100% sure that older code calculated bonuses correctly. Also I've changed bonuses, most likely lowering their intended effects but I wasn't sure what old code was supposed to be doing exactly.

There should be a better way of doing this also, I may move it to getattr at some point... All effects are equally modified at the moment, we may want to change that to make sure that we handle the effect differently at positive and negative values.
« Last Edit: October 22, 2016, 07:24:08 AM by Xela »
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8679 on: October 22, 2016, 07:26:10 AM »
Yeah... I am 100% sure that older effects were not functioning properly, introvert along would have more that doubled disposition on every modification...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8680 on: October 22, 2016, 08:54:44 AM »
I believe the idea was that it's easier to change (increase and decrease) disposition for Extrovert and vice versa for Introvert effects. So every time we try to change it by 10, it would be 5 for Intro and 15 for Extra (as an example, I don't remember actual numbers).

And looks like it works now, although numbers are not integer  :)
« Last Edit: October 22, 2016, 09:30:59 AM by DarkTl »

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8681 on: October 22, 2016, 09:35:29 AM »
I cannot find any actual code for Fast and Slow Learner effects, except their activation and deactivation. Looks like it was deleted at some point...

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8682 on: October 22, 2016, 09:53:56 AM »
They were xp related? I am on android atm...
Like what we're doing?

Offline Xela

  • Global Moderator
  • *****
  • Posts: 6893
  • "It's like hunting cows"
Re: General Discussion
« Reply #8683 on: October 22, 2016, 09:55:55 AM »
And looks like it works now, although numbers are not integer  :)

I'll double check this later... thought that i had...
Like what we're doing?

Offline DarkTl

  • Hero Member
  • *****
  • Posts: 4737
Re: General Discussion
« Reply #8684 on: October 22, 2016, 10:00:31 AM »
They were xp related? I am on android atm...
Yeap. I think it was x1.2 and x0.8 exp.
I don't see it even in the initial commit, so original code is lost forever  :D
« Last Edit: October 22, 2016, 10:15:47 AM by DarkTl »