Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My valves are flipping out!!!!
Nuclearbones Offline
Junior Member

Posts: 45
Threads: 19
Joined: May 2012
Reputation: 0
#1
My valves are flipping out!!!!

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.

////////////////////////////
// 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.
(This post was last modified: 10-01-2012, 06:53 PM by Nuclearbones.)
10-01-2012, 02:19 AM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#2
RE: My valves are flipping out!!!!

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.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
10-01-2012, 07:03 PM
Website Find
Nuclearbones Offline
Junior Member

Posts: 45
Threads: 19
Joined: May 2012
Reputation: 0
#3
RE: My valves are flipping out!!!!

(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.
10-14-2012, 04:32 AM
Find




Users browsing this thread: 1 Guest(s)