Forum index VCMI Project - Heroes 3: WoG recreated
Forum of the project aiming to recreate best turn-based strategy ever!

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum  DownloadDownload

Previous topic :: Next topic
Help with mods - questions
Author Message
marif 


Joined: 16 Jun 2008
Posts: 59
Location: Warsaw
Posted: 2014-11-20, 21:31   Help with mods - questions

Hi,

I try to make an artifact that allows the hero to make more experience, lets say 15% as in the example below. As I understand, EXP_MULTIPLIER is the right bonus type to choose. I add the folowing code:

Code:

        "bonuses":
        [
            {
                "type": "EXP_MULTIPLIER",
                "val" : 15,
                "valueType": "PERCENT_TO_BASE"
            }
        ]


While starting, VCMI detects the mod as correct, but when I get the artifact and fight lets say 100 peasants, I still get 100 exp points instead of 115. Am I doing something wrong?
 
     
Warmonger 
VCMI programmer


Age: 28
Joined: 07 Jun 2008
Posts: 1541
Location: Warsaw, Poland
Posted: 2014-11-20, 21:42   

Quote:
EXP_MULTIPLIER
val - percent of additional exp gained by stack / commander (base value 100)

Try SECONDARY_SKILL_PREMY with learning for hero.

From CGHeroInstance.cpp:
Code:
TExpType CGHeroInstance::calculateXp(TExpType exp) const
{
    return exp * (100 + valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::LEARNING))/100.0;
}
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2014-11-20, 21:42   

EXP_MULTIPLIER
##val - percent of additional exp gained by stack / commander (base value 100)

This is bonus not for hero.

By the way, I made artefact with bonus
Code:
{
"type":"PRIMARY_SKILL",
"subtype":3,
"val":100,
"valueType":"PERCENT_TO_BASE"

}

and it's not working. Where I have mistaken?
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
marif 


Joined: 16 Jun 2008
Posts: 59
Location: Warsaw
Posted: 2014-11-20, 21:56   

Quote:
Try SECONDARY_SKILL_PREMY with learning for hero.


Yep, that was my initial idea, but I wanted to make an artifact that is universal (does not require hero to have learning). That is why I am asking for this.

Does even funcionality like this exist?
 
     
Warmonger 
VCMI programmer


Age: 28
Joined: 07 Jun 2008
Posts: 1541
Location: Warsaw, Poland
Posted: 2014-11-20, 22:11   

That's why I provided code sample. It does not check for secondary skill presence, just total bonus value.
_________________
Think twice if you really need to send me private message. Use public forum for general questions.
DJ Warmonger blog
beegee wrote:
Warmonger, you are the best!
 
 
     
marif 


Joined: 16 Jun 2008
Posts: 59
Location: Warsaw
Posted: 2014-11-20, 22:43   

Ok, now I undestand, thanks :)
 
     
marif 


Joined: 16 Jun 2008
Posts: 59
Location: Warsaw
Posted: 2014-11-23, 16:53   

Is there a way to make an artifact that turns 'living' creatures into 'undead' (with the exception of non-living; like golems etc.)? AFAIK there is no limiter on living creatures, I can't come up with any workaround as well...

Code:

        "bonuses":
        [
            {
                "type" : "UNDEAD",
                "limiters" :
                [
                    {
                        "type": "HAS_ANOTHER_BONUS_LIMITER",
                        "parameters" : ["???????"]
                    }
                ]
            }
 
     
AVS 

Joined: 25 Feb 2011
Posts: 554
Location: Russia
Posted: 2014-11-23, 17:19   

There is no LIVING bonus and it may be good idea to add it (I`ve seen a comment somewhere in codebase about presence such bonus in WoG`s creature exp mechanics).
 
     
marif 


Joined: 16 Jun 2008
Posts: 59
Location: Warsaw
Posted: 2014-11-23, 17:31   

I mentioned it over half a year ago on the bugtracker right here in the comments, but WARMONGER said it would cause problems... though thinking of it now I would disagree :)
 
     
marif 


