![]() ![]() |
![]() Post #1 | |
![]() Member Posts: 197 From: Liberty City, Shoreside Joined: 15-July 10 ![]() | Hello 2 all. I've made a script to create a proection of light under the pickup of weapon. But need to ask you about the code. Does there any mistakes or no. It works at this time, so I posted it in mod showroom. Screen: ![]() Code mmm... How to make the code visible only for registered users? This post has been edited by DK22: Jan 7 2011, 01:37 PM |
![]() |
![]() Post #2 | |
![]() Coding like a Rockstar! ![]() Posts: 1,468 From: ??? Joined: 28-May 09 ![]() | Nice ![]() If it works the way you want it to, I can't imagine there would be any mistakes... You don't have to use "remove_references" for the pickup object, though, because you got that via memory and not an opcode which adds the references. Here was my code for landing pickups, which never worked out ![]() SANNY 0AA7: call_function 0x404570 num_params 0 pop 0 8@ 0A8D: 0@ = read_memory 0x4571A1 size 4 virtual_protect 1 000A: 0@ += 0x4 while true 003D: for 1@ = 0x0 to 0x26C 0A90: 2@ = 1@ * 0x20 005A: 2@ += 0@ 0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0 if 8039: not 2@ == 0 then 0AA8: call_function_method 0x465070 struct 8@ num_params 1 pop 1 2@ 3@ 0984: 7@ = object 3@ model if and 0029: 7@ >= #GUN_VIBE1 002B: #ARMOUR >= 7@ 8039: not 7@ == #JETPACK then 0A8E: 4@ = 2@ + 0x1C 0A8D: 5@ = read_memory 4@ size 4 virtual_protect 0 if 08B7: test 5@ bit 21 then //08BD: set 5@ bit 0 //08C3: clear 5@ bit 3 08C3: clear 5@ bit 21 // turn off pickup rendering (stops object spinning) 0A8C: write_memory 4@ size 4 value 5@ virtual_protect 0 //02CE: 6@ = ground_z_at 4@ 5@ 6@ //01BC: put_object 3@ at 4@ 5@ 6@ //0453: set_object 3@ XY_rotation 90.0 90.0 angle 0 //0900: anchor_object 3@ 0382: set_object 3@ collision_detection 1 0392: make_object 3@ moveable 1 0381: throw_object 3@ velocity_in_direction 0 0 0.1 end end end end end As I discovered, pickup objects can't be forced to have physics. A lot of failed code here ![]() EDIT There's no way to hide stuff from Guests now.. maybe I'll implement that with v2. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
![]() Post #3 | |
![]() Member Posts: 197 From: Liberty City, Shoreside Joined: 15-July 10 ![]() | SANNY Wanted this code? GTFO This post has been edited by DK22: Dec 23 2011, 12:54 AM |
![]() Post #4 | |
![]() Coding like a Rockstar! ![]() Posts: 1,468 From: ??? Joined: 28-May 09 ![]() | It does, if I remember correctly. So does setting the rotation.. But it looks messed up. Also, the bit I disabled to allow this stuff causes game crashes sometimes, so isn't a good solution. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
![]() Post #5 | |
The New Guy! Posts: 4 Joined: 8-December 10 ![]() | So, if it's mod showroom, where is the mod? ![]() |
![]() Post #6 | |
![]() Member Posts: 197 From: Liberty City, Shoreside Joined: 15-July 10 ![]() | Anyway, I dunno on 100% if it work with crashes or no... SANNY Wanted this code? GTFO I also tried to make that SANNY Wanted this code? GTFO but there is some problems with type 15... If player will go away, the model of pickup (the psevdo-model that I created) will destroy and wouldnt create again... But pickup is still there, but unvisible... Just hoping for your help in that. @Deji: I tested, game not crashes when I changed position with your code, but pos is not changed. This post has been edited by DK22: Dec 23 2011, 12:55 AM |
![]() Post #7 | |
![]() Coding like a Rockstar! ![]() Posts: 1,468 From: ??? Joined: 28-May 09 ![]() | Hmm.. In my experience, picking up the pickup would crash the game.. Either straight away or after reloading the game. Also, make sure the object isn't being moved, then moved back (this seemed to happen a lot) a large enough wait between 2 put_object opcodes should fix it. 0900 turned out not to be anchor_object, can't remember if it actually helped keep it in place or not (I remember it doing). You shouldn't ever have to load the model if the pickup exists. What do you mean about the SCM Pickup thing? -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
![]() Post #8 | |
![]() Member Posts: 197 From: Liberty City, Shoreside Joined: 15-July 10 ![]() | I can't get the right position of pickup... SANNY Wanted this code? GTFO The proection is not created, or created somewhere else. Here is example from japan cleo-wiki SANNY Wanted this code? GTFO This post has been edited by DK22: Dec 23 2011, 12:55 AM |
![]() Post #9 | |
![]() Coding like a Rockstar! ![]() Posts: 1,468 From: ??? Joined: 28-May 09 ![]() | You can simply use store_object position on the object handle converted from the struct. CLEO 4 can do it with opcode 0AEC. From my source, you can do it via a CLEO 3-friendly method: SANNY 0AA8: call_function_method 0x465070 struct 8@ num_params 1 pop 1 4@ 3@ // convert object struct to SCM handle ![]() SANNY 01BB: store_object 2@ position_to 3@ 4@ 5@ 016F: particle 3 rot 0.0 size 1.0 255 RGB 255 71 16 at 3@ 4@ 5@ But I still don't see a good way to get the objects to lie down naturally using my method of stopping the pickups, because as I saw when I created a line of all pickups, not all objects look right rotated at 90.0. Cop weapons, do, though: ![]() SANNY 0AEC: 2@ = object_struct 1@ handle 01BB: store_object 2@ position_to 3@ 4@ 5@ 01BC: put_object 2@ at 3@ 4@ -100.0 0453: set_object 2@ XY_rotation 90.0 0 angle 0 But for some reason, lying them down seems to make the light "blink" on and off. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
![]() Post #10 | |
Ameteur Member Posts: 54 Joined: 8-January 11 ![]() | Hi, i'm tested that script a bit, so here is a little report. I'm using SANNY //0AE3: 3@ = random_object_near_point 0@ 1@ 2@ in_radius 2000.0 find_next false 0866: get_object_in_sphere 0@ 1@ 2@ radius 2000.0 handle_as 3@ and SANNY until 8866: get_object_in_sphere 0@ 1@ 2@ radius 2000.0 handle_as 3@ instead of cleo4 opcodes, so maybe for me that code contain more bugs than original one. Anyway, i've got crash on mission Just Business: CODE ******************************************** thread ivweapo Local variables dump: 9932252 57376 32 -1 0 0 1155660800 -991873024 1081081856 0 353 57117 1151090688 0 0 0 1157820928 -990623744 1096024064 0 0 0 0 0 0 0 0 0 0 0 1108089368 1095294952 ******************************************** 00000538: 0002 get numeric params: 1 param 1 = -522 (&label: 8248) 00000522: 8248 get numeric params: 1 param 1 = 353 00000527: 004D (&IFresult = False) get numeric params: 1 param 1 = -545 (&label: 0006) 00000545: 0006 get numeric params: 1 param 1 = 1 00000552: 00D6 get numeric params: 1 param 1 = 0 00000556: 0039 get numeric params: 1 param 1 = 1 00000563: 004D (&IFresult = True) get numeric params: 1 param 1 = -582 (&label: 0107) 00000570: 0249 get numeric params: 1 param 1 = 353 00000575: 0006 get numeric params: 1 param 1 = 0 00000582: 0107 get numeric params: 4 param 1 = 353 param 2 = 1157820928 param 3 = -990623744 param 4 = 1095294952 00000599: 0906 get numeric params: 2 param 1 = 59403 param 2 = 1149026304 00000609: 01BB get numeric params: 1 param 1 = 57376 ********************************* > Total opcodes: 79687136 > Logging finished: 21:30:18 Powered by SCMLog v1.04 ********************************* CODE Exception At Address: 0x0047D582 Registers: EAX: 0x00000000 EBX: 0x00000001 ECX: 0x04C464B8 EDX: 0x0000E020 ESI: 0x02D9B820 EDI: 0x00000000 EBP: 0x0022FBD0 ESP: 0x0022FB48 Also, sometimes weapons in player arms becomes invisible for some reason. And some pickups on the ground invisible too, only lighting shown. I hope, it help to do that mod better ![]() This post has been edited by ThirteenAG: Jan 8 2011, 06:51 PM |
![]() Post #11 | |
![]() Coding like a Rockstar! ![]() Posts: 1,468 From: ??? Joined: 28-May 09 ![]() | The crash is caused by 01BB because 0866 cannot be used as a condition (it will not change the result). You need to add a check to make sure the object is valid. But this topic is already fairly focused on the original, unmodified code. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
![]() Post #12 | |
Ameteur Member Posts: 54 Joined: 8-January 11 ![]() | Ok, i'm tried to use original code with cleo4. Game still crashes on mission. Modified code(cleo3), without crash: http://pastebin.com/LkyZWS7d Works for me, at least. This post has been edited by ThirteenAG: Jan 12 2011, 11:51 PM |
![]() Post #13 | |
![]() Member Posts: 197 From: Liberty City, Shoreside Joined: 15-July 10 ![]() | Ok. I'll update it later. I have a new idea about this. This post has been edited by DK22: Jan 10 2011, 06:18 PM |
![]() Post #14 | |
Ameteur Member Posts: 38 Joined: 16-January 11 ![]() | Ok, i'm tried to use original code with cleo4. Game still crashes on mission. Modified code(cleo3), without crash: http://pastebin.com/LkyZWS7d Works for me, at least. Just tried it out ![]() Could this be adapted to include the various weapon pickups around the place ? Like the gun on top of Sweet's house for example ? And maybe other pickups as well, like health and armor in the gang-wars, and as well as police stars ![]() Keep up the good work. I joined just to reply to this topic ![]() |
![]() Post #15 | |
Ameteur Member Posts: 54 Joined: 8-January 11 ![]() | Just tried it out ![]() Maybe that type of weapon you already have, have you tried to press "action" button to replace it? If yes, then probably you should wait new version from DK22. |
![]() Post #16 | |
![]() Member Posts: 197 From: Liberty City, Shoreside Joined: 15-July 10 ![]() | |
![]() Post #17 | |
Ameteur Member Posts: 54 Joined: 8-January 11 ![]() | |
![]() Post #18 | |
![]() Coding like a Rockstar! ![]() Posts: 1,468 From: ??? Joined: 28-May 09 ![]() | Nice. That bit setting write memory opcode I posted should do it. Not sure whether it is as stable, though. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
![]() Post #19 | |
![]() Devil's Advocate ![]() Posts: 413 From: CA US Joined: 26-July 09 ![]() | Nice can't wait for this mod. By the way can you make your IV Target mod to be CLEO 3-compatible? ![]() -------------------- ![]() |
![]() Post #20 | |
![]() Coding like a Rockstar! ![]() Posts: 1,468 From: ??? Joined: 28-May 09 ![]() | Fix your damn CLEO 4! ![]() -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
![]() ![]() |