Frictional Games Forum (read-only)
My valves are flipping out!!!! - 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 Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: My valves are flipping out!!!! (/thread-18574.html)



My valves are flipping out!!!! - Nuclearbones - 10-01-2012

No joke. I wish I could record it and put it on YouTube for you guys, it's a truly grand moment.

But with all seriousness. I coded the script to get stuck and play a sound. But when I did my test run the first time I had forgotten to clarify my alState. Fixed that problem. Second test run, when I twist it to the right side it:
1. Makes the wrong sound (broken glass instead of metal clunk)
2. The valve begins to continuously spin at a fast speed, and there was no stopping it.

I don't know what I did, but I might keep that effect. But Just in-case I change my mind I would like the solution to both of these problems. Here is my .hps script so you can see.

Code:
////////////////////////////
// Run first time starting map
void OnStart()
{  
    //Valves
    SetEntityConnectionStateChangeCallback("valve_iron_1", "Unlock1");
    SetEntityConnectionStateChangeCallback("valve_iron_2", "Unlock2");
    SetEntityConnectionStateChangeCallback("valve_iron_3", "Unlock3");
    
}

void Unlock1(string &in asEntity, int level_state)
{
    if (level_state == 1)
    {
    PlaySoundAtEntity("", "07_pick_lock.snt", "Player", 0.0f, false);
    SetWheelStuckState(asEntity, 1, true);
    }
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Thanks for your support guys.

[EDIT]
I really need the help with changing the sounds people.


RE: My valves are flipping out!!!! - Robby - 10-01-2012

That's quite strange. Isn't it supposed to be "lever_state" in the script?

I don't know about this stuff (a bit too complex for me). I do make scripts and all, but this is a bit more advanced.


RE: My valves are flipping out!!!! - Nuclearbones - 10-14-2012

(10-01-2012, 07:03 PM)Nemet Robert Wrote: That's quite strange. Isn't it supposed to be "lever_state" in the script?

I don't know about this stuff (a bit too complex for me). I do make scripts and all, but this is a bit more advanced.
Nope, I'm using valves so it would be "wheel_state".

Oh well sorry, this is my first CS and I am also making it the most complex.