theyhunger
Junior Member
Posts: 15
Threads: 6
Joined: Jul 2017
Reputation:
0
|
[CLOSED] Sticky Areas Not Working
I have "used" the cogwheel puzzle from Dungeon - Justine but changed it so you need to find all three cogwheels instead of just one for the puzzle. In-game, the first cogwheel does stick to that area but the other two does not. I don't understand why it's not working so maybe whoever is reading this can help me out. If you need information on the, here are some screenshots. Thanks!
https://imgur.com/a/UmQTA
If that doesn't work, the Sticky Area goes as follows:
MoveBody (tick)
RotateBody (tick)
PoseTime (0.5)
AttachableBodyName (elevator_cogwheel01_1_Body)
AttachFunction (StartFixMachineTimer)
AttachSound (13_attach_wheel.snt)
AttachPS (ps_hit_metal.ps)
And the code goes as follows:
void StartFixMachineTimer(string &in asEntityName, string &in asBodyName)
{
AddLocalVarInt("CogsPlaced", 1);
if(GetLocalVarInt("CogsPlaced")==3){
//Just incase setting a stick on/off after something is stuck is not a good idea.
SetEntityActive("AreaCloseToMachine", false);
AddTimer("", 1.0f, "FixMachine");
//AddDebugMessage("Make some time until cog is in place...", false);
}
}
void FixMachine(string &in asTimer)
{
PlaySoundAtEntity("run1", "L03_machine_run", "AreaMachineSound", 2.0f, false);
PlaySoundAtEntity("run2", "L03_machine_extra", "AreaMachineSound", 2.0f, false);
PlaySoundAtEntity("start", "13_ignite", "AreaMachineSound", 0.2f, false);
RotatePropToSpeed("cogwheel01", 1, 1, -1, 0, 0, false, "");
RotatePropToSpeed("cogwheel02", 1, 1, 1, 0, 0, false, "");
RotatePropToSpeed("cogwheel03", 1, 1, -1, 0, 0, false, "");
RotatePropToSpeed("elevator_machine_cog_small_5", 1, 1, 1, 0, 0, false, "");
RotatePropToSpeed("elevator_machine_cog_small_4", 1, 2, -2, 0, 0, false, "");
RotatePropToSpeed("elevator_machine_cog_small_6", 1, 1, 1, 0, 0, false, "");
RotatePropToSpeed("elevator_machine_cog_small_7", 1, 2, -2, 0, 0, false, "");
RotatePropToSpeed("elevator_machine_cog_small_2", 1, 1, 0, 0, 1, false, "");
RotatePropToSpeed("elevator_machine_cog_small_3", 1, 2, 0, 0, -2, false, "");
RotatePropToSpeed("elevator_machine_cog_small_1", 1, 1, 0, 0, 1, false, "");
RotatePropToSpeed("elevator_machine_cog_small_8", 1, 1, 1, 0, 0, false, "");
RotatePropToSpeed("elevator_machine_cog_small_9", 1, 2, -2, 0, 0, false, "");
RotatePropToSpeed("elevator_machine_cog_small_10", 1, 1, 1, 0, 0, false, "");
RotatePropToSpeed("elevator_machine_cog_small_11", 1, 2, -2, 0, 0, false, "");
RotatePropToSpeed("cogwheel_large_3", 0.6, 0.6f, 0, 0, 1, false, "");
RotatePropToSpeed("cogwheel_medium_6", 1, 1, 0, 0, -1, false, "");
RotatePropToSpeed("cogwheel_medium_7", 1, 1, 0, 0, 1, false, "");
RotatePropToSpeed("cogwheel_medium_3", 1, 1, 1, 0, 0, false, "");
RotatePropToSpeed("cogwheel_medium_4", 1, 1, -0.8, -0.2, 0, false, "");
RotatePropToSpeed("cogwheel_medium_5", 1, 1, 0.3, 0.6, 0, false, "");
RotatePropToSpeed("cogwheel_large_1", 0.6, 0.6, 0, -1, 0, false, "");
RotatePropToSpeed("cogwheel_large_2", 0.6, 0.6, 0, 1, 0, false, "");
RotatePropToSpeed("cogwheel_medium_1", 1, 1, 0, -1, 0, false, "");
RotatePropToSpeed("cogwheel_medium_2", 1, 1, 0, 1, 0, false, "");
//AddDebugMessage("Cogwheel in place, starting machine!", false);
SetLocalVarInt("MachineFixed", 1);
}
P.S. the names of the Sticky Areas are just simply StickyArea_1-3.
The only difference between the three sticky areas is that the attachable body name is slightly different. It changes from elevator_cogwheel01_1_Body to elevator_cogwheel02_1_Body and elevator_cogwheel03_1_Body.
If you need any more info or screenshots, let me know!
(This post was last modified: 04-15-2018, 12:27 PM by theyhunger.)
|
|