Coding

 Reply to this postStart new topic

Different Engine Opcodes?

Adler
post Dec 4 2010, 09:14 AM
Post #1


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



I checked out 02D4 081D and the CLEO opcode 0ABF but they sound like they do the same thing.

When tested on planes and helicopters (sorry I haven't tested on land/sea vehicles), 02D4 makes a plane fall to the ground promptly but makes helicopters locked in a constant rotation and speed (which doesn't seem to be turning off the engine). 081D doesn't seem to do anything, and 0ABF has a similar effect as 02D4 on planes but for helicopters (tested on a Hunter) 0ABF makes it fire its rockets but has no effect on helicopters.

This post has been edited by Adler: Dec 4 2010, 09:31 PM


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Dec 4 2010, 05:18 PM
Post #2


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



The firing rockets thing is probably to do with differences in a normal cars structure and a flying vehicle structure.

We could have, lets say, +0x455 being the offset that stores the vehicles engine state in cars and bikes etc... But somewhere along the line, the flying vehicles offsets changed. On the most part, vehicles have a similar structure, but maybe the plane has extra or less information before the engine offset, so there's something else there instead.

It's possible that when the CLEO opcode was made, Seemann didn't realise there was already 2 opcodes to do this. Or perhaps it just allows some greater control over the engine. The CLEO opcode clearly doesn't account for the differences in vehicle offsets unlike the original opcode.


--------------------
Go to the top of the page
 
+Quote Post
Adler
post Dec 4 2010, 06:42 PM
Post #3


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Yeah I guess so. Too bad none of the engine opcodes work properly for helicopters; now I have to find a way to make it drop to the ground when it runs out of fuel. tongue.gif

Is there anything in the memory that controls the helicopter's propellers?


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Dec 4 2010, 08:32 PM
Post #4


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Nothing documented, it seems.


--------------------
Go to the top of the page
 
+Quote Post
Adler
post Dec 4 2010, 09:29 PM
Post #5


Devil's Advocate

Group Icon

Posts: 413
From: CA US
Joined: 26-July 09



Okay then but I think I found out what caused the Hunter to fire its rockets (and afterwards it is unable to fire rockets or the machinegun anymore).
SANNY
0918: unknown_car 0@ driver_flag 0

The above opcode supposedly makes a car stuck in neutral (from GTAForums Documentation) and also makes planes fall down to the ground. For helicopters it has no effect except for the Hunter which fires rockets and makes it unable to use its weapons. I haven't tested with other flags but it might have some cool effects on vehicles.

Also is there a way to check if the Hydra is in hover mode?

This post has been edited by Adler: Dec 4 2010, 10:53 PM


--------------------
Go to the top of the page
 
+Quote Post
Deji
post Dec 4 2010, 11:26 PM
Post #6


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Can only find the landing gear status at the moment...

SANNY
while true
    01CD: render_game_frame
    if
        0449:   actor $PLAYER_ACTOR in_a_car
    then
        0811: 0@ = actor $PLAYER_ACTOR car_nosave
        0A97: 1@ = car 0@ struct
        000A: 1@ += 0x9CC  // landing wheels angle (1.0 == fully up, 0.0 == fully down)
        0A8D: 2@ = read_memory 1@ size 4 virtual_protect 0
        0AD1: show_formatted_text_highpriority "%f" time 1 2@
    end
end


--------------------
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: