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
Json configuration for spells
Author Message
AVS 

Joined: 25 Feb 2011
Posts: 545
Location: Russia
Posted: 2014-05-13, 04:44   

Rising mechanics is hardcoded.
 
     
Macron1
Guest
Posted: 2014-05-18, 10:26   

By the way, I found thing seems like a bug.
I have a mod where "depends" is set to "new_spells.mod".
I forgot to make spells mod enabled, and VCMI is stalled on starting, saying nothing that some mod is missing.
Looks like a bug.
 
     
Macron1
Guest
Posted: 2014-05-27, 21:34   

AVS wrote:


This is completely wrong. To add another spell effects U should copy effects. And damage+effect spells are untested, but should work.


Looks like spells from other spells are working, but only by id. If I use id, than battle is not
freezing. seems like json parser doesn't parse spells by name to spells by id:
Code:
            "advanced":
            {
                "description": "Gives to shooters ability to shoot by explosive shells.",
   
                "cost": 13,
                "power": 10,
                "aiValue": 9,
                "range": "0",
   
                "targetModifier":{"smart":true},
   
                "effects":
                {
                    "speed":
                    {
                        "type": "SPELL_LIKE_ATTACK",
                        "subtype":21,
                        "val":3,
                        "duration": "N_TURNS"
                    }
                }
            },
 
     
Macron1
Guest
Posted: 2014-07-03, 09:38   

I wanted to ask.
Is 0.96 spell modding is the same as of 05.27.2014 version?
Or there were some improvements?
Like adventure spells or summon spells still not work?
PS By adventure spells i mean buff something like spell giving LAND_MOVEMENT bonus until end of turn to hero.
 
     
AVS 

Joined: 25 Feb 2011
Posts: 545
Location: Russia
Posted: 2014-07-03, 09:53   

Macron1 wrote:
I wanted to ask.
Is 0.96 spell modding is the same as of 05.27.2014 version?
Or there were some improvements?
Like adventure spells or summon spells still not work?
PS By adventure spells i mean buff something like spell giving LAND_MOVEMENT bonus until end of turn to hero.


No changes yet.
 
     
Warmonger 
VCMI programmer


Age: 27
Joined: 07 Jun 2008
Posts: 1530
Location: Warsaw, Poland
Posted: 2014-07-03, 10:00   

Will upload updated mod with new spells to Launcher when it's ready.
_________________
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: 2015-01-17, 14:01   

I wanted to make "spell" that will give army +1 morale (in 0.97b)

Code:
{
    "battleHymnChampions":
    {
        "type": "combat",
        "name": "Champions March",
        "school":
        {
            "air": false,
            "earth": false,
            "fire": false,
            "water": false
        },
        "level": 1,
        "power": 10,
       
        "defaultGainChance": 3,
        "gainChance":
        {
            "castle": 7
        },
 
"immunity":{"MIND_IMMUNITY":true},
        "absoluteImmunity":{"NON_LIVING":true,"UNDEAD":true},
 
        "flags" : {"positive": true,"offensive":false,"damage":false},
         "animation":{
            "affect":["Battle Hymns/Champions/Coin_with_sword.def"]
        },
        //graphics - OPTIONAL; object;
        "graphics":
        {
            "iconBook": "Battle Hymns/Champions/back0.bmp",
            "iconScroll": "Battle Hymns/Champions/back1.bmp",
            "iconScenarioBonus": "Battle Hymns/Champions/back2.bmp",
            "iconEffect": "Battle Hymns/Champions/back3.bmp"
        },
        "sounds":
        {
            //OPTIONAL; resourse path, casting sound
            "cast":"Battle Hymns/Champions/Win"
        },
       
        "targetType": "CREATURE",
 
        "levels":
        {
            "none":
            {
                "description": "Champion March increases army morale by +1.",
   
                "cost": 2,
                "power": 10,
                "aiValue": 5,
                "range": "X",
   
                //"targetModifier":{"smart":true},
   
                "effects":
                {
                    "attacks":
                    {
                        "type": "MORALE",
                        "val": 1,
                //        "duration": "N_TURNS",
                "propagator":"HERO"
                    }
                }
            },
            "basic":
            {
                "description": "Champion March increases army morale by +1.",
   
                "cost": 2,
                "power": 10,
                "aiValue": 5,
                "range": "X",
   
            //    "targetModifier":{"smart":true},
   
                "effects":
                {
                    "attacks":
                    {
                        "type": "MORALE",
                        "val": 1,
            //            "duration": "N_TURNS"
                    "propagator":"HERO"
                    }
                }
            },
            "advanced":
            {
                "description": "Champion March increases army morale by +1.",
   
                "cost": 2,
                "power": 10,
                "aiValue": 5,
                "range": "X",
   
            //    "targetModifier":{"smart":true},
   
                "effects":
                {
                    "attacks":
                    {
                        "type": "MORALE",
                        "val":2,
            //            "duration": "N_TURNS"
                    "propagator":"HERO"
                    }
                }
            },
            "expert":
            {
                "description": "Champion March increases army morale by +1.",
   
                "cost": 2,
                "power": 10,
                "aiValue": 5,
                "range": "X",
   
            //    "targetModifier":{"smart":true},
   
                "effects":
                {
                    "attacks":
                    {
                        "type": "MORALE",
                        "val":3,
            //            "duration": "N_TURNS"
                    "propagator":"HERO"
                    }
                }
            },
        }
    }
 
}


