sci4me Posted December 5, 2010 Share Posted December 5, 2010 Ok, i made this SIMPLE mission, and i did my BEST to make it work, but i cant get it to work. PLEASE HELP ME! THANKS! Code: // This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'AM' :PT_11wait 0 if player.Defined($PLAYER_CHAR)jf @PT_11 wait 0 Model.Load(#CELLPHONE)wait 5000 03BD: destroy_sphere [email protected]: AS_actor $PLAYER_ACTOR hold_cellphone 1 03BF: set_player $PLAYER_CHAR ignored_by_everyone 1 wait 2000 00BB: show_text_lowpriority GXT 'HELLO' time 3000 flag 1 wait 3000 00BB: show_text_lowpriority GXT 'HI' time 3000 flag 1 wait 3000 00BB: show_text_lowpriority GXT 'WHAT' time 3000 flag 1 wait 3000 00BB: show_text_lowpriority GXT 'WHY' time 2000 flag 1 wait 2000 00BB: show_text_lowpriority GXT 'COME' time 3000 flag 1 wait 3000 00BB: show_text_lowpriority GXT 'OK' time 3000 flag 1 wait 300002A3: enable_widescreen 0 0729: AS_actor $PLAYER_ACTOR hold_cellphone 0 03BF: set_player $PLAYER_CHAR ignored_by_everyone 0 wait 3000 02A7: [email protected] = create_icon_marker_and_sphere [email protected] at -2815.0996 -1526.0273 140.8437jump @insphere:insphereif00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2815.0996 -1526.0273 140.8437 radius 1.5 1.5 3.5 else_jump @inspherejump @mstart:mstartmodel.Load(#SWAT)038B: load_requested_models if andmodel.Available(#SWAT)else_jump @mstartjump @mon:mon03BD: destroy_sphere [email protected] [email protected] = Actor.Create(4, #SWAT, -2815.7368, -1522.215, 140.8437)actor.Angle([email protected]) = 179.9298wait 4002A3: enable_widescreen 1 wait 5005BA: AS_actor [email protected] move_mouth -1 ms wait 500BB: show_text_lowpriority GXT 'DOTHIS' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'WHA' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'WEFRAID' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'NUKE' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'MELIVE' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'OFCO' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'OK' time 3000 flag 1wait 300000BB: show_text_lowpriority GXT 'TOP' time 3000 flag 1wait 30000968: actor [email protected] stop_mouth 02A3: enable_widescreen 0wait 50 02A7: [email protected] = create_icon_marker_and_sphere [email protected] at -2294.7734 -1671.8262 483.3995wait 5000actor.DestroyWithFade([email protected])model.Destroy(#SWAT)jump @blowup:blowupif00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2815.0996 -1526.0273 140.8437 radius 1.5 1.5 3.5 else_jump @blowupjump @blowit:blowit03BD: destroy_sphere [email protected] 100000948: create_explosion_at -2815.0996 -1526.0273 140.8437 type 10 camera_shake 0.0 0A93: end_custom_thread It compiles fine, but the mission freezes after i put away my phone (ingame). PLZ HELP! and yes the text does work fine. Link to comment Share on other sites More sharing options...
Bennington Posted December 5, 2010 Share Posted December 5, 2010 Put a wait-instruction at the beginning of each label and try out. It´s mostly the reason for game freezings... Link to comment Share on other sites More sharing options...
TheSiggi Posted December 5, 2010 Share Posted December 5, 2010 03BD: destroy_sphere [email protected] is not defined :insphere// missing wait if00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2815.0996 -1526.0273 140.8437 radius 1.5 1.5 3.5 else_jump @inspherejump @mstart :mstartmodel.Load(#SWAT)038B: load_requested_modelsif andmodel.Available(#SWAT)else_jump @mstartjump @mon change it to: :mstartmodel.load(#SWAT)while not Model.Available(#SWAT) wait 0end :blowup// missing waitif00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -2815.0996 -1526.0273 140.8437 radius 1.5 1.5 3.5else_jump @blowupjump @blowit Link to comment Share on other sites More sharing options...
james227uk Posted December 5, 2010 Share Posted December 5, 2010 Put a wait-instruction at the beginning of each label and try out.It´s mostly the reason for game freezings... Not totally necessary, but I do it. You only really need a WAIT 0 at the beginning of a label when that label starts off with a condition (IF etc). Link to comment Share on other sites More sharing options...
Nahiyan Posted December 6, 2010 Share Posted December 6, 2010 OK I see a lot of stuff that can be fixed! :PT_11wait 0ifplayer.Defined($PLAYER_CHAR)jf @PT_11wait 0Model.Load(#CELLPHONE)wait 5000 You don't need that second wait 0 there. Also, instead of waiting 5 seconds so the model can load, you could use a "Repeat...Until" structure. Its syntax is like this - [/code]Repeat // Stuff to do while the condition is false. Usually when people want the script to wait for a model to load, they put a wait 0 here. Until <condition> // The condition, when the condition returns true, the script will stop doing whatever is between Repeat and Until.[/code] Or you could use a While...End structure. Basically the script will do whatever is between them until the condition returns false. Syntax below - While <condition>// Stuff to doend Oh yeah and you don't need to jump to the next label, the game reads and script up to down automatically The only time the game will crash is if the script reaches the end of the script. When you want your script to stop and not crash the game then put opcode 0A93 at the end. Good luck with your mission Yeah and also read The_Siggi's corrections above ^^ 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