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
Help with a script file? :)
ApeCake Offline
Member

Posts: 116
Threads: 20
Joined: Jun 2012
Reputation: 4
#3
RE: Help with a script file? :)

So you want to use the key on a locked Iron Maiden, and then a monster appears behind you? I hope I got that right. Anyways, this is the script that hopefully works, I haven't tested it myself.

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("nameofIronMaiden", false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem("nameofkey");
}


You could either choose to let the monster spawn when you unlock the door, or when you open the door after you've unlocked it. The first one is very easy. Just add SetEntityActive("NameofMonster", true); to void UsedKeyOnDoor(string &in asItem, string &in asEntity). Make sure you have an inactive monster in your level editor on the place you want him to spawn.
Here is the second one.



void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("nameofIronMaiden", false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem("nameofkey");
}


void NAMEofFUNCTION(string &in entity)
{
SetEntityActive("NameofMonster", true);
}

Click the iron maiden in the level editor and go to the Entity tab. Write NAMEofFUNCTION in "PlayerInteractCallback".
06-30-2012, 08:14 PM
Find


Messages In This Thread
Help with a script file? :) - by lbrosious96 - 06-30-2012, 12:30 AM
RE: Help with a script file? :) - by Cruzore - 06-30-2012, 12:41 AM
RE: Help with a script file? :) - by ApeCake - 06-30-2012, 08:14 PM



Users browsing this thread: 1 Guest(s)