What is wrong with this script! *Different script problem* - 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: What is wrong with this script! *Different script problem* (/thread-7839.html) Pages:
1
2
|
What is wrong with this script! *Different script problem* - flamez3 - 05-07-2011 //////////////////////////// // Run first time starting map void OnStart() { AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1); } void MonsterFunc1(string &in asParent , string &in asChild , int alState) { SetEntityActive("servant_grunt_2" , true); } AddEntityCollideCallback{"Player" , "ScriptArea_2" , "MonsterFunc1" , true , 1}; void MonsterFunc1(string &in asParent , string &in asChild , int alState) { SetEntityActive("servant_grunt_1" , true); } void StartPlayerLookAt(ScriptArea_3, 50, 40, onlook); void TimerDoneLookAt(string &in asTimer) { StopPlayerLookAt(); } ALWAYS, it ALWAYS said err at line 14,25. expected identifier, the bold part in the script is line 14,25. Don't i already have an identifier, and yes, i have gone countless times to the script recollection, but that's where i got the script from, and it's not working. Any HELP PLEASE RE: What is wrong with this script! - Apjjm - 05-07-2011 Code: AddEntityCollideCallback{"Player" , "ScriptArea_2" , "MonsterFunc1" , true , 1}; RE: What is wrong with this script! - flamez3 - 05-07-2011 (05-07-2011, 01:22 AM)Apjjm Wrote: thanks for the help, but i decided to scrap the first event, now it's just this PHP Code: //////////////////////////// it gives me errors like this FATAL ERROR : Could not load script file 'custom stories.......(etc) main (15,20) : ERR : Expected identifier main (22,9) : ERR : Expected identifier i have no idea what i did wrong, can you or anyone help me with this script? RE: What is wrong with this script! - Apjjm - 05-07-2011 (05-07-2011, 01:27 AM)flamez3 Wrote: i have no idea what i did wrong, can you or anyone help me with this script?try the following: Code: void OnStart() I am assuming here you want the timer to start when you call the StartPlayerLookAt function. Remember that everything you want to happen in a function must be wrapped in the {}'s, and anything you want to happen at the start of the map called in either onStart() or onEnter(): Code: //Example: RE: What is wrong with this script! - flamez3 - 05-07-2011 (05-07-2011, 01:33 AM)Apjjm Wrote:(05-07-2011, 01:27 AM)flamez3 Wrote: i have no idea what i did wrong, can you or anyone help me with this script?try the following: I think that disabled the other problems, now it just says main (8,47) Onlook is not decalared any ideas? RE: What is wrong with this script! - Apjjm - 05-07-2011 (05-07-2011, 01:41 AM)flamez3 Wrote: I think that disabled the other problems, now it just says What do you intend "Onlook" to be? Currently onlook is an undefined variable in your script - for now try "" instead. Onlook, though, is actually supposed to name to a callback function in a string (or be "" if you don't want one. This works in the same way as you defined the callback routine for the timer.) when the player actually is looking at the target. RE: What is wrong with this script! - flamez3 - 05-07-2011 (05-07-2011, 01:53 AM)Apjjm Wrote:(05-07-2011, 01:41 AM)flamez3 Wrote: I think that disabled the other problems, now it just says THANK YOU, One problem, How do i make it so after you go past a point in the game, it looks where i made the scriptarea_3, because now it's just looking at it the start of the game. RE: What is wrong with this script! - Apjjm - 05-07-2011 (05-07-2011, 02:00 AM)flamez3 Wrote: THANK YOU, One problem, How do i make it so after you go past a point in the game, it looks where i made the scriptarea_3, because now it's just looking at it the start of the game. You would have to create a new script area, which like your monster one, is triggered when the player collides with it, though triggers a different callback function. This can then make the player look at a different area. If you called this new script area "CollisionLookAt_1" (as I strongly suggest giving your objects names that summise their function a little), then you could try changing your code as follows: Code: //Add to the onStart() routine RE: What is wrong with this script! - flamez3 - 05-07-2011 (05-07-2011, 02:08 AM)Apjjm Wrote:(05-07-2011, 02:00 AM)flamez3 Wrote: THANK YOU, One problem, How do i make it so after you go past a point in the game, it looks where i made the scriptarea_3, because now it's just looking at it the start of the game. Thanks for this help you gave me, it did the job(it still looks at it in the start but it does look at it when i walk over the script. If there was a reputation button, i would spam it on you lol. thanks RE: What is wrong with this script! - Apjjm - 05-07-2011 (05-07-2011, 02:21 AM)flamez3 Wrote: Thanks for this help you gave me, it did the job(it still looks at it in the start but it does look at it when i walk over the script. If there was a reputation button, i would spam it on you lol. thanksNot a problem . If you want to stop the "lookAt" function when the room starts, just remove the two lines from the onEnter() function, as these start the "lookAt" and start the timer to stop the "lookAt". |