Frictional Games Forum (read-only)
[SCRIPT] Hard to find the errors in the HPS file - 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: [SCRIPT] Hard to find the errors in the HPS file (/thread-13765.html)

Pages: 1 2


Hard to find the errors in the HPS file - robinnjensen - 03-05-2012

Hello, i have been searching through the script areas and i can't seem to find anything, i'm kinda new to this stuff aswell, but i would be great thankfull if any of you guys would like to help me to fix my script ! Smile

here it is
--------------------------------------------------------------------------------------------------
////////////////////////////
//run when entering map
void OnStart()
{
AddUseItemCallback("", "key_study_1", "Freedom", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); 





void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Freedom", false, true);
PlaySoundAtEntity("", "unlock_door", "door", 0, false);
RemoveItem("key_study_1");
}




void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_2", true); 
SetEntityPlayerInteractCallback("cabinetmetal", "Spawn", true);




void Spawn(string &in asEntity)




}
SetEntityActive("corpse_male_1", true);
AddTimer("Scare", 0.5f, "Scare1");




void scare1(string &in asTimer)




GiveSanityDamage(10, true);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);




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




////////////////////////////
// Run when leaving map
void OnLeave()
}
--------------------------------------------------------------------------------------
Really thankfull!


---------------------------
FATAL ERROR
---------------------------
FATAL ERROR: Could not load script file 'custom_stories/Robin's Hell/custom_stories/Robin's Hell/maps/Robin's Hell.hps'!
main (24, 16) : ERR : Expected identifier
main (25, 9) : ERR : Expected identifier
main (29, 1) : ERR : Expected ',' or ';'
main (30, 18) : ERR : Expected identifier
main (35, 1) : ERR : Expected ',' or ';'

---------------------------
OK
---------------------------



RE: Hard to find the errors in the HPS file - Strembitsky - 03-05-2012

What is the error message?


RE: Hard to find the errors in the HPS file - robinnjensen - 03-05-2012

(03-05-2012, 12:49 AM)Strembitsky Wrote: What is the error message?
I just added the error! Smile


RE: Hard to find the errors in the HPS file - Adrianis - 03-05-2012

It's kinda hard to see your script posted all in quotes like that, it looks like your missing a few '{' '}' here and there, but its hard to tell.

In the error message, the first of the two numbers in brackets (i.e. 'main (*24*, 16)') is the line number from your code where the error occured. If you go to the lines it is reffering to (in this case line 24) you can check you got all your syntax correct.



RE: Hard to find the errors in the HPS file - robinnjensen - 03-05-2012

(03-05-2012, 01:03 AM)Adrianis Wrote: It's kinda hard to see your script posted all in quotes like that, it looks like your missing a few '{' '}' here and there, but its hard to tell.

In the error message, the first of the two numbers in brackets (i.e. 'main (*24*, 16)') is the line number from your code where the error occured. If you go to the lines it is reffering to (in this case line 24) you can check you got all your syntax correct.
I have made an change to the post now!
It should be easier to see the errors now i guess! Smile




RE: Hard to find the errors in the HPS file - Strembitsky - 03-05-2012

That script right now looks like a jumbled shitstorm of errors. I suggest you re-write all of your script, because you have missed a lot of "{" and ";".


RE: Hard to find the errors in the HPS file - robinnjensen - 03-05-2012

(03-05-2012, 01:26 AM)Strembitsky Wrote: That script right now looks like a jumbled shitstorm of errors. I suggest you re-write all of your script, because you have missed a lot of "{" and ";".
Hmm, do you think you can help me write the code free of errors? feels like that i will make the same misstake again if i rewrite it..


RE: Hard to find the errors in the HPS file - Strembitsky - 03-05-2012

If you have any idea on how to script, you won't make the same errors if you rewrite it. If you are deadlocked on the idea that you will make the same errors, then study how to script better.


RE: Hard to find the errors in the HPS file - Adrianis - 03-05-2012

(03-05-2012, 01:40 AM)robinnjensen Wrote:
(03-05-2012, 01:26 AM)Strembitsky Wrote: That script right now looks like a jumbled shitstorm of errors. I suggest you re-write all of your script, because you have missed a lot of "{" and ";".
Hmm, do you think you can help me write the code free of errors? feels like that i will make the same misstake again if i rewrite it..
You'll be less likely to make the mistakes again if you learn how to correct this issue yourself, check out Elven's video on scripting functions, you obviously know how to use them but you need to make sure the way you are writing the syntax is correct, and this video will show you the right syntax

http://www.youtube.com/watch?v=Pv9GK5Gh4Bw

Hope that helps



RE: Hard to find the errors in the HPS file - Adrianis - 03-05-2012

If you don't make any progress like that mate let me know and I'll try and help you get it right.