OmniMax 0 Posted January 26, 2004 I have this really neat mission and a big list of if commands and gotos. They're all in my init.sqs But it gives me the error [] exec "beginmission.sqs" invalid number in expression and I'm clueless to why an exec parameter would want a number. here is a an example of one of the gotos <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #kv "E_OBJ" setMarkerPos (getmarkerpos "c_Kvilda") obj = "Kvilda" [] exec "beginmission.sqs" end but it worked when I was only doing one goto. I am in dire need of assistance. Thanks in advance. Share this post Link to post Share on other sites
Taurus 20 Posted January 26, 2004 can we please see your init.sqs? Share this post Link to post Share on other sites
OmniMax 0 Posted January 26, 2004 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #time time1 = random 12 time2 = random 12 time1 = time1 - (time1 mod 1) time2 = time2 - (time2 mod 1) timetime = time1 + time2 skiptime timetime ?(timetime > 19) : fire setpos [(getpos jeep select 0), (getpos jeep select 1) - .5, (getpos jeep select 2) + .5] ?(timetime < 5) : fire setpos [(getpos jeep select 0), (getpos jeep select 1) - .5, (getpos jeep select 2) + .5 ] fire inflame true goto "weather" #weather weat1 = random .5 0 setOvercast weat1 goto "mission" #mission mis1 = random 15 mis2 = random 15 mis1 = mis1 - (mis1 mod 1) mis2 = mis2 - (mis2 mod 1) mismis = mis1 + mis2 ?(mismis < 1) : goto "fact" ?(mismis == 1) : goto "mok" ?(mismis == 2) : goto "kv" ?(mismis == 3) : goto "mod" ?(mismis == 4) : goto "blu" ?(mismis == 5) : goto "mokr" ?(mismis == 6) : goto "tros" ?(mismis == 7) : goto "vart" ?(mismis == 8) : goto "lou" ?(mismis == 9) : goto "bla" ?(mismis == 10) : goto "dol" ?(mismis == 11) : goto "mir" ?(mismis == 12) : goto "pet" ?(mismis == 13) : goto "vidl" ?(mismis == 14) : goto "slap" ?(mismis == 15) : goto "frym" ?(mismis == 16) : goto "kos" ?(mismis == 17) : goto "jou" ?(mismis == 18) : goto "opa" ?(mismis == 19) : goto "pas" ?(mismis == 20) : goto "ska" ?(mismis == 21) : goto "neve" ?(mismis == 22) : goto "dav" ?(mismis == 23) : goto "velk" ?(mismis == 24) : goto "mala" ?(mismis == 25) : goto "lany" ?(mismis == 26) : goto "lip" ?(mismis == 27) : goto "okro" ?(mismis == 28) : goto "st" ?(mismis == 29) : goto "bit" ?(mismis == 30) : goto "bor" end #fact "E_OBJ" setMarkerPos (getmarkerpos "c_mokravrata") obj = "factory" [] exec "beginmission.sqs" end #mok "E_OBJ" setMarkerPos (getmarkerpos "c_mokravrata") obj = "mok" [] exec "beginmission.sqs" end #kv "E_OBJ" setMarkerPos (getmarkerpos "c_Kvilda") obj = "Kvilda" [] exec "beginmission.sqs" end #mod "E_OBJ" setMarkerpos (getmarkerpos "c_modrava") obj = "Modrava" [] exec "beginmission.sqs" end #blu "E_OBJ" setMarkerpos (getmarkerpos "c_bludov") obj = "Bludov" [] exec "beginmission.sqs" end #mokr "E_OBJ" setMarkerpos (getmarkerpos "c_mokropsy") obj = "Mokropsy" [] exec "beginmission.sqs" end #tros "E_OBJ" setMarkerpos (getmarkerpos "c_trosky") obj = "Trosky" [] exec "beginmission.sqs" end #vart "E_OBJ" setMarkerpos (getmarkerpos "c_varta") obj = "Varta" [] exec "beginmission.sqs" end #lou "E_OBJ" setMarkerpos (getmarkerpos "c_loukov") obj = "loukov" [] exec "beginmission.sqs" end #bla "E_OBJ" setMarkerpos (getmarkerpos "c_blata") obj ="blata" [] exec "beginmission.sqs" end #dol "E_OBJ" setMarkerpos (getmarkerpos "c_dolina") obj = "dolina" [] exec "beginmission.sqs" end #mir "E_OBJ" setMarkerpos (getmarkerpos "c_mirov") obj = "mirov" this exec "beginmission.sqs" end #pet "E_OBJ" setMarkerpos (getmarkerpos "c_petrovice") obj = "Petrovice" [] exec "beginmission.sqs" end #vidl "E_OBJ" setMarkerpos (getmarkerpos "c_vidlakov") obj = "Vidlakov" [] exec "beginmission.sqs" end #slap "E_OBJ" setMarkerpos (getmarkerpos "c_slapy") obj = "Slapy" [] exec "beginmission.sqs" end #frym "E_OBJ" setMarkerpos (getmarkerpos "c_frymburk") obj = "Frymburk" [] exec "beginmission.sqs" end #kos "E_OBJ" setMarkerpos (getmarkerpos "c_kost") obj = "Kost" [] exec "beginmission.sqs" end #jou "E_OBJ" setMarkerpos (getmarkerpos "c_joudov") obj = "Joudov" [] exec "beginmission.sqs" end #opa "E_OBJ" setMarkerpos (getmarkerpos "c_opatov") obj = "Opatov" [] exec "beginmission.sqs" end #pas "E_OBJ" setMarkerpos (getmarkerpos "c_paseky") obj = "Pasekey" [] exec "beginmission.sqs" end #ska "E_OBJ" setMarkerpos (getmarkerpos "c_skalice") obj = "Skalice" [] exec "beginmission.sqs end #neve "E_OBJ" setMarkerpos (getmarkerpos "c_neveklov") obj = "Neveklov" [] exec "beginmission.sqs" end #dav "E_OBJ" setMarkerpos (getmarkerpos "c_davle") obj = "Davle" [] exec "beginmission.sqs" end #velk "E_OBJ" setMarkerpos (getmarkerpos "c_velkaves") obj = "velka ves" [] exec "beginmission.sqs" end #mala "E_OBJ" setMarkerpos (getmarkerpos "c_malaves") obj = "Mala ves" [] exec "beginmission.sqs" end #lany "E_OBJ" setMarkerpos (getmarkerpos "c_lany") obj = "Lany" [] exec "beginmission.sqs" end #lip "E_OBJ" setMarkerpos (getmarkerpos "c_lipany") obj = "Lipany" [] exec "beginmission.sqs end #okro "E_OBJ" setMarkerpos (getmarkerpos "c_okrouhlo") obj = "Okrouhlo" [] exec "beginmission.sqs" end #st "E_OBJ" setMarkerpos (getmarkerpos "c_stseldo") obj = "St. Sedlo" [] exec "beginmission.sqs" end #bit "E_OBJ" setMarkerpos (getmarkerpos "c_bitov") obj = "Bitov" [] exec "beginmission.sqs" end #bor "E_OBJ" setMarkerpos (getmarkerpos "c_bor") obj = "Bor" [] exec "beginmission.sqs" end Share this post Link to post Share on other sites
bn880 5 Posted January 26, 2004 There is no end keyword in OFP Share this post Link to post Share on other sites
OmniMax 0 Posted January 26, 2004 That would explain a lot. The constant stacked dings (mutliple errors, hints) Then how do you end a script? searching the com ref, still can't find how to end a script... nevermind, my ends should be exits. heh. newbie mistake. Share this post Link to post Share on other sites
void_false 1 Posted January 26, 2004 i always thought that to end a script u need to write return 0; Share this post Link to post Share on other sites
MarK (CZ) 0 Posted January 26, 2004 i always thought that to end a script u need to write return 0; That would work e.g. in JavaScript functions Share this post Link to post Share on other sites
Chris Death 0 Posted January 27, 2004 errm - MarK (CZ) may i ask you; what you gotta get paid from the snowboard industry, for each post you gonna post? ~S~ CD Share this post Link to post Share on other sites
OmniMax 0 Posted January 27, 2004 Did somebody say McDonalds? In the near future, (OFP2) I wish BIS would make their syntax more native to another language © because everytime I switch around, I forget the syntax to a language then I keep making syntax errors. Share this post Link to post Share on other sites
bn880 5 Posted January 27, 2004 lol... and every time I post Walker sends me 10 cents. Share this post Link to post Share on other sites
bn880 5 Posted January 27, 2004 Did somebody say McDonalds? In the near future, (OFP2) I wish BIS would make their syntax more native to another language © because everytime I switch around, I forget the syntax to a language then I keep making syntax errors. Bah, you just have to go with the flow, memorizing syntax too well is a waste of your brain. Get a good reference book, or for C/C++ etc get the MSDN library on PC. For OFP you have command reference and examples. Share this post Link to post Share on other sites
MarK (CZ) 0 Posted January 27, 2004 Did somebody say McDonalds?  In the near future, (OFP2) I wish BIS would make their syntax more native to another language © because everytime I switch around, I forget the syntax to a language then I keep making syntax errors.    Bah, you just have to go with the flow, memorizing syntax too well is a waste of your brain.  Get a good reference book, or for C/C++ etc get the MSDN library on PC. For OFP you have command reference and examples.  Yep, but I really hate the way OFP scripts look like. It's getting complicated if I want some more complex calculations and so. Functions are better in this but I can't use them everywhere... Share this post Link to post Share on other sites