script issue - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: script issue (/thread-4903.html) Pages:
1
2
|
script issue - LoneWolf - 10-03-2010 I have this script under void onstart () and it wont work, does it go under void onenter () onstead ? AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScript", true, 1); } void CollideScript(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("castle_arched01_2", true, true); ShowEnemyPlayerPosition("servant_grunt_1"); } RE: script issue - HakePT - 10-03-2010 (10-03-2010, 02:32 PM)LoneWolf Wrote: Void OnStart() nope it is supposed to be like this. Make sure the names are correct and that there are no spelling errors. RE: script issue - LoneWolf - 10-03-2010 Thanks but i now know my problem, alot of new things i do do not update into my level now, i dont know why but soem effects and sounds do but some do not, also a whole area to my map is gone i really do not know why it shows up in my level editor but not in my actual game map. Check my thread saying, hwo to make water work i have stated my problems there, as my water should also work btu it wont update, and yes ive saved my map as the right one and quit and restart it all works on my level editor but not in my game. RE: script issue - Mofo - 10-03-2010 (10-03-2010, 04:09 PM)LoneWolf Wrote: Thanks but i now know my problem, alot of new things i do do not update into my level now, i dont know why but soem effects and sounds do but some do not, also a whole area to my map is gone i really do not know why it shows up in my level editor but not in my actual game map. It might have something to do with the update, check this notice: http://www.frictionalgames.com/forum/thread-4822.html RE: script issue - LoneWolf - 10-03-2010 (10-03-2010, 04:14 PM)Mofo Wrote:(10-03-2010, 04:09 PM)LoneWolf Wrote: Thanks but i now know my problem, alot of new things i do do not update into my level now, i dont know why but soem effects and sounds do but some do not, also a whole area to my map is gone i really do not know why it shows up in my level editor but not in my actual game map. Thanks thats it all fixed now. Im off to test everythign out Thanks! RE: script issue - LoneWolf - 10-03-2010 Hmm... everythign works apart from that script i'm not sure where to use tokens to here my script in full. Please tell me if theres anythign wrong because the script for the door works perfect but the door close and the enemy sees player doesnt work. //////////////////////////// // Run first time starting map void OnStart() { AddUseItemCallback("", "StudyKey", "castle_arched01_3", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("castle_arched01_3", false, true); PlaySoundAtEntity("", "unlock_door", "castle_arched01_3", 0, false); RemoveItem("StudyKey"); AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1); } void CollideRoomTwo(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("castle_arched01_2", true, true); ShowEnemyPlayerPosition("servant_grunt_1"); } RE: script issue - HakePT - 10-03-2010 AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1); Shouldn't this part be under the OnStart()? If not you functions are dependent and may be causing your problem. RE: script issue - LoneWolf - 10-03-2010 (10-03-2010, 09:46 PM)HakePT Wrote: AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1); Okay this is what i changed it all to now - (i will try it out tomorrow but if anyone knows how to get all my scripting to work then please tell me, my door+key works but i dont want to mess aroudn more and end up with nothing working). //////////////////////////// // Run first time starting map void OnStart() { AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1); } void CollideRoomTwo(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("castle_arched01_2", true, true); ShowEnemyPlayerPosition("servant_grunt_1"); } { AddUseItemCallback("", "StudyKey", "castle_arched01_3", "UsedKeyOnDoor", true); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } RE: script issue - HakePT - 10-04-2010 (10-03-2010, 10:02 PM)LoneWolf Wrote: //////////////////////////// //////////////////////////// // Run first time starting map void OnStart() { AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1); AddUseItemCallback("", "StudyKey", "castle_arched01_3", "UsedKeyOnDoor", true); } void CollideRoomTwo(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("castle_arched01_2", true, true); ShowEnemyPlayerPosition("servant_grunt_1"); } void UsedKeyOnDoor(string &in asItem, string &in asEntity) { *(shouldn't there be code here unlocking the door? your door unlock won't work like this)* } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } RE: script issue - LoneWolf - 10-04-2010 Thanks it all works now, and yes i missed 3 lines out from my script dont know how i missed it when copying. My only issue is that the stupid monster doesnt know how to open doors, i put it in the room and when it finds me it just stays in the room not knowing how to get out of it, even when i make a noise or hit door it stays in then eventually after 1 min of hitting the door it'll break the door down. Is there anythign i can do to sort this issue out? |