Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Hard to find the errors in the HPS file
Author Message
robinnjensen Offline
Junior Member

Posts: 5
Joined: Mar 2012
Reputation: 0
Post: #1
Hard to find the errors in the HPS file
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
---------------------------
(This post was last modified: 03-05-2012 01:08 AM by robinnjensen.)
03-05-2012 12:47 AM
Find all posts by this user Quote this message in a reply
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #2
RE: Hard to find the errors in the HPS file
What is the error message?

The Nightmares v1.0 - Dreadful Fires WIP
03-05-2012 12:49 AM
Find all posts by this user Quote this message in a reply
robinnjensen Offline
Junior Member

Posts: 5
Joined: Mar 2012
Reputation: 0
Post: #3
RE: Hard to find the errors in the HPS file
(03-05-2012 12:49 AM)Strembitsky Wrote:  What is the error message?
I just added the error! Smile
03-05-2012 12:51 AM
Find all posts by this user Quote this message in a reply
Adrianis Offline
Senior Member

Posts: 492
Joined: Feb 2012
Reputation: 22
Post: #4
RE: Hard to find the errors in the HPS file
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.
03-05-2012 01:03 AM
Find all posts by this user Quote this message in a reply
robinnjensen Offline
Junior Member

Posts: 5
Joined: Mar 2012
Reputation: 0
Post: #5
RE: Hard to find the errors in the HPS file
(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
03-05-2012 01:09 AM
Find all posts by this user Quote this message in a reply
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #6
RE: Hard to find the errors in the HPS file
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 ";".

The Nightmares v1.0 - Dreadful Fires WIP
03-05-2012 01:26 AM
Find all posts by this user Quote this message in a reply
robinnjensen Offline
Junior Member

Posts: 5
Joined: Mar 2012
Reputation: 0
Post: #7
RE: Hard to find the errors in the HPS file
(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..
03-05-2012 01:40 AM
Find all posts by this user Quote this message in a reply
Strembitsky Offline
Member

Posts: 243
Joined: Feb 2012
Reputation: 3
Post: #8
RE: Hard to find the errors in the HPS file
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.

The Nightmares v1.0 - Dreadful Fires WIP
03-05-2012 01:55 AM
Find all posts by this user Quote this message in a reply
Adrianis Offline
Senior Member

Posts: 492
Joined: Feb 2012
Reputation: 22
Post: #9
RE: Hard to find the errors in the HPS file
(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
03-05-2012 01:56 AM
Find all posts by this user Quote this message in a reply
Adrianis Offline
Senior Member

Posts: 492
Joined: Feb 2012
Reputation: 22
Post: #10
RE: Hard to find the errors in the HPS file
If you don't make any progress like that mate let me know and I'll try and help you get it right.
03-05-2012 02:56 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)