MW_29 Posted March 13, 2012 Share Posted March 13, 2012 (edited) I got some problem. The thing is i want to make use of the memory addresses, to be precisive pointer on player actor, to make conditional IF player is falling (jus as from greater height) but i tried to code it with no luck, problem seems to be in using the pointer itself, most probably i just can't make it in the right way... I won't public the code with other conditionals related to falling, because i couldn't even do simple code with pointer with mem address that is checking if player is crouching, see it yourself: :NONAME_0wait 0 if and Player.Defined($PLAYER_CHAR)8118: not actor $PLAYER_ACTOR deadelse_jump @NONAME_0 jump @NONAME_1 :NONAME_1wait [email protected] = 0x94AD28 [email protected] += 0x150 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0jump @NONAME_2:NONAME_2wait 0if0039: [email protected] == 1 // integer valuesjf @NONAME_1wait 1000507: set_camera_interference 1wait 200000507: set_camera_interference 0 jump @NONAME_0 I use this mem addresses from gtamodding site as source, i assume, but maybe wrongly that 0x94AD28 - is just and only pointer to player ped0x150 - this i have to add to previous to get pointer pointing that player is crouching AS you can see it in code up above, but i have to do something wrong cuz this simply does not work ;/ Any help, based on showing me what i do wrong way in my script, excluding useless links to other topics, where i already checked and found not so clear answers for my question, would be much appreciated Edited March 13, 2012 by MW_29 Link to comment Share on other sites More sharing options...
Ashwin.Star Posted March 13, 2012 Share Posted March 13, 2012 i had same problem, the solution is 05E0: [email protected] = read_memory 0x94AD28 size 1 virtual_protect [email protected] += 0x150 read the memory before adding offset, try it & then tell me! Link to comment Share on other sites More sharing options...
Silent Posted March 13, 2012 Share Posted March 13, 2012 Even easier: while true 0001: wait 0 ms if 0256: player 0 defined then 05E6: [email protected] = actor $PLAYER_ACTOR struct 000A: [email protected] += 0x150 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 if 0039: [email protected] == 1 then 0001: wait 100 ms 0507: set_camera_interference 1 0001: wait 20000 ms 0507: set_camera_interference 0 end endend Link to comment Share on other sites More sharing options...
MW_29 Posted March 13, 2012 Author Share Posted March 13, 2012 First, thanks for replies Second, i tried what Ashwin suggested, but still nothing happens, no sign of test camera interferences ;/ Also i tried what you silent posted, the code like below crashes my game after loading bar goes to the end: // This file was decompiled using vicescm.ini published by http://gtag.gtagaming.com/opcode-database on 18.5.2011{$VERSION 2.1.1000}{$CLEO .cs}//-------------MAIN---------------0000: while true 0001: wait 0 ms if 0256: player 0 defined then 05E6: [email protected] = actor $PLAYER_ACTOR struct 000A: [email protected] += 0x150 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 if 0039: [email protected] == 1 then 0001: wait 100 ms 0507: set_camera_interference 1 0001: wait 20000 ms 0507: set_camera_interference 0 end endend Maybe it is addresses thing, dis i use wrong ones? GTAModding says as for crouching there is: +0x150 - [1 byte] - crouching .....what's wrong then? Link to comment Share on other sites More sharing options...
Silent Posted March 13, 2012 Share Posted March 13, 2012 Game crashing? Looks like one of 49045568908 VC CLEO bugs Link to comment Share on other sites More sharing options...
MW_29 Posted March 13, 2012 Author Share Posted March 13, 2012 Game crashing? Looks like one of 49045568908 VC CLEO bugs Huh. No single cleo script failed me so far, and i have about 33 right now, more than half of them written by myself. Therefore there are also used write and read memory instructions, the second ones for reading "a'la code" keystrings, and many many various opcodes i ve experienced since i started coding... and didn't find , that's probably luck , any fabric cleo bug or just used those opcodes that aren't bugged it seems ;] And what about this one case? Really can't be done anything about it? Generally i meant to script something like this, if player above on ex. 50m height, and falling , then kill player when he hits the ground ...can it be done? I think yes, the only thing, the only conditional i do not have as necessary part of this conception is something, that would act as indicator that player is falling or in air. By looking at those mem addresses at gtam i thought of using one of: +0x78 - [float] - Z move speed // as negative value could probably mean that player Z axis speed vector is turned to ground+0xE6 - [1 byte] - is player on ground // as opposite to this could possibly mean that player isn't on ground but in air There is one more but i am not sure what description means exactly: 0x2A - fallen down So does it mean the player is fallen down to the ground after hit by a car or sth, or it is expressed in english passive form, as the player itself is fallen (in PL: "spadający") towards down, but i really doubt it could be that way So tell me what do You think, about an idea. I'd like to have sth like death after falling 50 meters down, in SA there was such 'ability', but in VC there is just about losing 40 - 60 % of health even if falling from skyscraper Link to comment Share on other sites More sharing options...
Ashwin.Star Posted March 13, 2012 Share Posted March 13, 2012 my game also crash when it reads 05E6: [email protected] = actor $PLAYER_ACTOR struct or any other Struct opcode, -------------------------------------------------- so want that the player to be dead if falls more than 40 meter of height, i think i can do this! wait for me. Link to comment Share on other sites More sharing options...
MW_29 Posted March 13, 2012 Author Share Posted March 13, 2012 my game also crash when it reads05E6: [email protected] = actor $PLAYER_ACTOR struct or any other Struct opcode, -------------------------------------------------- so want that the player to be dead if falls more than 40 meter of height, i think i can do this! wait for me. Okay... I got whole script but mine lacks this thing which would check if falling Generally i am open to any constructive replies so if You know how to script it, be the ranger, lead the way ;] Link to comment Share on other sites More sharing options...
Ashwin.Star Posted March 13, 2012 Share Posted March 13, 2012 This should work, it is just a trick {$CLEO}thread 'Ashwin':0wait 005E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0x3C //<--- height Pos05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 005E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<------ Player on ground 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 005E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0x244 //<------ current status05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0if [email protected] >= 1109393408 //<---- player is more than 40 m [email protected] == 0 //<---- & not on groundjf @0if [email protected] == 1 //<--- fall by [email protected] == 41 //<--- or a sucide loljf @[email protected] = 0:[email protected] += 1 05E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<---- player on ground05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0wait 0ifnot [email protected] == 1 //<---- not on ground yetjf @[email protected] >= 200 //<---------- aprox time taken to reach on ground from 40 mjf @1:3wait 0 05E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<--- player on ground05E0: [email protected] = read_memory [email protected] size 1 virtual_protect [email protected] == 1 //<--- reach on groundjf @30222: set_player $2 health_to 0 //<----- kill himjump @0 good luck! Link to comment Share on other sites More sharing options...
MW_29 Posted March 13, 2012 Author Share Posted March 13, 2012 (edited) This should work,it is just a trick {$CLEO}thread 'Ashwin':0wait 005E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0x3C //<--- height Pos05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 005E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<------ Player on ground 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 005E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0x244 //<------ current status05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0if [email protected] >= 1109393408 //<---- player is more than 40 m [email protected] == 0 //<---- & not on groundjf @0if [email protected] == 1 //<--- fall by [email protected] == 41 //<--- or a sucide loljf @[email protected] = 0:[email protected] += 1 05E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<---- player on ground05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0wait 0ifnot [email protected] == 1 //<---- not on ground yetjf @[email protected] >= 200 //<---------- aprox time taken to reach on ground from 40 mjf @1:3wait 0 05E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<--- player on ground05E0: [email protected] = read_memory [email protected] size 1 virtual_protect [email protected] == 1 //<--- reach on groundjf @30222: set_player $2 health_to 0 //<----- kill himjump @0 good luck! God damn You Ash , it works as good as a good old AK ;D Now i am checking at what height it looks real to die from, if to adjust it to greater value, then should i just adjust [email protected] ?? You gave it 1109393408 and that's 0x42200000 as in HEX, ...so game height units on which player pointer operates on are ..in HEX, not DEC?! I mean i see 42200000 eee... -> 42 200 000 ...so somehow it resembles 40 meters? Or how am i supposed to understand it? Why so high/long number here? But i assume that it is value to change if wanted kill-height some value > than 40m, right ? Edited March 13, 2012 by MW_29 Link to comment Share on other sites More sharing options...
MW_29 Posted March 13, 2012 Author Share Posted March 13, 2012 (edited) But i found there is something with height that causes the player falling from yet 30 meters is being killed, also did you took adjustment as for situation when player is on skyscraper so that if he jumps on another BUT only 10 meters lower than first one, the distance that will count will be ONLY this 10 meters and without addition of global height that player is on in relation to main game ground level 0m ? Sorry for this, but but i feel in debt for You as maker of script, and until topic is fresh i just post what can be improved ;] Also if necessary i provide my help with all knowledge about an idea ;] And i test height by using this simple code, try yourself. NOTE: Change coord Z values (25.0; 27.5; 30.0) according to current needs of testing: // This file was decompiled using vicescm.ini published by http://gtag.gtagaming.com/opcode-database on 18.5.2011{$VERSION 2.1.1000}{$CLEO .cs}//-------------MAIN---------------0000: :NONAME_0wait 0 if and Player.Defined($PLAYER_CHAR)8118: not actor $PLAYER_ACTOR dead80E0: not player $PLAYER_CHAR drivingelse_jump @NONAME_0 jump @NONAME_1 :NONAME_1wait 0if00E1: key_pressed 0 4jf @NONAME_004C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 0.0 25.000A1: put_actor $player_actor at [email protected] [email protected] [email protected]: play_sound 1 at [email protected] [email protected] [email protected] 100000222: set_player $player_char health_to 10004C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 0.0 27.500A1: put_actor $player_actor at [email protected] [email protected] [email protected]: play_sound 1 at [email protected] [email protected] [email protected] 200018C: play_sound 1 at [email protected] [email protected] [email protected] 100000222: set_player $player_char health_to 10004C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 0.0 30.000A1: put_actor $player_actor at [email protected] [email protected] [email protected]: play_sound 1 at [email protected] [email protected] [email protected] 200018C: play_sound 1 at [email protected] [email protected] [email protected] 200018C: play_sound 1 at [email protected] [email protected] [email protected] 1000jump @NONAME_0 Edit: I am sure that mentioned thing is happening that when on skyscraper then putting player even 10 meters up from actual Z position, OR EVEN JUSY JUMPING ONCE IN PLACE xD kills player, so this addition of main/global height has to be taken out of the count... Edit2: I figured out that putting player on height and lettign him fall 27.5 doesn't kill him yet, but putting at 27.75 does, so the limit height seems to be somewhere between (27.5 ; 27.75) height; To see just use 27.5 ; 27.75 ; 28.0 values in test height script. Edit3: And it seems that i just forgot about that vice city streets are on some level , so those ~27 values added to level of the street ~= 40 meters, so sorry for it ;] But it still points to deducation that [email protected] value in your script count player height in relation to MAIN 0 meters level , and i think THIS kills player when jumping just using spacebar when at skyscraper rooftop, and also kills player when standing on street which is placed at height of about 11 - 12 meters plus putting player up +27 meters , that together ~40 ...so what we would need is to check player height in relation to GND at specified coords just like opcode: 02CE: $98 = ground_z $953 $954 50.0 ...well, i ll try to do sth about it myself, but i don't have any problems while You can take a look at it Yourself, thats even better , actually it is Your script I ' VE GOT SOLUTION!!! {$CLEO}thread 'Ashwin':0wait 0//05E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player pointer//[email protected] += 0x3C //<--- height Pos//05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 004C4: create_coordinate $falX $falY $falZ from_actor $player_actor offset 0.0 0.0 0.002CE: $falG = ground_z $falX $falY $falZ0009: $falG += 40.0 // floating-point values <--- THAT'S THE MAGIC LINE :P05E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<------ Player on ground 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 005E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0x244 //<------ current status05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0if and0034: $falZ >= $falG // (float)//[email protected] >= 1109393408 //<---- player is more than 40 m [email protected] == 0 //<---- & not on groundjf @0if [email protected] == 1 //<--- fall by [email protected] == 41 //<--- or a sucide loljf @[email protected] = 0:[email protected] += 105E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<---- player on ground05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0wait 0ifnot [email protected] == 1 //<---- not on ground yetjf @[email protected] >= 200 //<---------- aprox time taken to reach on ground from 40 mjf @1:3wait 0 05E0: [email protected] = read_memory 0x94AD28 size 4 virtual_protect 0 //<---- player [email protected] += 0xE6 //<--- player on ground05E0: [email protected] = read_memory [email protected] size 1 virtual_protect [email protected] == 1 //<--- reach on groundjf @30222: set_player $2 health_to 0 //<----- kill himjump @0 ...Just yet to be able to "play" dying animation just in the moment when player hits the ground, just before he performs roll, would look more realistic, right now i am thinking of it. Also desired "killing height" to ones needs can be adjusted by changing value in this line: 0009: $falG += 40.0 // floating-point values And sorry Y'all guys for so long post and frequent 'bumping' posts as machinegun Ashwin, You still alive ? Edited March 13, 2012 by MW_29 Link to comment Share on other sites More sharing options...
Link2012 Posted March 13, 2012 Share Posted March 13, 2012 God damn You Ash , it works as good as a good old AK ;D Now i am checking at what height it looks real to die from, if to adjust it to greater value, then should i just adjust [email protected] ?? You gave it 1109393408 and that's 0x42200000 as in HEX, ...so game height units on which player pointer operates on are ..in HEX, not DEC?! I mean i see 42200000 eee... -> 42 200 000 ...so somehow it resembles 40 meters? Or how am i supposed to understand it? Why so high/long number here? But i assume that it is value to change if wanted kill-height some value > than 40m, right ? 1109393408 -> 0x42200000 -> 4.0E1 -> 40.0 You can write [email protected] >= 40.0 instead. Link to comment Share on other sites More sharing options...
MW_29 Posted March 13, 2012 Author Share Posted March 13, 2012 (edited) thanks for explanation @Link2012, although i got rid of those lines connected with question for which You gave an answert, i am sure your hint could or will be useful somewhere in the near future Found anti-roll solution. Player hitting the ground seems to not do forward roll, but "performs" instant dying animation, when replaced this opcode: 0222: set_player $2 health_to 0 by that one: 0322: kill_player $player_char ...testing in progress, and i'm looking for bugs, not to mention those earlier already fixed ones, no new bugs found so far Edited March 13, 2012 by MW_29 Link to comment Share on other sites More sharing options...
Ashwin.Star Posted March 14, 2012 Share Posted March 14, 2012 @MW yeah i am still alive, i am not jumping from 40 m. ha ha anyway, i am using 4 byte value instead of float, because there is not a way to read float value from address, I'm sure that my script will not kill the player if not jumping from >40.0 m, even jumping from 40 m, jumping from building to another building can easily be done, tell me you want me to do it or your own! & thanks for appreciating my script, Link to comment Share on other sites More sharing options...
Link2012 Posted March 14, 2012 Share Posted March 14, 2012 i am using 4 byte value instead of float, A float is 4byte value... because there is not a way to read float value from address, It is possible and you did it!! The float is like any other 4byte value but with other format. [email protected] = 40.0, [email protected] will contains 1109393408 Example: [email protected] = [email protected] = 1109393408if 003B: [email protected] == [email protected]// will be trueend If you used [email protected] >= 40.0 Instead of [email protected] >= 1109393408, it will be the same. Link to comment Share on other sites More sharing options...
MW_29 Posted March 14, 2012 Author Share Posted March 14, 2012 @MWyeah i am still alive, i am not jumping from 40 m. ha ha anyway, i am using 4 byte value instead of float, because there is not a way to read float value from address, I'm sure that my script will not kill the player if not jumping from >40.0 m, even jumping from 40 m, jumping from building to another building can easily be done, tell me you want me to do it or your own! & thanks for appreciating my script, Well, thanks And to be honest and not to offend ...Your code actually DID that effect. Jumping while staying at the top of skyscraper, killed player, just and exactly like that general height was being counted in instead just height above ground level on specified X Y coord, and thats why i changed those lines so i got rid of it. Also i changed opcode that substracted player's health, to killing one, by this player hittign the ground after falling does NOT do forward roll, and is immidiatelly killed and does death anim, and that exactly is what i wanted, also if You want i can make vids from game showing both situations - the clear your code without my and code WITH my modification to show what i am talking about, ...but later when i get back from studies, not now Generally code looks like this , the satisfying code at least as for me , take a look: // This file was decompiled using vicescm.ini published by http://gtag.gtagaming.com/opcode-database on 18.5.2011{$VERSION 2.1.1000}{$CLEO .cs}//-------------MAIN---------------thread 'FALL' :FALL_10wait 0 if 80E0: not player $PLAYER_CHAR driving jf @FALL_10 04C4: create_coordinate $FALX $FALY $FALZ from_actor $PLAYER_ACTOR offset 0.0 0.0 0.0 02CE: $FALG = ground_z $FALX $FALY $FALZ $FALG += 52.25 // floating-point values 05E0: [email protected] = read_memory 9743656 size 4 virtual_protect 0 [email protected] += 230 // integer values 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 05E0: [email protected] = read_memory 9743656 size 4 virtual_protect 0 [email protected] += 580 // integer values 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 if and0034: $FALZ >= $FALG // floating-point values (never used in VC or GTA 3) [email protected] == 0 // integer values jf @FALL_10 if or [email protected] == 1 // integer values [email protected] == 41 // integer values jf @FALL_10 [email protected] = 0 // integer values :[email protected] += 1 // integer values 05E0: [email protected] = read_memory 9743656 size 4 virtual_protect 0 [email protected] += 230 // integer values 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 wait 0 if not [email protected] == 1 // integer values jf @FALL_10 if [email protected] >= 250 // integer values jf @FALL_209 :FALL_291wait 0 05E0: [email protected] = read_memory 9743656 size 4 virtual_protect 0 [email protected] += 230 // integer values 05E0: [email protected] = read_memory [email protected] size 1 virtual_protect 0 if [email protected] == 1 // integer values jf @FALL_291 018C: play_sound 61 at $FALX $FALY $FALZ 0322: kill_player $PLAYER_CHAR jump @FALL_10 NOTE, i added boxes crushing sound at the end so instead soundless hitting the ground i have sth like bone crushing ;D Link to comment Share on other sites More sharing options...
Ashwin.Star Posted March 14, 2012 Share Posted March 14, 2012 Nice, ------------ no need to check for driving, [email protected] == 1 //<---- if player not driving [email protected] == 41 // <---- if jumping 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