PDA

View Full Version : Scheme editor


_Kilburn
28 Jul 2006, 23:35
I started a scheme editor. :) It won't create a new scheme, but it will override an existing build-in scheme. Anyway, it will allow you to have as much donkeys, alien abductions, etc.. as you want. And you will be able to change worm starting health, turn time, etc... I'm using Qt, and I've just made the UI using Qt Designer. What do you think? :p

http://img135.imageshack.us/img135/8503/schemehackeris5.jpg

Edit: I have not put sudden death mode, mine fuse, etc... yet, but i'll put them later.

Muzer
29 Jul 2006, 09:25
I will beta test if you want. I'm also beta testing all evilworm's WA projects, and expect a PM fronm him soon...

Anyway, lookin good!

_Kilburn
29 Jul 2006, 10:20
Thank you. It's the first time I build a PC program, so I hope there won't be too many bugs. :p

Ayal1991
29 Jul 2006, 14:02
nice! i remember i tryed to edit the grnade into the donky thing... i open it as a text document and alwayes after i changed something i closed it... i'm used to it =/ so i got off it, tough i think i would succeed =] in what programing language are you making it?
and where is the schames files? (what folder? ^^)

Muzer
29 Jul 2006, 14:45
IIRC, they're built into the SaveGame.xom file located in your W4\data folder. This also contains all other info about your saved game.

_Kilburn
29 Jul 2006, 14:45
I'm making it in C++, with Qt library. In fact, I am not creating a new scheme, but I'm modifying a built-in scheme (beginner, standard, pro, etc...).

Hehe... and it works online :D And you can have 500 health worms, 100 sec turn time, 90 donkeys, etc... etc...

@Muzer: Ah? I didn't know that. I modifiy Tweak\Local.xml.

Ayal1991
29 Jul 2006, 15:11
nvm ^_^ found out how to do it =D and i can do it alone now ^^ yay, if i'll be boared (well, i sure will be, the question is when) i'll make a program for it too.
it's just the .xml files ^_^

Muzer
30 Jul 2006, 09:27
Now all that's missing is a wpntwker and imo that would make w4m better than WA!

_Kilburn
30 Jul 2006, 10:32
Yes, it was my first project, that's why I asked so many questions about PipeGun, etc... ^^

Ayal91
30 Jul 2006, 14:50
Now all that's missing is a wpntwker and imo that would make w4m better than WA!
huh?
what's wpntwker?
and what's imo?
O.O

_Kilburn
30 Jul 2006, 15:11
Tweaking (http://forum.team17.co.uk/showthread.php?t=25728) :)

Wormbot2.0
30 Jul 2006, 18:11
I started a scheme editor. :) It won't create a new scheme, but it will override an existing build-in scheme. Anyway, it will allow you to have as much donkeys, alien abductions, etc.. as you want. And you will be able to change worm starting health, turn time, etc... I'm using Qt, and I've just made the UI using Qt Designer. What do you think? :p

http://img135.imageshack.us/img135/8503/schemehackeris5.jpg

Edit: I have not put sudden death mode, mine fuse, etc... yet, but i'll put them later.

Cool. I want one! ;)

Ayal91
30 Jul 2006, 19:10
Tweaking (http://forum.team17.co.uk/showthread.php?t=25728) :)
aha, well, i guss you need to edit the .xom file under data/wepons of the wepon right?

_Kilburn
30 Jul 2006, 22:18
No :) We edit the .xml files in the data\Tweak folder.

ignacio ga
30 Jul 2006, 23:20
when it is ready
are you going to put it to download?
sorry of my english, Im spanish...
THANKS!!

Ayal1991
31 Jul 2006, 10:16
No :) We edit the .xml files in the data\Tweak folder.
oh, didn't notice such a folder -.-
=] i'll try it out too =]\
anyway, soon i'll have all wepons unlocked (done all challenges and storys... edited most of the schames...)

btw where are the schames made by you own (cutomized) are saved?
think i found it - WeakTwk? under "numofstrikebombs"?

