Frictional Games Forum (read-only)

Full Version: Help me on My Script please.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a script.. its :

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Script_1", "Teleport1", true, 1);
AddUseItemCallback("", "SecondRoomKey_1", "SecondRoom_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "Corridorkey_1", "Hall", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("SecondRoom_1", false, true);
SetSwingDoorLocked("Hall", false, true);
PlaySoundAtEntity("", "unlock_door", "SecondRoom_1", 0, false);
PlaySoundAtEntity("", "unlock_door", "Hall", 0, false);
RemoveItem("SecondRoomKey_1");
RemoveItem("Corridorkey_1");
}

void Teleport1(string &in asParent, string &in asChild, int alStates)
{
SetEntityActive("TeleportingNG_1", true);
PlaySoundAtEntity("", "24_iron_maiden.snt", "TeleportingNG_1", 0, false);
AddPropForce("TeleportingNG_1", -10000, 0, 0, "Player");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


and the Extra english lang file is :

<LANGUAGE>
<RESOURCES />
<CATEGORY Name="CustomStoryMain">
<Entry Name="Description">You Are a guy who's working as a Janitor in A Mansion Where you woke up alone at 6:30 AM. You discovered that there are monster inside and they don't want you to leave the Mansion. Find A Way to Leave the House without dying.</Entry>
</CATEGORY>
<CATEGORY Name="Journal">
<Entry Name="Note_A3_Name">Discovering</Entry>
<Entry Name="Note_A3_Text">I Woke up at 6:30 where i discovered that i'm alone.[br][br]I Need to Get out of the house, but... [br][br] I Also discovered something...There...Are....Monsters inside. I Need To Leave now and Get help as i am going to die in this house.. [br][br]Is this my last momnet ? God help Me, i don't know what i should do..[br][br][br][br][br]Sincerely.[br]Unknown</Entry>

</CATEGORY>
<CATEGORY Name="LevelDoors">
<Entry Name="LevelDoor_1>Door Locked</Entry>

</CATEGORY>
</LANGUAGE>

My Door for the next level won't start.. and my letters in my notes dissapear..
And also my Description in my Custom Story dissapear too...

Help ....
LockedTextCat :
Level Doors
LockedTextEntity:
LevelDoor_1

Please help me on my script and i'll rate anyone who gave me help... Big Grin
It's </RESOURCES>. Also, you cannot have two functions calling the same callback func.
If you want a level door to transport you anywhere, do it in the Level Editor. There should be a Map category in Properties. Click it and input your next map.
(02-27-2014, 12:25 PM)JustAnotherPlayer Wrote: [ -> ]It's </RESOURCES>. Also, you cannot have two functions calling the same callback func.
If you want a level door to transport you anywhere, do it in the Level Editor. There should be a Map category in Properties. Click it and input your next map.

Sorry if this bug you but...
Can you put a the right code i should use ?
Big Grin

Anyway i understand you </RESOURCES> but i don't understand the others....
Sorry i stink at english
Spoiler below!

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""Script_1""Teleport1"true1);
AddUseItemCallback("""SecondRoomKey_1""SecondRoom_1""UsedKeyOnDoor"true);
AddUseItemCallback("""Corridorkey_1""Hall""UsedKeyOnDoor"true);
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("SecondRoom_1"falsetrue);
SetSwingDoorLocked("Hall"falsetrue);
PlaySoundAtEntity("""unlock_door""SecondRoom_1"0false);
PlaySoundAtEntity("""unlock_door""Hall"0false);
RemoveItem("SecondRoomKey_1");
RemoveItem("Corridorkey_1");
}

void Teleport1(string &in asParentstring &in asChildint alState)
{
SetEntityActive("TeleportingNG_1"true);
PlaySoundAtEntity("""24_iron_maiden.snt""TeleportingNG_1"0false);
AddPropForce("TeleportingNG_1", -1000000"world");


Spoiler below!

PHP Code:
<LANGUAGE>
<
RESOURCES>
</
RESOURCES>
<
CATEGORY Name="CustomStoryMain">
<
Entry Name="Description">You Are a guy who's working as a Janitor in A Mansion Where you woke up alone at 6:30 AM. You discovered that there are monster inside and they don't want you to leave the MansionFind A Way to Leave the House without dying.</Entry>
</
CATEGORY>

<
CATEGORY Name="Journal">
<
Entry Name="Note_A3_Name">Discovering</Entry>
<
Entry Name="Note_A3_Text">I Woke up at 6:30 where i discovered that i'm alone.[br][br]I Need to Get out of the house, but... [br][br] I Also discovered something...There...Are....Monsters inside. I Need To Leave now and Get help as i am going to die in this house.. [br][br]Is this my last momnet ? God help Me, i don't know what i should do..[br][br][br][br][br]Sincerely.[br]Unknown</Entry>
</
CATEGORY>

<
CATEGORY Name="LevelDoors">
<
Entry Name="LevelDoor_1>Door Locked</Entry>
</CATEGORY>
</LANGUAGE> 


I guess you're really that desperate to fix this huh? A willingness to give me a reputation? Really? Besides your little jumpscare?
(02-27-2014, 12:38 PM)JustAnotherPlayer Wrote: [ -> ]
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""Script_1""Teleport1"true1);
AddUseItemCallback("""SecondRoomKey_1""SecondRoom_1""UsedKeyOnDoor"true);
AddUseItemCallback("""Corridorkey_1""Hall""UsedKeyOnDoor"true);
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("SecondRoom_1"falsetrue);
SetSwingDoorLocked("Hall"falsetrue);
PlaySoundAtEntity("""unlock_door""SecondRoom_1"0false);
PlaySoundAtEntity("""unlock_door""Hall"0false);
RemoveItem("SecondRoomKey_1");
RemoveItem("Corridorkey_1");
}

void Teleport1(string &in asParentstring &in asChildint alStates)
{
SetEntityActive("TeleportingNG_1"true);
PlaySoundAtEntity("""24_iron_maiden.snt""TeleportingNG_1"0false);
AddPropForce("TeleportingNG_1", -1000000"Player");


PHP Code:
<LANGUAGE>
<
RESOURCES>
</
RESOURCES>
<
CATEGORY Name="CustomStoryMain">
<
Entry Name="Description">You Are a guy who's working as a Janitor in A Mansion Where you woke up alone at 6:30 AM. You discovered that there are monster inside and they don't want you to leave the MansionFind A Way to Leave the House without dying.</Entry>
</
CATEGORY>

<
CATEGORY Name="Journal">
<
Entry Name="Note_A3_Name">Discovering</Entry>
<
Entry Name="Note_A3_Text">I Woke up at 6:30 where i discovered that i'm alone.[br][br]I Need to Get out of the house, but... [br][br] I Also discovered something...There...Are....Monsters inside. I Need To Leave now and Get help as i am going to die in this house.. [br][br]Is this my last momnet ? God help Me, i don't know what i should do..[br][br][br][br][br]Sincerely.[br]Unknown</Entry>
</
CATEGORY>

<
CATEGORY Name="LevelDoors">
<
Entry Name="LevelDoor_1>Door Locked</Entry>
</CATEGORY>
</LANGUAGE> 

I guess you're really that desperate to fix this huh? A willingness to give me a reputation? Really? Besides your little jumpscare, most of us will hate it.

OMG !! Thank you for your help.. Much appreciated ... +rep
Keep up your good work "Justanotherplayer".. Big Grin Big Grin
i'll rate you.