The online racing simulator
Getting CamLevel to work with Z30
hey guys / Scawen!

after INSIM_VERSION was increased to 5, for example the insim-tool "camlevel" (http://www.lfsforum.net/showth ... 37&highlight=camlevel) doesn't work anymore because it won't work with any other version than 4, like it says in it's programming in "camlevel.py":


# Try to connect to LFS...
insim = socket.socket()
connected = False
while not(connected):
try:
print 'Attempting to connect to LFS on port', insimport, '...'
insim.connect(('localhost',insimport))
insim.send(is_isi.pack(44,1,1,0,outsimport,0,0,0,0,'','CamLevel'))
version = is_ver.unpack(insim.recv(20))
if version[6] != 4:
print 'Wrong InSim version, (expected 4, got', version[6],',) exiting...'
time.sleep(5)
sys.exit()
else:
connected = True
print 'Connected to LFS...'
except socket.timeout:
print 'LFS did not respond to connection attempt, waiting 5 seconds...'
time.sleep(5)
except socket.error:
print 'Could not connect to LFS, check that InSim ports match.'
time.sleep(5)

can I do anything about this? I'd really like to use the tool furthermore..
Change the 4 to a 5.

# Try to connect to LFS...
insim = socket.socket()
connected = False
while not(connected):
try:
print 'Attempting to connect to LFS on port', insimport, '...'
insim.connect(('localhost',insimport))
insim.send(is_isi.pack(44,1,1,0,outsimport,0,0,0,0,'','CamLevel'))
version = is_ver.unpack(insim.recv(20))
[b]if version[6] != 5:[/b]
print 'Wrong InSim version, (expected 4, got', version[6],',) exiting...'
time.sleep(5)
sys.exit()
else:
connected = True
print 'Connected to LFS...'
except socket.timeout:
print 'LFS did not respond to connection attempt, waiting 5 seconds...'
time.sleep(5)
except socket.error:
print 'Could not connect to LFS, check that InSim ports match.'
time.sleep(5)

Quote from phoenixIlooka :
can I do anything about this? I'd really like to use the tool furthermore..

I don't suppose you tried to just change the '4' into '5' I would have tried but cba to install older python versions...


E: Dammit you irritating scotsman
I tried to change 4 to 5, but the tool just does the same as before, like if I didn't change anything?!

Isn't the "camlevel.py" the file i need to change? because it's the only one where i can see such plausible code regarding the insim version.
Do I have to get the source code and compile a new exe? Because I never did that..

Or what do I have to do with python? what is it?
Quote from phoenixIlooka :I tried to change 4 to 5, but the tool just does the same as before, like if I didn't change anything?!

Well, if you modify the source code, running the application won't do any good untill you compile it again...

The py-file is the source code. You can run it by installing the python interpreter. This code will not work with anything above version 2.5. Additionally you need the pygame-module (which is the reason newer python versions won't work).

The setup.py file is for a module called cx_freeze which is used to compile the exe out of the python file.
But if phoenixIlooka isn't a programmer, then probably that's a bit too much to do. I'm one and I wouldn't know what to do...

phoenixIlooka, maybe you can find the original thread where the programmer posted the program, and he (or another python programmer) can post a new version that works with the later InSim?
-
(hyntty) DELETED by hyntty : NOM NOM
Here's an updated version that should work with InSim 5.

If I push myself to get back into LFS and InSim development, I may take this on and flesh it out a bit... certainly update it to use DarkTimes's pyinsim instead of the "by-hand" code that's in there now.

http://dl.dropbox.com/u/7022167/camlevel2.zip
It doesn't work..
It's the same as it was before..
Attached images
camlvl.png
Travis forgot to compile the exe again... that's why

Before I even try and do that I have a question: How is it even supposed to work? I get nothing but 'Outsim enabled' in LFS and 'Outsim timed out' in the app itself? Problem at my end (firewall blocking perhaps?) or should something else too be updated?
I'll take a closer look at it sometime later today. Honestly (and by the original author's own admission), it's a bit of a mess. It needs a pretty serious overhaul.
Quote from hyntty :Travis forgot to compile the exe again... that's why

Before I even try and do that I have a question: How is it even supposed to work? I get nothing but 'Outsim enabled' in LFS and 'Outsim timed out' in the app itself? Problem at my end (firewall blocking perhaps?) or should something else too be updated?

In the original thread a few persons had this problem, too.
Maybe you can find a solution there.

For example I just excluded the whole LFS-folder from observation in my firewall program.
a small side-note, i know it is off-topic, but still should add..

for whoever takes a look at that program, is it possible to make it possible if your head-movement is an axis? or would that be a large problem to fix.
I updated it to work with Z30, the link is in the first post of the original thread. As for other problems/issues, I really hoped someone else who knew what they were doing would pick it up and make it more functional, I really only intended it as a demo of what I wished the developers would add to LFS itself.

FGED GREDG RDFGDR GSFDG