Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Go Back  Xtreme Visual Basic Talk > > > Hex based templates > modifiable in ASCII > export Hex


Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2013, 03:33 PM
Timbab Timbab is offline
Newcomer
 
Join Date: Oct 2013
Posts: 1
Default Hex based templates > modifiable in ASCII > export Hex


Okay, I know only the very basics of VB, so bare with me please. I'm not here begging for others to do the work for me, but it would be fantastic if some of you could point me in the right directions. I'm a graphics guy, so this is fairly new territory for me.

I've been modifying a game (Star Wars Galaxies and yes, it's legal) over the past few years and in the recent days, after looking at terrain files, I've figured out a way frankenstein a really simple 'ghetto' terrain builder. The only problem, even though I know exactly what I need, I'm not sure how to exactly do it in VB.

To cut a long story short, this is what I'd like to do:

The game .trn files I can edit right now manually with a hex editor and an .iff file type editor that can display the contents of the .trn in a .iff like FORM/chunk node structure. The contents are displayed as hex.

Here are 2 examples of the two:

In a hex editor: http://i.imgur.com/SreJTj9.png
In the .iff type editor: http://i.imgur.com/xqhX109.png

Basically the terrain is generated in a procedural way (Patent about it, if anyone is curious), so really in the end, it's a bunch of the same file structures used over and over again, slightly modified depending on what it does, Boundary chunk structures for example have a DATA chunk that stores coordinates.

Now, here is the part I need to be able to create. I want to create a fairly simple program, where I can save these 'templates' in for each specific chunk structure (Shader Filter, Flora Constant, Boundary Constant, etc, but they all have the identical structure with a different DATA chunk and 2 of the FORM's are different), which I can pull from a drop down menu, that then lets me modify a couple of the key values, (like if you look in the hex editor screenshot, after the DATA chunk, you have 00 00 00 14 and then a 0D, which is 13, which is the flora ID) in a textbox as a regular decimal number, so instead of having to enter the correct hex value, if I wanted to change 0D, I'd type in 12, instead of 0C. There are also a couple of float values (that are in reverse, inside the file) that I would also want to have a modifier for.

After I'd be done editing the template, I'd be able to export it either directly at the end of the .trn, or simply a new file where I can copy the hex values from and add them in manually.

I hope this isn't too confusing and it is doable.

Basically summarize it shortly: Have a set of stored templates that I pulled from the hex values inside of my .trn inside of the program, be able to select a template, have modifiers for specific locations of the template, be able to export it as copyable hex values.



Could you guys point me in the right directions for something like this? I wouldn't ask if I wasn't under time pressure, I got a project coming up unrelated to this and wouldn't be able to do this/learn VB fully for a couple of months.



A more advanced version of that, would be to have a treeview of the chunk structures that you've created from the templates in the side, that let you rearrange the nodes, like in the .iff like editor in the screenshot.

Thanks so much in advance!
Reply With Quote
  #2  
Old 11-06-2013, 11:26 AM
Gruff's Avatar
GruffHex based templates > modifiable in ASCII > export Hex Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Welcome to the forum Timbab. Do not forget to read the forum Posting Guidelines.

I cannot say I understand exactly what you are talking about,
but it sounds like you want to create a game editor that reads and creates binary files.

What you are talking about is not trivial.

The Treeview control is not terribly difficult for a medium weight VB programmer.
I'd suggest writing a much simpler test app to learn about the treeview.
Say a simple text based Org chart editor.

You might also post your questions in the gamer's forum area where others may
have experience with this sort of thing.

In the meantime you will want to read up on the 'System.IO.File' namespace.
the 'ReadAllBytes() and WriteAllBytes()' methods as well as the 'BinaryReader' object
to get started with binary files. You will also find the 'Seek' method of the 'BaseReader'
under the BinaryReader useful.

Code:
Imports System.IO Public Class Form1 Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click ' Create sample binary file. Using writer As New BinaryWriter(File.Open("c:\gfile.bin", FileMode.Create)) Dim buffer() As Byte = New Byte() {48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 13, 10, 65, 66, 67} writer.Write(buffer) writer.Close() 'View file in notepad if you like. End Using End Sub Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click 'Read ten bytes starting at the third byte Using reader As New BinaryReader(File.Open("c:\gfile.bin", FileMode.Open)) reader.BaseStream.Seek(3, SeekOrigin.Begin) Dim buffer() As Byte = reader.ReadBytes(10) reader.Close() MessageBox.Show(Bytes_To_Hex(buffer)) End Using End Sub Private Function Bytes_To_Hex(ByVal bytes_Input As Byte()) As String Dim sOut As String = "" For Each b As Byte In bytes_Input sOut &= Conversion.Hex(b).PadLeft(2, "0"c) & " " Next Return sOut.ToString() End Function End Class
__________________
Burn the land and boil the sea
You can't take the sky from me


~T

Last edited by Gruff; 11-06-2013 at 03:46 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
 
Hex based templates > modifiable in ASCII > export Hex
Hex based templates > modifiable in ASCII > export Hex
 
-->