Frictional Games Forum (read-only)
Functional Turntable on Amnesia - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Resources (https://www.frictionalgames.com/forum/forum-42.html)
+---- Thread: Functional Turntable on Amnesia (/thread-29880.html)



Functional Turntable on Amnesia - André Campana - 05-03-2015

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/6mbrjxbh1no4x26/turntable.zip


RE: Functional Turntable on Amnesia - FlawlessHappiness - 05-03-2015

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.


RE: Functional Turntable on Amnesia - Statyk - 05-03-2015

Moved to resources <3