So I opted to do something cool like write an app to mod halo rather than the plain old tic tac toe or checkers game for my C++ final project.
I'm having a few issues though that I thought maybe you guys could help me clear up:
My major problem is that i want to be able to read in a list of Offsets and Values to then edit in a .map file. I am kinda stumped as to how to bring these values in as they are Hex, however.
If I attempt to bring in 0x01A68734 as an int, it will only bring in the 0. If I instead just bring in the 01A68734 then C++ treats it as a decimal int because there is no 0x in front of it. I could also bring it in as a string, but from there I have no idea how to convert it back to a hexadecimal integer so that I can use it.
I've had great success when I've hardcoded the Hex values into the program, but I want my app to be able to load custom lists of offsets and values and I don't want to have to convert every hex value to decimal.
Secondly, I want to make a short demo video of my app for my presentation kinda like Red vs. Blue. I've been successful in offset swapping all of the parts of the HUD except the Health and Grenades. No matter what I change the Health and Grenade Huds' offsets to be, the game crashes so I can't get rid of them. I'd really like to not have any of the HUD showing in my video. Does anyone know how I can get rid of it?
Thanks!
Writing a Halo Modder in C++ For A Class and NEED HELP!
-
- Posts: 34
- Joined: Sun Nov 02, 2003 12:09 am
- Location: British Columbia
- Contact:
For your first problem *drags out c++ text* you may be able to use the I/O flags to format your variables. For instance...
{
//setting flag so output will be in hexadecimal
std::cout.unsetf(std::ios::dec);
std::cout.setf(std::ios::hex);
std::cout<<"Hexnum";
}
would display the int variable Hexnum as hexadecimal (you may need to include <fstream.h>).
I'm not sure if you could do the same thing for cin, but that could surely solve the problem. If this doesn't make sense, try this tut where I learned it, http://www.developer.com/net/cplus/arti ... _2119781_1 (particularly the third page). Congratulations on having success on all the other aspects of file manipulation, I would have expected the rest of the program to be more difficult than this. Hope you get a good grade in for your project
.
As for your second problem, you need to mess with the meta for awhile to remove the grenade HUD. I've made a ppf for the entire removal of it and you can download it from the link in my sig.
{
//setting flag so output will be in hexadecimal
std::cout.unsetf(std::ios::dec);
std::cout.setf(std::ios::hex);
std::cout<<"Hexnum";
}
would display the int variable Hexnum as hexadecimal (you may need to include <fstream.h>).
I'm not sure if you could do the same thing for cin, but that could surely solve the problem. If this doesn't make sense, try this tut where I learned it, http://www.developer.com/net/cplus/arti ... _2119781_1 (particularly the third page). Congratulations on having success on all the other aspects of file manipulation, I would have expected the rest of the program to be more difficult than this. Hope you get a good grade in for your project

As for your second problem, you need to mess with the meta for awhile to remove the grenade HUD. I've made a ppf for the entire removal of it and you can download it from the link in my sig.
Awesome, thanks a lot
I actually worked through the whole hex problem. The solution was actually pretty simple, and I can't believe I didn't think of it sooner.
I went ahead and brought the hex value in as a string without the 0x.
I then just did a couple of loops to reverse the hex bytes
(i.e. ABCDEF01 becomes 01EFCDAB) and then went through a loop to break each character down into it's decimal equivalent. Then went through and raised each one to the correct power and added them together. After I wrote out the code, changed all my ints to unsigned ints (I couldn't figure out why I kept getting negative results, then I realized that signed ints aren't big enough to hold that much data) I nearly kicked myself for not thinking of it sooner.
Anyway, I suppose the answers to things like this usually seem simple after you get them working.
As for the HUD, thanks for the link. I will definitely be applying your ppf tonight and playing around with it a bit.
At this point, I have a fully working text based app that will read in any number of offsets and values from a .dat file and apply them to a map. Hopefully the guy in charge of the GUI will get that up and running soon so we can start putting this whole thing together.
Thanks again for all the help!
I actually worked through the whole hex problem. The solution was actually pretty simple, and I can't believe I didn't think of it sooner.
I went ahead and brought the hex value in as a string without the 0x.
I then just did a couple of loops to reverse the hex bytes
(i.e. ABCDEF01 becomes 01EFCDAB) and then went through a loop to break each character down into it's decimal equivalent. Then went through and raised each one to the correct power and added them together. After I wrote out the code, changed all my ints to unsigned ints (I couldn't figure out why I kept getting negative results, then I realized that signed ints aren't big enough to hold that much data) I nearly kicked myself for not thinking of it sooner.
Anyway, I suppose the answers to things like this usually seem simple after you get them working.
As for the HUD, thanks for the link. I will definitely be applying your ppf tonight and playing around with it a bit.
At this point, I have a fully working text based app that will read in any number of offsets and values from a .dat file and apply them to a map. Hopefully the guy in charge of the GUI will get that up and running soon so we can start putting this whole thing together.
Thanks again for all the help!
-
- Posts: 34
- Joined: Sun Nov 02, 2003 12:09 am
- Location: British Columbia
- Contact: