Iggyhopper
10 Jul 2009, 05:46
This is just a glimpse of a file that is used to mod Worms 4: Mayhem.
file Tweak\WeapTwk.xml
#Bomber.NumBombs = 20
edit kWeaponBazooka-0
IsLowGravity = false
quick * Bomblet
Num*s = 5
*MaxConeAngle = 0.90
*MaxSpeed = -0.2
*MinSpeed = -0.1
*WeaponName = kWeaponGrenade
quick $ Magnitude
quick % Radius
WormDamage$ = 35
LandDamage% = 30
edit kWeaponClusterGrenade-0
NumBomblets = 20
BombletMaxSpeed = 0.75
BombletMaxConeAngle = 0.05
file Tweak\Tweak.xml
#Ninja.NumShots *= 2
#Ninja.MaxLength = 9999
#Ninja.WormMass = 0.8
Be prepared, modding will never be the same.
UPDATE 7/28/09 1:33 AM
Added support for variables, using dollar sign like PHP
Added easier editing for weapons via "#edit", makes ID finding easier
The at sign "@", will now be used for resources, and "#" for weapons
Enabled copy for weapons, functionality is not yet there
Added a "parse" command for multiple/linked mod files
Added/fixed XPath editing, now requires double quotes with expression
Added user input dialogs, allowing for flexible modding options
Reduced number of usable special symbols to 8
Reduced the "quick" command for setting aliases, to "symbol = replacement"
Tidied up code for allowance of easy one-liner changes
Tidied up code for better class-type editing
Added command to add an attribute of the same name via "+[name] = [value]"
Added selection for same-name attributes (ex: ParticleColor[1] r=128)
xpath "id('myID')"
#edit Bazooka
$BazDmg = WormDamageMagnitude
$BazDmg += MaxPower / 5
% = Power
Max% = 10
UPDATE 7/28/09 10:29 AM
Added function calls (but not user-function creation) ex: GetRandomInt(0,9)
UPDATE 7/29/09 3:01 PM
Started work on the actual application. The previous updates were all about the parser.
UPDATE 7/30/09 9:00 AM
Here's a list of the internal functions that are available to you.
Add(A, B) - Addition
Sub(A, B) - Subtraction
Mul(A, B) - Multiplication
Div(A, B) - Division
GetRandomBool(TruePercentage) - Returns a random boolean (true/false) with a percentage that it will be true
GetRandomInt(Minimum, Maximum) - Return a random integer between Min and Max
GetRandomFloat() - Returns a random floating-point number between 0.0 and 1.0
GetRandomFloat(Minimum, Maximum) - Returns a random floating-point number (ex: 25.95, 1.45) between Min and Max
More will come, but for now this looks adequate enough. I better start working on the other parts of the program.
UPDATE 7/30/09 6:38 PM
Started working on the program, I saw Harry Potter's latest movie last night, I thought it was good, but a little long. Anyway, working on the main branch of the program. Updating functions, etc.
UPDATE 8/11/09 2:17 PM
Okay, the edit command has been done to accept three ways.
edit [Name] : Basic editing by ID
#edit [Name] : You give it a weapon name (ex: "#edit Bazooka") and it will try to find the ID for you
#[Name] : Same as above, but less typing
UPDATE 8/18/09 1:20 PM
I started working on variable setting and other things. Gosh this is hard stuff. I have class in about 10 days. Maybe I'll try to get it done before 2010 >.>
UPDATE 9/14/09 5:33 PM
Woohoo! Big break, I finally got simple variables down. There was some kind of bug and I could not get over it. Well in my time off I discovered the solution (without ever coding anything!). I can now continue in the rest of my program. I also noticed that you cannot set variables to indexes as in "$mycolor = ParticleColor[2]". I'll fix that later, but for now it's nothing important.
UPDATE 9/17/09 7:41 PM
Fully finished simple variable setting ($A = 5, $B += 2, $C /= 10, etc.). More advanced variable setting ($D += 5 * GetRandomInt(4, 7), $E *= 5 + $F) is still being worked on at the moment. It should be done by Friday afternoon. Next stop is actually loading, saving, and backing up XML files. Also, maybe I can fit in the input. I seriously can't think of any way I could recursively identify function calls and report back the values so that they all work. I mean I don't think I could possibly handle the following:
$Example = Add(Sub(Add(2, 6), Add(8, 6)), Mul($E, GetRandomInt(4, 9)))
UPDATE 10/16/09 1:32 PM
Came across another bug, it's happening with some user input dialogs for custom/flex mods. Anyway, I started work on the user input dialog and it's going smoothly so far. Hoping to get the beta 2 out by December.
UPDATE 10/17/09 2:54 PM
I have fixed the bug with input dialog, now all I need to do is make it appear on top when it opens. Started working on actual XmlDocument editing, next is XPath because it is very simple and easy to test first. I should hear a drum roll soon for the release of this product.
UPDATE 11/2/09 10:14 AM
Just some minor things today, I'm busy. I started loading and saving xml documents, building the backup file list. Pretty lazy.
Well maybe, we'll see if I want to go that far.
Download is not updated, it is beta 1.
Beta 2 will be released soon.
file Tweak\WeapTwk.xml
#Bomber.NumBombs = 20
edit kWeaponBazooka-0
IsLowGravity = false
quick * Bomblet
Num*s = 5
*MaxConeAngle = 0.90
*MaxSpeed = -0.2
*MinSpeed = -0.1
*WeaponName = kWeaponGrenade
quick $ Magnitude
quick % Radius
WormDamage$ = 35
LandDamage% = 30
edit kWeaponClusterGrenade-0
NumBomblets = 20
BombletMaxSpeed = 0.75
BombletMaxConeAngle = 0.05
file Tweak\Tweak.xml
#Ninja.NumShots *= 2
#Ninja.MaxLength = 9999
#Ninja.WormMass = 0.8
Be prepared, modding will never be the same.
UPDATE 7/28/09 1:33 AM
Added support for variables, using dollar sign like PHP
Added easier editing for weapons via "#edit", makes ID finding easier
The at sign "@", will now be used for resources, and "#" for weapons
Enabled copy for weapons, functionality is not yet there
Added a "parse" command for multiple/linked mod files
Added/fixed XPath editing, now requires double quotes with expression
Added user input dialogs, allowing for flexible modding options
Reduced number of usable special symbols to 8
Reduced the "quick" command for setting aliases, to "symbol = replacement"
Tidied up code for allowance of easy one-liner changes
Tidied up code for better class-type editing
Added command to add an attribute of the same name via "+[name] = [value]"
Added selection for same-name attributes (ex: ParticleColor[1] r=128)
xpath "id('myID')"
#edit Bazooka
$BazDmg = WormDamageMagnitude
$BazDmg += MaxPower / 5
% = Power
Max% = 10
UPDATE 7/28/09 10:29 AM
Added function calls (but not user-function creation) ex: GetRandomInt(0,9)
UPDATE 7/29/09 3:01 PM
Started work on the actual application. The previous updates were all about the parser.
UPDATE 7/30/09 9:00 AM
Here's a list of the internal functions that are available to you.
Add(A, B) - Addition
Sub(A, B) - Subtraction
Mul(A, B) - Multiplication
Div(A, B) - Division
GetRandomBool(TruePercentage) - Returns a random boolean (true/false) with a percentage that it will be true
GetRandomInt(Minimum, Maximum) - Return a random integer between Min and Max
GetRandomFloat() - Returns a random floating-point number between 0.0 and 1.0
GetRandomFloat(Minimum, Maximum) - Returns a random floating-point number (ex: 25.95, 1.45) between Min and Max
More will come, but for now this looks adequate enough. I better start working on the other parts of the program.
UPDATE 7/30/09 6:38 PM
Started working on the program, I saw Harry Potter's latest movie last night, I thought it was good, but a little long. Anyway, working on the main branch of the program. Updating functions, etc.
UPDATE 8/11/09 2:17 PM
Okay, the edit command has been done to accept three ways.
edit [Name] : Basic editing by ID
#edit [Name] : You give it a weapon name (ex: "#edit Bazooka") and it will try to find the ID for you
#[Name] : Same as above, but less typing
UPDATE 8/18/09 1:20 PM
I started working on variable setting and other things. Gosh this is hard stuff. I have class in about 10 days. Maybe I'll try to get it done before 2010 >.>
UPDATE 9/14/09 5:33 PM
Woohoo! Big break, I finally got simple variables down. There was some kind of bug and I could not get over it. Well in my time off I discovered the solution (without ever coding anything!). I can now continue in the rest of my program. I also noticed that you cannot set variables to indexes as in "$mycolor = ParticleColor[2]". I'll fix that later, but for now it's nothing important.
UPDATE 9/17/09 7:41 PM
Fully finished simple variable setting ($A = 5, $B += 2, $C /= 10, etc.). More advanced variable setting ($D += 5 * GetRandomInt(4, 7), $E *= 5 + $F) is still being worked on at the moment. It should be done by Friday afternoon. Next stop is actually loading, saving, and backing up XML files. Also, maybe I can fit in the input. I seriously can't think of any way I could recursively identify function calls and report back the values so that they all work. I mean I don't think I could possibly handle the following:
$Example = Add(Sub(Add(2, 6), Add(8, 6)), Mul($E, GetRandomInt(4, 9)))
UPDATE 10/16/09 1:32 PM
Came across another bug, it's happening with some user input dialogs for custom/flex mods. Anyway, I started work on the user input dialog and it's going smoothly so far. Hoping to get the beta 2 out by December.
UPDATE 10/17/09 2:54 PM
I have fixed the bug with input dialog, now all I need to do is make it appear on top when it opens. Started working on actual XmlDocument editing, next is XPath because it is very simple and easy to test first. I should hear a drum roll soon for the release of this product.
UPDATE 11/2/09 10:14 AM
Just some minor things today, I'm busy. I started loading and saving xml documents, building the backup file list. Pretty lazy.
Well maybe, we'll see if I want to go that far.
Download is not updated, it is beta 1.
Beta 2 will be released soon.