Jump to content
Sign in to follow this  
OmniMax

[] exec "beginmission.sqs"

Recommended Posts

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

<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

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
i always thought that to end a script u need to write

return 0;

biggrin_o.gif

That would work e.g. in JavaScript functions tounge_o.gif

Share this post


Link to post
Share on other sites

errm - MarK (CZ)

may i ask you; what you gotta get paid from the snowboard

industry, for each post you gonna post? tounge_o.gif

~S~ CD

Share this post


Link to post
Share on other sites

Did somebody say McDonalds? biggrin_o.gif

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.

crazy_o.gifcrazy_o.gifcrazy_o.gif

Share this post


Link to post
Share on other sites
Did somebody say McDonalds? biggrin_o.gif

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.

crazy_o.gifcrazy_o.gifcrazy_o.gif

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. biggrin_o.gif

Share this post


Link to post
Share on other sites
Did somebody say McDonalds?  biggrin_o.gif

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.  

crazy_o.gif  crazy_o.gif  crazy_o.gif

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.  biggrin_o.gif

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×