PDA

View Full Version : W4ModLauncher : An advanced launcher for Worms 4, with a nice additionnal feature


_Kilburn
12 Jan 2008, 03:59
15 Jan 2009 : Current verison : 0.82
+ More details about what file is currently being copied in the loading window
+ The launcher can now copy and restore any game file. For instance, if it finds a folder named "Hud" in your mod folder, then it will copy its whole contents into the original Hud folder.
Download version 0.82 update (http://kilburn.ftp.free.fr/W4ModLauncher_patch082.zip)
Download version 0.82 FULL (http://kilburn.ftp.free.fr/W4ModLauncher082.zip) (download this if you haven't installed a previous version before)
Source code (http://kilburn.ftp.free.fr/W4ModLauncher_Source.zip)

Unzip this into your Worms 4 Mayhem installation directory, or it will NOT load mods properly.

13 Jan 2008 : version 0.81
+ Fixed bad encoding with xml2twk (newline symbols are not recognized by the standard Windows notepad)
+ Fixed minor bug with xml2twk (writes empty files for non-databanked objects, even though they are not modified)
+ Re-converted WormsTweak and ChaosW4 using the fixed xml2twk
+ xml2twk can now find duplicate properties that don't exist in original tweak and write them using the "+Property" syntax, useful for team weapon and scheme tweaks that add new weapons and schemes
Download version 0.81 (http://kilburn.ftp.free.fr/W4ModLauncher081.zip)

13 Jan 2008 : version 0.8
+ Added complete list of supported screen resolutions and refresh rates
+ Added ability to load several mods at once
Download version 0.8 (http://kilburn.ftp.free.fr/W4ModLauncher08.zip)

12 Jan 2008 : version 0.7
+ First release
Download version 0.7 (http://kilburn.ftp.free.fr/W4ModLauncher07.zip)

http://img112.imageshack.us/img112/1542/twkscrnsb2.png

Here is a beta version of my current project. It's a launcher that will completely replace the default launcher. It has a few more features (allow screenshots, allow manual camera), and over all, it can load tweaks for you, so no need to save/copy/move tweaks each time you want to play or not with them. Just check the mod you want to play with, and click Play to load it and start the game.

But try to load one of the two mods available. You will notice that the launcher takes some time for loading the tweaks. Obviously, it does much more than simply moving XML files. So, how does it work?

If you want to know, browse into the WormsMods folder, and take a look at the structure of the mods. You will notice that there is no XML file there, only a Tweak folder, and inside of it, folders named WeapTwk, PartTwk, etc..., andinside of them, lots of .TWK files. Maybe you will recognize some of those names, if you already know tweaking a little.

http://img258.imageshack.us/img258/5310/screen3uh1.png

Try to open one of these, with Notepad or any text editor. You will not find XML there, but a kind of script, much easier to understand than XML.
If you still can't understand, I will explain you : each mod has is own folder, and inside of it, a folder for each .xml file which is modified. And inside of this folder, one small .TWK file for each object (weapon, particle, etc...) which will be added or modified.

For example, on the above picture, the file kWeaponBazooka.twk will be read by the launcher, which will apply the modifications to the bazooka (kWeaponBazooka) in WeapTwk.xml. This new tweak management system has many advantages:
- You don't have to waste time for searching your object in huge XML files such as PartTwk.xml.
- Sharing your individual weapons with people is much easier. Just upload your .TWK files and tell people to create an empty mod and throw those files in.
- .TWK files are only needed for objects which are modified. Thus, the size of the whole mod will be much smaller than the full XML file (especially huge files such as PartTwk.xml or Local.xml).

The language used in .TWK files is really simple, much easier to learn and understand than XML. You don't have to worry about opening and closing tags, angle brackets and all this annoying XML stuff.

What you will have to write in a .TWK file is nothing more than a sequence of lines "Property=Value". For example, if you want to set the collision radius of the bazooka shell to 5, you would have to find the <Radius> tag in WeapTwk.xml, and change its value to 5.<Radius>5</Radius>
In the .TWK file, just add the lineRadius=5
Simple, isn't it?

For vectors, colors and references, the "Value" has a particular syntax.

For a vector, you have to write "@vector X Y Z", where X, Y and Z are the components of your vector (you may omit Z if your vector is 2D).
In XML files, vectors are declared like this:<Property x='X' y='Y' z='Z' />

For a color, you have to write "@color R G B A", where R, G, B and A are respectively the Red, Green, Blue, and Alpha (opacity) components of your color. You may omit A if you color doesn't have an Alpha components. Also, the values for R, G, B and A may be in the range [0-1] or [0-255]. It depends of the context. If a property has color with a particular format, then give it a color of the same format.
In XML files, colors are declared like this:<Property r='R' g='G' b='B' a='A' />

For a reference, you have to write "@href " followed by the name of the object it refers to.
In XML files, references are declared like this:<Property href='objectname' />

Examples:EmitterOriginOffset=@vector 0 800 0
EmitterOriginRandomise=@vector 0 0 0
ParticleColor=@color 1 0 1
ParticleSize=@vector 80 100Weapon=@href DATA.LockedWeapons-2

Also, you may encounter this sometimes: <ParticleColor r='1' g='1' b='1' />
<ParticleColor r='1' g='0.8' b='0' />
<ParticleColor r='0.8' g='0.5' b='0.1' />
<ParticleColor r='0.3' g='0.28' b='0.3' />
<ParticleColor r='0.6' g='0.6' b='0.6' />
As you can see, this is a sequence of properties which have the exact same name ! (this is a part of a particle emitter, which holds the different colours the particles will have over time)

The solution in a .TWK file is adding "(n)" to the end of the name of the property, if you want to modify the (n+1)th property. For example, ParticleColor(0) will be the first ParticleColor found in the sequence, ParticleColor(1) will be the second one, ParticleColor(2) the third one, etc...
So the conversion in .TWK language would be:ParticleColor=@color 1 1 1
ParticleColor(1)=@color 1 0.8 0
ParticleColor(2)=@color 0.8 0.5 0.1
ParticleColor(3)=@color 0.3 0.28 0.3
ParticleColor(4)=@color 0.6 0.6 0.6

Notice that ParticleColor is identical to ParticleColor(0).

Sometimes, you may want to add such a duplicate property to your object, but you don't know how many times it is repeated. In this case, just put a "+" before the name of your property.+ParticleColor=@color 0.3 0.3 0.3 This will add a new ParticleColor property to your object, no matter how many ParticleColor property already exist.


This is for the objects you want to modify which already exist. For objects that do not exist, you will have to create a .TWK file with the name of the object you want to create, and then enter its properties. You have 2 solutions:
-Solution 1 : Create an empty object, and declare ALL its properties.
Just add the keyword "#class " to the beginning of your TWK file, followed by the type of object you want to create (for example, if you want to create a cluster for a weapon, the type should be PayloadWeaponPropertiesContainer).
Then, do not forget to give ALL the properties needed for this object.

-Solution 2 : Copy an existing object, and modify its properties.
Add the keyword "#copy " to the beginning of your TWK file, followed by the name of the object you want to copy. For example, if you want to create a bazooka shell which is twice bigger, without affecting the original bazooka weapon, just create your .TWK file (for example kWeaponBigBazooka.twk), and write this:
#copy kWeaponBazooka
Scale=2
Radius=10


I guess you already know which solution you should always use. #class should be never used except in very rare cases. Else, it is reserved to the xml2twk converter.
Also, #copy will always copy the object from the original tweak. Thus, you can't copy an object you have created. A #copynew keyword may be added in future versions for copying newly created or modified objects.

You may notice that you don't need to declare the objects you create (If you know advanced tweaking, and how to add your own clusters and particles, you should know that you always have to declare them on the top of the XML file). W4ModLauncher does it automatically for you.
But you may want to create an object without adding it, for example, if you are making new team weapons (those are not declared in the databank, but in a WeaponFactoryCollective object). In this case, just add a new line with the keyword "#nodb" BEFORE "#class" or "#copy".

Finally, let's see the non-container resources, such as integers, strings, floating point values, colors, vectors. You may create one file for each of these resources, and modify the Value property, but that would be kind of... not pratical at all.
The non-container resources have they own common .TWK file. Create a .TWK file, and rename it EXACTLY to "resource.twk".

Inside of this file, write the keyword #int, #uint, #float, #string, #color, or #vector depending on the type of the resource you want to modify/add, then write the modifications the same way as properties : "Resource=Value".

For exemple, if you want to change the duration of the jetpack, you have to create a Tweak folder (for Tweak.xml, because the resource Jetpack.InitFuel is located in Tweak.xml), and write:#int
Jetpack.InitFuel=9999999

Any other property modified after the #int keyword will have the type XIntResourceDetails (integer), until you write a new type keyword. For example:#int
Value1=10
Value2=15
Value3=42
Value4=35
#float
Value5=3.14
Value6=8.2
#color
Value7=@color 255 255 255 255
Value8=@color 255 0 0 255
#string
Value9=Hello World
Value10=test

Value1~4 are integers, Value5 and Value6 are floating point values, Value7 and Value 8 are colors, and Value9 and Value10 are strings.

W4ModLauncher ignores spaces at the beginning and end of a line, and near a "=" sign. If you think adding spaces and indentation makes the code more readable, you can do it without any problem:#string
Value1 = test
Value2 = hello world

#int
Value3 = 2
Value4 = 5

You can add commentaries as well. The syntax for commentaries is the same as for the C language.// This is a commentary line
/* This
is
a commentary block */


// Set any model for the payload, and set its scale to 0 to make it invisible.
PayloadGraphicsResourceID=Bazooka.Payload // using the bazooka shell as the model
Scale=0


Finished. :p Now you know how the .TWK language works. It is really useful for managing and understanding tweaks. For example, if you download a mod from someone else, you will see immediately which objects have been added or modified, and which properties have been changed (which is nearly impossible in a XML file, unless you spend hours to compare the modified file and the original one).

There are two mods in the archive. Those are some of my old tweaks I have converted to .twk files. Worms Tweak Patch is a complete tweak, while Chaos W4 is still very experimental, so a few weapons may not work.

Do not check "Telnet". It's a debugging feature that will make you crash if you try to play online. I will explain what it does later.

I have also created an user-defined language for Notepad++, for the .twk scripts.
Download user-defined language file for Notepad++ (http://kilburn.ftp.free.fr/userDefineLang_w4tweak.xml)

Edu_99
12 Jan 2008, 05:24
nice work bud....i am prous to say i was the first on to test it out

GeneralTNT
12 Jan 2008, 14:07
There is an error it says: Can not find Worms 4: Mayhem directory. try re-installing the game.

I have the game, and I don't know what's up.

_Kilburn
12 Jan 2008, 14:17
Umm... is it... legal ?

GeneralTNT
12 Jan 2008, 14:28
Yep... It's legal, but the patch wont even work too, I find this odd.

_Kilburn
12 Jan 2008, 14:58
If the patch doesn't work, then there is a problem with your installation. Try re-installing your game.

Plasma
12 Jan 2008, 15:17
TNT, this loader doesn't work because you've got the American version of the game. Which is also pre-patched, which is why the patch won't work.

GeneralTNT
12 Jan 2008, 15:19
Oh sorry... I guess the Mod is only for other versions. Sorry

TeDdywoRm
13 Jan 2008, 01:51
Hmm...May I ask, does it work on the demo?

dzani
13 Jan 2008, 09:18
_KILBURN!NOOOOOO!that loader sucks....
Kidding its good.Nice work.

_Kilburn
13 Jan 2008, 17:08
Hmm...May I ask, does it work on the demo?

I don't think it does, haven't tried it yet though.


Also, new version released with new stuff and a few bug fixes, check the first post. :)

TeDdywoRm
14 Jan 2008, 10:24
Meh. Nevermind.
I've got the demo and I have vista.So it doesn't work...(Even the demo.)

Plasma
14 Jan 2008, 17:55
Meh. Nevermind.
I've got the demo and I have vista.So it doesn't work...(Even the demo.)
I wasn't expecting it to, considering it didn't even work for the American version, which is only slightly different to the European version.

_Kilburn
14 Jan 2008, 22:16
The program is reading registry entries to make sure the game is installed properly. Maybe the registry entries are not at the same location in the US version.

spz7221
15 Jan 2008, 15:44
When i used the xml2twk all it did was make empty folders

_Kilburn
15 Jan 2008, 20:54
It uses the original XML files in the data\Tweak folder as a reference for finding what you have edited, and what you have added. So if you have tweaked XML files in data\Tweak, it will not work properly.

robowurmz
17 Jan 2008, 07:19
Kilburn, you never cease to amaze me!

_Kilburn
21 Feb 2008, 21:18
Just a little bump, because nobody seems to be interested. Well, any tweak done using this system ?

Raffeh
24 Feb 2008, 07:41
I'm currently trying this out.

AAAAAND it stopped responding.


EDIT: Actually, it works fine now. But I think the Manual Camera moves too slow.

Warm Worm
13 Mar 2008, 19:50
there will be any updates with new tweaks?

_Kilburn
13 Mar 2008, 22:29
Well, since there have been many interesting discoveries about tweaks and stuff, that's a possibility. :p

TeDdywoRm
14 Mar 2008, 13:00
Hmm.. Now that I tested the launcher, it's official that it doesn't work for the demo.:(

_Kilburn
14 Mar 2008, 14:41
Why don't you get the full game? It's so great. :(

TeDdywoRm
14 Mar 2008, 14:44
Since I can't buy the game online, it's also ultra-rare to have worms games in stores here in the philippines...:(

*cries out loud

Warm Worm
14 Mar 2008, 16:07
xml2twk only makes blank files!i tried to Convert Weaptwk.xml but it made a blank archive instead of twk. files...(and i have version 0.81)

_Kilburn
14 Mar 2008, 17:10
What are you attempting to do? If you want to convert a modified WeapTwk.xml, it must be out of the Tweak folder, the original WeapTwk.xml should be in there.

Plasma
14 Mar 2008, 17:25
Since I can't buy the game online, it's also ultra-rare to have worms games in stores here in the philippines...:(

*cries out loud
And what's wrong with Amazon.com anyway?

Warm Worm
14 Mar 2008, 17:36
i'm trying to convert weaptwk.xml to .twk to i make new tweaks.tweaking using twk. files are easier,you know.

_Kilburn
14 Mar 2008, 17:44
Oh, I haven't thought about that. Anyway, what you can do is copying WeapTwk.xml somewhere else out of the tweak folder, delete the WeapTwk.xml in the Tweak folder, copy Empty.xml and rename it to WeapTwk.xml, and then run xml2twk and convert the original WeapTwk.xml.

Then, delete the empty WeapTwk.xml, and put the original file back there.

tom2k
24 Mar 2008, 12:24
Hi, just want to say thanks for this wonderfull tool.

I couldnt play Worms 4 for a long time, it always crashed for some reason when i tryed to load it up.
Now, when i enable "no Movies" in this tool i can play Worms 4 without a problem.
I saw that a lot of people got similiar problems that couldnt get solved, so maybe someone from the support can sticky this.

Plasma
24 Mar 2008, 12:47
I couldnt play Worms 4 for a long time, it always crashed for some reason when i tryed to load it up.
Now, when i enable "no Movies" in this tool i can play Worms 4 without a problem.
I saw that a lot of people got similiar problems that couldnt get solved, so maybe someone from the support can sticky this.
Did you actually try enabling "no moveis" on the regular launcher but it didn't help, or did you completely miss it?

tom2k
24 Mar 2008, 13:19
I checked it on the original loader too but it had no influence on the problem.

edit: just for my knows, is it possible to play online with this tweaked weapons ?

Muzer
24 Mar 2008, 13:50
Unless the other person has the same tweak, no

tom2k
24 Mar 2008, 13:55
thx for the answer

Iggyhopper
21 Dec 2008, 01:37
So, if you have only the file that changes the bazooka, it will only change the bazooka?

Hmm.

I mean, you don't need every single .twk file do you? If you just wanted to mod the bazooka, you would only need to make the kWeaponBazooka.twk?

_Kilburn
21 Dec 2008, 12:30
That's right.
By the way, you want to make a weapon editor, right? Which language will you be using, with which library? I was making one before, but I gave up because I didn't have enough free time. This launcher was meant to be the first step to easy XML reading and writing. If you need anything about how tweaks work, feel free to send me a PM.

Iggyhopper
21 Dec 2008, 18:41
That's right.
By the way, you want to make a weapon editor, right? Which language will you be using, with which library? I was making one before, but I gave up because I didn't have enough free time. This launcher was meant to be the first step to easy XML reading and writing. If you need anything about how tweaks work, feel free to send me a PM.Okay, I made a new thread.

wormser
3 Mar 2009, 18:08
sorry the xml2twk converter doesnt work
i dont know what i do wrong

_Kilburn
4 Mar 2009, 20:56
What doesn't work? Details please?

twwig
13 Mar 2009, 18:08
I just tried making my first mod, but no matter what i do or what i edit, it doesnt change anything, like its not loading my mod. also, it doesnt have the mod loading bar when i select it.

_Kilburn
14 Mar 2009, 10:24
Does your mod appear in the list of available mods?

tickbite
15 Mar 2009, 00:58
Hey, you made a great little application there. The automatic camera really got on my nerves, so this is a gift! Thanks.

I was wondering if there was a way to change the look of your mod launcher. Specifically, I would love to have the original Worms 4 title back in there (without your words "mod loader" next to it). That would make it look more professional (as if this was the original launcher). Is that possible?

Oh, and is there a way to save screenshots into a separate folder and not right into the installation directory?

Thanks!

_Kilburn
15 Mar 2009, 15:08
I would love to have the original Worms 4 title back in there (without your words "mod loader" next to it). That would make it look more professional (as if this was the original launcher). Is that possible?

I'm not sure it works, but you can try this (http://www.angusj.com/resourcehacker/).

Oh, and is there a way to save screenshots into a separate folder and not right into the installation directory?

As far as I know, it's not possible. :( The launcher doesn't really interact with the game, all it does is run it with parameters, and write and backup files when you launch a mod.

Pollito
17 Mar 2009, 01:26
I want a mod that can remove the gauge that avoids you to make overpowered weapons in the ingame weapon editor, can you make one please?, or tell me where i can download one if it already exists?:)

Plasma
17 Mar 2009, 20:48
I want a mod that can remove the gauge that avoids you to make overpowered weapons in the ingame weapon editor, can you make one please?, or tell me where i can download one if it already exists?:)
Not gonna happen on this forum! Because the team weapon is usable online unless removed from the scheme, removing the limitations of it gives a hugely unfair advantage against other people! So yeah, that's about the only help on tweaking you won't be given around here.

_Kilburn
18 Mar 2009, 11:24
Plus you won't even notice the difference, trust me. They aren't really much more powerful with everything maxed out and you won't be able to do anything new other than cheating online.

Edu_99
14 Apr 2009, 01:15
hey kilburn....ive been working with particles lately and making my own weapons (which i will release to the public)....im just wondering, for the fire punch, how did u do it so the worm jumps really high??? and is there a way i can convert some of the PartTwk .twk files back into .xml to be able to use them in my weapons??

froanas
19 Apr 2009, 22:52
hey, i just wanted to fix the resolution problem, this is great, thanks so much.

I was wondering though, how did you do it? like the resolution part, i was trying to figure out how to fix just that part myself

Thanks,
Joe

froanas
21 Apr 2009, 09:30
hey so i'm making a similar one just to handle the resolution problem i'm having (the regular launcher wont let me use 1280x800) and i was wondering what you wrote that in, and if its c++ then how did you execute the actual worms program at the end? i have an idea how to do it but i'm not sure what's the best/most efficient.

also if anyone is interested in it let me know and i'll upload it, i dont really care either way

froanas
21 Apr 2009, 09:39
sorry lol one last question, i figured out how to change the resolutions, and then saw all the other posts on how to do it :p but i was also wondering how you made your program detect supported resolutions. i do have pretty good coding background so dont be afraid to let free the jargon.

thanks again,
Joe

_Kilburn
21 Apr 2009, 21:08
Source code is available in first post, you could have had a look at it. :p Anyway, I used EnumDisplaySettings (http://msdn.microsoft.com/en-us/library/aa920775.aspx) from the core Windows library.

Edu_99
22 Apr 2009, 05:36
kilburn....how did u make the fire punch go really high? (sorry if im off topic)
......oh an also for the cluster bomb, how did u make the bazookas appear from the sky?

Iggyhopper
30 Apr 2009, 17:10
It's actually a combo of three weapons.

1. The cluster bomb.
2. The cluster bomb's bomlets
3. The cluster bomblets' bomblets

1. You throw the cluster bomb, it's bomblet angle is set to 0 (straight up), and power is set really high.
2. The bomblet explodes because it is on a timer, its bomblet settings are 20-25 bazooka bomblets.
3. The bazooka shells reign down.

Edu_99
30 Apr 2009, 23:42
ooooo:p
and what about the super fire punch?

Iggyhopper
2 May 2009, 00:50
This is what edits the firepunch, there's a bunch of options.
<XFloatResourceDetails id='Weapon.Firepunch.GravityMultiplier'>
<Value>2</Value>
<Name>Weapon.Firepunch.GravityMultiplier</Name>
<Flags>64</Flags>
</XFloatResourceDetails>
<XFloatResourceDetails id='Weapon.Firepunch.MinVelocity'>
<Value>0</Value>
<Name>Weapon.Firepunch.MinVelocity</Name>
<Flags>64</Flags>
</XFloatResourceDetails>
<XFloatResourceDetails id='Weapon.Firepunch.Velocity'>
<Value>0.4</Value>
<Name>Weapon.Firepunch.Velocity</Name>
<Flags>64</Flags>
</XFloatResourceDetails>

Then, in the firepunch weapon container.
<ImpulseDirection x='70' y='0' z='0' />

I can never figure that one out, what I have so far is that the worm is already set to fly with "WormImpulse" and such. Play around with it.

Edu_99
2 May 2009, 18:22
Thanks!!! Do u mind if I pm u if I need something else??

Dramen
2 Jul 2009, 09:36
Sorry for this MEGA bump, sorry...but...

Isn't thier a site, or somewhere were people have uploaded there custom new weapon tweaks that we can download and use? I can't seem to find anything like this anywhere and wonder why not...as you can make so many cool things yet, no-one seems to of ever :S.

Or have we all moved on? lol :P

JadedLight
16 Aug 2009, 15:55
Where can I download the worms tweak patch and the CH tweak?

jelly worm
28 Sep 2009, 15:54
how do I add tweaks to the luncher

Iceworm
28 Sep 2009, 22:52
I can't use it because it says "Could not find worms 4 mayhem directory. Try reinstalling the game."
Probably because my game isn't in the same folder it is programmed. I'm guessing it is suppose to be in the codemasters folder, right. I have the Majesco version. So do you think I should install my game in the way the European is set up.

jelly worm
8 Oct 2009, 20:28
there are no mods in my luncher

jelly worm
9 Oct 2009, 14:32
Since I can't buy the game online, it's also ultra-rare to have worms games in stores here in the philippines...:(

*cries out loud

he's available in danmark if you will go there on a holiday you cood try to look out for him:)

ghostcorps
28 Oct 2009, 16:19
Hi :)

I installed Worms 4 yesterday but the screen was flickering like crazy. I had a few things to fix anyway so I created a clean image to test with. Initially the game worked with the low res, so I added your launcher to correct the resolution and the flickering came back. no I can not get rid of it, even with the iroginal exe's! :( Can you suggest anything that would have caused this?

I am running Win7 with a Radeon 4870

Thanks :)

rusty967
12 Feb 2011, 14:53
I'm not really a computer whizz so maybe some help please, I have a winrar archiver if thats of any use. I like Video help but clear reply or a readme file would do nicley :rolleyes:

dzani
17 Feb 2011, 23:41
Extract files from winrar and copy to your game folder.

kardam
26 Jan 2013, 15:37
from where i can get the no american verion of the game?