_Kilburn
31 Jul 2006, 10:41
No, they are in data\SaveGame.xml :p

Plasma
31 Jul 2006, 12:40
No, they are in data\SaveGame.xml :p
That's data\SaveGame.XOM! It isn't editable using normal programs.

Ayal1991
31 Jul 2006, 12:55
No, they are in data\SaveGame.xml :p
i ment the tweak thing...
someone said he droped alot of the fat guy -.- so i said i think i foudn where it... not the customized schames

_Kilburn
31 Jul 2006, 18:17
That's data\SaveGame.XOM! It isn't editable using normal programs.

Oops, stupid mistake :o

Muzer
1 Aug 2006, 10:02
So... yeah. Will there be a (pre-)alpha release?

_Kilburn
1 Aug 2006, 19:31
It's almost finished. :) Give me 1-2 days.

Plasma
1 Aug 2006, 20:04
May I ask, which .xml file do I have to edit to change the schemes manually? I could never find which one is the correct one.

_Kilburn
1 Aug 2006, 21:42
data\Tweak\Local.xml But you can modifiy only built-in schemes (Beginner, Standard, Pro, Kitchen Sink, etc...), user created schemes are in SaveGame.xom, but it's more complicated. :p

Btw, you can also modify built-in team weapons (The Peace Breaker, Wipe Out,...) . and you can take them online

Plasma
1 Aug 2006, 23:32
data\Tweak\Local.xml But you can modifiy only built-in schemes (Beginner, Standard, Pro, Kitchen Sink, etc...), user created schemes are in SaveGame.xom, but it's more complicated. :p
I know, but I can edit the built-in schemes, create a new scheme based on the edited one, and then revert the built-in scheme to it's origional form.

and you can take them online
What did Spadge tell you about using mods online, _Kilburn?

_Kilburn
1 Aug 2006, 23:54
What did Spadge tell you about using mods online, _Kilburn?

Uuuuh, but it's so funny :p It's just for fun, I can win without them...

And... here is a beta version. :)

(I don't know how to compile the huge DLLs, sorry for the file size :o )

Scheme Hacker 0.8 (http://kilburn.ftp.free.fr/SchemeHacker.zip)

Enjoy! :D

Krazy_92
2 Aug 2006, 04:34
Not really "Scheme Hacker" since you arent hacking the game.. you are only modifying it ;D

_Kilburn
2 Aug 2006, 09:28
Yes, but I like this name :p I hope it works, I had some problems with DLLs.

quakerworm
2 Aug 2006, 10:46
if you do not mind getting your hands dirty with a hex editor and getting a hang of the structure of .xom files, which actually isn't all that bad, you could write up a version that allows creation of a new scheme in the savegame.xom.

Plasma
2 Aug 2006, 12:25
and getting a hang of the structure of .xom files
That's easier said than done; I dont even know how to open a .xom file.

_Kilburn
2 Aug 2006, 14:09
Not happy? Do you want more? :mad:

Muzer
2 Aug 2006, 14:39
EXCELLENT! I set health crates to 9999 and health to 9999. I got a worm and collected a crate, and the numbers were spinning for ages! Also his health peak was about 55 THOUSAND!

_Kilburn
2 Aug 2006, 14:47
Lol!1 Nice! I will add a team weapon editor in my program :p What do you think?

Plasma
2 Aug 2006, 15:56
Lol!1 Nice! I will add a team weapon editor in my program :p What do you think?
If you ask me, it's a bad idea because that means one person can have a very unfair advantage over a person that doesn't know the first person was hacking.

Especially, as you said, when playing online!

_Kilburn
2 Aug 2006, 16:10
I can add a power limit, the weapon will be just a little more powerful.

Plasma
2 Aug 2006, 16:12
I can add a power limit, the weapon will be just a little more powerful.
Isn't that what I just said is a bad idea to do?

_Kilburn
2 Aug 2006, 21:31
Not just a very little more powerful? :eek: *sigh* :(

Muzer
3 Aug 2006, 08:54
MAybe you could release it via PM's to people who never play online, and if they do, they never take h4x0rz on there.

I am one of those people

quakerworm
4 Aug 2006, 11:18
That's easier said than done; I dont even know how to open a .xom file.
then how do you know it's easier said than done?

i have dug through them, and they are relatively simple. the only thing that threw me off for a moment was the fact that the strings in STRS chunk were out of order, but since they are all addressed in the beginning of the chunk, it does not matter.

Plasma
4 Aug 2006, 13:19
then how do you know it's easier said than done?
1: It's very hard to edit a file when you aren't able to edit the file.
2: "Edit the XOM file" is relatively eay to say.

Muzer
4 Aug 2006, 16:21
Yeah, but how do you pronounce .xom?

I say it "dot zom" (like the x in xylophone is pronounced like a zed (woo for the british pronounciation of z!)), but I think some people would say it "dot ex oh em"

_Kilburn
4 Aug 2006, 16:56
"dot ex oh em" would me more correct, since XOM means XML Object Model. :p
(but maybe it has more meanings...)

Etho
4 Aug 2006, 20:21
i have dug through them, and they are relatively simple. the only thing that threw me off for a moment was the fact that the strings in STRS chunk were out of order, but since they are all addressed in the beginning of the chunk, it does not matter.

I was making a scheme editor for worms 4 a while ago that editted the SaveGame.xom file. Reading the file is easy, but compiling it is not. The file holds every bit of information about your progress in the game, not just scheme data. Every chunk of data in the file has a long value used to locate the chunk. So if you want to insert, delete, or even edit a scheme, you need to change all these values to match up accordingly with the changes you've made. (there are 1000's of them)

In the end of it all, my editor could only read schemes. I got bored of the game before I figured out an efficient way to actually edit, insert, or delete schemes.

quakerworm
6 Aug 2006, 12:49
1: It's very hard to edit a file when you aren't able to edit the file.
just because it's hard for you, doesn't mean it's hard.

_Kilburn
7 Aug 2006, 10:36
Build a scheme editor, if you think it's so easy... :rolleyes:

.BoggyB..
7 Aug 2006, 17:07
there use to be one it runned on dos. it was for worms3d i tried it once and didnt know how so i gave up.

quakerworm
8 Aug 2006, 16:53
Build a scheme editor, if you think it's so easy... :rolleyes:
the bit that actually adjusts the .xom file is almost trivial, and i can have that written in no time. i really don't want to mess with putting together a gui, though. it's a very boring part of developing an editor of any kind. how abou this. give me the source to what you got, and i'll edit in ability to work with schemes in savegame.xom file.

robowurmz
10 Aug 2006, 19:51
Lol!1 Nice! I will add a team weapon editor in my program :p What do you think?
Hey, hold on, I have an idea...if this team weapon editor does work, surely it would OVERRIDE the power guage?
Mu ha hah ah ha hah hah!
ALL SHALL KNEEL BEFORE THE ALMIGHTY FALSE TEETH CLUSTER POISON STRIKE WHICH INADVERTANTLY TAKES AT LEAST 200 DAMAGE!
Or something like that.

(by the way, I pronounce .xom as "Gzom")

Fizz
11 Aug 2006, 06:53
Hey, hold on, I have an idea...if this team weapon editor does work, surely it would OVERRIDE the power guage?
Hi robowurmz and others,

I don't remember in which .xml file it's located in, but you can simply cancel out the power guage and set all the settings to max ;). This would make the weapon stronger, but not so strong that someone would notice it online.

P.S. - Don't hack online....

_Kilburn
11 Aug 2006, 08:31
ALL SHALL KNEEL BEFORE THE ALMIGHTY FALSE TEETH CLUSTER POISON STRIKE WHICH INADVERTANTLY TAKES AT LEAST 200 DAMAGE!


Fear my almighty homing sh*t... :p
75 damage to all worms
A huge hole
No blast power

:)

Hot Gravy
10 Feb 2007, 11:43
Lol!1 Nice! I will add a team weapon editor in my program :p What do you think?



YESSS!!!!! Just add a note in your program to remind people they're not allowed to use the tweaked ones online, and also, Plasma, if you think that's cheap to complete the battles, you tweak the weapons yourself!

_Kilburn
10 Feb 2007, 11:49
Nice thread resurrection xD


I have a much simpler solution. I can disable online playing when you are using the tweaked team weapon editor. :)

Hot Gravy
10 Feb 2007, 11:57
Nice thread resurrection xD


I have a much simpler solution. I can disable online playing when you are using the tweaked team weapon editor. :)



*drops jaw*

WHO TAUGHT YOU HOW TO DO THIS STUFF????!

Anyways, Online play doesn't work for me! So I won't mind. Anyways, what do I do with the sceme file after I've saved it?

_Kilburn
10 Feb 2007, 12:03
WHO TAUGHT YOU HOW TO DO THIS STUFF????!

I learnt it myself. :cool:


And, my old scheme editor sucks, I'll need to do a new one. Anyway, when you save a scheme file, you are just saving the scheme data. Then, you can reload this scheme with Scheme Hacker, and then run the game to apply the modified scheme, that's all.

Just click Play in Scheme Hacker to play with the modified schemes.

Hot Gravy
10 Feb 2007, 12:04
I learnt it myself. :cool:


And, my old scheme editor sucks, I'll need to do a new one. Anyway, when you save a scheme file, you are just saving the scheme data. Then, you can reload this scheme with Scheme Hacker, and then run the game to apply the modified scheme, that's all.

Just click Play in Scheme Hacker to play with the modified schemes.

Oh, thanks!

Etho
10 Feb 2007, 21:39
I thought this topic might be of interest to you Kilburn. :)

http://forum.team17.co.uk/showthread.php?t=27796

_Kilburn
12 Feb 2007, 09:51
Very interesting. :p Thank you.
Just a silly question : how do you see if a CTNR really corresponds to a scheme ?

And....


Artillery Mode [0 = No, 1 = Yes]
Byte +1 = Artillery Mode [+ byte]
Byte +2 = Artillery Mode [+ byte * 256]
Byte +3 = Artillery Mode [+ byte * 256 * 256]
Byte +4 = Artillery Mode [+ byte * 256 * 256 * 256]

Does this mean that 4 bytes are used to store a simple boolean value ??? :eek: That's a bit weird.

Etho
12 Feb 2007, 16:32
Yup, a lot of boolean or byte values are saved as longs. It would have made things simpliar if ALL values were expressed as a long; but Team17 decided to mix in a few booleans anyways. The scheme files are poorly designed.

I can't remember how the .xom works exactly. I remember that things just keep branching out from the header and spread all over the place making quite a mess. I think the only way you can add or delete a scheme from the .xom is by completely re-writing it or by changing all pointer values.

quakerworm
12 Feb 2007, 18:24
etho, you do know that you can read a 32bit integer using read commands in one operation by simply copying 4 bytes into area of memory used to store the value in the program. e.g., in c-style program, you'd do the following:
int artillery_mode;
fread(&artillery_mode,4,1,file_stream);
intel machines will use big endian notation. in rare cases when the notation doesn't match architecture (ppc uses little endian, i believe), you will simply want to swap bytes:
void swap_bytes32(void *val)
{
char tv[4],tc;
memcpy(tv,val,4);
tc=tv[0];
tv[0]=tv[3];
tv[3]=tv[1];
tv[1]=tv[2];
tv[2]=tv[3];
tv[3]=tc;
memcpy(val,tv,4);
}
and you'd call this with something like swap_bytes32(&artillery_mode);
a good reason to do it this way is because reconstructing floating point values that way is not pretty. reading them in by copying bytes, on the other hand, will work exactly the same way as with integers.

and yes, to add/remove a ctnr entry from a .xom file, you have to rewrite the whole thing almost in all cases. the reason for that is that links address ctnr entries by count, so if you remove one, you need to decrement all links pointing past that ctnr. if you add one, increment. to do this, you need at very least to know where the link variable in each ctnr is stored. you also need to keep in mind that links are stored in a very odd manner. values <128 are stored with a single byte, while all values >=128 are stored with two bytes, and the highest bit of the lower byte is treated as a flag telling you whether 1 or 2 bytes will be used. i never seen values >16k, so i don't know if this is used to generate 3 byte values or not.

_Kilburn
12 Feb 2007, 18:30
I don't know if it may be help but:

In default.cfg, add the parameter /TELNET
Run the game, and minimize it
Open a web browser and go to http://localhost/

There are some insteresting information about XOM2 classes, the instances loaded in the game, and the address where they are loaded.

You can also try to open a command line, and then type telnet localhost.

Etho
13 Feb 2007, 05:14
At the time I wrote the .txt I don't think I knew that quaker, nor did I know how to use For Loops. As you can imagine, my Worms 4 scheme editor code was extremely messy. I remember getting each byte value, multiplying it, and then adding it to a Long integer. The positive side of that experience is that it taught me all about overflow errors. ;)

In VB6 it is quite straight forward:

Dim LongValue as Long
Get #FileNum, FilePosition, LongValue

quakerworm
13 Feb 2007, 06:27
it's useful to know how to do it both ways, but the more you learn to do by just shoveling data around using memory operations instead of relying on algebra, the faster your code will be. consider following two lines, assuming x declared as integer.
x*=2;
x=x<<1;
both perform the same operation, but the multiplication method will take up two more cpu instructions than the shift method, on x86 cpus, anyways. it's a very artificial example in the sense that you rarely care about two cpu cycles, but you do often run into situations where if you move things about a bit, you can cut processing time significantly.

baldie
8 Nov 2007, 14:23
but where is the bovine blitz,in your schemehacker?

_Kilburn
9 Nov 2007, 13:16
It's the SuperAirstrike. (well, it had this name in the XML files, so I didn't change it)

spz7221
9 Nov 2007, 15:46
are you planing on any updates?

Dramen
17 Nov 2007, 01:26
Are there any programs like "the fiddler" out for worms 4? Or are all tweaks having to be done by editing this file...

This french site seems to be going on about making such program but i cant see one anywhere...

Some of the videos on youtube are awesome...if only i knew how to do that. Any tutorials?

_Kilburn
19 Nov 2007, 11:46
I was planning to do such a program, but as Worms 4 doesn't work on my laptop, I can't work on it anymore. :(

Dramen
20 Nov 2007, 16:19
Awww rats...why doesnt it work? Its not exactly a high end game...

You should give your current work to someone else whose eager and willing, I mean hell i'm eager and willing but i probs wouldnt be any good with c++ if thats wat u were doing...i can do lua though...to an extent.

robowurmz
20 Nov 2007, 16:36
_Kilburn is the Lua King IMHO, and I don't even know if you can build programs entirely with Lua...

_Kilburn
21 Nov 2007, 00:05
Good idea, I will eventually look for a GUI library for Lua. Much better than C++. :p

Dramen
21 Nov 2007, 16:16
Random persons helpful hints :D

As for entire programs...entirely possible, look a garrysmod for HL2, application is 100% lua, not to mention other modules, but others aspects are c++.

Well gl w.e. u do kilburn...maybe sumday heh :)

_Kilburn
21 Nov 2007, 18:23
Sure, I'm a complete Garry's Mod fan. Robowurmz is a Garry's Mod player too, that's why he said I'm a Lua King (which is not really exact because I haven't really done any exciting addon yet). :p

Oh, glad to see another GMod player here. :)


Ok, now looking for a good GTK binding for Lua with a good documentation.

robowurmz
21 Nov 2007, 20:52
The addons for wiremod you have done were great. And those contraptions you make are awesome as well.

quakerworm
21 Nov 2007, 23:10
Good idea, I will eventually look for a GUI library for Lua. Much better than C++. :p
if you think that a script language is better than c++, you don't know c++. there are tasks for which scripts are better, and when you want user to have limited moding abilities, you want a script. for a fully modable game, you still want .dll libraries that the user may compile with c++.

