Frictional Games Forum (read-only)
IT WORKS! yay - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: IT WORKS! yay (/thread-14698.html)

Pages: 1 2


RE: Player Respawn on other map - Mackiiboy - 04-11-2012

(04-11-2012, 03:16 PM)jessehmusic Wrote: okey i got the changemap now but Daniel start looking in the ground and he donst stop any clue?
.
I have no idea why. Can you elaborate a bit?
When does it happen, before/after death?, on the next map?



RE: Player Respawn on other map - jessehmusic - 04-11-2012

After the death i spawn at the area then "Daniel keeps looking on the ground" , wtf? here is script

void OnStart()
{
CheckPoint ("", "playerstart_1", "ChangeMap", "Message", "Death");

}


void ChangeMap(string &in asName, int alCount)
{
ChangeMap("Map3.map", "PlayerStartArea_1", "", "");
}




RE: Player Respawn on other map - Mackiiboy - 04-11-2012

(04-11-2012, 03:29 PM)jessehmusic Wrote: After the death i spawn at the area then "Daniel keeps looking on the ground" , wtf? here is script

void OnStart()
{
CheckPoint ("", "playerstart_1", "ChangeMap", "Message", "Death");

}


void ChangeMap(string &in asName, int alCount)
{
ChangeMap("Map3.map", "PlayerStartArea_1", "", "");
}
.
void ChangeMap(string &in asName, int alCount)

Change the name of your function to something else, I do not think it can be named ChangeMap.




RE: Player Respawn on other map - jessehmusic - 04-11-2012

(04-11-2012, 03:36 PM)Mackiiboy Wrote:
(04-11-2012, 03:29 PM)jessehmusic Wrote: After the death i spawn at the area then "Daniel keeps looking on the ground" , wtf? here is script

void OnStart()
{
CheckPoint ("", "playerstart_1", "ChangeMap", "Message", "Death");

}


void ChangeMap(string &in asName, int alCount)
{
ChangeMap("Map3.map", "PlayerStartArea_1", "", "");
}
.
void ChangeMap(string &in asName, int alCount)

Change the name of your function to something else, I do not think it can be named ChangeMap.
still doing it :S


RE: Player Respawn on other map - Mackiiboy - 04-11-2012

(04-11-2012, 03:40 PM)jessehmusic Wrote: still doing it :S
.
Wierd. I tried it out and it works perfectly. Do you change map after death at all?
I you do, can you put up the whole script from your other map?





RE: Player Respawn on other map - jessehmusic - 04-11-2012

(04-11-2012, 03:42 PM)Mackiiboy Wrote:
(04-11-2012, 03:40 PM)jessehmusic Wrote: still doing it :S
.
Wierd. I tried it out and it works perfectly. Do you change map after death at all?
I you do, can you put up the whole script from your other map?

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "MusicStart", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "MonsterAttack", true, 1);
AddEntityCollideCallback("Player", "door_slam", "DoorSlam", true, 1);
AddEntityCollideCallback("Player", "Light_area", "Lights", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "MonsterAttack_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "Lights1", true, 1);
SetEntityPlayerInteractCallback("ptest_cellar_wood01_1", "Bang1", true);
AddUseItemCallback("", "key_4", "ptest_cellar_wood01_3", "keyondoor4", true);
AddUseItemCallback("", "key_laboratory_1", "freedom_door", "keyondoor3", true);
AddUseItemCallback("", "The_gone_key", "Lockeddoor_1", "KeyOnDoor1", true);
CheckPoint ("", "playerstart_1", "Jalla", "Message", "Death");
}
void Jalla(string &in asName, int alCount)
{
ChangeMap("Map3.map", "PlayerStartArea_1", "", "");
}
void MonsterAttack_1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "Scary_sound.snt", "Player", 0, false);

