Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED]ChangeMap script problem
Author Message
Catalyst Offline
Member

Posts: 212
Joined: Aug 2014
Reputation: 3
Post: #1
[SOLVED]ChangeMap script problem

Hello, i have a problem...when i change map through script:
ChangeMap("LR.map", "start", "", ""); , on the next map player is spawning in the floor and when it jumps cannot get in normal position, I watched if script is correct and checked if SetPlayerCrouching is enabled.

Please help, somebody know how to do this?

Thanks in advanced.

Egypt CS
[Image: 27003.png]
(This post was last modified: 11-16-2014 01:02 PM by Catalyst.)
11-15-2014 05:04 PM
Find all posts by this user Quote this message in a reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,982
Joined: Mar 2012
Reputation: 171
Post: #2
RE: ChangeMap script problem

is the StartArea called "start" in the next map?

Please show your script of LR.map.

Being happy is the first step to success.
11-15-2014 05:46 PM
Find all posts by this user Quote this message in a reply
Daemian Offline
Posting Freak

Posts: 1,130
Joined: Dec 2012
Reputation: 49
Post: #3
RE: ChangeMap script problem

Yes, and make sure the 'start' area is above the floor level and it's a PlayerStart type.

11-15-2014 06:14 PM
Find all posts by this user Quote this message in a reply
Catalyst Offline
Member

Posts: 212
Joined: Aug 2014
Reputation: 3
Post: #4
RE: ChangeMap script problem

(11-15-2014 06:14 PM)Daemian Wrote:  Yes, and make sure the 'start' area is above the floor level and it's a PlayerStart type.

yes, its called start and is higher floor, almost in the middle of the room

(11-15-2014 05:46 PM)FlawlessHappiness Wrote:  is the StartArea called "start" in the next map?

Please show your script of LR.map.

player start area is called "start"

void OnStart()
{
AddUseItemCallback("", "key_tower_1", "mansion_5", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_tomb_rusty_1", "mansion_4", "UsedKeyOnDoor3", true);
AddUseItemCallback("", "key_tomb_1", "level_wood_1", "UsedKeyOnDoor2", true);
SetPlayerSanity(60);
SetLightVisible("Insane_Light", false);
SetLightVisible("Insane_Light_1", false);
SetEntityCallbackFunc("lantern_1", "Lantern");
SetEntityCallbackFunc("key_tomb_1", "DamnedPicture");
AddEntityCollideCallback("Player", "Sanity", "Bloody", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "Scare", true, 1);
AddEntityCollideCallback("Player", "ZoneActivation", "Trigger", true, 1);
SetEntityConnectionStateChangeCallback("lever", "SecretRoom");
AddTimer("", 1, "AmountOfSanity");
AddTimer("", 10, "Plague");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("mansion_5", false);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_5", 0, false);
RemoveItem("key_tower_1");
CompleteQuest("cabinetdoor","CabinetDoor");
AddPlayerSanity(20);
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_wood_1", false);
PlaySoundAtEntity("", "unlock_door.snt", "level_wood_1", 0, false);
RemoveItem("key_tomb_1");
CompleteQuest("kitchendoor","KitchenDoor");
AddPlayerSanity(10);
}

void UsedKeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_4", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_4", 0, false);
RemoveItem("key_tomb_rusty_1");
CompleteQuest("studiumdoor","StudiumDoor");
AddPlayerSanity(10);
}


