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
Silly scripting
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#2
RE: Silly scripting

Is "keyfordoor" the name of the key? I would normally leave it its default name.

void OnStart()
{
AddUseItemCallback("", "keyfordoor", "mansion_2", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("keyfordoor", "OnPickup");
}
Get rid of SetEntityCallbackFunc("keyfordoor", "OnPickup"); "keyfordoor" should go into the Key's Callbackfunc in the level editor.

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_2", 0, false);
RemoveItem("keyfordoor");
}
Replace string &in asItem, string &in asEntity with string &in entity, string &in type

void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("monster", true);
ShowEnemyPlayerPosition("monster");
}
Replace string &in asEntity, string &in type with string &in entity, string &in type


That should make it work.

08-19-2011, 06:08 PM
Find


Messages In This Thread
Silly scripting - by GoDl1Kelol - 08-19-2011, 04:38 PM
RE: Silly scripting - by Rapture - 08-19-2011, 06:08 PM
RE: Silly scripting - by GoDl1Kelol - 08-19-2011, 07:24 PM



Users browsing this thread: 1 Guest(s)