kmangame0 {l Wrote}:I am working on a project for school that integrates Philips Hue smart light bulbs into STK. The objective of this project is to use audio-to-visual replacement to allow players whom have hearing disabilities an equal playing advantage. IE: if there is a audio warning for being targeted by a weapon there would also be a visual cue via the smart bulbs. Right now I am working on a way to measure the distance of one kart to another and align that value with the brightness of a bulb (the closer the opponent the brighter the bulb).
For reference I have very little experience in game programming and even less in c++, but I am wondering if anyone who has experience with this code base can tell me if the code already exists in the project to measure the distance between the karts or if I will have to write this logic myself.
for(unsigned int i=0; i<World::getWorld()->getNumKarts(); i++)
{
const AbstractKart* kart = m_world->getKart(j);
if(kart==m_kart) continue; // skip player's kart
float distance = (m_kart->getXYZ() - kart->getXYZ() ).length();
}
kmangame0 {l Wrote}:Thanks so much for your help!
kmangame0 {l Wrote}:Okay guys I have one more question. I am trying to use a python wrapper in order to scoop up the stdout of supertuxkart.app. To do this I have decided to use pythons popen but I am running into some weird behavior.
File "/var/root/Documents/dev/cmichDev/stk/stkReader.py", line 5, in <module>
stdin=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Have you guys ever tried to access the stdin or stdout of supertuxkart? If so, what was your method?
hiker {l Wrote}:'Permission denied' would indicate that perhaps you are trying to start the wrong 'thing' (e.g. perhaps a directory instead of the binary?)
hiker {l Wrote}:Otherwise just copy&paste your code, and we can have a look.
hiker {l Wrote}:Also, on what platform are you on?
hiker {l Wrote}:Note that nearly all output of stk is also written to the log file in the user config directory. If you are adding output, just use the Log::verbose/warning/error/... functions, and you can see it there as well.
Users browsing this forum: No registered users and 1 guest