SetEntityActive("grunt_2", true);
AddEnemyPatrolNode("grunt_2", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt_2", "PathNodeArea_3", 0, "");
SetPropHealth("ptest_cellar_wood01_4", 0);
}
void Lights1(string &in asParent, string &in asChild, int alState)
{
SetLampLit("bridge_torch_2", true, true);
SetLampLit("bridge_torch_3", true, true);
PlaySoundAtEntity("", "Scary_sound.snt", "Player", 0, false);
}
void Lights(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_static01_3", true, true);
SetLampLit("torch_static01_4", true, true);
}
void DoorSlam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "05_event_door_bang.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "door2", true);
GiveSanityDamage(15.0f, true);
}

void keyondoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("freedom_door", false, true);
PlaySoundAtEntity("", "unlock_door", "freedom_door", 0, false);
RemoveItem("key_laboratory_1");
}


void MonsterAttack(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("grunt", 5.0f, 2.0f, "");
SetEntityActive("grunt", true);
ShowEnemyPlayerPosition("grunt");
AddTimer("", 4.0f, "stoplookenemy1");
GivePlayerDamage(99.0f, "", true, false);
SetPlayerActive(false);
}


void stoplookatenemy1(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);

}

void keyondoor4(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("ptest_cellar_wood01_3", false, true);
PlaySoundAtEntity("", "unlock_door", "ptest_cellar_wood01_3", 0, false);
RemoveItem("key_4");
}

void KeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Lockeddoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Lockeddoor_1", 0, false);
RemoveItem("The_gone_key");
}

void Bang1(string &in asEntity)
{

}

void MusicStart(string &in asParent, string &in asChild, int alState)

{
PlayMusic("Ominous Noises - The Tortured Soul Scary Sound Effects.ogg", true, 0.8f, 1, 0, true);
}




RE: Player Respawn on other map - DRedshot - 04-11-2012

I'm guesing there's a problem with this part of the script

Spoiler below!

void stoplookatenemy1(string &in asTimer)
{

StopPlayerLookAt();
SetPlayerActive(true);

}


Try troubleshooting that. I would also try this:

Spoiler below!

void Jalla(string &in asName, int alCount)
{

StopPlayerLookAt();
ChangeMap("Map3.map", "PlayerStartArea_1", "", "");

}

See if that helps Smile


Edit: Yep, found the problem.
Re-read what you wrote in the Timer callback, you've misspelt something Tongue

AddTimer("", 4.0f, "stoplookenemy1");
void stoplookatenemy1(string &in asTimer)

remove the 'at ' and it will work fine!


RE: Player Respawn on other map - Mackiiboy - 04-11-2012

(04-11-2012, 03:42 PM)Mackiiboy Wrote: Wierd. I tried it out and it works perfectly. Do you change map after death at all?
I you do, can you put up the whole script from your other map?
.
I guess that the script you did put up was not from the other map, I meant from "Map3.map" Shy


RE: Player Respawn on other map - jessehmusic - 04-11-2012

(04-11-2012, 03:51 PM)Mackiiboy Wrote:
(04-11-2012, 03:42 PM)Mackiiboy Wrote: Wierd. I tried it out and it works perfectly. Do you change map after death at all?
I you do, can you put up the whole script from your other map?
.
I guess that the script you did put up was not from the other map, I meant from "Map3.map" Shy
i dont got any script at map3.map yet
(04-11-2012, 03:50 PM)DRedshot Wrote: I'm guesing there's a problem with this part of the script

Spoiler below!

void stoplookatenemy1(string &in asTimer)
{

StopPlayerLookAt();
SetPlayerActive(true);

}


Try troubleshooting that. I would also try this:

Spoiler below!

void Jalla(string &in asName, int alCount)
{

StopPlayerLookAt();
ChangeMap("Map3.map", "PlayerStartArea_1", "", "");

}

See if that helps Smile


Edit: Yep, found the problem.
Re-read what you wrote in the Timer callback, you've misspelt something Tongue

AddTimer("", 4.0f, "stoplookenemy1");
void stoplookatenemy1(string &in asTimer)

remove the 'at ' and it will work fine!
ty it worked