Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ERR : Expected expression value
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
RE: ERR : Expected expression value

This code is... rather... overcomplicated. I won't judge harshly on that, but it did take a while to weed through it to find out your error.

Please note I'm referring to my image, thus I will use the numbers relative to your code. For example, instead of stating Line 1446, I will state Line 185. You can also click the image if it is too small.

[Image: 12f8650e76.png]

From what I can see, after formatting your code, you start an if-then-else conditional on Line 12 and call the else at Line 20. That's fine, but then all of the code between Line 21 and Line 184 runs.

Your error, however, is because you have declared the else statement at Line 20, you can't declare the else at Line 185. The reason being is this:

PHP Code: (Select All)
if(conditionis true    //Line 12
//execute                       //Line 14-18
condition is false       //Line 20
//execute                       //Line 22-184
condition is false       //Line 185
//Error                          //There is an error, because we check for a true condition, and otherwise give a false. 

There are two ways you can fix this, other than reorganising your code so it is just that little bit more pleasing to view.

1. Use an else if statement to check for another set conditional. This means, adding another conditional check to your if-then-else for another specific value or range. This would turn the above snippet into this:
if(condition_1 is true)
else if(condition_2 is true)
else (condition is false)

You can find more info about that here: https://wiki.frictionalgames.com/hpl2/am...-statement

Or 2. You can add another if-then-else to do the checking necessary against the value or variable you would like, outside of the original if-then-else between Line 20 and Line 184.

Not much more I can suggest. Good luck! Also - you've posted this in the wrong section, it should go into Development Support, but I understand that unregistered users cannot post there, so no biggie! I'll move it over when this issue is solved Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 09-20-2016, 04:53 PM by Romulator.)
09-20-2016, 04:48 PM

Messages In This Thread
ERR : Expected expression value - by XDJ5000 - 09-20-2016, 04:14 PM
RE: ERR : Expected expression value - by Romulator - 09-20-2016, 04:48 PM
RE: ERR : Expected expression value - by XDJ5000 - 09-20-2016, 05:39 PM

Users browsing this thread: 1 Guest(s)