Omega_Is_Here Posted May 21, 2017 Share Posted May 21, 2017 (edited) Hello ! I'm still a beginner noob at cleo... I'm working on a mod to be able to buy drugs from dealers but i'm facing 2 problems... The first one is that the dealer doesn't do his animation (DEALER_DEAL) After cj pays Actor [email protected] is not performing the DEALER_DEAL animation The second one gets complicated So normally when cj replies with a positive response to the dealer, he tells the dealer to go away How do i replace that with my mod? What i mean is if i press y i don't want what happens normally i want my mod to take place... Any help would be appreciated ! Please provide detailed and clear answers! :SMOKE_1 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 80DF: not actor $PLAYER_ACTOR driving 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 03EE: player $PLAYER_CHAR controllable 004D: jump_if_false @SMOKE_1 0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to [email protected] closest_ped_to [email protected] 0001: wait 0 ms 00D6: if 8039: not [email protected] == -1 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if or 02F2: actor [email protected] model == #BMYDRUG 02F2: actor [email protected] model == #WMYDRUG 02F2: actor [email protected] model == #HMYDRUG 02F2: actor [email protected] model == #BIKDRUG 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 00F2: actor [email protected] near_actor $PLAYER_ACTOR radius 1.5 1.5 sphere 0 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 0AB0: key_pressed 69 004D: jump_if_false @SMOKE_1 0002: jump @SMOKE_2 :SMOKE_2 04ED: load_animation "GANGS" 04ED: load_animation "DEALER" 04ED: load_animation "SMOKING" 0247: load_model 1212 038B: load_requested_models 029B: [email protected] = init_object 1212 at 0.0 0.0 0.0 0382: set_object [email protected] collision_detection 0 0001: wait 0 ms 00D6: if 04EE: animation "GANGS" loaded 004D: jump_if_false @SMOKE_2 0001: wait 0 ms 00D6: if 04EE: animation "DEALER" loaded 004D: jump_if_false @SMOKE_2 05C1: AS_actor $PLAYER_ACTOR speak_from_audio_table 194 0812: AS_actor $PLAYER_ACTOR perform_animation "SHOP_PAY" IFP "DEALER" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time 4500 0001: wait 500 ms 070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.03 0.030 0.02 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 0 0001: wait 4000 ms 0108: destroy_object [email protected] 0249: release_model 1212 0647: AS_actor [email protected] clear_look_task 0109: player $PLAYER_CHAR money = -20 05C1: AS_actor [email protected] speak_from_audio_table 84 0812: AS_actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 3200 0812: AS_actor $PLAYER_ACTOR perform_animation "DRUGS_BUY" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 3200 0001: wait 3200 ms 0687: clear_actor [email protected] task That's it for now Edited May 21, 2017 by BiPolarBear Link to comment Share on other sites More sharing options...
EAZYJ Posted May 21, 2017 Share Posted May 21, 2017 (edited) I had the same problem for the animation try this opcode instead maybe. 0605: actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 1.0 loop 1 lockX 0 lockY 0 lockF 0 time -1 Edited May 21, 2017 by EAZYJ Link to comment Share on other sites More sharing options...
Omega_Is_Here Posted May 21, 2017 Author Share Posted May 21, 2017 I had the same problem for the animation try this opcode instead maybe. 0605: actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 1.0 loop 1 lockX 0 lockY 0 lockF 0 time -1 Thanks for the reply Sadly did not work Link to comment Share on other sites More sharing options...
deltaCJ Posted May 22, 2017 Share Posted May 22, 2017 You should delete the if not [email protected] == -1 _____________________ it does not belong there. Link to comment Share on other sites More sharing options...
Omega_Is_Here Posted May 22, 2017 Author Share Posted May 22, 2017 You should delete the if not [email protected] == -1 _____________________ it does not belong there. Beleive it or not the game crashes if i delete it It's not the problem :-/ Link to comment Share on other sites More sharing options...
ZAZ Posted May 23, 2017 Share Posted May 23, 2017 (edited) Create a marker above actor to indicate and make shure that the script found and keeps the dealer ped later, you can remover it, if script works fine {$CLEO .cs}thread 'DEALER':SMOKE_10001: wait 0 ms if 0256: player $PLAYER_CHAR defined jf @SMOKE_1 if and0AB0: key_pressed 69// E key80DF: not actor $PLAYER_ACTOR driving jf @SMOKE_1 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.0if 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 8.0 find_next 0 pass_deads 1 // CLEO 4 opcodejf @SMOKE_1if 8118: not actor [email protected] dead jf @cleanup //if or//02F2: actor [email protected] model == #BMYDRUG //02F2: actor [email protected] model == #WMYDRUG //02F2: actor [email protected] model == #HMYDRUG //02F2: actor [email protected] model == #BIKDRUG //jf @cleanupif00F2: actor [email protected] near_actor $PLAYER_ACTOR radius 1.5 1.5 sphere 0jf @cleanup0187: [email protected] = create_marker_above_actor [email protected]:SMOKE_20001: wait 0 ms if 0256: player $PLAYER_CHAR defined jf @cleanupif8118: NOT actor [email protected] deadjf @cleanupif80F2: not actor [email protected] near_actor $PLAYER_ACTOR radius 10.5 10.5 sphere 0jf @SMOKE_2 :cleanup0164: disable_marker [email protected]: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian wait 100jump @SMOKE_1 Btw. deltaCJ was wrong, but i used a different code for the script above and also i used opcode 0AE1: directly as condition Edited May 23, 2017 by ZAZ Omega_Is_Here 1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Omega_Is_Here Posted May 23, 2017 Author Share Posted May 23, 2017 (edited) Create a marker above actor to indicate and make shure that the script found and keeps the dealer ped later, you can remover it, if script works fine Even after placing a marker above the dealer, nothing happens... I think i know why. In main.scm external script //-------------External script 19 (DEALER)--------------- is preventing dealer form doing dealer_deal animation It's beyond my coding skills and i don't know what to do at such situation Anyways, here's the script if you like to try it out ingame yourself (WITH MARKER) {$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'SMOKE' :SMOKE_10001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 80DF: not actor $PLAYER_ACTOR driving 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 03EE: player $PLAYER_CHAR controllable 004D: jump_if_false @SMOKE_1 0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to [email protected] closest_ped_to [email protected] 0001: wait 0 ms 00D6: if 8039: not [email protected] == -1 004D: jump_if_false @SMOKE_1 00D6: if or02F2: actor [email protected] model == #BMYDRUG 02F2: actor [email protected] model == #WMYDRUG 02F2: actor [email protected] model == #HMYDRUG 02F2: actor [email protected] model == #BIKDRUG 004D: jump_if_false @SMOKE_10001: wait 0 ms00D6: if00F2: actor [email protected] near_actor $PLAYER_ACTOR radius 1.5 1.5 sphere 0004D: jump_if_false @SMOKE_10001: wait 0 ms 00D6: if 0AB0: key_pressed 69 // E 004D: jump_if_false @SMOKE_10187: $marker = create_marker_above_actor [email protected] 0002: jump @SMOKE_2 :SMOKE_204ED: load_animation "GANGS"04ED: load_animation "DEALER" 04ED: load_animation "SMOKING"0247: load_model 1212038B: load_requested_models0001: wait 0 ms 00D6: if 04EE: animation "GANGS" loaded 004D: jump_if_false @SMOKE_20001: wait 0 ms 00D6: if 04EE: animation "DEALER" loaded 004D: jump_if_false @SMOKE_2 01B9: set_actor $PLAYER_ACTOR armed_weapon_to 003BF: set_player $PLAYER_CHAR ignored_by_everyone 1029B: [email protected] = init_object 1212 at 0.0 0.0 0.00382: set_object [email protected] collision_detection 0 05C1: AS_actor $PLAYER_ACTOR speak_from_audio_table 194 0812: AS_actor $PLAYER_ACTOR perform_animation "SHOP_PAY" IFP "DEALER" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time 45000001: wait 500 ms070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.03 0.030 0.02 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 00001: wait 4000 ms0108: destroy_object [email protected] 0249: release_model 12120647: AS_actor [email protected] clear_look_task0109: player $PLAYER_CHAR money = -2005C1: AS_actor [email protected] speak_from_audio_table 84 0812: AS_actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 32000812: AS_actor $PLAYER_ACTOR perform_animation "DRUGS_BUY" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 32000001: wait 3200 ms0687: clear_actor [email protected] task0002: jump @SMOKE_1 Edited May 23, 2017 by BiPolarBear Link to comment Share on other sites More sharing options...
ZAZ Posted May 24, 2017 Share Posted May 24, 2017 Yes the extern script, we can terminate it by 0459: end_thread_named 'DEALER' I tried some codes 0459: end_thread_named 'DEALER'0792: disembark_instantly_actor [email protected]: set_actor [email protected] decision_maker_to 320A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR0A1D: AS_actor $PLAYER_ACTOR rotate_to_and_look_at_actor [email protected]but the actor walked always away and then he made the animationso, it's important to run the animation earlier instead after your 4000 ms wait time 05C1: AS_actor $PLAYER_ACTOR speak_from_audio_table 194 0812: AS_actor $PLAYER_ACTOR perform_animation "SHOP_PAY" IFP "DEALER" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time -10001: wait 500 ms070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.03 0.030 0.02 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 00812: AS_actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -10001: wait 4000 msif it's not enough, you can lock the actorand you can bring the actor_rotate code more times the script below, what i got so far, check it out {$CLEO .cs}thread 'DEALMOD':SMOKE_1wait 0 if 0256: player $PLAYER_CHAR defined jf @SMOKE_1 if and0AB0: key_pressed 69// E key80DF: not actor $PLAYER_ACTOR driving jf @SMOKE_1 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.0if 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 8.0 find_next 0 pass_deads 1 // CLEO 4 opcodejf @SMOKE_1if 8118: not actor [email protected] dead jf @cleanup_1 if or02F2: actor [email protected] model == #BMYDRUG 02F2: actor [email protected] model == #WMYDRUG 02F2: actor [email protected] model == #HMYDRUG 02F2: actor [email protected] model == #BIKDRUG jf @cleanup_1if00F2: actor [email protected] near_actor $PLAYER_ACTOR radius 1.5 1.5 sphere 0jf @cleanup_10459: end_thread_named 'DEALER'0792: disembark_instantly_actor [email protected]: set_actor [email protected] decision_maker_to 3204D7: set_actor [email protected] locked 10A1D: AS_actor [email protected] rotate_to_and_look_at_actor $PLAYER_ACTOR0A1D: AS_actor $PLAYER_ACTOR rotate_to_and_look_at_actor [email protected]: [email protected] = create_marker_above_actor [email protected]: load_animation "GANGS"04ED: load_animation "DEALER" 0247: load_model 1212038B: load_requested_models029B: [email protected] = init_object 1212 at 0.0 0.0 0.00382: set_object [email protected] collision_detection 0 :SMOKE_2wait 0 if and04EE: animation "GANGS" loaded04EE: animation "DEALER" loaded jf @SMOKE_205C1: AS_actor $PLAYER_ACTOR speak_from_audio_table 194 0812: AS_actor $PLAYER_ACTOR perform_animation "SHOP_PAY" IFP "DEALER" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time -10001: wait 500 ms070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.03 0.030 0.02 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 00812: AS_actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -10001: wait 4000 ms0108: destroy_object [email protected] 0249: release_model 1212if 0256: player $PLAYER_CHAR defined jf @cleanup_2if8118: NOT actor [email protected] deadjf @cleanup_2//0647: AS_actor [email protected] clear_look_task0109: player $PLAYER_CHAR money = -2005C1: AS_actor [email protected] speak_from_audio_table 84 //0812: AS_actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -10812: AS_actor $PLAYER_ACTOR perform_animation "DRUGS_BUY" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time -10001: wait 5000 msif8118: NOT actor [email protected] deadjf @cleanup_20687: clear_actor [email protected] task:cleanup_204EF: release_animation "GANGS"04EF: release_animation "DEALER"04D7: set_actor [email protected] locked 0 :cleanup_10164: disable_marker [email protected]: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian wait 100jump @SMOKE_1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Omega_Is_Here Posted May 24, 2017 Author Share Posted May 24, 2017 (edited) Yes the extern script, we can terminate it by 0459: end_thread_named 'DEALER' I tried some codes but the actor walked always away and then he made the animationso, it's important to run the animation earlier instead after your 4000 ms wait time if it's not enough, you can lock the actor and you can bring the actor_rotate code more times Finally ! After many trials and errors, the dealer_deal animation worked Locking the actor, lowering 4000 ms didn't stop the dealer from moving, but ending the dealer thread early did I ended the dealer thread before the dealer's animation (dealer_deal) The dealer was forced to do the animation instead of walking away But after the script ends, the dealer walks away like a normal ped instead of selling drugs again But that's because the dealer thread has ended maybe ? What it looks like now (Working) :SMOKE_10001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 80DF: not actor $PLAYER_ACTOR driving 004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 03EE: player $PLAYER_CHAR controllable 004D: jump_if_false @SMOKE_1 0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to [email protected] closest_ped_to [email protected] 0001: wait 0 ms 00D6: if 8039: not [email protected] == -1 004D: jump_if_false @SMOKE_1 00D6: if or02F2: actor [email protected] model == #BMYDRUG 02F2: actor [email protected] model == #WMYDRUG 02F2: actor [email protected] model == #HMYDRUG 02F2: actor [email protected] model == #BIKDRUG 004D: jump_if_false @SMOKE_10001: wait 0 ms00D6: if00F3: actor $PLAYER_ACTOR near_actor [email protected] radius 2.0 2.0 sphere 0 on_foot004D: jump_if_false @SMOKE_1 0001: wait 0 ms 00D6: if 0AB0: key_pressed 69 004D: jump_if_false @SMOKE_10002: jump @SMOKE_2 :SMOKE_2029B: [email protected] = init_object 3044 at 0.0 0.0 0.0 029B: [email protected] = init_object 3045 at 0.0 0.0 0.0 069A: attach_object [email protected] to_object [email protected] with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.004ED: load_animation "GANGS"04ED: load_animation "DEALER" 04ED: load_animation "SMOKING"0247: load_model 12120247: load_model 30440247: load_model 3045038B: load_requested_models0001: wait 0 ms 00D6: if 04EE: animation "GANGS" loaded 004D: jump_if_false @SMOKE_20001: wait 0 ms 00D6: if 04EE: animation "DEALER" loaded 004D: jump_if_false @SMOKE_20459: end_thread_named 'DEALER' 0A1D: AS_actor $PLAYER_ACTOR rotate_to_and_look_at_actor [email protected]: wait 0 ms0247: load_model 1212038B: load_requested_models029B: [email protected] = init_object 1212 at 0.0 0.0 0.0 //Money0382: set_object [email protected] collision_detection 0067E: put_camera_on_actor $PLAYER_ACTOR offset 0.5 -1.0 1.1 target_actor [email protected] tilt 0.0 switchstyle 201B9: set_actor $PLAYER_ACTOR armed_weapon_to 003BF: set_player $PLAYER_CHAR ignored_by_everyone 1029B: [email protected] = init_object 1212 at 0.0 0.0 0.0 // Money0382: set_object [email protected] collision_detection 0 //Money05C1: AS_actor $PLAYER_ACTOR speak_from_audio_table 194 0812: AS_actor $PLAYER_ACTOR perform_animation "SHOP_PAY" IFP "DEALER" framedelta 4.0 loopA 1 lockX 0 lockY 0 lockF 0 time -10001: wait 1000 ms070A: AS_actor $PLAYER_ACTOR attach_to_object [email protected] offset 0.03 0.030 -0.02 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 00001: wait 3500 ms0108: destroy_object [email protected] 0249: release_model 12120647: AS_actor [email protected] clear_look_task0109: player $PLAYER_CHAR money = -2005C1: AS_actor [email protected] speak_from_audio_table 84 0812: AS_actor [email protected] perform_animation "DEALER_DEAL" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 32000812: AS_actor $PLAYER_ACTOR perform_animation "DRUGS_BUY" IFP "DEALER" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 time 32000001: wait 1500 ms070A: AS_actor [email protected] attach_to_object [email protected] offset 0.04 0.1 0.05 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 00001: wait 1200 ms0108: destroy_object [email protected]: destroy_object [email protected]: wait 500 ms02EB: restore_camera_with_jumpcutjump @smoke_1 Also, is it possible to make my mod to happen if the player presses Y to the dealer? If i change the key press from 69//E (Which it is right now) To 89//Y, The script does happen but cj also replies negatively like he normally does... Do i have to change something in the external script dealer in main.scm? If so how do i do that? Or do i have to end the external script dealer and rewrite the mod from scratch? And thanks for everything ZAZ Edited May 24, 2017 by BiPolarBear Link to comment Share on other sites More sharing options...