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
I Have a Problem to Level Door and level Changing
skirnks017 Offline
Junior Member

Posts: 17
Threads: 11
Joined: Mar 2012
Reputation: 0
#1
I Have a Problem to Level Door and level Changing

Hi Forum again Big Grin
Im writing this thread for i have a problem
I am getting an error when changing maps please help me
this is my error:
[Image: o0njhi.jpg]
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 Sad

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:






03-27-2012, 02:34 AM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: I Have a Problem to Level Door and level Changing

In your AddEntityCollideCallback line, the function "Reset" isn't enclosed in quotation marks. It only has one, on the right side.
An "unexpected end of file" error typically occurs (to me at least), when one of the string parameters is missing one or both quotation marks.

03-27-2012, 05:03 AM
Find




Users browsing this thread: 1 Guest(s)