Joined: 16 Jun 2008
Posts: 59
Location: Warsaw
Posted: 2014-11-23, 18:25   

BTW. I am also looking for a way to disable 'UNDEAD' ability (by an artifact), but nothing seems to work. I tried:

Code:
        "bonuses":
        [
            {
                "type" : "UNDEAD",
                "val" : null
            }
        ]


and

Code:
        "bonuses":
        [
            {
                "type" : "UNDEAD": null
            }
        ]


but both of them do the opposite (make all creatures UNDEAD) - probably null is ignored (?), but at VCMI initialization the mod is not labeled as incorrect... If there was an 'IS_LIVING' ability, then I would do it by setting type to 'IS_LIVING' and limiting it to 'UNDEAD' creatures :p
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2014-11-23, 18:47   

I didn't try such thing.
Don't think it's possible to remove current bonus ability "UNDEAD" in artefacts.
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
AVS 

Joined: 25 Feb 2011
Posts: 554
Location: Russia
Posted: 2014-11-23, 22:38   

marif wrote:
BTW. I am also looking for a way to disable 'UNDEAD' ability (by an artifact), but nothing seems to work. I tried:

Code:
        "bonuses":
        [
            {
                "type" : "UNDEAD",
                "val" : null
            }
        ]


and

Code:
        "bonuses":
        [
            {
                "type" : "UNDEAD": null
            }
        ]


but both of them do the opposite (make all creatures UNDEAD) - probably null is ignored (?), but at VCMI initialization the mod is not labeled as incorrect... If there was an 'IS_LIVING' ability, then I would do it by setting type to 'IS_LIVING' and limiting it to 'UNDEAD' creatures :p


This is other problem :) There is no way to revoke bonus. Also ""type" : "UNDEAD": null" is syntactically incorrect, no error in log = bug in json parser
 
     
marif 


Joined: 16 Jun 2008
Posts: 59
Location: Warsaw
Posted: 2014-11-23, 23:06   

Quote:
There is no LIVING bonus and it may be good idea to add it (I`ve seen a comment somewhere in codebase about presence such bonus in WoG`s creature exp mechanics).


Quote:
This is other problem :) There is no way to revoke bonus. Also ""type" : "UNDEAD": null" is syntactically incorrect, no error in log = bug in json parser


Well, I quietly hope you guys add those funcionalities to VCMI :)
 
     
Macron1
Guest
Posted: 2014-11-24, 16:34   

AVS wrote:
There is no LIVING bonus and it may be good idea to add it (I`ve seen a comment somewhere in codebase about presence such bonus in WoG`s creature exp mechanics).


Oh no, there will be need to manually correct all these jsons of creatures:-) What a pain! :evil:
All creatures by default are "LIVING". I think there will be mess, if there will be creatures with both LIVING and UNDEAD bonuses.
Maybe it's better to add bonuses that related to LIVING nature?
Like "AFFECTED_BY_MORALE","AFFECTED_BY_LUCK","AFFECTED_BY_HEALING"? Is this are all living creatures bonuses?
 
     
Macron1
Guest
Posted: 2014-11-24, 16:45   

Or another way i suggested long time ago.
We have DRAGON_NATURE, UNDEAD, NON_LIVING types of bonuses served as limiters.
I suggested adding customized type of limiters.
Like i will add something like
Code:

"limiters":{"types": {

"DEMON" :  {       
        {
             "abilities":
                  {
                      "fireImmunity":{"type":"FIRE_IMMUNITY",
                     "lessDamageFromSpellFireball":{   
                        "type":"MORE_DAMAGE_FROM_SPELL",
                       "val":-50,
                       "subtype":"spell.fireball"
                     }
}

                }
         }

    }

}

and if in creature json we see "type":"DEMON", VCMI will automatically assign this set of abilities to it.
Same can go for "LIVING" creature. Add list of abilities incorporated, and then
Code:
"abilityToBeLiving":{"type":"LIVING","limiter":"UNDEAD"}
 
     
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group

Hosting provided by DigitalOcean
Page generated in 0.03 second. SQL queries: 12