Frictional Games Forum (read-only)

Full Version: Functional Turntable on Amnesia
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I Love records, but i also love Amnesia, what about putting them together? Models made by me on Blender 2.72, music by Seeburg Basic Library.

[video=youtube]http://youtu.be/K9NbzUTSUVY[/video]

Code:
void OnStart()
{
    AddEntityCollideCallback("tonearm_1", "ScriptArea_3", "slowdown", true, 1);
}

void slowdown(string &in asParent, string &in asChild, int alStates)
{
    PlaySoundAtEntity("true_grit", "true_grit.snt", "Music", 0, false);
    RotatePropToSpeed("tonearm_1", -0.0027, -0.0027, 0, 1, 0, false, "ScriptArea_1");
}

void play(string &in asEntity)
{
    SetEntityInteractionDisabled("button_simple_1", true);
    RotatePropToSpeed("vinyl_1", -0.2, -7.8, 0, 1, 0, false, "");
    RotatePropToSpeed("tonearm_1", -1, -1, 0, 1, 0, false, "ScriptArea_1");
    RotatePropToSpeed("turntable_1", -0.2, -7.8, 0, 1, 0, false, "");
    AddEntityCollideCallback("tonearm_1", "ScriptArea_2", "return_tone", true, 1);
}

void return_tone(string &in asParent, string &in asChild, int alStates)
{
    StopSound("true_grit", 0.01);
    RotatePropToSpeed("tonearm_1", 1, 1, 0, 1, 0, false, "ScriptArea_1");
    AddEntityCollideCallback("tonearm_1", "ScriptArea_4", "stop_return", true, 1);
}

void return_tone_button(string &in asEntity)
{
    StopSound("true_grit", 0.01);
    RotatePropToSpeed("tonearm_1", 1, 1, 0, 1, 0, false, "ScriptArea_1");
    AddEntityCollideCallback("tonearm_1", "ScriptArea_4", "stop_return", true, 1);
}

void stop_return(string &in asParent, string &in asChild, int alStates)
{
    SetEntityInteractionDisabled("button_simple_1", false);
    RotatePropToSpeed("tonearm_1", -1, 0, 0, 1, 0, false, "ScriptArea_1");
    RotatePropToSpeed("vinyl_1", -1, 0, 0, 1, 0, false, "");
    RotatePropToSpeed("turntable_1", -1, 0, 0, 1, 0, false, "");
    AddEntityCollideCallback("tonearm_1", "ScriptArea_3", "slowdown", true, 1);
}

Download of the entities used: Give me the credits!
http://www.mediafire.com/download/6mbrjx...ntable.zip
Nice work!

There's a subforum for these kind of contributions Smile
It's the Development Ressources.
http://www.frictionalgames.com/forum/forum-42.html

Remember to post it there next time.
Moved to resources <3