Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support a value following a key on a separate line #9

Open
JoBoDo opened this issue Sep 26, 2016 · 0 comments
Open

Doesn't support a value following a key on a separate line #9

JoBoDo opened this issue Sep 26, 2016 · 0 comments

Comments

@JoBoDo
Copy link

JoBoDo commented Sep 26, 2016

This isn't urgent to fix, I only found this problem with one line of my VDF, so I just fixed that line for now.
However if the value for a key is on a separate line, the parser gets very confused.
I was running multiple parses and the data was getting entrenched further and further with each run. It wouldn't reset to a normal state until I restarted the node server.

The "Attributes" key is followed by the "MODIFIER_ATTRIBUTE_MULTIPLE" value on the next line. (this data still compiles/runs successfully inside of dota2

"DOTAAbilities"
{
    "item_apply_modifiers"
    {
        "Modifiers"
        {
            "ai_agro_from_healing_modifier"
            {
                "IsHidden"          "1"
                "Attributes"        
                "MODIFIER_ATTRIBUTE_MULTIPLE"
                "OnHealthGained"    //OnHealReceived triggered every time
                {
                    "RunScript"
                    {
                        "ScriptFile"    "Ai/ai_agro_listener.lua"
                        "Function"      "EnemyReceivedHeal"
                    }
                }
            }

        }
    }                           
}   

I was parsing my ability file, followed by my units file

var abilityData = vdf.parse(abilities_file);
var unitData = vdf.parse(units_file);

abilityData was the one that was causing the issue, but when i ran console.log on my units file, it added "DOTAAbilities" and "item_apply_modifiers". Each additional time I ran my parsing function, it added additional depth to the units file...

    "DOTAAbilities": {
        "item_apply_modifiers": {
            "DOTAAbilities": {
                "item_apply_modifiers": {
                    "DOTAAbilities": {
                        "item_apply_modifiers": {
                            "DOTAAbilities": {
                                "item_apply_modifiers": {
                                    "DOTAAbilities": {
                                        "item_apply_modifiers": {
                                            "DOTAUnits": {
                                                "npc_dota_creature_npc_acedia_king_acedia": {
                                                    "precache": {
                                                        "model": "models/heroes/wraith_king/wraith_king.vmdl"
                                                    },

hope this all makes sense, let me know if you need some more information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant