@Martin:
I can imagine that it's quite hard to understand. It's tightly integrated into my whole 'framework' and it's close to impossible to just rip it all out.
Oh, and I quite like the idea of searching through RBFs for values / keys.
#51
@Martin:
I can imagine that it's quite hard to understand. It's tightly integrated into my whole 'framework' and it's close to impossible to just rip it all out.
Oh, and I quite like the idea of searching through RBFs for values / keys.
So right now i'm just working out of your old code
Just threw it all into CopeCode.dll and started looking over samples.. :P
Anyway, i have tried coding the search thing myself, but for some reason it keeps making a stackoverflow when trying to make a list of ChildNodes in the treeview, but hey, thats life.. :P
Also:
Keep working on this! It's a great toolI just need to find out how to insert new lines to the rbf instead of just editing...
I'll be leaving to serve with the Royal Danish Airforce in 2 weeks time, so my program will get temporerily discontinued, but when i get back, i want to see 'Dawn of War Visual Studio' by Cope![]()
Brother Redemptor Jørgensen!
"It is my sacred duty to save your soul, and I will save it! Even if I kill your body in the process!"
MartinNJ's DoW II Mod Studio
#53
i just copy an existing and paste into. then you can just edit that. it works for what it is atm![]()
Tutorials_And_Helpful_Sites_Here <-link
Want a 3d model commissioned? I may do so. Pm me!
http://steamcommunity.com/groups/dow40k2-woa Join up for updates and view other members.
#54
Some day I might release all the sources but currently parts of it are a mess and not any help for anyone -.-.
Searching in trees (or all tree operations) is a recursive task and a stack overflow most likely occures due to an endless recursion.
-cope.
#55
maybe add in a check to save the rbf file if it was changed on closing it?
HorusHeretic: Thanks for the info ^.^
Copernicus: It shouldn't, it refuses to read everything but the text value of treeview1.nodes(0) :P But thats not something to fill this thread with ^^
One thing that is driving me nuts is that your editor holds the module file open until you close the application. This makes testing changes quickly and easily impossible and really slows down the process as I have to close down the app, test, then reopen it and all my tabs again. I don't see any reason why the module cant be opened, read and then closed (freed) immediately after.
[edit] Come to think of it, its probably the sgas being held open. I hope there's a work around for this. If not I'd be nice if the tool remember last files open with an ini or xml file.
Last edited by Clonesa; 26th Mar 10 at 2:12 AM.
#58
The module file is currently opened all the time, I will definitely change that. However, I will not change anything about the SGAs as my tool only reads the Table of Contents and extract files as needed. Loading the whole SGA into memory would take lots of resources and increase the load-up time of the tool significantly. Changing any SGAs while having them opened will most likely cause the tool to crash, thus I keep them opened all the time.
What I could imagine is a button that unloads everything and reloads the stuff, but this is basically what Close Mod and Open Mod do. Remembering the last mod would be a nice possibility to get around the problem, but remembering all the opened files doesn't sound too useful and introduces lots of additional problems.
Anyway, what are you changing about the SGAs while the tool is running? I'd expect that you open the tool, make your changes and start the game in -dev mode to test, then you can quickly apply another change and restart the game / reload the PBG ingame. It would for sure be a surprise for me to hear that people repack their mods between their tests.
-cope.
Last edited by Copernicus; 26th Mar 10 at 4:04 AM.
unlike in COH having files the game uses open when you are trying to play can cause it to crash, IIRC, so you can't have the tool and the game open at the same time, which is what i think his problem is.
#60
Hmh, I get the problem, thanks for the heads up. I'm currently writing the code for a Test Mode which will temporarily close all opened SGAs ( = closing the file stream while keeping the TOC) and reopen the streams as soon as it's switched off. This way I can keep the TOCs and unload the archives, of course you CAN NOT change the archives in between or the tool will crash.
-cope.
#61
Dissasembling DoW2's Filesystem.dll reveals that it loads SGAs using CreateFile with the FILE_SHARE_READ sharing mode. This mode allows other applications to read the file (as long as they also share it as FILE_SHARE_READ), but not to write it. If your tool opens the SGAs with FILE_SHARE_READ, then everything should work as desired - DoW2 will be able to read the SGAs at the same time as your tool, and nobody will be able to overwrite them.Changing any SGAs while having them opened will most likely cause the tool to crash, thus I keep them opened all the time.
#62
Thanks Corsix, we'll try this first. I should have checked that myself (but I currently don't have the FileSystem.dll at hand).
-cope.
Could you tell me if i can change the Colours of my Marines in the Campaign with this Tool anf if, how i do it? I cant find a way to do it... maybe im just blind or somethin like this ^^
#64
there should be a tutorial in the tutorials forum that tells you how to do that![]()
#65
@Bluebird:
Try this Tutorial.
Just to keep you informed: I've recently started to restructure parts of the program to allow the creation of file-type plugins; the release of the next version will thus take some more time.
-cope.
The link for the download is dead currently.
and to think I am still using the older0.1.4 version for heavy modding...
#67
a) The link works.
b) There's no version 0.0.1.4.
c) You're talking about MatrinNJ's tool.
![]()
#69
Version 1.4 released
Download
I bet nobody will ever use the plugin system besides maybe 2-3 persons which will then start complaining about itV1.4 - 04/6/2010
General:
- module files are now unloaded as soon as possible
- SGAs are now being loaded in shared access mode
- introduced a plug-in system allowing the user to bind specific file-extensions to their custom .NET Control
- the tool will now also load all the Data-stuff, making it yet more important for you to have different folders for Data and Attrib stuff
RBF Editor:
- the editor will now show a warning when trying to close an unsaved file.
Oh, the ReadMe isn't complete btw, take a look into Tools->File Type Manager, should be pretty much self explanatory. If there's only one plugin for a specific file type that one will be used automagically.
-cope.
PS: Instructions for writing plugins using .NET included.
Last edited by Copernicus; 5th Apr 10 at 3:41 PM.
1 of those 3 people will be me :P
But seriously nice job, the shared access should make testing changes much faster.
[edit]
Creating a plugin was fast and straightforward, kudos :P I've got a lua/scar text editor working. This tool is the thing I wanted to do on that open source collaboration
I had a project similar to this thats sort of discontinued, I'll work on integrating my controls as plugins for image viewing, syntax highlighting, etc.
Can I start complaining yet? :P Little bit of a bug. When in the plugin selection menu if you click on file types multiple times the list is continually populated with duplicates rather than being cleared first.
Last edited by Clonesa; 5th Apr 10 at 8:09 PM.
#71
Cool beans, not to be an unappreciative impatient prick, but I was praying to the gods your first plugin would be the action file editor :P
I've hit a bit of a snag implementing saving with a plugin. Perhaps I'm simply misunderstanding it. Source code of an example skeleton plugin would be greatly appreciated and probably easier for you than creating a doc or tutorial. I can't seem to view your intellisense comments in my code.
Also a weird bug I've been able to replicate about 5 times now (but its not reliable) is sometimes when I'm clicking quickly on the folder/file tree view and miss a node I get an error pop up.
#73
same. i get it usually when i have lots of files open and i close them all saving quickly.Also a weird bug I've been able to replicate about 5 times now (but its not reliable) is sometimes when I'm clicking quickly on the folder/file tree view and miss a node I get an error pop up.
#74
@Clonesa:
It's rather an editor for chunks in general (and it's not implemented as a plugin). It offers hex-editing capabilities for every unknown chunk type and GUI for known types. So you can edit ACTN chunks in files etc...
I'll try to provide an example plugin soon.
What does the error message say? Something like "No suitable plugin found!"?
-cope.
Its a null reference. Seems odd to me, but some event on the tree view object seems to fire and check for the node you've clicked, but as I didn't click on one... null reference. Its a bit odd in that you kind of have to spam somewhere to trigger it (say to the left of a node, in a blank space), which theoretically should not trigger said event, but it could something else entirely.
GUI for known types sounds very intriguing. I assume motiontree is not a known type atm (or has a breakthrough been made there?), but action is.
#76
The motiontree seems to consists of a bunch of simple chunks: EVTN and ACTN are pretty easy to understand I guess, haven't looked into the others. This tool will NOT be able to edit whole files but every chunk within a file. You can of course open any file you'd like to, even if you've got another plugin for it installed.
-cope.
Edit: Found the cause for the null-reference exception and fixed it.
Sweet
Sounds like I'll have to use the Chunky editor in action to get a good understanding. Sounds like good stuff though. Motiontree and Action are just so integral to modding. Seems like it would have been so much more beneficial for that dev chat to have happened just a few weeks later :S
Anyway, any idea why your intellisense comments are not showing up in my VS? I get no comments when viewing your methods or properties. I assume they are straight up XML comments. Its making implementing saving somewhat obscure. How I theorize it: plugin stores the path and stream from file_, plugin provides interface for user to save, when triggered the plugin writes whatever it feels like to the specified path and invokes the saved event to let your app know the user saved the file. Or perhaps we write to the stream and your app actually writes the stream to the file path?
Wow. Awesome work cope, it looks great
One small bug I've noticed so far; in the file type plugin manager, if you highlight "rbf" and then click anywhere in that column it produces lots of entries in the plugins column. Screenshot: http://grab.by/3Dnn
Edit: Wow I really need to read.
Last edited by Promythyus; 9th Apr 10 at 9:22 AM.
I guess day 1 DLC was too casual for EA, so let's start doing 8-month-early DLC! - Shuma
Eagerly awaiting DoW3 with mod tools. You hear me Relic?!
He fixed that a few posts back :P
[edit]
I think I figured out the whole plugin thing without the comments. How I'm doing it:
-Read stream from file_
-User triggers my save function
-I handle writing to the file using file_.FilePath as the path and overwrite
-I call InvokeOnSaved passing it FAT_Save and file_ (as UniFile appears to implement IFile)
I'm still not sure about FileTypePlugin.Close(). I thought it might close the tab and then maybe the stream, but appears to be neither.
I'm guessing invoking that event (last step above) is somewhat unnecessary, but lets your app know it was recently saved so it doesn't complain on exit? Then I got thinking. How does your app know when the user of the plugin has modified the file again and the current version is not saved?
[edit]
Actually I see that the save warning isn't implemented at all for plugins and is meant to be handled internally. I'm wondering why I invoke that event at all if I'm meant to handle the saving?
Last edited by Clonesa; 8th Apr 10 at 10:29 PM.
While i really like the layout and thus the simplicity of now editting .rbf files, for some reason after i finished editing just something random (when trying it out, like squad cost, wargear cost) and then starting the game (with -dev) in game, when i want to start a mp session, the game makes a window popup with an error report and that's that.
I also tried changing the wargear appearance based on mp rank and the files just go blank when i want to view them in the crude .rbf editor made by corsix. I checked this afterwards because the game would "crash" (not start) after these changes.
Perhaps you have adressed these problems, if so, my apolagies for wasting your time![]()
#81
@Z405:
What were you editing exactly using which version of the tool?
@Clonesa:
Let me help you:
I wonder why the commentary doesn't show up. However, it might be a good idea to make the saved-check a part of the tool and close some more of the streams in the UniFile itself.Code:// This method is called when the plugin is asked to close public override bool Close() { if (_RBF == null) return true; // Do the save-checking if (!_saved) { DialogResult dr = MessageBox.Show("The current file has not been saved since the last changes have been made! Save it now?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { SaveFile(_RBF.FilePath); } } // Close all open streams (if there are any) _RBF.Close(); return true; } // Saves the RBF to the specified path, I'm usually using _RBF.FilePath for this protected void SaveFile(string path) { _RBF.WriteDataTo(path); // UniFile implements IFile and is thus suited for the FileActionEventArgs FileActionEventArgs e = new FileActionEventArgs(FileActionType.FAT_Save, _RBF, _RBF.Tag); // Note: FAT_Save means 'FileActionType_Save' InvokeOnSaved(this, e); // OnSaved is invoked so the program can double check if the Tag we passed is a TreeNode // and reconfigure that TreeNode to point to our new file (the old file might have been located in a SGA) _saved = true; // Close all open streams again. _RBF.Close(); }
I should have provided more and better information about this in the first place, sorry.
-cope.
It appears i was using v1.0 and what i was adjusting, some squad numbers to test it out; stuff like requisition cost for infantry or their wargear. This worked fine, but when trying to test it; i received an ingame error before i could enter the multiplayer screen.
When adjusting epic wargear visuals so that you could look like rank60 on rank1, completely blanked out the .rbf file making dow2 crash. But i`m presuming you long fixed these issues since you're up to 1.4 and i was fooling around with 1.0![]()
#83
Outdated versions are unsupported.
@Clonesa:
For the next version I reworked parts of UniFile. It will most likely NOT break your plugins as I've basically removed things that weren't really in use (too avoid further confusion) and added some functionality. Please bug me so I write up a proper documentation.
Code:- reworked parts of UniFile: - merged protected virtual void WriteDataTo(Stream) and public void WriteDataTo(Stream) into public virtual void Write(Stream) - merged protected virtual void Read(Stream) and public void ReadDataFrom(Stream) into public virtual void Read(Stream) - UniFile.Close() now only needs to be called when constructing the UniFile using a stream, all other streams will be closed automatically - implemented the Set-property for both FileExtension and FileName of UniFile
-cope, this is one great Whatever !
I`m using 1.4 now, doh and it's working fantastic, makes me wonder why up till now i`ve been using DoW2Assistant, not that it's bad, but this is so much more convenient
The best part is that i can now see "in red" which files i actually altered, or even better, i can't make any errors which will result in 0kb .rbf files and needing to search through all the files where i made a mistake and if unlucky, redoing the entire thing.
3 thumbs up for you; yes i've got 3. I used to live in Tjernobyl.![]()
Was actually wondering if (when too much trouble ofc) you could make it so, that whenever i edit something in an .rbf file, the edits would light up red as well, just as you did with the initial list on the left where you can the .rbf files from.
This would really help a chaotic mind like me point out which parts of a file i already altered and what not.![]()
#86
I like that idea. It should be optional though -- and of course all of the red marks will vanish as soon as the file is closed.
I'm going to try that sooner or later, currently reimplementing the ACTN-editor.
-cope.
Guess you're a chaos marine @ heart as wellI like that idea. It should be optional though
Doesn't matter, i`ll just never close it untill the mod is doneand of course all of the red marks will vanish as soon as the file is closed.![]()
#88
What heart? Blood for the blood god! =P
Well, I could also expand the RBF format to support some Debug information and such... But this sounds like lots of work for not-so-much profit.
Even if the blood is ours!What heart? Blood for the blood god! =P![]()
If you've got the spare time and like to do it then hell yeah.Well, I could also expand the RBF format to support some Debug information and such... But this sounds like lots of work for not-so-much profit.
I`ve actually got one more idea, perhaps you`ll see the use of it as well. You made it possible to copy and paste value's which is extremely useful, but the lazy man in me would have found it equally handy to copy and paste .rbf files from those on the left side of your program.
If i'd want to make a semi altered plaguemarine squad, i would normally go to the .rbf itself and copy paste it right there. Ofcourse, i can still do this and what i`m suggesting is only because i have no clue at all how much work this is for you![]()
Huzzah, Action editor. Ty for the info, that is pretty much how I figured it, but definitely helps, particularly on why and when I should Close and InvokeOnSave.
#91
As said, Close() won't be needed in most cases in the next version.
I'm currently struggling with a damned split container which refuses to validate it's controls on resizing, spent the whole last hour fighting that bug yet I can't solve it. -.-
#92
Version 1.5 Released!
DOWNLOAD
Changelog:
Spoiler
V1.5 - 04/9/2010
General:
- fixed a bug with the FileTypeManager
- null-reference exception in the directory view has been fixed
- added a RelicChunky viewer/editor, just double click any file; if it's a RelicChunky it's going to be opened (use the right click menu alternatively)
- files and directories will now appear properly sorted
- small UI-fixes etc....
PlugIns:
- reworked parts of UniFile:
- merged
protected virtual void WriteDataTo(Stream)
and
public void WriteDataTo(Stream)
into
public virtual void Write(Stream)
- merged
protected virtual void Read(Stream)
and
public void ReadDataFrom(Stream)
into
public virtual void Read(Stream)
- UniFile.Close() now only needs to be called when constructing the UniFile using a stream, all other streams will be closed automatically
- implemented the Set-property for both FileExtension and FileName of UniFile
- expanded the FileTypePlugin base class in order to provide a general 'Has the file been saved?'-check:
- new method: public virtual void SaveFile() // called by the tool if there are still unsaved changes and the user decided to save them; the base implementation does nothing at all. This method shall STILL invoke the Saved-event (however, a plugin that does not have any saving abilities does not need to overwrite this method at all)!
- new property: public virtual bool HasChanges // returns whether there are changes, base implementation just returns false
- packed all the plugin-stuff into an extra-dll: CopePlugIn.dll; this has been made prevent ring-dependencies
You mean UniFile.Close() and not FileTypePlugin.Close()? Regarding the latter, I return false and my tab is still closed. Is that normal? I thought I could abort the close. Atm I use StreamReader and StreamWriter to read and write UniFile.Stream, seems to work fine.
In terms of your issue. I've heard grumbles about that before. I would just try to avoid the validating even with SplitContainer.
[edit] zomg, ninja release
Last edited by Clonesa; 9th Apr 10 at 3:15 PM.
#94
I've fixed it by changing the Dock-Property of the subcontrols on every resize. Crude, but it works. I'll look into that Close()-issue -- though I can't tell you when it will be fixed as I've got plenty of stuff to do. I just wanted to finish a first version of the ACTN-editor (and the chunk editor in general) before I head on to more important things.
-cope.
#95
Damnit I just got around to downloading 1.4![]()
I am an Iron Warrior! Iron Within, Iron Without!
#96
#98
Greetings Cope, it might be that i`m doing something wrong, though when i want to extend the amount levels regular infantry can "grow" it doesn't seem possible to copy paste a value path without messing up the file.
I open an EBPs file and open up the leveling_ext, then i open attrib_levels and i then rightclick on attrib_levels_attributes, "Copy Value Path", then i right click back on attrib_levels and "Paste Value", which results in copying over the entire attrib_levels file, while my aim was to add/increase the amount of levels that i can work on. (instead of 5 attrib_level_attributes i want to make 11 out of them)
Is this feature not (yet?) supported by Whatever? That, or i`m doing something wrong, which isn't new...
#100
"Copy Value Path" copies a string which describes the position of the value in the RBF, e.g. "GameData\whatever\somewhat\value". ToDo: Add proper tooltips.
Just use "Copy Value".
There are currently 1 users browsing this thread. (0 members and 1 guests)