• Dear visitors,

    The email issue has been finally solved.
    Thank you for your patience and happy browsing.

    Team ACM.

Begining with app development

Guillermo

New Member
Hi everybody.

I was trying to make my fist and very simple app for assetto, but I'm having a very anoying issue so I'm assuming I'm doing something wrong but I can't see where or wath.

I have read the python doc thread and follow this tutorial

https://github.com/ckendell/ACAppTutorial/blob/master/ACAppTutorial.md

But If I try to do anything more, like read the parameter ThermalState, the app get the error: "ERROR LOADING MODULE..."

Right now I don't have any example of code to show, but my thoughts is that the python doc is not updated, Am I right?

I'm going to writte a little app and post it there so you could tell me what I'm doing wrong.

See you...
 

Guillermo

New Member
So, I have make the simplest app in the world.
The first part which laps are counted, it's a copy paste form the tutorial I posted yesterday.
Add a RPM counter is the easiest thing in the world but I just get "Python [ERROR] Error Loading Module: sys.path.append('apps/python/showme')"

Code:
import sys
import ac
import acsys


l_lapcount=0
lapcount=0
l_Revs=0

def acMain(ac_version):
    global l_lapcount

    appWindow = ac.newApp("showme")
    ac.setSize(appWindow, 200, 200)

    l_lapcount = ac.addLabel(appWindow, "Laps: 0")
    ac.setPosition(l_lapcount, 3, 30)

    l_Revs = ac.addLabel(appWindow, "RPM: 0")
    ac.setPosition(l_Revs, 3, 50)

    return "showme"

def acUpdate(deltaT):
    global l_lapcount, lapcount, l_Revs

    laps = ac.getCarState(0, acsys.CS.LapCount)
    if laps > lapcount:
        lapcount = laps                    
        ac.setText(l_lapcount, "Laps: {}".format(lapcount))
       
    Revs = ac.getCarState(0, acsys.CS.RPM)
    ac.setText(l_Revs, "RPM: {}".format(Revs))
Maybe it's just syntax problem due to lack knowleg of python, but the syntax is very simple and add a label and read a value is trivial, but no way...I'm doing something really wrong and I can't see.
 

Guillermo

New Member
Ok, I have found one of my problems, I'm identing code with TABs, and python don't like TABs :banghead:
kyle 1-1 Python :D

Round 2:
I can't read any data from acsys or SimInfo(), but the lapcount.
So what am I doing wrong?
Code:
import sys
sys.path.insert(0, 'apps/python/showme/dll')
import ac
import acsys
import math
from libs.sim_info import SimInfo

sim_info = SimInfo()

l_lapcount=0
lapcount=0
l_Revs=0
Revs=0
l_Gear=0
Gears=0
l_Compound=''
Compound=''

def acMain(ac_version):
    global l_lapcount

    appWindow = ac.newApp("showme")
    ac.setSize(appWindow, 200, 200)
    l_lapcount = ac.addLabel(appWindow, "Laps: 0")
    ac.setPosition(l_lapcount, 3, 30)
    l_Revs = ac.addLabel(appWindow, "RPM: 0")
    ac.setPosition(l_Revs, 3, 45)
    l_Gear = ac.addLabel(appWindow, "Gear: 0")
    ac.setPosition(l_Gear, 3, 60)
    l_Compound = ac.addLabel(appWindow, "Tyre: none")
    ac.setPosition(l_Compound, 3, 75)
   
    return "showme"

def acUpdate(deltaT):
    global sim_info, l_lapcount, lapcount, l_Revs, l_Gear, Revs, Gears, l_Compound, Compound
   
    laps = ac.getCarState(0, acsys.CS.LapCount)
    if laps > lapcount:
        lapcount = laps                    
        ac.setText(l_lapcount, "Laps: {}".format(lapcount))
    Revs = ac.getCarState(0, acsys.CS.RPM)
    ac.setText(l_Revs, "RPM: {}".format(Revs))
    Gears = sim_info.physics.gear
    ac.setText(l_Gear, "Gear: {}".format(Gears))
    Compound = sim_info.graphics.tyreCompound
    ac.setText(l_Compound, "Tyre: {}".format(Compound))

def acShutdown():
    ac.log("Shuttingdown showme")
    ac.console("Shuttingdown showme")
 

ACDT

New Member
hi if i wanted to make a app wich is like a parking sensor so when somone is near me it will fire off a beep or maybe indacate with a png light :) only its for drifting i hate hiting walls n well this is the app ima try make :) also mayeb have levels of difrent beeps or lights for how close u are
 
Top