Quantcast

Jump to content

» «
Photo

[REL|SRC/BIN|IV] StructEdit

49 replies to this topic
thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#1

Posted 06 January 2012 - 11:22 PM Edited by thaCURSEDpie, 12 March 2012 - 03:13 PM.

Intro
Sick and tired of having to restart IV everytime you are adjusting your vehicle's parameters? Want to tweak them just that tad more, but hate the time it takes you? Worry no more!

This little mod allows the user to change a lot of the values listed in the weaponinfo.xml and handling.dat files in-game. This means no-more restarting the game when developing new weapons or vehicles!

Aside of that, the mod also allows the user to create documentation for other structures, and edit the documentation for the existing structures (CWeaponInfo and CVehicleInfo). This can be useful if the offsets change in later patches, or if new parameters are found.

user posted image

Changing values is as easy as selecting the right parameter, entering the new value, and pressing the button smile.gif .

Youtube vid:


Download
here
(see also: http://github.com/th...pie/structedit)
Current version: Beta v0.11

Requirements
You will need an ASI-loader ( http://www.gtaforums...howtopic=380830 )
And HazardX's .Net scripthook ( http://www.gtaforums...howtopic=392325 )


Installation

Extract the "scripts" folder to your main GTA:IV directory. That's it.


Usage
Use the "si_gui" console command to activate the Graphical User Interface (GUI).
(alternatively: "si-gui")
Use "si_regen" to rescan the structure information files and use updated offsets / descriptions.
(alternatively: "si-regen")

FAQ:
Will this work with my modded handling.dat / weaponinfo.xml???!!!!11?1
First of all: why don't you just give it a shot?
Second of all: Yes it will.

Technical background: StructEdit doesn't give a crap about the handling.dat / weaponinfo.xml. It does not read these files. This is also the reason why StructEdit is able to change the values on-the-fly: StructEdit reads the values directly from IV's memory. (If you're interested how, have a look at the source. Also do some searches for 'pointers', 'offsets', 'memory addresses')

Will this work with 1040 / EFLC / <any other non-1070 version>
NO. The reason is very simple. I only have 1070. For StructEdit to work it needs to have the correct offsets. Because I only have 1070, I'm not able to retrieve the offsets for any other game version. You may do so yourself, or hope other people do it.

CVehicleInfo offset for 1040:
0x117ABB0 (thanks Jitsuin & lms)
(Update 'CVehicleInfo 0x110 0x11E3BF0 115' in CVehicleInfo.sif. RTFM if you don't know how whatsthat.gif )

StructEdit doesn't work! The GUI is empty / filled with 0's / filled with nonsense!
You are not using 1070 and have not updated the offsets. Update to 1070.


Custom structures / offsets

Using a different version of IV? Working with EFLC? Want to edit other structures in-memory? You can create your own information files smile.gif . Check out the "filetype description.txt" file, and the example files in the .\scripts\structedit folder.

fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None

#2

Posted 06 January 2012 - 11:26 PM

Thanks, i have a plan to make something like this for GTA SA as a CLEO script.

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#3

Posted 06 January 2012 - 11:34 PM

QUOTE (fastman92 @ Friday, Jan 6 2012, 23:26)
Thanks, i have a plan to make something like this for GTA SA as a CLEO script.

Cool. Have a look at my github for the source. A lot of it is indepent from the fact that it's a mod for IV, should be pretty easy to adjust for GTA:SA.

GTARandom
  • GTARandom

    Unfortunate piece of meat

  • Feroci Racing
  • Joined: 15 Jun 2009
  • Croatia

#4

Posted 07 January 2012 - 12:05 AM

Now if someone would make the same but for refreshing model changes you make without the restart biggrin.gif

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#5

Posted 07 January 2012 - 12:14 AM

QUOTE (GTARandom @ Saturday, Jan 7 2012, 00:05)
Now if someone would make the same but for refreshing model changes you make without the restart biggrin.gif

That's an entire different ball-game and a LOT harder than what I've done here. Wouldn't expect it to happen quickly, if at all tounge.gif .

jitsuin
  • jitsuin

    Meat Popsicle

  • BUSTED!
  • Joined: 06 Dec 2011

#6

Posted 07 January 2012 - 02:28 AM

Very nice, I like the windows style UI icon14.gif

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#7

Posted 07 January 2012 - 02:31 PM

QUOTE (jitsuin @ Saturday, Jan 7 2012, 02:28)
Very nice, I like the windows style UI icon14.gif

Thank HazardX wink.gif . Though building a GUI using code is a pain in the ass... (even though this one is still pretty simple)

kikiboy95
  • kikiboy95

    Still Vice!

  • Members
  • Joined: 23 Mar 2010

#8

Posted 08 January 2012 - 02:28 AM

This is one of the best IV modding programs I've come at to. You should be awarded for this one, gr8 job!

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#9

Posted 08 January 2012 - 02:33 PM

kikiboy95:
Thanks man! smile.gif

ldfxf
  • ldfxf

    Player Hater

  • Members
  • Joined: 07 Sep 2011

#10

Posted 13 January 2012 - 01:29 AM Edited by ldfxf, 13 January 2012 - 01:42 AM.

Oh great! This is really helpful.
I hate to restart my game again and again to edit the handling.dat.
This one save my ass!
THX A LOT.

nrv74
  • nrv74

    Crackhead

  • Members
  • Joined: 27 Feb 2009

#11

Posted 28 January 2012 - 12:21 PM Edited by nrv74, 28 January 2012 - 01:14 PM.

looks exactly like what I want since a long time but I can' t even put a "_" in the console maybe because of my crappy french keyboard... if anyone knows how to help me, it would be very nice
I even tried to remap my keyboard but noway. cryani.gif
Is there any way for me to run this mod? like changing the command to open the stuctedit window or to make this "_" work in the scripthook console with my keyboard?

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#12

Posted 28 January 2012 - 11:14 PM

nrv74:
Same guy who also posted on the youtube vid?

Added other version of the commands, so now you can use either:
"si_gui"
or
"si-gui"

to enable the GUI. Now I hope you can at least type the '-' character, lol.

Link in first post is updated and points to the new version (0.11)

nrv74
  • nrv74

    Crackhead

  • Members
  • Joined: 27 Feb 2009

#13

Posted 28 January 2012 - 11:19 PM

wow dude that' s really cool thanks for your reply. I will try and enjoy that

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#14

Posted 28 January 2012 - 11:20 PM

QUOTE (nrv74 @ Saturday, Jan 28 2012, 23:19)
wow dude that' s really cool thanks for your reply. I will try and enjoy that

No problemo. Let me know if it works wink.gif .

nrv74
  • nrv74

    Crackhead

  • Members
  • Joined: 27 Feb 2009

#15

Posted 29 January 2012 - 09:46 AM

I' m able to open the GUI now, but I don' t have enough knowledge yet to make it work with eflc and a tweaked handling dat plus a newhandling dat. Only a few values appear and no identifier. I will keep on trying, anyway, thanks a lot

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#16

Posted 29 January 2012 - 10:04 AM

nrv74:
Yeah, sadly I don't own the EFLC extension pack, so I can't help you there. The offsets are not correct for EFLC, so the GUI won't give you any correct values. Good to hear you got the GUI working though!

I'd guess little has changed though, the overall structure should be the same, you'd only need to to replace the offsets in the .sif's. Finding these offsets is not *that* hard, but it's a bitch to explain.

I may one day make a tutorial or something. If you want to have a go at it yourself, read up on the following things:
"CheatEngine" (tons of tutorials)
"pointers" (look up "C pointers" or something like that)
"assembly" (note: x86 assembly!)
"memory addresses" (should probably be covered under "assembly" though)

So... that will take some time. You could also save a lot of time by buying me EFLC tounge.gif (j/k)

nrv74
  • nrv74

    Crackhead

  • Members
  • Joined: 27 Feb 2009

#17

Posted 29 January 2012 - 10:31 AM

Hummm.... I'll send you a package tomorrow^^
I will try to make myself less stupid reading all that when my gf won' t be around ^^
thanks again for your time and help that' s really nice and your tool looks absolutely great. see ya

nrv74
  • nrv74

    Crackhead

  • Members
  • Joined: 27 Feb 2009

#18

Posted 30 January 2012 - 05:26 PM

Hi thacursedpie, me again...
As I really wanted to make good handling lines, I' ve tried it on my new gtaIV install.
It works, BUT
There is not every values on the window, like for example maxspeed and some others, especially for bikes, which are using two handling lines as helicopters and boats...
I' m not able to change every values in the ones structedit recognize, like lowering Z axis....

I hope you planned to perfect this tool, cause it' s really awesome to be able to work handling lines ingame .

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#19

Posted 30 January 2012 - 10:13 PM

nrv74:
Yep, not all parameters have been documented, so I can't support them :S.

See it this way: StructEdit needs to be told where the stuff is you want to edit. Let's say the parameter you want to edit is a treasure, buried deep within the GTAIV process. All the other parameters are treasures too. Now, if you want to access a treasure through StructEdit, you need to give StructEdit a map, to tell it where to look.

So for example, we give it a map (.sif file) which says: "center of mass is stored *here*, drive force is stored *here*". StructEdit takes this and is now able to edit those values. If you say to StructEdit: "Change the center of mass to X!", StructEdit says: "okay boss!", it looks up the location of the 'treasure' on the 'map', and does as you wish.

Now if you want to change the topspeed, StructEdit says: "Well, I'm sorry, but I don't know where the topspeed is located!". Imagine searching for a treasure, but without the treasure map! And in this case it gets even harder, because you don't know what the treasure looks like! So you'll never be able to find it.


So what we (modders) do, we search through the GTAIV process, and locate the treasures. We make a nice neat list. Some of us are even kind enough to post the lists online, so others can benefit smile.gif . Have a look at the CVehicleInfo documentation for example: http://www.gtamoddin...13#CVehicleInfo .
This is what the list of treasure positions (memory addresses / offsets) looks like. As you can see, it's not complete.

We locate these treasures using special software, such as CheatEngine. In short, this works like this: you tell CheatEngine how the treasure looks ("It's a big box filled with money!"), then CheatEngine starts digging around through the GTAIV process. Luckily, CheatEngine digs pretty fast, so it'll come back and say: "Hey boss! I found a couple of treasures which look like that! They are located *here*, *here* and *here*". That way you are able to locate 'em and put them on your treasure chart ^^.

If you have a bit of knowledge, you can also do some manual digging. Let's say that when you know where a certain treasure is located, you can use your programming / reversing knowledge to locate treasures buried near the first one. (this is of course way faster than letting CE shovel through the entire process every time)

Your best bet is that either someone comes along and updates the documentation (happens smile.gif . eg. I added the CWeaponInfo doc, Jenksta improved upon it greatly), or you do it yourself.

At the moment I simply don't have the time to document the parameters, sorry.

Hopefully though this post was kind of educational tounge.gif .

nrv74
  • nrv74

    Crackhead

  • Members
  • Joined: 27 Feb 2009

#20

Posted 31 January 2012 - 05:21 AM

yes, I was already seeing your tool a bit like this treasure finder which needs a map.
Saddly for me, as you said , my best bet is that someone updates this map, cause CE & the other stuffs look like a mix between japanese, arab, russian & hebrew.
So I guess I' ll just stay tuned^^

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#21

Posted 31 January 2012 - 05:40 PM

Yet you can *learn* Arab, Russian, Hebrew, Japanese. You can learn *anything*. Hard things just take more time wink.gif .

Note to myself: (ignore wink.gif )
TODO in next version:
* support all game versions using signature scanning
* parse handling.dat & weaponinfo.xml to get signature data (? or ask user for data).
* extend CVehicleInfo documentation

NaidRaida
  • NaidRaida

    Inactive user

  • Members
  • Joined: 14 Dec 2010

#22

Posted 04 February 2012 - 06:02 PM Edited by NaidRaida, 04 February 2012 - 07:27 PM.

How do I enable the GUI? Putting si_gui into commandline.txt doesnīt work for me or which console do you mean? Iīm confused now.

EDIT: Ah, wait Iīve read something on youtube about the console. This mod sounds very useful, I bet I restarted GTA hundreds of times, I hope itīll work. icon14.gif

EDIT2: Allright, the console opens by pressing "^", the GUI pops up as well but there are no parameters, no identifiers, only zeros. Iīm using patch 1.0.4.0 (patch 4) on retail version.

Maybe the tool is irritated because my handling files are alreay modified with other tools (handling editor). I donīt know. Anyway nice mod, I believe it works.

Threepwood
  • Threepwood

    Calm like a bomb.

  • Members
  • Joined: 13 Jul 2008

#23

Posted 04 February 2012 - 07:43 PM

Wow! Does this support multiple handling files, like newhandling dat from the AddOn Cars tutorials? Or is it (atm) limitated to the original handling.dat?

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#24

Posted 05 February 2012 - 08:25 PM Edited by thaCURSEDpie, 05 February 2012 - 08:49 PM.

NaidRaida:
Problem is that you're using patch 1040, which as another offset. To update your offset:

Go to your main IV install directory. Then to scripts\structedit. There should be two files in there:
CVehicleInfo.sif and CWeaponInfo.sif. Open CVehicleInfo.sif. Change the following line:
CODE

CVehicleInfo 0x110 0x11E3BF0 115


To
CODE

CVehicleInfo 0x110 0x117ABB0 115


This should allow the mod to work. I'm not able to test this myself however, because I don't have 1040 anymore (just 1070). But other users who are using 1040 have obtained this offset, so I guess you could give it a shot.
Note: this will only work for 1040. For any other game version (including EFLC) the offset will differ too.

Threepwood:
StructEdit doesn't read the handling.dat file at all. The handling.dat file(s) are just a way to tell GTAIV.exe what the handling for each vehicle should be. What StructEdit does is read GTAIV.exe's memory and change the values directly. So StructEdit frankly doesn't care if the handling.dat is default modded, or mangled tounge.gif .

You mention "AddOn cars". Does this mean you're adding cars to the game? Normal IV has 115 vehicles. If you add more, you're going to have to change the NUM_ELEMENTS property in CVehicleInfo.sif. You can do this by changing the last value of
CODE

CVehicleInfo 0x110 0x11E3BF0 115

to the new amount of vehicles. I'd also like to refer you to the documentation for the .sif filetype, which comes with the mod, as well as the actual .sif files (they are located in .\scripts\structedit) - which are commented to make clear what is what smile.gif .

EDIT:
Updated first post, added 'FAQ' section to answer frequently asked questions. Also instructions on how to get it working for 1040.

Threepwood
  • Threepwood

    Calm like a bomb.

  • Members
  • Joined: 13 Jul 2008

#25

Posted 06 February 2012 - 06:34 AM

Thanks a lot!!

NaidRaida
  • NaidRaida

    Inactive user

  • Members
  • Joined: 14 Dec 2010

#26

Posted 06 February 2012 - 07:14 PM Edited by NaidRaida, 07 February 2012 - 07:56 PM.

Thanks thaCURSEDpie! I will try that and give you feedback later. icon14.gif

---

EDIT: Allright, itīs working! Thanks again! Now I can see the car names and the values.

Does this also work for the CWeaponInfo.sif? I could simply test it but right now I donīt want to change anything there, just curious about this method.

EDIT2: No, itīs not working!

Some values can be changed but several others I cannot change. I click on the button but the new values are not transfered.

rippi
  • rippi

    Crackhead

  • Members
  • Joined: 07 Sep 2010

#27

Posted 14 February 2012 - 02:29 PM

add support for patch 1.0.4.0 pleaseee smile.gif

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#28

Posted 14 February 2012 - 03:29 PM

rippi:
No. I don't feel like completely re-installing IV. Update to 1070.

NaidRaida:
Cool that it's working. Of course it's not working for CWeaponInfo.cif - the offset should be different. You're a bit vague. What values can't you change?

chasez
  • chasez

    GTAV? Haven't played it!

  • Members
  • Joined: 21 Nov 2008
  • None

#29

Posted 06 April 2012 - 12:04 AM

GUI works and by the console info I can tell that it can reload too but...

1. doesn't want to save values with "-" sign in front of them
2. after changing values and reloading doesn't make any changes.

I'm using patch 1.0.7.0 just to make it clear now.

thaCURSEDpie
  • thaCURSEDpie

    GTA:IV scripter

  • Members
  • Joined: 01 Jul 2007

#30

Posted 12 April 2012 - 09:39 AM

QUOTE (chasez @ Friday, Apr 6 2012, 00:04)
GUI works and by the console info I can tell that it can reload too but...

1. doesn't want to save values with "-" sign in front of them
2. after changing values and reloading doesn't make any changes.

I'm using patch 1.0.7.0 just to make it clear now.

Hey man, sorry for the late reply. I'm veerry busy IRL, so I don't have much time.

Anyhow:
1. That's probably because I made a mistake in setting the restrictions for the relevant parameter. What parameter were you trying to change? Or does this go for all of them? Have a look at the .sif files in the ./scripts/structedit folder (just open with notepad). You'd probably see what's wrong right away.

2. I don't really understand what you mean. The changes are made directly to the values in-memory. If you see a value has changed after you've changed it - it has changed. The mod displays the true values as they are present in-memory. If they do not change, something went wrong (which can be quite a lot).

If you restart the game (or load a new save), the game probably reloads the values into memory, thus the changes you've made are undone.


Making permanent changes was never the scope of this mod - the goal was to aid modders in editing some of the config files (handling.dat, waeponinfo.xml). When I have the time (and motivation) I might rebuild the mod and also make it possible to change values programatically. There's something like that implemented already (see the source @ github), but it's not very nice and I haven't tested it yet.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users