Hi Forum again
Im writing this thread for i have a problem
I am getting an error when changing maps please help me
this is my error:
and... this is my script for map.hps
////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "KeyOnDoor", true); //First key
AddUseItemCallback("", "keyfordoor_1", "mansion_5", "KeyOnDoor2", true); //Second key
SetEntityPlayerInteractCallback("key_tomb_rusty_1", "ActivateMonster", true);
SetEntityPlayerInteractCallback("key_tomb_rusty_1", "NextLevel", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_5", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_5", 0, false);
RemoveItem("keyfordoor_1");
}
void OnLeave()
{
}
void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_4", true);
AddEnemyPatrolNode("servant_grunt_4", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_4", "PathNodeArea_2", 0, "Idle");
}
void NextLevel(string &in Entity)
{
SetPlayerCrouching(true);
FadePlayerRollTo(-70, 50, 50);
SetPlayerMoveSpeedMul(0);
PlaySoundAtEntity("react_pant", "react_pant.snt", "Player", 0, false);
GivePlayerDamage(5, "BloodSplat", true, false);
MovePlayerHeadPos(0, -1, 0, 1, 1);
SetPlayerCrouchDisabled(true);
FadeOut(3);
AddTimer("ChangeMap1", 3.1, "ChangeMap");
}
void ChangeMap1(string &in asTimer)
{
ChangeMap("mapa01.map", "PlayerStarArea_1", "", "");
}
////////////////////////////
// Run when leaving map
And this is my script for my map01.hps:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", Reset", true, 1);
}
void Reset (string &in asParent, string &in asChild, int alState)
{
SetPlayerCrouching(false);
FadePlayerRollTo(0, 0, 0);
SetPlayerMoveSpeedMul(1);
MovePlayerHeadPos(0, 0, 100, 1);
SetPlayerCrouchDisabled(false);
}
void OnLeave()
{
}
////////////////////////////
// Run when leaving map
Please Help me
I'm trying to do is take a key and the character loses consciousness then wakes up in a different room is mapa01.map
this is what I intend to do:
VIDEO