Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Syntax Error

Author
Message
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 30th Apr 2005 10:53 Edited at: 1st May 2005 03:41
I have another syntax error but I can't work out where it is, can someone help me please I have been trying this for hours

hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 30th Apr 2005 14:12
I think it's right here:



You have an if statement with a then in the same line, but then you continue it into an if, else statement. Try changing it to this:


Next time, please put your code in a snippet so there's some indenting. It'll make it much easier for us to spot errors.

vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 1st May 2005 03:41
Yes thanks you sorry I thoght I had got the code all in the code snippet brackets
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 1st May 2005 03:41
There done, thanks Hyrichter
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 1st May 2005 03:49
Sorry I did try your suggestion but it didn't work
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 1st May 2005 04:46
Now that it's in a snippet, I *think* I've spotted the error. It's a little above where I thought it was before. It appears to be with this block of code -- you have an extra endif in there that probably shouldn't be there.


Try taking out the endif that's right below the line:
set camera to object orientation 2

That should at least get rid of your syntax error (hopefully) but it may not work as you intend it to, as I'm not totally sure what does what in your code.

vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 1st May 2005 13:11
It is meant to allow the player to get into the tank and be able to control it, thanks though by the way hyrichter, I shall se if this works
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 1st May 2005 13:13
No still getting this error, I shall struggle on though
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 1st May 2005 17:05
I see like 5 errors in that code but they are errors in such a way that they make the code hard to tell what it is supposed to do.

I marked all the errors I seen but could not fix them because of their location and type. I marked them with
`*****************
`comment
`*****************



vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 1st May 2005 21:02
I see, thanks Lost In Thought I will copy the code down and see if I can get things to work
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 1st May 2005 21:12 Edited at: 1st May 2005 21:13
No tried it and put the corrections in but I still get a syntax error for some strange reason

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st May 2005 22:26
I don't get a syntax error, but a nesting error. Wich means you forgot a "then" or "loop" or "next"...
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 1st May 2005 23:27
Yes thanks Sven B sorry my mistake I will go through this again then
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 2nd May 2005 05:23 Edited at: 2nd May 2005 05:24
This else doesn't need to be there.



Also you never put and endif to this



vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 3rd May 2005 02:08
Sven B where do I put the "Next" or "Then" or "Loop" and thanks Lost In Thought I will have a look at it
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 6th May 2005 07:01
Did you ever get this fixed?

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th May 2005 04:02
"Then" belongs after the "if" or "else" command...
"next" belongs after the "for" command...
"loop" belongs after the "do" command...

'fcourse you have to write code between it...
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th May 2005 04:20
By the way, i fully debugged your code:

vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 7th May 2005 06:26
Thank you I will test this Sven B
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 7th May 2005 06:34
I can't get the movement as before I shall have to work on it some more but it is working OK
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th May 2005 16:34
Oh before i forget!
i added a command: point camera x#,y#,z#

Anyway, remove it if you want.
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 7th May 2005 22:09 Edited at: 9th May 2005 02:17
Yes I remed it but I still get everything frozen I can't move the player or get to the tank I am just stuck just don't know why that is,
I could use some help on that
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 8th May 2005 21:44
I don't really get your angles. Why do you pitch your object?
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 9th May 2005 02:17 Edited at: 9th May 2005 02:29
I used the pitch object cfommands because I really wanted to get the tank to pitch without flying of the the ground or flying though the ground and I couldn't get the newvalue commands to do what I wanted, and I can only get the pitch using objects it was so that if your in the hovertank you can pitchlower to shoot say another enemy piulot.

But I suddenly realise I might not need it if I make the bullets a little smarter so they can target the enemy pilot who would be running on foot if he ejected out of his destroyed hover or hovercraft tank

Login to post a reply

Server time is: 2025-05-22 23:43:02
Your offset time is: 2025-05-22 23:43:02