Kriskers Posted March 12, 2010 Share Posted March 12, 2010 Hello! I am making a CLEO script which makes your phone ringing, CJ picks it up and he asks "who is it?" and the caller says "help me" but my script is crashing and I dont know why? (I just got into CLEO scripting ) My code is this : thread 'SKELETON_THREAD' :SKELETON_THREAD_19wait 0 if Player.Defined($PLAYER_CHAR)else_jump @SKELETON_THREAD_19 if $ONMISSION == 0 else_jump @SKELETON_THREAD_19 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -1317.184 2525.606 87.5162 radius 50.0 50.0 50.0 else_jump @SKELETON_THREAD_19 if and00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes [email protected] >= 2 20 > [email protected] else_jump @SKELETON_THREAD_145 jump @SKELETON_THREAD_19 :SKELETON_THREAD_145Model.Load(#CELLPHONE)038B: load_requested_models :SKELETON_THREAD_152wait 0 if Model.Available(#CELLPHONE)else_jump @SKELETON_THREAD_152 0729: AS_actor $PLAYER_ACTOR hold_cellphone 1 wait 2200 00BB: show_text_lowpriority GXT 'SKE1' time 2200 flag 1 wait 2400 00BB: show_text_lowpriority GXT 'SKE2' time 3000 flag 1 wait 3200 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 Model.Destroy(#CELLPHONE) Please tell me why is my mod crashing whenever I quit the call? Oh and how to put selfmade sounds into my script so you can actually hear CJ asking who is it and then you will hear static! I hope im not asking you to do impossible! Link to comment Share on other sites More sharing options...
ZAZ Posted March 13, 2010 Share Posted March 13, 2010 Hello! I am making a CLEO script which makes your phone ringing, CJ picks it up and he asks "who is it?" and the caller says "help me" but my script is crashing and I dont know why? (I just got into CLEO scripting ) My code is this : thread 'SKELETON_THREAD' :SKELETON_THREAD_19wait 0 if Player.Defined($PLAYER_CHAR)else_jump @SKELETON_THREAD_19 if $ONMISSION == 0 else_jump @SKELETON_THREAD_19 if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -1317.184 2525.606 87.5162 radius 50.0 50.0 50.0 else_jump @SKELETON_THREAD_19 if and00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes [email protected] >= 2 20 > [email protected] else_jump @SKELETON_THREAD_145 jump @SKELETON_THREAD_19 :SKELETON_THREAD_145Model.Load(#CELLPHONE)038B: load_requested_models :SKELETON_THREAD_152wait 0 if Model.Available(#CELLPHONE)else_jump @SKELETON_THREAD_152 0729: AS_actor $PLAYER_ACTOR hold_cellphone 1 wait 2200 00BB: show_text_lowpriority GXT 'SKE1' time 2200 flag 1 wait 2400 00BB: show_text_lowpriority GXT 'SKE2' time 3000 flag 1 wait 3200 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 Model.Destroy(#CELLPHONE) Please tell me why is my mod crashing whenever I quit the call? Oh and how to put selfmade sounds into my script so you can actually hear CJ asking who is it and then you will hear static! I hope im not asking you to do impossible! If it should be a cleo script you must add the cleo directive at script beginn: {$CLEO .cs} Compiling+copy this script without cleo directive creates a main.scm which let your game crash Backup first your main.scm and script.img Then close your thread at the script end either add 0A93: end_custom_thread or a jump to the script beginn(Loop-adress), jump @SKELETON_THREAD_19 Fourthermore, opcode 00BF: is no question code remove it from the conditional check and place it before the conditional check {$CLEO .cs}thread 'SKELETON_THREAD':SKELETON_THREAD_19wait 0if Player.Defined($PLAYER_CHAR)else_jump @SKELETON_THREAD_19if$ONMISSION == 0else_jump @SKELETON_THREAD_19if00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -1317.184 2525.606 87.5162 radius 50.0 50.0 50.0else_jump @SKELETON_THREAD_1900BF: [email protected] = current_time_hours, [email protected] = current_time_minutesif [email protected] >= 220 > [email protected]_jump @SKELETON_THREAD_145jump @SKELETON_THREAD_19:SKELETON_THREAD_145Model.Load(#CELLPHONE)038B: load_requested_models:SKELETON_THREAD_152wait 0if Model.Available(#CELLPHONE)else_jump @SKELETON_THREAD_1520729: AS_actor $PLAYER_ACTOR hold_cellphone 1wait 220000BB: show_text_lowpriority GXT 'SKE1' time 2200 flag 1wait 240000BB: show_text_lowpriority GXT 'SKE2' time 3000 flag 1wait 32000729: AS_actor $PLAYER_ACTOR hold_cellphone 0Model.Destroy(#CELLPHONE)wait 1000jump @SKELETON_THREAD_19 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Kriskers Posted March 13, 2010 Author Share Posted March 13, 2010 Thank you sooooooo much, ZAZ your the best there is but there is just one more thing to do! I want that actor would pick up the phone ONCE not endlessly when he is at aldea malvada, i know i have to use some end_thread code but how? Please help me with that part! Link to comment Share on other sites More sharing options...
Kriskers Posted March 13, 2010 Author Share Posted March 13, 2010 Sorry for the double post but I figured the end_thread thing out but how to change it so that the player will receive a call at exactly 3:33 at night (AM)? Please tell me , I couldnt figure that out! Link to comment Share on other sites More sharing options...
james227uk Posted March 13, 2010 Share Posted March 13, 2010 if and00BF: [email protected] = current_time_hours, [email protected] = [email protected] == [email protected] == 33else_jump @SKELETON_THREAD_145 Link to comment Share on other sites More sharing options...
Kriskers Posted March 14, 2010 Author Share Posted March 14, 2010 Nope, that didnt work! When I enter the cheat XJVSNAJ (which changes the clock to 0:00) I still get the phonecall, not 3:33! Link to comment Share on other sites More sharing options...
james227uk Posted March 14, 2010 Share Posted March 14, 2010 {$CLEO .cs}thead 'PHONECALLZ':1wait 0if Player.Defined($PLAYER_CHAR)jf @100BF: [email protected] = current_time_hours, [email protected] = [email protected] == [email protected] == 33jf @1Model.Load(#CELLPHONE):2wait 0if Model.Available(#CELLPHONE)jf @20729: AS_actor $PLAYER_ACTOR hold_cellphone 1wait 220000BB: show_text_lowpriority GXT 'SKE1' time 2200 flag 1wait 240000BB: show_text_lowpriority GXT 'SKE2' time 3000 flag 1wait 32000729: AS_actor $PLAYER_ACTOR hold_cellphone 0wait 2000Model.Destroy(#CELLPHONE)wait 100jump @1 Link to comment Share on other sites More sharing options...
Kriskers Posted March 14, 2010 Author Share Posted March 14, 2010 Sorry to say it but even that didnt help, i am now receiving calls at 0:33 and 2:33 and 17:33 but I want that I will get the call ONLY at 3:33 not any other time but exactly that time! Link to comment Share on other sites More sharing options...
ZAZ Posted March 14, 2010 Share Posted March 14, 2010 Sorry to say it but even that didnt help, i am now receiving calls at 0:33 and 2:33 and 17:33 but I want that I will get the call ONLY at 3:33 not any other time but exactly that time! james227uk forgot an and and made a misstake in thread 'PHONECALLZ' if [email protected] == [email protected] == 33jf @1 I recomand to check with "if bigger" for a tiny period of time Bigger scripts with long loops can have a delay and miss the right moment {$CLEO .cs}thread 'PHONECALLZ'00C0: set_current_time_hours_to 3 minutes_to 20 :1wait 0if Player.Defined($PLAYER_CHAR)jf @100BF: [email protected] = current_time_hours, [email protected] = current_time_minutes03F0: enable_text_draw 1 045A: draw_text_1number 200.0 60.0 GXT 'NUMBER' number [email protected] // ~1~ 045A: draw_text_1number 240.0 60.0 GXT 'NUMBER' number [email protected] // ~1~if [email protected] == [email protected] > 3235 > [email protected] @1Model.Load(#CELLPHONE):2wait 0if Model.Available(#CELLPHONE)jf @20729: AS_actor $PLAYER_ACTOR hold_cellphone 1wait 220000BB: show_text_lowpriority GXT 'SKE1' time 2200 flag 1wait 240000BB: show_text_lowpriority GXT 'SKE2' time 3000 flag 1wait 32000729: AS_actor $PLAYER_ACTOR hold_cellphone 0wait 2000Model.Destroy(#CELLPHONE)wait 100jump @1 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Kriskers Posted March 14, 2010 Author Share Posted March 14, 2010 As again ZAZ you are the best!!!! Here comes the final question ( to perfect my CLEO script for downloading)! How to make the game ask "Press TAB to pick up the phone" and you can hear the phone ringing? And how to make a sound play in the background when CJ is talking! (I want to put CJ saying "Who is this?" sound to the background of the text saying "Who is this?". I hope I dont make CLEO scripters life hard with my question! :S Atleast tell me the opcode for it! Link to comment Share on other sites More sharing options...
james227uk Posted March 14, 2010 Share Posted March 14, 2010 I'll forget I at least tried help you... Link to comment Share on other sites More sharing options...
ZAZ Posted March 14, 2010 Share Posted March 14, 2010 (edited) Here comes the final question ( to perfect my CLEO script for downloading)! How to make the game ask "Press TAB to pick up the phone" and you can hear the phone ringing? And how to make a sound play in the background when CJ is talking! (I want to put CJ saying "Who is this?" sound to the background of the text saying "Who is this?". lol, final question, you mean we should do the work for you? look in audioevents.txt for soundnumbers read in my cleo script tut for more infos opcodes can be found in main.scm, opcode search tool, sascm.ini, in Dejis topic let the phone ring then let the code run in a loop which check if action-key is pressed Edited March 14, 2010 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Kriskers Posted March 15, 2010 Author Share Posted March 15, 2010 Thanks, I appreciate your help! 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