void Lantern(string &in asEntity, string &in type)
{
SetEntityActive("insanity", true);
PlaySoundAtEntity("", "scare_tingeling.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
StartPlayerLookAt("insanity", 1, 10, "StopPlayerLookAt");
GiveSanityDamage(11.0f, true);
CompleteQuest("firstnope", "Firstnope");
}

void DamnedPicture(string &in asEntity, string &in type)
{
SetEntityActive("insane_paint", true);
PlaySoundAtEntity("", "scare_tingeling.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
StartPlayerLookAt("insane_paint", 1, 10, "StopPlayerLookAt");
GiveSanityDamage(11.0f, true);
CreateParticleSystemAtEntity("", "ps_guardian_appear_explosion", "insane_paint", false);
}

void Bloody(string &in asParent, string &in asChild, int alState)
{
AddTimer("", 6, "Horror");
GiveSanityDamage(10.0f, true);
FadeOut(2);
}

void Scare(string &in asParent, string &in asChild, int alState)
{
StopMusic( 2, 1);
AddTimer("", 2, "ChangeMusic");
GiveSanityDamage(3.0f, true);
SetPropHealth("pot_plant_small01_2", 0.0f);
SetPropHealth("pot_plant_small02_1", 0.0f);
StartPlayerLookAt("pot_plant_small02_1", 1, 10, "StopPlayerLookAt");
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
}

void Horror(string &in asTimer)
{
FadeIn(2);
SetLightVisible("Insane_Light", true);
SetLightVisible("Insane_Light_1", true);
PlaySoundAtEntity("", "scare_tingeling.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
SetEntityActive("insanepaint1", true);
SetEntityActive("insanepaint2", true);
SetEntityActive("insanepaint3", true);
PlayMusic("04_amb.ogg", true, 0.5, 6, 1, true);
AddTimer("",10, "StopRed");
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
}

void StopRed(string &in asTimer)
{
SetLightVisible("Insane_Light", false);
SetLightVisible("Insane_Light_1", false);
AddPlayerSanity(20);
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
}

void ChangeMusic(string &in asTimer)
{
PlayMusic("07_amb.ogg", true, 0.5, 6, 1, true);
CreateParticleSystemAtEntity("", "ps_dust_break_25", "ScriptArea_2", false);
PlaySoundAtEntity("", "scare_tingeling.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_2", 1, 10, "StopPlayerLookAt");
AddTimer("", 2, "Cough");
}

void Cough(string &in asTimer)
{
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
}

void OnLeave()
{
SetEntityActive("Sanity", true);
SetupLoadScreen("Loading", "message_1", 1, "game_loading_trunk.jpg");
}

void Trigger(string &in asParent, string &in asChild, int alState)
{
FadeOut(0);
PlaySoundAtEntity("", "scare_tingeling.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
AddTimer("", 3, "Teleport");
SetPlayerMoveSpeedMul(0.35f);
SetPlayerRunSpeedMul(0);
SetPlayerLookSpeedMul(0.5);
}

void Teleport(string &in asTimer)
{
FadeIn(3);
TeleportPlayer("area_teleport_1");
AddTimer("", 3, "Teleport2");
}

void Teleport2(string &in asTimer)
{
FadeOut(0);
TeleportPlayer("area_teleport_2");
AddTimer("", 3, "Teleport3");
}

void Teleport3(string &in asTimer)
{
FadeIn(3);
TeleportPlayer("telearea");
AddTimer("", 3, "Teleport4");
}

void Teleport4(string &in asTimer)
{
FadeOut(0);
TeleportPlayer("telearea2");
SetPlayerCrouching(true);
AddTimer("", 3, "TeleEnd");
}

void TeleEnd(string &in asTimer)
{
FadeIn(3);
SetSanityDrainDisabled(true);
TeleportPlayer("teleport_target");
AddTimer("", 7, "Retake");
SetEntityActive("vision", true);
SetPlayerActive(false);
StartPlayerLookAt("vision", 1, 1, "StopPlayerLookAt");
ShowEnemyPlayerPosition("vision");
SetPlayerCrouching(false);
}

void Studium(string &in asEntity)
{
AddQuest("studiumdoor","StudiumDoor");
}

void Cabinet(string &in asEntity)
{
AddQuest("cabinetdoor","CabinetDoor");
}

void Kitchen(string &in asEntity)
{
AddQuest("kitchendoor","KitchenDoor");
}


void Retake(string &in asTimer)
{
SetPlayerActive(true);
TeleportPlayer("back");
SetPlayerSanity(42);
SetPlayerHealth(100);
SetEntityActive("vision", false);
PlaySoundAtEntity("", "player_stand.snt", "Player", 0, false);
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
AddTimer("", 4, "Again");
PlayMusic("09_amb_safe.ogg", true, 0.5, 6, 1, true);
}

void Again(string &in asTimer)
{
PlaySoundAtEntity("", "hurt_pant.snt", "Player", 0, false);
AddQuest("first", "First");
SetPlayerMoveSpeedMul(1.0f);
SetPlayerRunSpeedMul(1.3f);
SetPlayerLookSpeedMul(1.1f);
}

void SecretRoom(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret_shelf", 1);
PlaySoundAtEntity("", ".snt", "shelf_move_1", 0, false);
return;
}
AddPlayerSanity(20);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
}

void AmountOfSanity(string &in asTimer)
{
if(GetPlayerSanity() < 40.0f)
{
PlaySoundAtEntity("Player", "react_breath.snt", "Player", 0, false);
AddTimer("", 10, "AmountOfSanity");
}
}

void Plague(string &in asTimer)
{
PlaySoundAtEntity("", "player_cough.snt", "Player", 0, false);
}

Egypt CS
[Image: 27003.png]
(This post was last modified: 11-15-2014 06:27 PM by Catalyst.)
11-15-2014 06:23 PM
Find all posts by this user Quote this message in a reply
Catalyst Offline
Member

Posts: 212
Joined: Aug 2014
Reputation: 3
Post: #5
RE: ChangeMap script problem

i have a screenshot for this issue
http://postimg.org/image/x04vozumr/

Egypt CS
[Image: 27003.png]
11-15-2014 10:00 PM
Find all posts by this user Quote this message in a reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,982
Joined: Mar 2012
Reputation: 171
Post: #6
RE: ChangeMap script problem

Show a screenshot of the map in the level editor, could you?

Being happy is the first step to success.
11-15-2014 10:07 PM
Find all posts by this user Quote this message in a reply
Daemian Offline
Posting Freak

Posts: 1,130
Joined: Dec 2012
Reputation: 49
Post: #7
RE: ChangeMap script problem

Maybe you enabled "fast physics load". It ignores planes.

11-16-2014 04:01 AM
Find all posts by this user Quote this message in a reply
Catalyst Offline
Member

Posts: 212
Joined: Aug 2014
Reputation: 3
Post: #8
RE: ChangeMap script problem

(11-16-2014 04:01 AM)Daemian Wrote:  Maybe you enabled "fast physics load". It ignores planes.

I don't know, I never heard about this option,I just changed map through timer script, so how I can disable it?

there is map in editor :

http://postimg.org/image/osainlo2l/

looks stupid from the fourth map to change through script to first startup map, and her startup position, to test only the script, so this script for me doesn't work Sad

Egypt CS
[Image: 27003.png]
(This post was last modified: 11-16-2014 08:39 AM by Catalyst.)
11-16-2014 08:36 AM
Find all posts by this user Quote this message in a reply
Catalyst Offline
Member

Posts: 212
Joined: Aug 2014
Reputation: 3
Post: #9
RE: ChangeMap script problem

Don't worry Smile I found the problem and solution Smile

Egypt CS
[Image: 27003.png]
11-16-2014 10:17 AM
Find all posts by this user Quote this message in a reply
DnALANGE Offline
Banned

Posts: 1,550
Joined: Jan 2012
Post: #10
RE: ChangeMap script problem

you didnt seem to have a plane in your leveleditor....
Was that the problem?
11-16-2014 11:58 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)