EddieShoe
Junior Member
Posts: 28
Threads: 6
Joined: Sep 2010
Reputation:
0
|
RE: Lever help needed [UNSOLVED]
(07-04-2012, 04:22 PM)Steve Wrote: (07-04-2012, 03:55 PM)EddieShoe Wrote: So, I think I got what you meant. It works for me on my map, but I am not 100% sure this is what you wanted. I'm no pro at this either, I just tried my best. I've learned a lot from Your Computer so you should definitely try out his tutorials. Anyway, here's the script:
void leverfunc(string &in asEntity, int alState)
{
if (alState == 1)
{
SetSwingDoorClosed("your_door_here", false, false); Don't know if this has to be here, opens to door.
SetSwingDoorDisableAutoClose("your_door_here ", true); Disables auto-closing of the door.
AddPropImpulse("your_door_here ", X, Y, >, "world"); Opens the door in the desired direction.
return;
}
if (alState == -1)
SetSwingDoorClosed("your_door_here", true, false); Closes the door.
}
EDIT: Maybe you want to add SetSwingDoorDisableAutoClose("your_door_here ", false); under the -1 state as well, just before the SetSwingDoorClosed. It gives me this error :/
main (41, 43): ERR : Exected expresion value
I put it in like this.
void OnStart()
{
SetEntityConnectionStateChangeCallback("LeverComplete", "leverfunc");
}
void leverfunc(string &in asEntity, int alState)
{
if (alState == 1)
{
SetSwingDoorClosed("hatch_drainage_1", false, false);
SetSwingDoorDisableAutoClose("hatch_drainage_1", true);
AddPropImpulse("hatch_drainage_1", 0, 0, >, "world");
return;
}
if (alState == -1)
SetSwingDoorClosed("hatch_drainage_1", true, false);
SetSwingDoorDisableAutoClose("hatch_drainage_1", true);
}
at the X and Y part I had no idea what to fill in so I just put 0, 0 like YC
line 41 is : AddPropImpulse("hatch_drainage_1", 0, 0, >, "world");
AH! I forgot to change that typo, it's supposed to say X, Y, Z and you have to change it to the axis you want it to move along. That was a minor mistake but still dumb, sorry! Example is 0, 0, 15, that will move it +15 along the Z axis.
Currently working on: "Awake"
Progress: ~5%
|
|