04-11-2011, 03:43 AM
I dont know what im doing wrong. This stuff is confusing.
all i want is a door to close behind me and my character to spin around and look at it. Heres the my script for it. The game keeps giving me an error when i try to start up the map.
////////////////////////////
// Run first time starting map
void OnStart()
{
SetMessage("Journal", "start", 8.0f);
AddUseItemCallback("", "doorkey_1", "castle_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "exitkey_1", "metal_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player", "doorslam", "Collidedoorslam, true, 1);
}
void Collidedoorslam(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("castle_2", 6, 8, "");
SetSwingDoorClosed("castle_2". true, true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("doorkey_1");
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
RemoveItem("exitkey_1");
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt_1" , true);
}
all i want is a door to close behind me and my character to spin around and look at it. Heres the my script for it. The game keeps giving me an error when i try to start up the map.
Spoiler below!
////////////////////////////
// Run first time starting map
void OnStart()
{
SetMessage("Journal", "start", 8.0f);
AddUseItemCallback("", "doorkey_1", "castle_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "exitkey_1", "metal_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player", "doorslam", "Collidedoorslam, true, 1);
}
void Collidedoorslam(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("castle_2", 6, 8, "");
SetSwingDoorClosed("castle_2". true, true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_1", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_1", 0, false);
RemoveItem("doorkey_1");
SetSwingDoorLocked("metal_1", false, true);
PlaySoundAtEntity("", "unlock_door", "metal_1", 0, false);
RemoveItem("exitkey_1");
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt_1" , true);
}