Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2016-08-04 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog

Author Topic: War3Source Config files  (Read 1160 times)

El Diablo

  • Hero Member
  • *****
  • Posts: 1114
    • View Profile
    • War3Evo
War3Source Config files
« on: December 23, 2014, 04:38:38 AM »
I've been requested by few people to create a way to allow them to add races via configuration files.

So, I will be working on this soon and add it as an update.

I hope that the creators of War3Source will accept this up coming addition.



p.s. I plan to use a similar setup like FF2.   Where you can point to certain plugin files for your skills,abilities, and ultimates in your configuration file.  Shouldn't take too long and then non-programmers will be able to add races.
« Last Edit: December 23, 2014, 05:18:22 AM by el diablo »

El Diablo

  • Hero Member
  • *****
  • Posts: 1114
    • View Profile
    • War3Evo
Re: War3Source Config files
« Reply #1 on: December 23, 2014, 05:30:23 PM »
This is the basic (proposed) structure I'm thinking of using.. if anyone has suggestions or comments, please do reply.

I plan to add more possibilities and such, and even the ability to create external addon plugins to be triggered from the race created by the configuration file.

Code: [Select]
// A List of possible configurations

"character"
{
    "Basic Details"
    {
        "racename"              "Race Name"
        "raceshortname"         "raceshortname"
    }

    // skill = passive skill
    // ability = push button
        // ability1 = +ability or +ability1
        // ability2 = +ability2
        // ability3 = +ability3
        // ability4 = +ability4
    // ultimate = ultimate

    "Restrictions"
    {
        "restrictteam"      "0"
        "restrictitem"      ""
        "team2limit"        "0"
        "team3limit"        "0"
    }

    "skill1" or "ability1" or "ultimate"
    {
        "name"               "name of skill"
        "description"        "description of skill"
       
        "W3Buff1"            "fLowGravitySkill"
        "W3BuffValue1"       "0.9/0.8/0.7/0.6"
        "W3Buff2"            "fMaxSpeed"
        "W3BuffValue2"       "1.05/1.10/1.15/1.20"
    }

    "skill2"
    {
        "name"               "name of skill"
        "description"        "description of skill"

        "aura"                "slowaura"
        "auratarget"          "team" // self, team, enemies
        "auradistance"        "300.0/400.0/500.0/600.0"
        "aurabuff1"            "fSlow"
        "aurabuffvalue1"       "0.8/0.75/0.70/0.65"
    }

    "ability1" or "ultimate"
    {
        "name"               "name of skill"
        "description"        "description of skill"
       
        "type1"                     "damage"
        "type1_arg"                 "25/50/75/100"
        "type2"                     "healself"
        "type2_arg"                 "1/2/3/4"
        "sequence"                  "type1,type2"
        "delaybetweensequence"      "0.5" // seconds
        "trigger"                   "player_spawn" //
        "distance"                  "0" // 0 unlimited distance
        "cooldown"                  "60" // number of seconds for cooldown
    }

    "ability1"
    {
        "name"               "name of ability"
        "description"        "description of ability"
       
        "WARDS"              "red"
        "MaxWards"           "4"
        "WardDuration"       "60.0"
        "pulseInterval"      "1.0"
        "behavior"           "damage"
        "wardtarget"         "enemy" // self, enemy, allies
        "team2color"         "red"  // Custom color to use on team 2 (terrorists in CS:S)
        "team3color"         "blue" // Custom color to use on team 3 (counter-terrorists in CS:S)
        "disableOnDeath"     "true" // Disables the ward when the owner dies
    }
}

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2428
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: War3Source Config files
« Reply #2 on: December 23, 2014, 07:04:54 PM »
are you using key value syntax?

id prefer json but there is really no parser for it

http://en.wikipedia.org/wiki/JSON#JSON_sample

Revan

  • Hero Member
  • *****
  • Posts: 503
    • View Profile
Re: War3Source Config files
« Reply #3 on: December 23, 2014, 07:14:15 PM »
are you using key value syntax?

id prefer json but there is really no parser for it

http://en.wikipedia.org/wiki/JSON#JSON_sample

What about this?
I also saw something written in pure SP on github..
#war3source on gamesurge

Ownz

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2428
  • chmod -R 777 *
    • View Profile
    • OwnageClan
Re: War3Source Config files
« Reply #4 on: December 23, 2014, 10:16:32 PM »

El Diablo

  • Hero Member
  • *****
  • Posts: 1114
    • View Profile
    • War3Evo
Re: War3Source Config files
« Reply #5 on: December 24, 2014, 02:34:26 AM »
i think i'll stick with something that is natively supported.   That extension is outdated, and what would happen if it just stopped working for some reason?


FF2 uses keyvalues, and seems to be popular enough, although for some of it I may use adt_array.

Which of the two would be more better to use?
« Last Edit: December 24, 2014, 02:37:22 AM by el diablo »

Revan

  • Hero Member
  • *****
  • Posts: 503
    • View Profile
Re: War3Source Config files
« Reply #6 on: December 24, 2014, 09:16:53 AM »
The pure SP json version  is safe to use and not outdated or something like that.

SMC parsing may be a good choice too.
« Last Edit: December 24, 2014, 07:45:37 PM by Revan »
#war3source on gamesurge

El Diablo

  • Hero Member
  • *****
  • Posts: 1114
    • View Profile
    • War3Evo
Re: War3Source Config files
« Reply #7 on: January 15, 2015, 09:41:30 AM »
I'm starting to think it might be easier for me to create a php program that people could go to, and create a race, and it would create the source file and compiled file for them.

I was also thinking of maybe creating a java web application to do this, but since java is highly untrusted ... nobody would probably use it.

I then could constantly update the program.

This is what I plan for it to look like... Anyone have improvement ideas, let me know.

I'm going to continue to work on this, and hopefully have something running soon that will output a source file / compiled file after someone creates a basic race template with this.

https://war3evo.info/war3source/index.php
« Last Edit: January 15, 2015, 11:18:39 AM by El Diablo »