OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: reima on 26 Apr 2005, 11:21:21
-
Hi, I have a small problem..
I was reading Johan Gustafson's scripting tutorial and I managed to make the 'hello.sqs' -file.
BUT
When I clicked 'preview' it said 'error: invalid number of expression' ? or sumthing..
(and I did everything as the tutorial said?) What's my problem ???
-
You probably have a tiny error somewhere: a single letter wrong, or : instead of a ;. Check through it again.
Whenever you get an error message, always quote it exactly in the forum. It really helps us understand what's going on. The error message usually includes a hash sign #, which indicates where in the line of code the error has occurred. (It isn't always right, but it helps.)
Oh, and
Welcome to the forum!
-
Thanks :)
this is what it says:
Titletext [|#| "hello!", "plain down"]' : error invalid number in expression
and this is my hello.sqs
TitleText ["Hello!","plain down"];exit <- something wrong?
this is my first day when im editing missions so don't be mad at me
;)
-
We're not mad, questions like this is what the forum is for. You're doing exactly the right thing - having a go at a tutorial and asking for help here when you get stuck.
However, I'm not sure what the problem is. It should work. Try putting the exit on the next line like this:-
titleText ["Hallo!","plain"]
exit
Check that there are no extra spaces, for example it should be [" not [ "
-
Hum.. I copy pasted that script straight from that tutorial so it should be ok.
I'm thinkin' that could there be something wrong with my game?
I'm using the FDF - mod ( Finish Defensive Forces )
oh, and one question, what is that "debug console" -thing for?
what does it do?
-
Hum.. I copy pasted that script straight from that tutorial so it should be ok.
Don't copy/paste it, type in yourself, the faster you will learn :)
Your code is right but I think you are using the wrong parenthesis
See the difference between
WRONG!
titleText ["Hallo!","plain"]and
RIGHT
titletext ["Hallo!","plain"]
When you copy the text from the tutorial the parenthesis will look like this
""
when you type it, it looks like this
""
-
wow, I typed it myself and it worked.. :-X
well I got my first lesson now, thanks a lot :)
-
Check that there are no extra spaces, for example it should be [" not [ "
Oh I just need to nitpick, again...
That bears no relevance macca... works even if you have 8000 spaces between [ and "...
Well, I tried it with 20 spaces, but anyway ::)
-
I was guessing. ;D Didn't spot the quotes thing. Nitpicking scripts is not my strongpoint anyway. ::)
-
Solve the topic, Reima :)