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
"Area" behaving like an item to be picked up.
laakkone Offline
Junior Member

Posts: 3
Threads: 1
Joined: Sep 2013
Reputation: 0
#4
RE: "Area" behaving like an item to be picked up.

Kurton Wrote: This happens if the area type is set to 'Examine' instead of 'Script'
It is set to 'Script'

Statyk Wrote: Can you post your script for the map please?

void OnStart()
{
    AddUseItemCallback("", "key1", "work_desk_door_1", "key_desk", true);
    AddUseItemCallback("", "crowbar", "mansion_1", "UsedCrowbarOnDoor", true);
    AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
    AddEntityCollideCallback("Player", "music_script", "musictest", false, 0);
}


void musictest(string &in asParent, string &in asChild, int alState)
{
        if(alState == 1)
        {
        PlayMusic("18_puzzle_valve01.ogg", false, 1, 1, 1, true);
        }
        if(alState == -1)
        {
        StopMusic(1, 1);
        }
}



void DoorLockedPlayer(string &in entity)
{
    if(GetSwingDoorLocked("work_desk_door_1") == true)
    {

        SetMessage("Messages", "desk_locked_1", 0);

    }
}


void key_desk(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked(asEntity, false, true);
    PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
    RemoveItem(asItem);
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar");
}


void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.ogg", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
    AddPlayerSanity(25);
    SetSwingDoorLocked("mansion_1", false, true);
    AddPropImpulse("mansion_1", 0, 0, -50, "World");
    SetSwingDoorDisableAutoClose("mansion_1", true);
    SetSwingDoorClosed("mansion_1", false, false);
    SetMoveObjectState("mansion_1", 1);
    PlaySoundAtEntity("", "break_wood_metal.ogg", "AreaBreakEffect", 0, false);
    CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
    SetEntityActive("crowbar_joint_1", false);
    SetLocalVarInt("Door", 1);
}


void OnEnter()

{
    PlayMusic("01_amb_darkness.ogg", true, 1, 1, 0, true);
}

void OnLeave()
{
}
09-21-2013, 08:43 PM
Find


Messages In This Thread
RE: "Area" behaving like an item to be picked up. - by laakkone - 09-21-2013, 08:43 PM



Users browsing this thread: 1 Guest(s)