This code didn't work at all until I added "propagator":"HERO".
That's strange, because creatures have reaction on bonus "Morale".


But the way, we have section "school"

Is there no "mind" magic?
And this is not very good for future modding (where modding of secondary skills will be added).
I suggest change "air","earth","fire","water" magic schools IDs to secondary skill IDs.
Like
Code:
        "school":
        {
            "airMagic": false,
            "earthMagic": false,
            "fireMagic": false,
            "waterMagic": false
        },

For example, I want to make spell, that will require "artillery" skill. Then I will write
"artillery":true, and levels of spell will depend on level of Artillery skill


PPS There is no duration "ONE_TURN", duration is calculated from spell power. I wanted to make battle hymns spells work only 1 turn... :mrgreen:
_________________
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: 545
Location: Russia
Posted: 2015-01-17, 22:20   

1) custom duration will be allowed only for scripted spells.
2) Spell should have at least one school and custom schools are not planned at all yet
3) need complete mod to try to fix "didn't work at all until ..."
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-01-17, 23:25   

AVS wrote:
1) custom duration will be allowed only for scripted spells.
2) Spell should have at least one school and custom schools are not planned at all yet
3) need complete mod to try to fix "didn't work at all until ..."


1) OK, I'll say it for future. I just throught that set of durations isn't complete:
Code:
PERMANENT
## ONE_BATTLE //at the end of battle
## ONE_DAY //at the end of day
## ONE_WEEK //at the end of week (bonus lasts till the end of week, thats NOT 7 days
## N_TURNS //used during battles, after battle bonus is always removed
## N_DAYS
## UNITL_BEING_ATTACKED //removed after attack and counterattacks are performed
## UNTIL_ATTACK //removed after attack and counterattacks are performed
## STACK_GETS_TURN //removed when stack gets its turn - used for defensive stance
## COMMANDER_KILLED


2) It works without selecting any school. But there is a bug during spell book drawing of icons:-)
3) Will create mod with this spell and send to you.
_________________
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: 545
Location: Russia
Posted: 2015-01-18, 03:02   

Macron1 wrote:


2) It works without selecting any school. But there is a bug during spell book drawing of icons:-)

That`s why I`ve said "should" ;)
Last edited by AVS on 2015-01-18, 14:54; edited 1 time in total  
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-01-18, 10:43   

AVS wrote:

3) need complete mod to try to fix "didn't work at all until ..."


In attachment.
1) In spell Champions Marsch propagator HERO is commented.
So when spell is cast, green counter appears, but morale is not increased. And in creatue window there is no icon of active spell.
In spell Bard Song propagator is not commented, so luck is applied.
2) These hymns are not assigned to any magic school, so in magic book this is corruption - there are only 4 defs for spell level indicatings (for each school), so it goes outside of array schoolBorders[] and takes cadre from another def (Schools.def) that should not be there.
I think there must be check - is spell school is not set, that do not try to load graphics from schoolBorders.

hymns-mod.zip
hymns test mod
Download 93 Time(s) 61.84 KB

_________________
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: 545
Location: Russia
Posted: 2015-01-18, 15:01   

Macron1 wrote:


I suggest change "air","earth","fire","water" magic schools IDs to secondary skill IDs.
Like
Code:
        "school":
        {
            "airMagic": false,
            "earthMagic": false,
            "fireMagic": false,
            "waterMagic": false
        },




In theory it is of course possible, but a bit harder than trivial :). Spell school is not just required primary skill

Code:

struct SpellSchoolInfo
{
    ESpellSchool id; //backlink
    Bonus::BonusType damagePremyBonus;
    Bonus::BonusType immunityBonus;   
    std::string jsonName;
    SecondarySkill::ESecondarySkill skill;
    Bonus::BonusType knoledgeBonus;           
};

(non including interface logic).
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-01-18, 15:47   

Or then allow some time to add new Spell Schools Info with Secodary Skills.
To change AIR_SPELL_DMG_PREMY to SPELL_DMG_PREMY with "subtype":"spellSchool.air"
and so on.
Magic Book problem
1) Leave it be - 4 elemental magics will have their own pages, and all other schools will go to united combat spells pages.
2) Move magic book to json, so user can make other schools pages.
Or cause, it will require a lot of work, don't expect it to 1.0 version.
It will require to move secondary skills bonuses to json also.
_________________
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: 545
Location: Russia
Posted: 2015-01-18, 15:56   

Macron1 wrote:

1) Leave it be - 4 elemental magics will have their own pages, and all other schools will go to united combat spells pages.


This may be implemented in part 6 (current is 4; 5 will be about adventure spells) of spell refactoring.
 
     
majaczek 

Age: 27
Joined: 12 Jun 2008
Posts: 474
Posted: 2015-01-21, 20:02   

Would You Implement Reinforcements Spell?
it allows to teleport creatures from Town to Hero which is not visiting it.

there is mod in ERA which replaces Disguise by Reinforcements, but we may add it as separate spell.
 
     
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
Template Chronicles modified by Nasedo modified by Tow.
© VCMI Team
Page generated in 0.08 second. SQL queries: 14