Home   Help Search Login Register  

Author Topic: Invalid number of expression ?  (Read 2169 times)

0 Members and 1 Guest are viewing this topic.

reima

  • Guest
Invalid number of expression ?
« 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   ???

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Invalid number of expression ?
« Reply #1 on: 26 Apr 2005, 11:28:58 »
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!
« Last Edit: 26 Apr 2005, 11:29:33 by macguba »
Plenty of reviewed ArmA missions for you to play

reima

  • Guest
Re:Invalid number of expression ?
« Reply #2 on: 26 Apr 2005, 11:37:34 »
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

 ;)

« Last Edit: 26 Apr 2005, 11:39:10 by reima »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Invalid number of expression ?
« Reply #3 on: 26 Apr 2005, 11:47:12 »
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 [ "
Plenty of reviewed ArmA missions for you to play

reima

  • Guest
Re:Invalid number of expression ?
« Reply #4 on: 26 Apr 2005, 12:02:14 »
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?

Offline Blanco

  • Former Staff
  • ****
Re:Invalid number of expression ?
« Reply #5 on: 26 Apr 2005, 12:14:26 »
Quote
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!
Code: [Select]
titleText ["Hallo!","plain"]and

RIGHT
Code: [Select]
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

""
« Last Edit: 26 Apr 2005, 12:27:57 by Blanco »
Search or search or search before you ask.

reima

  • Guest
Re:Invalid number of expression ?
« Reply #6 on: 26 Apr 2005, 12:19:10 »
wow, I typed it myself and it worked.. :-X
well I got my first lesson now, thanks a lot :)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Invalid number of expression ?
« Reply #7 on: 26 Apr 2005, 18:20:33 »
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 ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Invalid number of expression ?
« Reply #8 on: 26 Apr 2005, 18:35:23 »
I was guessing.  ;D  Didn't spot the quotes thing.    Nitpicking scripts is not my strongpoint anyway.   ::)
Plenty of reviewed ArmA missions for you to play

Offline Blanco

  • Former Staff
  • ****
Re:Invalid number of expression ?
« Reply #9 on: 26 Apr 2005, 22:28:42 »
Solve the topic, Reima  :)
Search or search or search before you ask.