Jump to content

Recommended Posts

Well, no semi colons after if statements, append txt at the end of the DOCUMENTS name so it loads, use BBEdit for line number counting, Use the end(); to stop scripts easily, like using

Code:
if (choice == 1) {// choice 1 (or 0 in the term) is leave.        message_dialog("blah,","");        end();        }flip_terrain(?,?);break;is less time consuming thenif (choice == 1) {// choice 1 (or 0 in the term) is leave.        message_dialog("blah,","");        end();        }if (choice == 2) {        your codes here. 
It also makes it cleaner cause it does not have to use all the brackets. Like look at an exerpt from one of my scripts.
Code:
 beginstate 16;check_text_response_match("imdone");text = got_text_match();if (text == 0) {	set_state_continue(19);	end();	}if (get_terrain(6,41) == 268) {	message_dialog("The panal glows. _The portal of command imdone is now closed_","");	set_terrain(6,41,0);	end();	}message_dialog("The panal glows._Ok. Portal Open. Please go to the top of the huge stairway near the south entrance","");set_terrain(6,41,268);break;  
What happens is it first checks to see if the text is wrong then contines if it is to the next state (for me at least) to see if the code is right for something else. Then it checks to see if the portal is open, and closes it. If it is not open and the correct sequence is put in, the portal opens. The order you put the codes in is hard to explain, just try using set_state_continue with end();

To explain it, do all the stuff that would end the script first with ifs and brackets, then do stuff that should happen that dont end the scripts. Good Luck wink

Link to comment
Share on other sites

Try adhering to the following coding standards:

 

IF statements should look like:

Code:
if (expr) {  code  if (expr) {    code  }}
Calls to functions with multiple parameters should have a single space after the seperating comma:
Code:
do_something(1, 2);
If using co-ordinates (SDF or map) in your function calls, you may find the following syntax cleaner:
Code:
set_flag(5,1      ,1);
In this case, the SDF is spaced from the rest of the parameters and the space after the first , is omitted.
Link to comment
Share on other sites

Quote:
Originally written by Prophet_of_Doom:
Uh, speaking of spelling, I've never heard of a "panal," GIFTSare2d2, you might want to fix that because it's your scenario and all.
I change spelling and grammer once scripting is done. And I am NOT changing the spelling for this particular word. In my world, panel is panal. This kind of thing, 'uniqueifies' the scen.
Heck, I might make a small scen for my friend (not the public) where everything is Klingon wink .
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...