_Kilburn
22 Nov 2007, 12:01
Oh, yes, sorry, I didn't want to mean that Lua was better than C++ (since Lua is interpreted using C++), but, well, it's far easier and faster to make simple programs with Lua.

Dramen
22 Nov 2007, 15:55
Exactly, and lua is a lot more efficient than C++ as well, and true, although not core binding it serves its purpose well.

Think is, how does worms 4 current "special worm weapons" I.E. the one u make and use in the game currently work? I would of thought you could expand upon that if we knew how T17 did it.

quakerworm
22 Nov 2007, 23:27
Oh, yes, sorry, I didn't want to mean that Lua was better than C++ (since Lua is interpreted using C++), but, well, it's far easier and faster to make simple programs with Lua.
yes. typically, any time you want a dictionary array and you don't care about performance too much, scripting language such as lua or python will get you done sooner.

oh, and you don't have to write lua interpreter on c++. in fact, i'm pretty sure lua is written in c. i co-wrote some stuff that used lua scripts to control the behavior of the core graphics engine. the later was, of course, c++.
lua is a lot more efficient than C++
what do you mean by efficient? it certainly isn't computationally efficient. no interpreted language is. do you mean development time? that may be, for a lot of cases, but you are paying a very heavy price in performance.
Think is, how does worms 4 current "special worm weapons" I.E. the one u make and use in the game currently work? I would of thought you could expand upon that if we knew how T17 did it.
we do know how they work. _kilburn has done a lot of work on that. i played around with it a bit. there is nothing fancy there. there are several types of payloads, each of which can be tuned within certain parameters. all of the code for these is fixed, so we cannot change the behavior drastically. however, since the tunning parameters are stored in xml, and they are checked only when weapon is created, you may create overpowered weapons by modifying some xml files. (i don't recall which, but i'm sure _kilburn does) you can do the same thing with regular weapons as well within the scheme definitions, but i'm not sure if these will propagate on-line.

speaking of, if you want a true dark side match, give each team an unlimited supply of sentry guns, tune the gun to do a ridiculous amount of damage, and increase how much it pushes each worm. if you want a really long match, also increase the worm health a bit. if you do this in a custom scheme, you might get it to work on-line, but i haven't tried it.

_Kilburn
23 Nov 2007, 00:41
I'm not sure how the whole system works, but what you find in these tweak files are instances of classes, with the values of their properties. There are 6 or 7 classes for all the weapons, but I don't remember exactly, because I haven't tweaked for a while. If I remember correctly, there is BaseWeaponContainer, PayloadWeaponContainer, HomingPayloadWeaponContainer, JumpingPayloadWeaponContainer, FlyingPayloadWeaponContainer, and a few specific classes for guns and sentry gun.

Same for the weapon factory weapons, though the properties are much more limited.


I have done a fun scheme once, with worms with 666 health, and max wind speed of 200. Add "Wind affects worms" and "Wind affects weapons" to the wormpot, and you get a pretty fun gamemode, which is playable online.

quakerworm
23 Nov 2007, 00:57
I'm not sure how the whole system works...
what you described is pretty much how the system works. there are several weapon classes, and some of the parameters are loaded from xml tweak files. the rest is details of implementation, and unless you want to mess with binaries, it is irrelevant.

this is also why i said that if you want to make a truly modable game you want to go with dll files. that way, your limitations in moding weapons are nearly the same as limitations of creating the original weapons. if you want, you can even add a system for generating pseudo-classes based on dictionary hash tables on the fly. though, it shouldn't be difficult to create a sufficiently flexible abstract base class that can be molded into whatever weapon by overloading virtuals (which can be done on the fly) and maybe adding parameter lists (again, easy to do on the fly if they are linked).

GeneralTNT
24 Dec 2007, 15:11
How do you do unlimited for the ammo?

Midtown123
10 Aug 2008, 21:27
How the heck do you use this thing:-/? Sorry, but I can't figure it out. Do I put it in the W4 Directory? Please respond...

Midtown123
30 Nov 2008, 22:16
Oh come on!:mad: By the way, -1 for infinite ammo.