Frictional Games Forum (read-only)
Scripting, need urgent help! - 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: Scripting, need urgent help! (/thread-9259.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13


RE: Scripting, need urgent help! - JenniferOrange - 07-24-2011

I noticed 8, 9, and 10 go their tops cut off. 8 and 9 are the two .hps files for each of the maps. 10 is my extra_english.lang. Also it doesn't matter with 8 & 9, they both match.
Aye, that's my bad. o.o silly me. xD I'm doing the key pickup/trigger monster test right now.


RE: Scripting, need urgent help! - JetlinerX - 07-24-2011

Same. Hmmm, because I am totally useless with scripting tho, not sure what I can do...


RE: Scripting, need urgent help! - JenniferOrange - 07-24-2011

Looking at your script again I've noticed OnEnter() is missing...
Also, this is what you've told your script to do:
Pick up upstairskey_1, activate monster_grunt & showenemyplayerposition, unlock leveltransferdoor_1 with upstairskey_1 and remove it from the inventory.
That seems to be wrong, since in the level editor leveltransferdoor_1 is the door you DON'T want a key to be used on. Therefore leveltransferdoor_1 should be changed to the name of the door in the other area, and the key script should be switched over to the other maps .hps file.
Also did you make sure the door the monster breaks down hasn't been checked as unbreakable?


RE: Scripting, need urgent help! - JetlinerX - 07-24-2011

No, leveltransferdoor_1 is the door that needs to be unlocked. The door is also not checked as unbreakable.


RE: Scripting, need urgent help! - JenniferOrange - 07-24-2011

Me testing it:
http://www.youtube.com/watch?v=K9wKH5-TF2s
it works for me. This is the exact script I gave on the Wiki.


RE: Scripting, need urgent help! - JetlinerX - 07-24-2011

D: Hmmm... What could I be doing wrong?!

The whole code:
void OnStart()
{
AddUseItemCallback("", "upstairskey_1", "leveltransferdoor_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("upstairskey_1", "OnPickup");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("leveltransferdoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "leveltransferdoor_1", 0, false);
RemoveItem("upstairskey_1");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("monster_grunt", true);
ShowEnemyPlayerPosition("monster_grunt");
}
void OnLeave ()
{

}


RE: Scripting, need urgent help! - JenniferOrange - 07-24-2011

Did you say earlier when the key is picked up nothing shows? Like it just says 'Picked Up' although in your extra_english.lang file you've put something? I have that problem. x_x
Make sure you go back in the map and check if the brute's name matches. Check the key and door as well. You might've changed a name and forgotten to hit Enter so it stays.


RE: Scripting, need urgent help! - JetlinerX - 07-24-2011

Oh crap! I totally didnt remember to chage the name!! Ill let you know, thanks SOOOO much for telling me that!


RE: Scripting, need urgent help! - JenniferOrange - 07-24-2011

Lol. Ah, simple mistakes ruin everything. xD


RE: Scripting, need urgent help! - JetlinerX - 07-24-2011

Hm, I changed the name on the monster_grunt thing on the last 2 lines, is that all? If so, it didnt work... again... Sad