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: 554
Location: Russia
Posted: 2015-01-21, 20:56   

My plan after current refactoring of spells is implement scripting.
 
     
Kantor 

Age: 22
Joined: 28 Dec 2013
Posts: 89
Location: Poland
Posted: 2015-01-22, 14:53   

AVS wrote:
My plan after current refactoring of spells is implement scripting.

That's really great news :-D .
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-03-14, 22:40   

Adventure map spells are working, this is really great.
But I have question.

For example, this spell (and all adventure spells rising some value) gives + to morale. I cast it 3 times, and it gives +6 morale on expert. I want to allow only 1 cast per turn for hero (or I cast it 20 times and will get +60 morale :mrgreen: till end of turn.
I tried to use "counters" but it doesn't help. Is there is a way to prevent it from multiple casts?

Code:
{
    "armyPrayer":
    {
        "type": "adventure",
        "name": "Army Prayer",
        "school":
        {
            "air": true,
            "earth": false,
            "fire": false,
            "water": false
        },
        "level": 3,
        "power": 10,
       
        "defaultGainChance": 3,
        "gainChance":
        {
            "castle": 4
        },
 
        //counterstrike animation?
    "counters": {"spell.armyPrayer":true},

 
        "flags" : {"indifferent": true,"positive":true},
 
        //graphics - OPTIONAL; object;
        "graphics":
        {
            "iconBook": "!Map-spells/ArmyPrayer/back0.bmp",
            "iconScroll": "!Map-spells/ArmyPrayer/back1.bmp",
            "iconScenarioBonus": "!Map-spells/ArmyPrayer/back2.bmp",
            "iconEffect": "!Map-spells/ArmyPrayer/back3.bmp"
        },

       
        "targetType": "NO_TARGET",
 
        "levels":
        {
            "none":
            {
                "description": "Gives army +1 morale until end of turn.",
   
                "cost": 8,
                "power": 10,
                "aiValue": 5,
                "range": "X",
   
                "targetModifier":{"smart":false},
   
                "effects":
                {
                    "attacks":
                    {
                        "type": "MORALE",
                        "val": 1,
                        "duration": "ONE_DAY",
//                        "propagator":"HERO"
                    },
//                    "morale":
//                    {
//                    "type":"MORALE",
//                    "val":1,
//                    "duration":"ONE_DAY"
//                    }
                }
            },
            "basic":
            {
                "description": "Gives army +1 morale until end of turn.",
   
                "cost": 7,
                "power": 10,
                "aiValue": 5,
                "range": "X",
   
                "targetModifier":{"smart":false},
   
                "effects":
                {
                    "attacks":
                    {
                        "type": "MORALE",
                        "val": 1,
                        "duration": "ONE_DAY",
    //                    "propagator":"HERO"
                    },
//                    "morale":
//                    {
//                    "type":"MORALE",
//                    "val":1,
//                    "duration":"ONE_DAY"
//                    }
                }
            },
            "advanced":
            {
                "description": "Gives army +1 morale until end of turn.",
   
                "cost": 6,
                "power": 10,
                "aiValue": 5,
                "range": "X",
   
                "targetModifier":{"smart":false},
   
                "effects":
                {
                    "attacks":
                    {
                        "type": "MORALE",
                        "val": 1,
                        "duration": "ONE_DAY",
        //                "propagator":"HERO"
                    },
//                    "morale":
//                    {
//                    "type":"MORALE",
//                    "val":1,
//                    "duration":"ONE_DAY"
//                    }
                }
            },
            "expert":
            {
                "description": "Gives army +1 morale until end of turn.",
   
                "cost": 8,
                "power": 10,
                "aiValue": 5,
                "range": "X",
   
                "targetModifier":{"smart":false},
   
                "effects":
                {
                    "attacks":
                    {
                        "type": "MORALE",
                        "val": 2,
                        "duration": "ONE_DAY",
        //                "propagator":"HERO"
                    },
//                    "morale":
//                    {
//                    "type":"MORALE",
//                    "val":1,
//                    "duration":"ONE_DAY"
//                    }
                }
            }
        }
    }
 
}
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 358
Posted: 2015-03-14, 23:42   

Macron1 wrote:
I want to allow only 1 cast per turn for hero (or I cast it 20 times and will get +60 morale :mrgreen: till end of turn.
I don't think it's possible yet as limit for Dimension Door is hardcoded.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-03-15, 00:00   

SXX wrote:
Macron1 wrote:
I want to allow only 1 cast per turn for hero (or I cast it 20 times and will get +60 morale :mrgreen: till end of turn.
I don't think it's possible yet as limit for Dimension Door is hardcoded.


How about adding "castLimit":n (limit of cast per day) to spell levels configuration?
It will help dimension door too...
_________________
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: 2015-03-15, 01:35   

Macron1 wrote:

For example, this spell (and all adventure spells rising some value) gives + to morale. I cast it 3 times, and it gives +6 morale on expert.

1) maximum morale is +3
2) this (configuration for adv spell) feature is not complete and anything may change.
3) any suggestions for adventure spell configuration will be rejected until scripting will be implemented. Consider adventure spell configuration as internal engine feature an NOT intended for modding.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-03-15, 07:20   

AVS wrote:
Macron1 wrote:

