sasukeroxxx
Junior Member
Posts: 39
Threads: 5
Joined: Sep 2011
Reputation:
0
|
[HELP!] Leveldoor...
I am Brazilian, and sorry for bad english. so I'm having a lot of progress with my "custom map" but I can not unlock a "Leveldoor" put everything right in the script, the name and such things but every time I use the key in the door we teleport to another map there appears the message: "Can not use the item this way" I'm just having trouble with it, did everything and could not find the problem a help would be great =D PS: the door name is like "LevelDoor" as the key "Key6"
void OnStart()
{
AddEntityCollideCallback("Player" , "Wood_Break_Sound" , "QuestUpdate" , true , 1);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddUseItemCallback("", "Key6", "LevelDoor", "UnlockLevelDoor", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
PlaySoundAtEntity("", "break_wood.snt", "Ambush_Door", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
GiveSanityDamage(50.0, true);
SetEntityPlayerInteractCallback("Ambush_Door", "PlayerInteractDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void UnlockLevelDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("LevelDoor", false);
PlaySoundAtEntity("", "unlock_door", "LevelDoor", 0.0f, false);
RemoveItem("Key6");
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1" , true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 2, "");
}
(This post was last modified: 10-23-2011, 09:24 PM by sasukeroxxx.)
|
|
10-23-2011, 07:38 AM |
|
Brute
Member
Posts: 197
Threads: 10
Joined: Aug 2011
Reputation:
3
|
RE: [HELP!] Leveldoor...
The only mistake, I can found is:
AddUseItemCallback("", "Key6", "LevelDoor", "UnlockLevelDoor", true);
This code must in an: void OnEnter() : line.
void OnEnter()
{
AddUseItemCallback("", "Key6", "LevelDoor", "UnlockLevelDoor", true);
}
And there is another one small mistake. Make sure, that you don't forget the .snt ending by a sound.
PlaySoundAtEntity("", "unlock_door .snt", "LevelDoor", 0.0f, false);
Good Luck!
(This post was last modified: 10-23-2011, 08:07 AM by Brute.)
|
|
10-23-2011, 08:06 AM |
|
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
|
RE: [HELP!] Leveldoor...
(10-23-2011, 07:38 AM)sasukeroxxx Wrote: void OnStart()
{
AddEntityCollideCallback("Player" , "Wood_Break_Sound" , "QuestUpdate" , true , 1);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddUseItemCallback("", "Key6", "LevelDoor", "UnlockLevelDoor", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
PlaySoundAtEntity("", "break_wood.snt", "Ambush_Door", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
GiveSanityDamage(50.0, true);
SetEntityPlayerInteractCallback("Ambush_Door", "PlayerInteractDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void UnlockLevelDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("LevelDoor", false);
PlaySoundAtEntity("", "unlock_door", "LevelDoor", 0.0f, false);
RemoveItem("Key6");
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1" , true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 2, "");
}
1. There is no MonsterFunction in your void OnStart()
2. Where BOLDED, wouldn't you want the wood break function there?
Just copy and paste this and see if this works...
void OnStart()
{
AddEntityCollideCallback("Player" , "Wood_Break_Sound" , "QuestUpdate" , true , 1); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddUseItemCallback("", "Key6", "LevelDoor", "UnlockLevelDoor", true);
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true); }
void QuestUpdate(string &in asParent, string &in asChild, int alState){
PlaySoundAtEntity("", "break_wood.snt", "Ambush_Door", 0.0f, false);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0.0f, false);
GiveSanityDamage(50.0, true);
SetEntityPlayerInteractCallback("Ambush_Door", "PlayerInteractDoor", true);
}
void UnlockLevelDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("LevelDoor", false);
PlaySoundAtEntity("", "unlock_door.snt", "LevelDoor", 0f, false);
RemoveItem("Key6");
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1" , true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 2, "");
}
Other that and without seeing the map in editor that is all i could find wrong with it.
|
|
10-23-2011, 12:12 PM |
|
sasukeroxxx
Junior Member
Posts: 39
Threads: 5
Joined: Sep 2011
Reputation:
0
|
RE: [HELP!] Leveldoor...
Ooh, thank you so much. had totally forgotten this,worked . is that the scripts of previous maps I have not used "OnEnter" and "OnLeave" and yet it worked. Aah and the 'MonsterFunction' is down there. was still all right, it was just the damn Leveldoor xD and Thanks to other tips. I will probably come back when more questions surge,after i wich try max to solve.
~ See ya
|
|
10-23-2011, 09:22 PM |
|
|