james227uk Posted April 6, 2009 Share Posted April 6, 2009 I have heard about a high level construction, Break (http://waterviper.forumtwilight.com/english-mission-coding-f2/scripting-function-s-t10.htm). However, I have made a a script using it, but Sanny does not class it as a keyword nor does it even know what it is, "Unknown directive Break" Anyone else used Break before? Link to comment Share on other sites More sharing options...
Dutchy3010 Posted April 6, 2009 Share Posted April 6, 2009 I have to admit that I never used that one before. I haven't even heard of it... But why don't you just use other constructions? Why do you make it so difficult for yourself? DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
james227uk Posted April 6, 2009 Author Share Posted April 6, 2009 I have to admit that I never used that one before. I haven't even heard of it... But why don't you just use other constructions? Why do you make it so difficult for yourself? Dunno, I just think high level construction looks cool. Link to comment Share on other sites More sharing options...
Dutchy3010 Posted April 6, 2009 Share Posted April 6, 2009 If-then-end is a high level construction, just like (for example) a while-loop. DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
PatrickW Posted April 6, 2009 Share Posted April 6, 2009 (edited) "Break" and her sister command "continue" can only be used inside loops, such as repeat..until and while..end. You can use it like this: while true wait 200 ms // foobar(); // .... // ..... if NOT player.Defined($PLAYER_CHAR) then break; endend Or alternatively as a parameter to "jf" : while true wait 200 ms // foobar(); // .... // ..... if player.Defined($PLAYER_CHAR) jf break;end Break will cause the engine to continue with the statement following the current loop, thus terminating it. Continue will cause the current loop-condition to be re-evaluated than restart of abort the loop based on the condition. Edited April 6, 2009 by PatrickW Link to comment Share on other sites More sharing options...
james227uk Posted April 6, 2009 Author Share Posted April 6, 2009 Oh, I see. Thanks Patrick 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