MKKJ Posted May 20, 2016 Share Posted May 20, 2016 I've been trying to make Special ability script, which I've done before and turns out to be a mess. So i tried to rewrite all over and make significant changes as well and turned out to another mess. Here's the three scripts (Yes, three scripts trying to communicate with each other, figures...) Note that these scripts have many unused lines commented out, it's just a mess but may give you a hint what i've tried to do. ability_skill.cs This script handles 'skill meter' for the ability, managing events that will gain this skill. Also additional in-game notifications. {$CLEO .cs}//-------------MAIN---------------thread 'MKADRS' :ADRENALINE_INITif0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE_INITwait 00007: [email protected] = 0.0 // Skill Value0007: [email protected] = 0.0 // Skill Gain Value0226: [email protected] = actor $PLAYER_ACTOR health // Temp. Health 0006: [email protected] = 00006: [email protected] = 00652: [email protected] = integer_stat 121 // Temp. Kill Count0652: [email protected] = integer_stat 130 // Temp. Headshot Count0006: [email protected] = 00006: [email protected] = 00A95: enable_thread_saving//--------------------------------:ADRENALINEwait 0if0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE//--------------------------------- :SKILL_RAISE_KILL0652: [email protected] = integer_stat 121 0652: [email protected] = integer_stat 121 0062: [email protected] -= [email protected] // (int)0085: [email protected] = [email protected] // (int)if0019: [email protected] > 0else_jump @SKILL_RAISE_HEADSHOT0012: [email protected] *= 20093: [email protected] = integer [email protected] to_float005B: [email protected] += [email protected] // (float)if0019: [email protected] > 1else_jump @SKILL_RAISE_KILL_QUICK0086: [email protected] = [email protected] // (float)000F: [email protected] -= 2.0005B: [email protected] += [email protected] // (float):SKILL_RAISE_KILL_QUICKwait 0if0019: [email protected] > 0then0006: [email protected] = -2500else005B: [email protected] += [email protected] // (float)0006: [email protected] = -2500end:SKILL_RAISE_HEADSHOT0652: [email protected] = integer_stat 1300652: [email protected] = integer_stat 1300062: [email protected] -= [email protected] // (int)0085: [email protected] = [email protected] // (int)if0019: [email protected] > 0else_jump @SKILL_RAISE_DAMAGE0012: [email protected] *= 20093: [email protected] = integer [email protected] to_float005B: [email protected] += [email protected] // (float):SKILL_RAISE_DAMAGE0226: [email protected] = actor $PLAYER_ACTOR health0062: [email protected] -= [email protected] // (int)if001B: 0 > [email protected]: [email protected] *= -10093: [email protected] = integer [email protected] to_float0017: [email protected] /= 10.0005A: [email protected] += [email protected] // (float)end0226: [email protected] = actor $PLAYER_ACTOR health :SKILL_THREAD_TIMERwait 0if0019: [email protected] > 0else_jump @SKILL_RAISE:SKILL_RAISE_PINCH0653: [email protected] = float_stat 240017: [email protected] /= 22.760092: [email protected] = float [email protected] to_integer0226: [email protected] = actor $PLAYER_ACTOR health if0025: [email protected] > [email protected] // (float)else_jump @SKILL_RAISE_SPEED000B: [email protected] += 0.05:SKILL_RAISE_SPEEDwait 0if00DF: actor $PLAYER_ACTOR drivingelse_jump @SKILL_TIMERRESET03C0: [email protected] = actor $PLAYER_ACTOR car02E3: [email protected] = car [email protected] speedif0031: [email protected] >= 30.0else_jump @SKILL_TIMERRESET000B: [email protected] += 0.05:SKILL_TIMERRESET0006: [email protected] = -1000//--------------------------------- :SKILL_RAISE//0AD1: show_formatted_text_highpriority "%f %f~n~%d~n~%d" time 2000 [email protected] [email protected] [email protected] [email protected] 0005B: [email protected] += [email protected] // (float)0007: [email protected] = 0.0if0031: [email protected] >= 1000.0then0007: [email protected] = 1000.0end//0088: $166 = [email protected] // (float)//==================================:ADRENALINE_INTRO_NOTIF0AAA: [email protected] = thread 'MKADRE' pointer000A: [email protected] += 0x50 // Offset to [email protected] of MKADRE0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00871: init_jump_table [email protected] total_jumps 4 default_jump 0 @ADRENALINE_STATNOTIF jumps 0 @ADRENALINE_INTRO_1 1 @ADRENALINE_INTRO_2 2 @ADRENALINE_INTRO_3 3 @ADRENALINE_INTRO_4 -1 @ADRENALINE_STATNOTIF -1 @ADRENALINE_STATNOTIF -1 @ADRENALINE_STATNOTIF:ADRENALINE_INTRO_1wait 0if and0039: [email protected] == 188FE: not text_box_displayedelse_jump @ADRENALINE_STATNOTIF03E5: show_text_box 'ADREN_W' // Adrenaline ability can be activated to slows down time by raising focus, allowing you to make quick move over your surroundings.0006: [email protected] = 1wait 500jump @ADRENALINE_STATNOTIF:ADRENALINE_INTRO_2wait 0if88FE: not text_box_displayedelse_jump @ADRENALINE_STATNOTIF03E5: show_text_box 'ADREN_X' // Adrenaline bar represents how long you can activate this ability. The bar will slowly increase back to its maximum while adrenaline inactive and decrease while active.0151: remove_status_text $MKKJ_Adrenaline04F7: status_text $MKKJ_Adrenaline type 1 line 4 GXT 'ADREN_1' // global_variable059C: enable_status_text $MKKJ_Adrenaline flashing 1 // global_variable0006: [email protected] = 2wait 500jump @ADRENALINE_STATNOTIF:ADRENALINE_INTRO_3wait 0if88FE: not text_box_displayedelse_jump @ADRENALINE_STATNOTIF03E5: show_text_box 'ADREN_Y' // You can increase your ability with fast-paced activities such as exercising, improving your accuracy, speeding or surviving in hard situation.0006: [email protected] = 3wait 500jump @ADRENALINE_STATNOTIF:ADRENALINE_INTRO_4wait 0if88FE: not text_box_displayedelse_jump @ADRENALINE_STATNOTIF03E5: show_text_box 'ADREN_Z' // Increasing this skill will increase it's maximum storage capacity, which directly affects how long adrenaline lasts.0006: [email protected] = 4wait 500//==================================:ADRENALINE_STATNOTIF0871: init_jump_table [email protected] total_jumps 5 default_jump 0 @ADRENALINE jumps 0 @ADRENALINE_STATNOTIF_1 1 @ADRENALINE_STATNOTIF_2 2 @ADRENALINE_STATNOTIF_3 3 @ADRENALINE_STATNOTIF_4 4 @ADRENALINE_STATNOTIF_5 -1 @ADRENALINE -1 @ADRENALINE:ADRENALINE_STATNOTIF_1wait 0if0031: [email protected] >= 200.0else_jump @ADRENALINEif88FE: not text_box_displayedelse_jump @ADRENALINE03E5: show_text_box 'ADREN_4' // ~h~Adrenaline~w~ - Obtained. You can now activate Adrenaline ability to slow down time.0006: [email protected] = 1:ADRENALINE_STATNOTIF_2wait 0if0031: [email protected] >= 400.0else_jump @ADRENALINEif88FE: not text_box_displayedelse_jump @ADRENALINE03E5: show_text_box 'ADREN_5' // ~h~Adrenaline~w~ - Upgraded. You can now activate this ability for longer.0006: [email protected] = 2:ADRENALINE_STATNOTIF_3wait 0if0031: [email protected] >= 600.0else_jump @ADRENALINEif88FE: not text_box_displayedelse_jump @ADRENALINE03E5: show_text_box 'ADREN_6' // ~h~Adrenaline~w~ - Upgraded. You can now activate this ability noticeably for longer.0006: [email protected] = 3:ADRENALINE_STATNOTIF_4wait 0if0031: [email protected] >= 800.0else_jump @ADRENALINEif88FE: not text_box_displayedelse_jump @ADRENALINE03E5: show_text_box 'ADREN_7' // ~h~Adrenaline~w~ - Upgraded. You can now activate this ability even longer.0006: [email protected] = 4:ADRENALINE_STATNOTIF_5wait 0if0031: [email protected] >= 1000.0else_jump @ADRENALINEif88FE: not text_box_displayedelse_jump @ADRENALINE03E5: show_text_box 'ADREN_9' // ~h~Adrenaline~w~ - Upgraded. Maximum reached.0006: [email protected] = 5jump @ADRENALINE ability_bar.cs This script handles ability bar meter that will be used to activate ability. Like skill, this meter also increases with certain events. {$CLEO .cs}//-------------MAIN---------------thread 'MKADRB':INITwait 0 if0256: player $PLAYER_CHAR definedelse_jump @INITwait 5000AAA: [email protected] = thread 'MKADRS' pointer000A: [email protected] += 0x3C // Offset to [email protected] of MKADRS:STAT0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AD1: show_formatted_text_highpriority "%f" time 500 [email protected] 0if0031: [email protected] >= 200.0else_jump @STAT0006: [email protected] = 0//0005: $166 = 1000.0//0089: [email protected] = $166 // (float)//0007: [email protected] = 1000.00092: [email protected] = float [email protected] to_integer0012: [email protected] *= 100006: [email protected] = 00652: [email protected] = integer_stat 1210226: [email protected] = actor $PLAYER_ACTOR health0652: [email protected] = integer_stat 1300A95: enable_thread_saving:FIRSTwait 0if0256: player $PLAYER_CHAR definedelse_jump @FIRST0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00092: [email protected] = float [email protected] to_integer0012: [email protected] *= 100AAA: [email protected] = thread 'MKADRE' pointer000A: [email protected] += 0x50 // Offset to [email protected] of MKADRE0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if0039: [email protected] == 0else_jump @ACTIVE//--------------------------------- :BAR_RAISE_KILL 0652: [email protected] = integer_stat 121 0062: [email protected] -= [email protected] // (int)0652: [email protected] = integer_stat 121if0019: [email protected] > 0else_jump @BAR_RAISE_HEADSHOT0012: [email protected] *= 200005A: [email protected] += [email protected] // (int)if0019: [email protected] > 1else_jump @BAR_RAISE_KILL_QUICK0085: [email protected] = [email protected] // (int)000E: [email protected] -= 200005A: [email protected] += [email protected] // (int):BAR_RAISE_KILL_QUICKwait 0if0019: [email protected] > 0then0006: [email protected] = -2500else005A: [email protected] += [email protected] // (int)0006: [email protected] = -2500end:BAR_RAISE_HEADSHOT0652: [email protected] = integer_stat 1300062: [email protected] -= [email protected] // (int)0652: [email protected] = integer_stat 130if0019: [email protected] > 0else_jump @BAR_RAISE_DAMAGE0085: [email protected] = [email protected] // (int)006A: [email protected] *= [email protected] // (int)0012: [email protected] *= 200005A: [email protected] += [email protected] // (int):BAR_RAISE_DAMAGE0226: [email protected] = actor $PLAYER_ACTOR health0062: [email protected] -= [email protected] // (int)0226: [email protected] = actor $PLAYER_ACTOR health if001B: 0 > [email protected]_jump @BAR_THREAD_TIMER0012: [email protected] *= -10005A: [email protected] += [email protected] // (float):BAR_THREAD_TIMERwait 0if0019: [email protected] > 0else_jump @BAR_RAISE:BAR_RAISE_PINCH0653: [email protected] = float_stat 240017: [email protected] /= 22.760092: [email protected] = float [email protected] to_integer0226: [email protected] = actor $PLAYER_ACTOR health if0025: [email protected] > [email protected] // (float)else_jump @BAR_RAISE_SPEED000A: [email protected] += 67:BAR_RAISE_SPEEDwait 0if00DF: actor $PLAYER_ACTOR drivingelse_jump @BAR_TIMERRESET03C0: [email protected] = actor $PLAYER_ACTOR car02E3: [email protected] = car [email protected] speedif0031: [email protected] >= 30.0else_jump @BAR_TIMERRESET000A: [email protected] += 34:BAR_TIMERRESET0006: [email protected] = -1000//--------------------------------- :BAR_RAISE0AD1: show_formatted_text_highpriority "%d %d %d~n~%d" time 2000 [email protected] [email protected] [email protected] [email protected]: [email protected] += [email protected] // (int)0006: [email protected] = 0if002B: 0 >= [email protected]_jump @END0006: [email protected] = 0:END0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0//0089: [email protected] = $166 // (float)0092: [email protected] = float [email protected] to_integer0012: [email protected] *= 10if002D: [email protected] >= [email protected] // (int)else_jump @FIRST0085: [email protected] = [email protected] // (int)jump @FIRST//===============================:ACTIVE0AAA: [email protected] = thread 'MKADRE' pointer000A: [email protected] += 0x50 // Offset to [email protected] of MKADRE0AAA: [email protected] = thread 'MKADRE' pointer000A: [email protected] += 0xBC // Offset to [email protected] of MKADRE:ACTIVE_LOOP0AD1: show_formatted_text_highpriority "~r~Active~s~ %d~n~%d %d %d~n~%d" time 2000 [email protected] [email protected] [email protected] [email protected] [email protected]: [email protected] = read_memory [email protected] size 4 virtual_protect 00A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0wait 0if0039: [email protected] == 1else_jump @ACTIVE_READjump @ACTIVE_LOOP:ACTIVE_READ0012: [email protected] *= -10652: [email protected] = integer_stat 1210226: [email protected] = actor $PLAYER_ACTOR healthjump @FIRST ability_exec.cs This script is the one that activates the ability, and shows status meter. I don't want to disturb the keypress response, so i separate scripts above. {$CLEO .cs}//-------------MAIN---------------thread 'MKADRE':ADRENALINE_0wait 10000AAA: [email protected] = thread 'MKADRS' pointer000A: [email protected] += 0x3C // Offset to [email protected] of MKADRS0AAA: [email protected] = thread 'MKADRB' pointer000A: [email protected] += 0x3C // Offset to [email protected] of MKADRB:ADRENALINE_1wait 00006: [email protected] = 820004: $10927 = 0:ADRENALINE_4wait 0 if0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE_40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0wait 0if0031: [email protected] >= 200.0else_jump @ADRENALINE_4//0089: [email protected] = $166 // (float)//0007: [email protected] = 1000.0 // Adrenaline Skill0092: [email protected] = float [email protected] to_integer0012: [email protected] *= 10 // Adrenaline Time Active Max0085: [email protected] = [email protected] // (int)0016: [email protected] /= -100 // Adrenaline Bar Divider while Active0085: [email protected] = [email protected] // (int)0012: [email protected] *= -1 // Adrenaline Bar Divider while Inactive:ADRENALINE_20wait 00151: remove_status_text $109270ADF: add_dynamic_GXT_entry "ADRENAL" text "Adrenaline"0004: $10927 = 004F7: status_text $10927 type 1 line 4 GXT 'ADRENAL' // global_variable059C: enable_status_text $10927 flashing 0 // global_variable0006: [email protected] = 0wait 100//====================================================:ADRENALINE_25wait 0if0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE_25//0089: [email protected] = $166 // (float)0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // Adrenaline Skill0092: [email protected] = float [email protected] to_integer0012: [email protected] *= 10 // Adrenaline Time Active Max0085: [email protected] = [email protected] // (int)0016: [email protected] /= -100 // Adrenaline Bar Divider while Active0085: [email protected] = [email protected] // (int)0012: [email protected] *= -1 :ADRENALINE_290A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0008A: $MKKJ_Adrenaline = [email protected] // (int)0074: $MKKJ_Adrenaline /= [email protected] // (int)wait 0if001D: [email protected] > [email protected] // (int)else_jump @ADRENALINE_330151: remove_status_text $10927:ADRENALINE_33wait 0if and0039: [email protected] == 18AB0: not key_pressed [email protected]_jump @ADRENALINE_360006: [email protected] = 0:ADRENALINE_36wait 0if and0019: [email protected] > 1000AB0: key_pressed [email protected]: [email protected] == 0else_jump @ADRENALINE_25//====================================================:ADRENALINE_62wait 00169: set_fade_color_RGB 255 255 255016A: fade 0 time 1004F7: status_text $10927 type 1 line 4 GXT 'ADRENAL' // global_variable059C: enable_status_text $10927 flashing 0 // global_variableActor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 1)0016: [email protected] /= -10085: [email protected] = [email protected] // (int)0006: [email protected] = 10006: [email protected] = 10946: set_actor $PLAYER_ACTOR actions_uninterupted_by_weapon_fire 1093B: set_actor $PLAYER_ACTOR upper_body_damage_anims_only 1wait 10015D: set_gamespeed 0.33016A: fade 1 time 10:ADRENALINE_63008A: $10927 = [email protected] // (int)0074: $10927 /= [email protected] // (int):ADRENALINE_67wait 0if and0039: [email protected] == 18AB0: not key_pressed [email protected]_jump @ADRENALINE_700006: [email protected] = 0:ADRENALINE_70wait 0 if and0039: [email protected] == 00AB0: key_pressed [email protected]_jump @ADRENALINE_74jump @ADRENALINE_80:ADRENALINE_74wait 0if or8256: not player $PLAYER_CHAR defined0019: [email protected] > 00117: player $PLAYER_CHAR wasted0741: actor $PLAYER_ACTOR bustedelse_jump @ADRENALINE_63:ADRENALINE_800169: set_fade_color_RGB 255 255 2550006: [email protected] = 1016A: fade 0 time 50015D: set_gamespeed 1.0Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)0946: set_actor $PLAYER_ACTOR actions_uninterupted_by_weapon_fire 0093B: set_actor $PLAYER_ACTOR upper_body_damage_anims_only 00006: [email protected] = 00006: [email protected] = 1wait 50016A: fade 1 time 500169: set_fade_color_RGB 0 0 0jump @ADRENALINE_25//==================================================== My main problem is inevitable crash whenever i save and load the game. Maybe because thread saving and uneven starting label. Then again i use thread saving because i have no idea where to store these important values. Unused stats not quite helping, Global vars neither. Although i might use Global vars for last resort. Another problem is how these scripts communicate, one thread reads other thread's local vars via memaddress, which i still think risky. You might notice there's some global vars commented out. I was using this global var for testing these scripts way back and just replaced it with memory address reading, only to found out the game crashes immediately after unlocked the ability (the skill value need to reach 200.0 before ability actives). I'd appreciate it if someone could look into these and give me solution or pointing mistakes i haven't noticed. And maybe suggestion to make this script a bit... cleaner. I've been stuck for awhile now and decided to take a break. Or in short "plz help" Link to comment Share on other sites More sharing options...
Silent Posted May 20, 2016 Share Posted May 20, 2016 (edited) My main problem is inevitable crash whenever i save and load the game. Maybe because thread saving and uneven starting label. Then again i use thread saving because i have no idea where to store these important values. Unused stats not quite helping, Global vars neither. Although i might use Global vars for last resort. Probably best to save to a separate binary file and then let the script read from it on startup. Script saving is fishy. Another problem is how these scripts communicate, one thread reads other thread's local vars via memaddress, which i still think risky. Nope - if done properly, it's probably the best and least invasive method. It's reliable too. You'd probably be able to join the scripts into a single script, too. EDIT: The game probably crashes (or precisely, freezes) because you didn't put any waits in the first ADRENALINE_INIT check? Edited May 20, 2016 by Silent Link to comment Share on other sites More sharing options...
MKKJ Posted May 21, 2016 Author Share Posted May 21, 2016 (edited) The game probably crashes (or precisely, freezes) because you didn't put any waits in the first ADRENALINE_INIT check? Oh yeah, that's one. Another one is reading memory from overwrited variable. Must be real tired to miss these for almost an hour. Probably best to save to a separate binary file and then let the script read from it on startup. Tell me more, i have no idea what you mean by save to another binary file. You mean other script? I think i will give up this thread saving since i found another crash after load. (I really mean crash, i start to differentiate it with freeze now) Edited May 21, 2016 by MKKJ Link to comment Share on other sites More sharing options...
Silent Posted May 21, 2016 Share Posted May 21, 2016 Depends on how frequent your writes would be. I would handle it by ensuring all data you need saved is stored in a single script (and read from it by the other scripts). @Deji used this method to check whether the user has just saved the game (note: untested): if [email protected] == 1then 0A8D: [email protected] = read_memory 0xBA68A6 size 1 virtual_protect 0 // CMenuManager.m_bLastScreen if or [email protected] == 18 // Save Complete Screen [email protected] == 19 // Save Complete Screen 2 then 0A8D: [email protected] = read_memory 0xBA68A7 size 1 virtual_protect 0 // CMenuManager.m_bSelectedSaveGame // Save the data here... endend 0A8D: [email protected] = read_memory 0xBA67A7 size 1 virtual_protect 0With m_bSelectedSaveGame obtained, you know what slot the user saved to so you can save your data like this (note: requires CLEO4): 0AC8: [email protected] = allocate_memory_size 2600AD3: [email protected] = format "ability\save%d.sav" [email protected] 0A9A: [email protected] = openfile [email protected] mode "wb" // IF and SETthen 0A9E: writefile [email protected] size 4 from [email protected] 0A9E: writefile [email protected] size 4 from [email protected] 0A9B: closefile [email protected]: free_allocated_memory [email protected]assuming variables you want to save are [email protected] and [email protected] - you can obviously save as many variables as you want. If this is all done correctly, loading data on script startup is trivial: // Determine whether we're on a loaded game.0652: [email protected] = integer_stat 136if [email protected] > 0then 0A8D: [email protected] = read_memory 0xBA68A7 size 1 virtual_protect 0 // CMenuManager.m_bSelectedSaveGame 0AC8: [email protected] = allocate_memory_size 260 0AD3: [email protected] = format "ability\save%d.sav" [email protected] if 0A9A: [email protected] = openfile [email protected] mode "rb" // IF and SET then 0A9D: readfile [email protected] size 4 to [email protected] 0A9D: readfile [email protected] size 4 to [email protected] 0A9B: closefile [email protected] end 0AC9: free_allocated_memory [email protected] Joys of making CLEOs which need to save data... ugh. By the way, you can remove all global variables from your scripts easily. Replace $PLAYER_CHAR with 0, obtain your local player handle by using this at the beginning of the script 01F5: [email protected] = get_player_actor 0(so you can use [email protected] where you used $PLAYER_ACTOR) Status texts are tricky though. I'm not aware of any tutorials on how to use them without globals in English, so linking to my non-English one - the functions are named like their SCM counterparts though, so you should be able to make something out of it): http://www.gta-mods.pl/artykuly/48/liczniki-timery (see "Dla zaawansowanych" section). You can also grab an example script using those here: http://www.gta-mods.pl/pliki/497/pasek-stanu-przyklad-w-cleo It also includes a CLEO4-only version (using 0AC6 and 0AC7 directly instead of its CLEO3 counterparts). MKKJ 1 Link to comment Share on other sites More sharing options...
MKKJ Posted May 21, 2016 Author Share Posted May 21, 2016 (edited) Allright, I've tried the first suggestion, i made fourth script with 0A95 that does nothing but stuck in wait loops while other threads manipulate its local vars with 0A8C. Though, damn, four scripts for this, i have no idea how to merge them (yet) so i might really need help for this. Global vars arent much concern for me though, $PLAYER_CHAR and $PLAYER_ACTOR are cool after all. $MKKJ_Adrenaline is assigned in my SB CustomVars as $10942, which seems like unused in default main.scm. This is how the script turned out Feel free to point out unnecessary details or mistakes. ability_skill.cs {$CLEO .cs}//-------------MAIN---------------thread 'MKADRS' :ADRENALINE_INITwait 0if0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE_INIT0AAA: [email protected] = thread 'MKADRV' pointerwait 0if8039: not [email protected] == 0else_jump @ADRENALINE_INIT0AAA: [email protected] = thread 'MKADRV' pointer000A: [email protected] += 0x3C // Offset to [email protected] of MKADRV000A: [email protected] += 0x40 // Offset to [email protected] of MKADRV0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00226: [email protected] = actor $PLAYER_ACTOR health // Temp. Health 0652: [email protected] = integer_stat 121 // Temp. Kill Count0652: [email protected] = integer_stat 130 // Temp. Headshot Count0006: [email protected] = 00006: [email protected] = 0//--------------------------------:ADRENALINEwait 0if0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 0//--------------------------------- :SKILL_RAISE_KILL0652: [email protected] = integer_stat 121 0652: [email protected] = integer_stat 121 0062: [email protected] -= [email protected] // (int)0085: [email protected] = [email protected] // (int)if0019: [email protected] > 0else_jump @SKILL_RAISE_HEADSHOT0012: [email protected] *= 20093: [email protected] = integer [email protected] to_float005B: [email protected] += [email protected] // (float)if0019: [email protected] > 1else_jump @SKILL_RAISE_KILL_QUICK0086: [email protected] = [email protected] // (float)000F: [email protected] -= 2.0005B: [email protected] += [email protected] // (float):SKILL_RAISE_KILL_QUICKwait 0if0019: [email protected] > 0then0006: [email protected] = -2500else005B: [email protected] += [email protected] // (float)0006: [email protected] = -2500end:SKILL_RAISE_HEADSHOT0652: [email protected] = integer_stat 1300652: [email protected] = integer_stat 1300062: [email protected] -= [email protected] // (int)0085: [email protected] = [email protected] // (int)if0019: [email protected] > 0else_jump @SKILL_RAISE_DAMAGE0012: [email protected] *= 20093: [email protected] = integer [email protected] to_float005B: [email protected] += [email protected] // (float):SKILL_RAISE_DAMAGE0226: [email protected] = actor $PLAYER_ACTOR health0062: [email protected] -= [email protected] // (int)if001B: 0 > [email protected]: [email protected] *= -10093: [email protected] = integer [email protected] to_float0017: [email protected] /= 10.0005A: [email protected] += [email protected] // (float)end0226: [email protected] = actor $PLAYER_ACTOR health :SKILL_THREAD_TIMERwait 0if0019: [email protected] > 0else_jump @SKILL_RAISE:SKILL_RAISE_PINCH0653: [email protected] = float_stat 240017: [email protected] /= 22.760092: [email protected] = float [email protected] to_integer0226: [email protected] = actor $PLAYER_ACTOR health if0025: [email protected] > [email protected] // (float)else_jump @SKILL_RAISE_SPEED000B: [email protected] += 0.05:SKILL_RAISE_SPEEDwait 0if00DF: actor $PLAYER_ACTOR drivingelse_jump @SKILL_TIMERRESET03C0: [email protected] = actor $PLAYER_ACTOR car02E3: [email protected] = car [email protected] speedif0031: [email protected] >= 30.0else_jump @SKILL_TIMERRESET000B: [email protected] += 0.05:SKILL_TIMERRESET0006: [email protected] = -1000//--------------------------------- :SKILL_RAISE//0AD1: show_formatted_text_highpriority "%f %f~n~%d~n~%d" time 2000 [email protected] [email protected] [email protected] [email protected] 0if0031: [email protected] >= 50.0else_jump @SKILL_LIMIT//005B: [email protected] += [email protected] // (float)000B: [email protected] += 50.0000F: [email protected] -= 50.0jump @SKILL_RAISE:SKILL_LIMITif0031: [email protected] >= 1000.0then0007: [email protected] = 1000.0endjump @ADRENALINE ability_bar.cs {$CLEO .cs}//-------------MAIN---------------thread 'MKADRB':INITwait 0if0256: player $PLAYER_CHAR definedelse_jump @INIT0AAA: [email protected] = thread 'MKADRS' pointer0AAA: [email protected] = thread 'MKADRE' pointer0AAA: [email protected] = thread 'MKADRV' pointerwait 0if and8039: not [email protected] == 08039: not [email protected] == 08039: not [email protected] == 0else_jump @INITwait 5000AAA: [email protected] = thread 'MKADRE' pointer000A: [email protected] += 0xBC // Offset to [email protected] of MKADRE000A: [email protected] += 0x3C // Offset to [email protected] of MKADRS000A: [email protected] += 0x50 // Offset to [email protected] of MKADRE000A: [email protected] += 0x44 // Offset to [email protected] of MKADRV:STAT0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0//0AD1: show_formatted_text_highpriority "%f" time 500 [email protected] 0if0031: [email protected] >= 200.0else_jump @STAT0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00092: [email protected] = float [email protected] to_integer0012: [email protected] *= 100006: [email protected] = 00652: [email protected] = integer_stat 1210226: [email protected] = actor $PLAYER_ACTOR health0652: [email protected] = integer_stat 130//========================================:FIRSTwait 0if0256: player $PLAYER_CHAR definedelse_jump @FIRST0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00092: [email protected] = float [email protected] to_integer0012: [email protected] *= 100A8C: write_memory [email protected] size 4 value [email protected] virtual_protect 00A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if0039: [email protected] == 0else_jump @ACTIVE//--------------------------------- :BAR_RAISE_KILL0652: [email protected] = integer_stat 121 0062: [email protected] -= [email protected] // (int)0652: [email protected] = integer_stat 121if0019: [email protected] > 0else_jump @BAR_RAISE_HEADSHOT0012: [email protected] *= 200005A: [email protected] += [email protected] // (int)if0019: [email protected] > 1else_jump @BAR_RAISE_KILL_QUICK0085: [email protected] = [email protected] // (int)000E: [email protected] -= 200005A: [email protected] += [email protected] // (int):BAR_RAISE_KILL_QUICKwait 0if0019: [email protected] > 0then0006: [email protected] = -2500else005A: [email protected] += [email protected] // (int)0006: [email protected] = -2500end:BAR_RAISE_HEADSHOT0652: [email protected] = integer_stat 1300062: [email protected] -= [email protected] // (int)0652: [email protected] = integer_stat 130if0019: [email protected] > 0else_jump @BAR_RAISE_DAMAGE0085: [email protected] = [email protected] // (int)006A: [email protected] *= [email protected] // (int)0012: [email protected] *= 200005A: [email protected] += [email protected] // (int):BAR_RAISE_DAMAGE0226: [email protected] = actor $PLAYER_ACTOR health0062: [email protected] -= [email protected] // (int)0226: [email protected] = actor $PLAYER_ACTOR health if001B: 0 > [email protected]_jump @BAR_THREAD_TIMER0012: [email protected] *= -10005A: [email protected] += [email protected] // (float):BAR_THREAD_TIMERwait 0if0019: [email protected] > 0else_jump @BAR_RAISE:BAR_RAISE_PINCH0653: [email protected] = float_stat 240017: [email protected] /= 22.760092: [email protected] = float [email protected] to_integer0226: [email protected] = actor $PLAYER_ACTOR health if0025: [email protected] > [email protected] // (float)else_jump @BAR_RAISE_SPEED000A: [email protected] += 67:BAR_RAISE_SPEEDwait 0if00DF: actor $PLAYER_ACTOR drivingelse_jump @BAR_TIMERRESET03C0: [email protected] = actor $PLAYER_ACTOR car02E3: [email protected] = car [email protected] speedif0031: [email protected] >= 30.0else_jump @BAR_TIMERRESET000A: [email protected] += 34:BAR_TIMERRESET0006: [email protected] = -1000//--------------------------------- :BAR_RAISE//0AD1: show_formatted_text_highpriority "%d %d %d~n~%d" time 2000 [email protected] [email protected] [email protected] [email protected]: [email protected] += [email protected] // (int)0006: [email protected] = 0if002B: 0 >= [email protected]_jump @END0006: [email protected] = 0:ENDif002D: [email protected] >= [email protected] // (int)else_jump @FIRST0085: [email protected] = [email protected] // (int)jump @FIRST//===============================:ACTIVE0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0wait 0if0039: [email protected] == 1else_jump @ACTIVE_READjump @ACTIVE:ACTIVE_READ0012: [email protected] *= -10652: [email protected] = integer_stat 1210226: [email protected] = actor $PLAYER_ACTOR healthjump @FIRST ability_exec.cs {$CLEO .cs}//-------------MAIN---------------thread 'MKADRE':ADRENALINE_0wait 0if0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE_00AAA: [email protected] = thread 'MKADRS' pointer0AAA: [email protected] = thread 'MKADRB' pointerif and8039: not [email protected] == 08039: not [email protected] == 0else_jump @ADRENALINE_0wait 1000000A: [email protected] += 0x3C // Offset to [email protected] of MKADRS000A: [email protected] += 0x3C // Offset to [email protected] of MKADRB:ADRENALINE_1wait 00006: [email protected] = 820004: $MKKJ_Adrenaline = 0:ADRENALINE_4wait 0 if0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE_40A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0wait 0if0031: [email protected] >= 200.0else_jump @ADRENALINE_40092: [email protected] = float [email protected] to_integer0012: [email protected] *= 10 // Adrenaline Time Active Max0085: [email protected] = [email protected] // (int)0016: [email protected] /= -100 // Adrenaline Bar Divider while Active0085: [email protected] = [email protected] // (int)0012: [email protected] *= -1 // Adrenaline Bar Divider while Inactive:ADRENALINE_20wait 00151: remove_status_text $MKKJ_Adrenaline0ADF: add_dynamic_GXT_entry "ADRENAL" text "Adrenaline"0004: $MKKJ_Adrenaline = 004F7: status_text $MKKJ_Adrenaline type 1 line 4 GXT 'ADRENAL' // global_variable059C: enable_status_text $MKKJ_Adrenaline flashing 0 // global_variable0006: [email protected] = 0wait 100//====================================================:ADRENALINE_25wait 0if0256: player $PLAYER_CHAR definedelse_jump @ADRENALINE_250A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 // Adrenaline Skill0092: [email protected] = float [email protected] to_integer0012: [email protected] *= 10 // Adrenaline Time Active Max0085: [email protected] = [email protected] // (int)0016: [email protected] /= -100 // Adrenaline Bar Divider while Active0085: [email protected] = [email protected] // (int)0012: [email protected] *= -1 :ADRENALINE_290A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0008A: $MKKJ_Adrenaline = [email protected] // (int)0074: $MKKJ_Adrenaline /= [email protected] // (int):ADRENALINE_33wait 0if and0039: [email protected] == 18AB0: not key_pressed [email protected]_jump @ADRENALINE_360006: [email protected] = 0:ADRENALINE_36wait 0if and0019: [email protected] > 1000AB0: key_pressed [email protected]: [email protected] == 0else_jump @ADRENALINE_25//====================================================:ADRENALINE_62wait 00169: set_fade_color_RGB 255 255 255016A: fade 0 time 1004F7: status_text $MKKJ_Adrenaline type 1 line 4 GXT 'ADRENAL' // global_variable059C: enable_status_text $MKKJ_Adrenaline flashing 0 // global_variable0016: [email protected] /= -10085: [email protected] = [email protected] // (int)0006: [email protected] = 10006: [email protected] = 10946: set_actor $PLAYER_ACTOR actions_uninterupted_by_weapon_fire 1093B: set_actor $PLAYER_ACTOR upper_body_damage_anims_only 1wait 10015D: set_gamespeed 0.33016A: fade 1 time 10:ADRENALINE_63008A: $MKKJ_Adrenaline = [email protected] // (int)0074: $MKKJ_Adrenaline /= [email protected] // (int):ADRENALINE_67wait 0if and0039: [email protected] == 18AB0: not key_pressed [email protected]_jump @ADRENALINE_700006: [email protected] = 0:ADRENALINE_70wait 0 if and0039: [email protected] == 00AB0: key_pressed [email protected]_jump @ADRENALINE_74jump @ADRENALINE_80:ADRENALINE_74wait 0if or8256: not player $PLAYER_CHAR defined0019: [email protected] > 00117: player $PLAYER_CHAR wasted0741: actor $PLAYER_ACTOR bustedelse_jump @ADRENALINE_63:ADRENALINE_800169: set_fade_color_RGB 255 255 2550006: [email protected] = 1016A: fade 0 time 50015D: set_gamespeed 1.00946: set_actor $PLAYER_ACTOR actions_uninterupted_by_weapon_fire 0093B: set_actor $PLAYER_ACTOR upper_body_damage_anims_only 00006: [email protected] = 00006: [email protected] = 1wait 50016A: fade 1 time 500169: set_fade_color_RGB 0 0 0jump @ADRENALINE_25 ability_save.cs {$CLEO .cs}//-------------MAIN---------------thread 'MKADRV' :INITwait 0if0256: player $PLAYER_CHAR definedelse_jump @INIT:START0007: [email protected] = 0.0 // Skill0006: [email protected] = 0 // Skill Gain0006: [email protected] = 0 // Bar0A95: enable_thread_saving:LOOP_Await 1000//0AD1: show_formatted_text_highpriority "%f %f~n~%d" time 1000 [email protected] [email protected] [email protected] @LOOP_A And man those scripts you posted, call functions and more memadresses, these scripts are on whole different level. I doubt i will need (or understand) these in meantime but i'll save these anyway. By the way aside from mess and global var concern, so far i haven't found any crash/freeze/bug. Edited May 29, 2016 by MKKJ Silent 1 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