The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
[CLOSED] Sticky Areas Not Working
theyhunger Offline
Junior Member

Posts: 15
Threads: 6
Joined: Jul 2017
Reputation: 0
#1
[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! Smile
(This post was last modified: 04-15-2018, 12:27 PM by theyhunger.)
04-13-2018, 05:04 PM
Find


Messages In This Thread
[CLOSED] Sticky Areas Not Working - by theyhunger - 04-13-2018, 05:04 PM
RE: Sticky Areas Not Working - by theyhunger - 04-15-2018, 09:03 AM
RE: Sticky Areas Not Working - by Romulator - 04-15-2018, 10:45 AM
RE: Sticky Areas Not Working - by theyhunger - 04-15-2018, 12:26 PM
RE: [CLOSED] Sticky Areas Not Working - by Ongka - 04-16-2018, 07:31 AM



Users browsing this thread: 2 Guest(s)