For example, this spell (and all adventure spells rising some value) gives + to morale. I cast it 3 times, and it gives +6 morale on expert.

1) maximum morale is +3
2) this (configuration for adv spell) feature is not complete and anything may change.
3) any suggestions for adventure spell configuration will be rejected until scripting will be implemented. Consider adventure spell configuration as internal engine feature an NOT intended for modding.

That's one cool feature, so i'll play with it :mrgreen:
Can AI use these custom spells for adventure map?
As for me, I can limit spell casting by my will 8-)
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
SXX 
VCMI programmer

Age: 25
Joined: 04 Jul 2014
Posts: 358
Posted: 2015-03-15, 07:59   

Macron1 wrote:
Can AI use these custom spells for adventure map?

VCAI isn't capable of casting any adventure map spells. :-(
 
     
AVS 

Joined: 25 Feb 2011
Posts: 554
Location: Russia
Posted: 2015-03-15, 09:06   

Macron1 wrote:

As for me, I can limit spell casting by my will 8-)

Of course you may do what you want with adv spells, but please don`t complain about missing features ;) But patches are always welcome :)
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-03-15, 09:12   

[quote="AVS"]
Macron1 wrote:

But patches are always welcome :)


I hope I will finish my current hell of materials work in march, and will try to fix something.
I must remember GIT magic as well 8-)

I plan to at least fix IMPROVED_NECROMANCY, so it will be configurable (user will write in "subtype" which creature to rise).
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-10-23, 18:55   

By the way, what is with summoning spells?

I looked into sources, it seems that something is changed for summoning spells.
Is it already can be configured through json?
What bonus type goes for summoning, if implemented?
_________________
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: 2015-10-23, 19:09   

I don`t have plans to implement summoning configuration right now. It will be part of second version of configuration format - kind of distant future (after json map format & scripting).
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2015-10-23, 19:23   

It's sad:-(
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2016-07-07, 10:44   

By the way, seems like a bug.
In VCMI 0.97 this spell worked (repaired non-living things).
In last builds this spell on activation writes that it will affect no one.
Setting "smart":true to false don't help

Code:

{
    "repair":
    {
        "type": "combat",
        "name": "Repair",
        "school":
        {
            "air": false,
            "earth": true,
            "fire": false,
            "water": false
        },
        "level": 4,
        "power": 30,
        "defaultGainChance": 3,
        "gainChance":
        {
            "tower": 5
        },
 
        "animation":{
            "affect":["repair/repair"]
        },       
 
        "flags" : {"positive":true,"rising":true},
       
    //    "immunity":{"UNDEAD":true,"NON_LIVING":false},
 
        //flags structure of bonus names,any one of these bonus grants immunity
        "absoluteLimit":
        {
            "NON_LIVING" : true,
            "SIEGE_WEAPON" : true
        },
         "limit":
        {
            "NON_LIVING" : true
        },
        //graphics - OPTIONAL; object;
        "graphics":
        {
            "iconBook": "repair/back0.bmp",
            "iconScroll": "repair/back1.bmp",
            "iconScenarioBonus": "repair/back2.bmp",
            "iconEffect": "repair/back3.bmp"
        },
        "sounds":
        {
            "cast":"spell_sounds/fixit"
        },
        "targetType" : "CREATURE",//_EXPERT_MASSIVE",
 
        "levels":
        {
            "none":
            {
                "description": "Repairs mechanisms, non-living creatures and siege weapons.",
   
                "cost": 35,
                "power": 0,
                "aiValue": 17,
                "range": "0",
                "targetModifier":{"smart":true}
            },
            "basic":
            {
                "description": "Repairs mechanisms, non-living creatures and siege weapons.",
   
                "cost": 35,
                "power": 200,
                "aiValue": 17,
                "range": "0",
                "targetModifier":{"smart":true}
                },
            "advanced":
            {
                "description": "Repairs mechanisms, non-living creatures and siege weapons.",
   
                "cost": 35,
                "power": 300,
                "aiValue": 18,
                "range": "0",
                "targetModifier":{"smart":true}
            },
            "expert":
            {
                "description": "Repairs mechanisms, non-living creatures and siege weapons.",
   
                "cost": 35,
                "power": 400,
                "aiValue": 19,
                "range": "0",
                "targetModifier":{"smart":true}
            }
        }
    }
 
}


And how about summoning spells?
I personally wait them more than one year.
Let's make them same as summoning elementals (only one type of summoning spells can be cast after first casting), passing through "subtype" type of monsters, and deciding quantity of monsters through "power"/hitPoints.
Just make them already, please. :roll:
_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
Macron1 

Joined: 02 Apr 2013
Posts: 576
Posted: 2016-10-27, 18:45   

By the way, made spell, that lowers stack speed to 0.

Code:

"type":"STACKS_SPEED",
"valueType":"PERCENT_TO_ALL",
"addInfo":100,
"val":-100,
"duration": "UNITL_BEING_ATTACKED"


It works well (unit not moving), but on screen error console message shows (in green font) - look image.
It's not an error, maybe just suppress error console on battle screen?

speed.jpg
error screen
16 Time(s) 272.09 KB

_________________
I'm not a member of VCMI developer group and my posts are not official. I'm just a fan.
 
     
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.05 second. SQL queries: 16