PDA

View Full Version : Getting CamLevel to work with Z30


phoenixIlooka
24th April 2011, 12:10
hey guys / Scawen!

after INSIM_VERSION was increased to 5, for example the insim-tool "camlevel" (http://www.lfsforum.net/showthread.php?t=37537&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..

DarkTimes
24th April 2011, 12:25
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))
if version[6] != 5:
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)

hyntty
24th April 2011, 12:25
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' :D I would have tried but cba to install older python versions...


E: Dammit you irritating scotsman

phoenixIlooka
24th April 2011, 12:56
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?

hyntty
24th April 2011, 15:42
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.

Scawen
24th April 2011, 18:21
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?

phoenixIlooka
24th April 2011, 19:23
It is this thread: http://www.lfsforum.net/showthread.php?t=37537&highlight=camlevel

I already asked but I don't think the author will work on that again...
And I don't know any other python programmer as you were right - i'm not a programmer :)

tmehlinger
24th April 2011, 20:44
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

phoenixIlooka
25th April 2011, 12:28
It doesn't work..
It's the same as it was before..

hyntty
25th April 2011, 12:50
Travis forgot to compile the exe again... that's why :D

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?

tmehlinger
25th April 2011, 14:54
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.

phoenixIlooka
26th April 2011, 08:56
Travis forgot to compile the exe again... that's why :D

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.

logitekg25
26th April 2011, 19:10
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.

Rotareneg
26th April 2011, 20:03
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.

phoenixIlooka
26th April 2011, 20:42
thank you very much!

http://dagobah.net/flash/thank_you.swf

:D