lianlab / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

Blender action actuator "Frame Property" not working #297

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. load the attached file in Blender and run gamekit addon
2.
3.

What is the expected output? What do you see instead?
Game should quit after 50 frames of animation but it doesn't. I tried BGE and 
it quits as expected. So I guess gamekit can't handle Frame Property in action 
actuator properly. Just thought I should point out this in case it's a bug that 
is easy to fix. 

What version of the product are you using? On what operating system?
OSX 10.8
Blender 2.63
GameKit 1186

Please provide any additional information below.

Original issue reported on code.google.com by afterb...@gmail.com on 16 Jan 2013 at 1:32

Attachments:

GoogleCodeExporter commented 9 years ago
The attached file should be here ...

Original comment by afterb...@gmail.com on 16 Jan 2013 at 6:47

Attachments:

GoogleCodeExporter commented 9 years ago
Yes you are right. This is not working...

Original comment by thomas.t...@googlemail.com on 16 Jan 2013 at 7:09

GoogleCodeExporter commented 9 years ago
This can easily fixed changing the file gkActionActuator.cpp like this

void gkActionActuator::update(void)
{   
    if (!m_isPlaying) return;

    if (m_state != m_link->getState())
    {
        stateChanged();
        return;
    }

    gkScalar t = getElapsedTime() + m_start;
    bool end = t >= m_end;
    bool off = isPulseOff();

// ----- Fix
    if (gkVariable *var = m_object->getVariable(m_startProp))
        var->setValue(t*m_animFps);
// -----

    if (off)
        m_ignorePulseOn = false;

    if (m_mode == AA_LOOP_END)
    {
        if (end)
        {
            stopAction();
            if (!off)
                playAction();
        }
    }
    else if (m_mode == AA_LOOP_STOP)
    {
        if (off)
            stopAction();
        else if (end)
            resetAction(false);
    }
    else //if (m_mode == AA_PLAY)
    {
        if (end)
            stopAction();
    }
}

Original comment by rhodyl...@gmail.com on 2 Dec 2014 at 4:57