AlexTMjugador Posted November 22, 2012 Share Posted November 22, 2012 (edited) Hi! I'm modifing a mod made by me, adding the ability to use boats (see the mod page at GTAGarage for see what does my mod), but I can't get the handle of the gang member on the boat. In first place, I used regular "passenger" opcodes, but they obviously didn't work. Then tried using spheres, but they didn't work because, in most boats, the driver seat it's not at the same Z level when the gang member is. I also tried with 092B, but it didn't work (I don't know if when you get the number of the members in a group the leader counts or not, and, if I use that method, I have to check if is near the player actor, but with that I can't ensure if the gang member is on the boat). I did a search in the forum, but I found nothing that could help me. So, please, can anyone help me? I will be grateful for your help Edited November 22, 2012 by AlexTMjugador Link to comment Share on other sites More sharing options...
Node Posted November 22, 2012 Share Posted November 22, 2012 Hi! I'm modifing a mod made by me, adding the ability to use boats (see the mod page at GTAGarage for see what does my mod), but I can't get the handle of the gang member on the boat. In first place, I used regular "passenger" opcodes, but they obviously didn't work. Then tried using spheres, but they didn't work because, in most boats, the driver seat it's not at the same Z level when the gang member is. I also tried with 092B, but it didn't work (I don't know if when you get the number of the members in a group the leader counts or not, and, if I use that method, I have to check if is near the player actor, but with that I can't ensure if the gang member is on the boat). I did a search in the forum, but I found nothing that could help me. So, please, can anyone help me? I will be grateful for your help Why can't you use the 'Homies' handle? Neat mod btw. Link to comment Share on other sites More sharing options...
AlexTMjugador Posted November 23, 2012 Author Share Posted November 23, 2012 (edited) Thanks for your response Because with that handle I can't ensure that he's on the boat, and you can use the mod if he is a mile away then And I'm not sure how to get that "member ID handle", because, like I said, I don't know if when you get a group X member handle the member number counts for the leader too (for example, if the leader is the member 1, other member will be 2, but if the leader doesn't count the other member ID will be 1). I searched the opcode in the GTA Gaming opcode database but it doesn't explain it very well. If it helps, here is my code (it's in Sanny Builder syntax) : // Before this there is a player check and all that:SWITCH_3973wait 0 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group if 07FD: group $PLAYER_GROUP alive else_jump @SWITCH_3899 07F6: get_group $PLAYER_GROUP number_of_leaders_to [email protected] number_of_members_to [email protected] // Here I'm not sure how does the opcode workif [email protected] == 2 else_jump @SWITCH_3899 092B: [email protected] = group $PLAYER_GROUP member 2 // Here I'm not sure how does the opcode workif Actor.Defined([email protected])else_jump @SWITCH_3899 if 00F3: actor [email protected] near_actor $PLAYER_ACTOR radius 10.0 10.0 sphere 0 on_foot else_jump @SWITCH_3899 if or Actor.Model([email protected]) == #FAM1 Actor.Model([email protected]) == #FAM2 Actor.Model([email protected]) == #FAM3 Actor.Model([email protected]) == 265 // This is because there are mods that add gang members Actor.Model([email protected]) == 266 // This is because there are mods that add gang memberselse_jump @SWITCH_3899 if 0AB0: key_pressed 9 else_jump @SWITCH_3899 03C0: [email protected] = actor $PLAYER_ACTOR car 0AB6: store_target_marker_coords_to [email protected] [email protected] [email protected] // IF and SET if and not [email protected] == 0.0 not [email protected] == 0.0 not [email protected] == 0.0 else_jump @SWITCH_2424 Player.CanMove($PLAYER_CHAR) = Falsefade 0 500 :SWITCH_4224wait 0 if not fading else_jump @SWITCH_4224 Car.SetSpeedInstantly([email protected], 0.0)068B: set_car [email protected] all_disembark 0430: put_actor $PLAYER_ACTOR into_car [email protected] passenger_seat 0 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group if 07FD: group $PLAYER_GROUP alive else_jump @SWITCH_4297 07B3: set_group $PLAYER_GROUP give_command 2 :SWITCH_4297072A: put_actor [email protected] into_car [email protected] driverseat 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.5 -0.75 0.0 Actor.PutAt($PLAYER_ACTOR, [email protected], [email protected], [email protected]) // Here I try to emulate that he's on the passenger seat, like when a homie is on the boat to follow youwait 1000 fade 1 500 ... Edited November 23, 2012 by AlexTMjugador Link to comment Share on other sites More sharing options...
AlexTMjugador Posted November 24, 2012 Author Share Posted November 24, 2012 *bump* Please Is it that difficult? Link to comment Share on other sites More sharing options...
Jack Posted November 24, 2012 Share Posted November 24, 2012 Did you try using passenger pointers from the SA mem address documentation. I'm using them right now and I managed to get a handle of any passanger in any car, something like this: 0A97: [email protected] = car [email protected] struct000A: [email protected] += 0x464 // passenger0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AEA: [email protected] = actor_struct [email protected] handle I don't have SA installed at the moment. Is that gang member a passenger or a driver? There's a driver pointer too. Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
ZAZ Posted November 24, 2012 Share Posted November 24, 2012 And I'm not sure how to get that "member ID handle", because, like I said, I don't know if when you get a group X member handle the member number counts for the leader too (for example, if the leader is the member 1, other member will be 2, but if the leader doesn't count the other member ID will be 1). I searched the opcode in the GTA Gaming opcode database but it doesn't explain it very well. get "gangmember ID handle": max. 7 possible gangmember can be available so you have to check if member 0,1,2,3,4,5,6 exist check if they are defined as actor and not dead it makes sense to use arrays otherwise you'll have a lot of work with lot of code :Beginningwait [email protected] = 007AF: [email protected] = player $PLAYER_CHAR group 092B: [email protected] = group [email protected] member 0 092B: [email protected] = group [email protected] member 1 092B: [email protected] = group [email protected] member 2 092B: [email protected] = group [email protected] member 3 092B: [email protected] = group [email protected] member 4 092B: [email protected] = group [email protected] member 5 092B: [email protected] = group [email protected] member 6:Array_Loopwait [email protected] > 7jf @Refresh if 056D: actor [email protected]([email protected],7i) defined jf @Skip_1 if 8118: not actor [email protected]([email protected],7i) dead jf @Skip_1if04A7: actor [email protected]([email protected],7i) driving_boatjf @Skip_1// gangmember which drives boat was found0633: AS_actor [email protected]([email protected],7i) exit_car //here can you do now somthing with the gangmemberjump @Refresh:Skip_1 [email protected] += 1jump @Array_Loop:Refresh [email protected] = 0:cleanupwait [email protected] > 7jf @Beginning if 056D: actor [email protected]([email protected],7i) defined jf @Skip_201C2: remove_references_to_actor [email protected]([email protected],7i):Skip_2 [email protected] += 1jump @cleanup if you're not able to use arrays, then read here about arrays or do it in the detailed way to do the checks with each possible actor handle :Loopwait 0if 056D: actor [email protected] defined jf @Step_1 if 8118: not actor [email protected] dead jf @Step_1if04A7: actor [email protected] driving_boatjf @Step_1// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_1if 056D: actor [email protected] defined jf @Step_2 if 8118: not actor [email protected] dead jf @Step_2if04A7: actor [email protected] driving_boatjf @Step_2// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_2if 056D: actor [email protected] defined jf @Step_3 if 8118: not actor [email protected] dead jf @Step_3if04A7: actor [email protected] driving_boatjf @Step_3// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_3if 056D: actor [email protected] defined jf @Step_4 if 8118: not actor [email protected] dead jf @Step_4if04A7: actor [email protected] driving_boatjf @Step_4// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_4if 056D: actor [email protected] defined jf @Step_5 if 8118: not actor [email protected] dead jf @Step_5if04A7: actor [email protected] driving_boatjf @Step_5// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_5if 056D: actor [email protected] defined jf @Step_6 if 8118: not actor [email protected] dead jf @Step_6if04A7: actor [email protected] driving_boatjf @Step_6// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_6if 056D: actor [email protected] defined jf @Step_7 if 8118: not actor [email protected] dead jf @Step_7if04A7: actor [email protected] driving_boatjf @Step_7// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh A smoother kind of an array loop and maybe more clear, is the "for-to-Loop" (a high level method) for [email protected] = 0 to 6 if 056D: actor [email protected]([email protected],7i) defined then if 8118: not actor [email protected]([email protected],7i) dead then if 04A7: actor [email protected]([email protected],7i) driving_boat then jump @actor_found end end endendjump @no_actor_found:actor_found// gangmember which drives boat was found0633: AS_actor [email protected]([email protected],7i) exit_car //here can you do now somthing with the gangmember:no_actor_found CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
AlexTMjugador Posted November 25, 2012 Author Share Posted November 25, 2012 (edited) Did you try using passenger pointers from the SA mem address documentation. I'm using them right now and I managed to get a handle of any passanger in any car, something like this: 0A97: [email protected] = car [email protected] struct000A: [email protected] += 0x464 // passenger0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AEA: [email protected] = actor_struct [email protected] handle I don't have SA installed at the moment. Is that gang member a passenger or a driver? There's a driver pointer too. I'm not sure. It seems to be on turret mode, because if I try to put him somewhere he stays on the boat unless I remove him from turret mode. Also, if I put him in a passenger seat he's invisible but his shadow is still visible under the boat. Edited November 25, 2012 by AlexTMjugador Link to comment Share on other sites More sharing options...
AlexTMjugador Posted November 25, 2012 Author Share Posted November 25, 2012 (edited) And I'm not sure how to get that "member ID handle", because, like I said, I don't know if when you get a group X member handle the member number counts for the leader too (for example, if the leader is the member 1, other member will be 2, but if the leader doesn't count the other member ID will be 1). I searched the opcode in the GTA Gaming opcode database but it doesn't explain it very well. get "gangmember ID handle": max. 7 possible gangmember can be available so you have to check if member 0,1,2,3,4,5,6 exist check if they are defined as actor and not dead it makes sense to use arrays otherwise you'll have a lot of work with lot of code :Beginningwait [email protected] = 007AF: [email protected] = player $PLAYER_CHAR group 092B: [email protected] = group [email protected] member 0 092B: [email protected] = group [email protected] member 1 092B: [email protected] = group [email protected] member 2 092B: [email protected] = group [email protected] member 3 092B: [email protected] = group [email protected] member 4 092B: [email protected] = group [email protected] member 5 092B: [email protected] = group [email protected] member 6:Array_Loopwait [email protected] > 7jf @Refresh if 056D: actor [email protected]([email protected],7i) defined jf @Skip_1 if 8118: not actor [email protected]([email protected],7i) dead jf @Skip_1if04A7: actor [email protected]([email protected],7i) driving_boatjf @Skip_1// gangmember which drives boat was found0633: AS_actor [email protected]([email protected],7i) exit_car //here can you do now somthing with the gangmemberjump @Refresh:Skip_1 [email protected] += 1jump @Array_Loop:Refresh [email protected] = 0:cleanupwait [email protected] > 7jf @Beginning if 056D: actor [email protected]([email protected],7i) defined jf @Skip_201C2: remove_references_to_actor [email protected]([email protected],7i):Skip_2 [email protected] += 1jump @cleanup if you're not able to use arrays, then read here about arrays or do it in the detailed way to do the checks with each possible actor handle :Loopwait 0if 056D: actor [email protected] defined jf @Step_1 if 8118: not actor [email protected] dead jf @Step_1if04A7: actor [email protected] driving_boatjf @Step_1// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_1if 056D: actor [email protected] defined jf @Step_2 if 8118: not actor [email protected] dead jf @Step_2if04A7: actor [email protected] driving_boatjf @Step_2// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_2if 056D: actor [email protected] defined jf @Step_3 if 8118: not actor [email protected] dead jf @Step_3if04A7: actor [email protected] driving_boatjf @Step_3// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_3if 056D: actor [email protected] defined jf @Step_4 if 8118: not actor [email protected] dead jf @Step_4if04A7: actor [email protected] driving_boatjf @Step_4// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_4if 056D: actor [email protected] defined jf @Step_5 if 8118: not actor [email protected] dead jf @Step_5if04A7: actor [email protected] driving_boatjf @Step_5// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_5if 056D: actor [email protected] defined jf @Step_6 if 8118: not actor [email protected] dead jf @Step_6if04A7: actor [email protected] driving_boatjf @Step_6// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_6if 056D: actor [email protected] defined jf @Step_7 if 8118: not actor [email protected] dead jf @Step_7if04A7: actor [email protected] driving_boatjf @Step_7// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh A smoother kind of an array loop and maybe more clear, is the "for-to-Loop" (a high level method) for [email protected] = 0 to 6 if 056D: actor [email protected]([email protected],7i) defined then if 8118: not actor [email protected]([email protected],7i) dead then if 04A7: actor [email protected]([email protected],7i) driving_boat then jump @actor_found end end endendjump @no_actor_found:actor_found// gangmember which drives boat was found0633: AS_actor [email protected]([email protected],7i) exit_car //here can you do now somthing with the gangmember:no_actor_found Thank you very much, ZAZ You solved all my questions, like always, but he doesn't drive the boat, he seems to be on turret mode on it Sorry for my bad english Edited November 25, 2012 by AlexTMjugador Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now