*Now that I think about, I am not "quite" sure this is the right section for this. It IS a coding question, but also a memory question (which should go in "other"?), and a vehicle question. With the advent of new memory editing opcodes, the distinction is getting blurry. If this isn't the right place please let me know.
If you need an explanation of what ID 154 is, refer to the bottom of this post.
I am trying to control the players current vehicle's up/down tilt rotation velocity (Make the vehicle tilt forward and backward, like the dodo-up, dodo-down controls), but I don't quite understand how GTA III handles this. When I change (what I think are) the correct addresses, the car rotates at an angle (the front left tilts up or down), or the whole thing just plain go's nuts and the game crashes. If anyone knows if I am editing the correct memory addresses, and if so how they work (they are driving me nuts!), can you point me in the right direction. I have played with these (and other addresses) in a memory editor, and searched around for information relating to both ID 154 (there is surprisingly little), and vehicle rotation (almost all is from vice city, which doesn't (form what I can tell) work quite the same as III) for over three days, but I haven't managed to forward my progress.
Here is my code (CLEO) so that you can see what I am doing (FBIPLANE is just the FBICAR copied into ID 154):
| CODE |
:ID154_FIX_BEGIN thread '154_FIX' CONST x_roll_offset = 4 y_roll_offset = 8 cons_players_current_car = 0x8F5FE8//008F5FE8 END
:ID154_FIX wait 250 if and player.Defined($PLAYER_CHAR) not player.Wasted($PLAYER_CHAR) is_player_driving_vehicle_type $PLAYER_CHAR #FBIPLANE jf @ID154_FIX 05E0: 0@ = read_memory cons_players_current_car size 4 virtual_protect 0 0@ += x_roll_offset 05E0: 1@ = read_memory cons_players_current_car size 4 virtual_protect 0 1@ += y_roll_offset 018C: play_sound 94 at 0.0 0.0 0.0 wait 1000
:ID154_FIX_MAIN if 00E0: player $PLAYER_CHAR driving //RETURN FALSE WHEN USING TYPE-SPECIFIC CHECK... jf @ID154_FIX_MAIN_END if 85EE: key_pressed 0x6b //VK_... UP, "KEYPAD +" jf @ID154_FIX_MAIN_UP if 85EE: key_pressed 0x6d //VK_... DOWN, "KEYPAD -" jf @ID154_FIX_MAIN_DOWN wait 500 jump @ID154_FIX_MAIN
:ID154_FIX_MAIN_UP //X ROLL 05E0: 2@ = read_memory 0@ size 4 virtual_protect 0 2@ += 0.5 05DF: write_memory 0@ size 4 value 2@ virtual_protect 0 //Y ROLL 05E0: 3@ = read_memory 1@ size 4 virtual_protect 0 3@ += 0.5 05DF: write_memory 1@ size 4 value 3@ virtual_protect 0 018C: play_sound 94 at 0.0 0.0 0.0 wait 0 jump @ID154_FIX_MAIN
:ID154_FIX_MAIN_DOWN //X ROLL 05E0: 2@ = read_memory 0@ size 4 virtual_protect 0 2@ -= 0.5 05DF: write_memory 0@ size 4 value 2@ virtual_protect 0 //Y ROLL 05E0: 3@ = read_memory 1@ size 4 virtual_protect 0 3@ -= 0.5 05DF: write_memory 1@ size 4 value 3@ virtual_protect 0 018C: play_sound 94 at 0.0 0.0 0.0 wait 0 jump @ID154_FIX_MAIN
:ID154_FIX_MAIN_END wait 250 jump @ID154_FIX
|
What ID 154 is: For those who do not know, Vehicle ID 154 in GTA III, is an unused vehicle ID that when a vehicle is assigned to it, behaves "somewhat" like a plane. Unlike the Dodo, ID 154
has propulsion... which once you have reached a certain speed will maintain itself indefinitely until you bring the vehicle back down to a stop (if you have ever played tony hawks pro skater, its like the way the skateboards keep moving by them selves). Also unlike the Dodo, ID 154 has tilt-left/tilt-right controls like a real plane, although they are not effective as they cause the plane to tilt forward, and use the same keys as look-left/look-right... It also seems to behave as though it is airborne constantly, even when on the ground. However, what it lacks is up/down controls, as it fails to respond to those set for the Dodo - which is what I am trying to fix.
Irrelevant Info:
BEST DISCOVERY YET: When the chittychittybb cheat is enabled, ID 154 loses its propulsion, and its plane-like handling. If pushed down a hill and gotten in, it will drive like a normal car until you get to the bottom of the hill.
One interesting thing of note, if you use the Dodo model, irrelevant of handling data, it causes the steer-left/steer-right controls to make the vehicle spin rapidly and crash the game. The other vehicles I have tried are the Corpse, Mannana & Fbicar, they all work fine.
*EDIT: It seems that the pedestrians don't know "quite" how to drive it, they only tilt and take off after having been scared by gunfire into a panic, although they seem to ignore paths entirely once they have entered a panic (They tend to just drive straight off into, or over, the ocean), that seems more likely to be a bug. Otherwise they drive it the same way as they would the Dodo on car paths.
As for theories for what it was meant to be, as they will inevitably come up, the above piece of information, plus the speed-setting and maintenance (effects peds to), makes me want to guess that this vehicle was intended for AI control (if the tilting upwards isn't just a coincidental glitch...). And the fact that it won't respond to Dodo controls (and has extra controls) tells me that it was scrapped before the Dodo was finished. But all of that is just pointless speculation, not that appropriate for this section...I have also been using cheat engine for locating and testing memory addresses, but if anyone has a recommendation they think is better please tell me.
**After playing with the memory addresses, I am starting to think that there is no relative up/down velocity, and that the game purely uses the world axis when rotating the vehicles - which makes for more complex math

.
***Now that I am thinking about it, the gta3 developer console was able to control the player's vehicle's tilt(the helicopter mod, the little said the better...), does anyone know how exactly it was done? Source possibly?
Damn this is getting stupidly difficult, I can't seem to get the game to do the same thing from one play to the next!
This post has been edited by Kapitano de la Gvardio on Sunday, Sep 2 2012, 17:35