Frictional Games Forum (read-only)
Please check the troubleshooting guides before posting! - 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: Please check the troubleshooting guides before posting! (/thread-16587.html)



Please check the troubleshooting guides before posting! - slater899 - 06-29-2012

ok so its been about 5 hours now and i still cant get this to work im making a custom story and i followed all the instructions to make a key open a door script and then everytime i try to run the map in game it says unable to load script unexpected end of file. here is my .HPS also i dont have much in the map either just two rooms basically its like a test. please respond asap! Smile
void OnStart()
{
if(ScriptDebugOn())
{
GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);


for(int i = 0;i < 10;i++)
{
GiveItemFromFile("tinderbox", "tinderbox.ent");
}
//===========================================
// This runs when the player enters the map
void OnEnter()
{
AddUseItemCallback("", "Newdoorkey_1", "Newdoor", "UsedKeyOnDoor", "true");
{
void UsedDoorKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Newdoor", false, true);
PlaySoundAtEntity("", "","Newdoor", 0, false);
RemoveItem(Newdoorkey_1);
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}


RE: Please check the troubleshooting guides before posting! - Cruzore - 06-29-2012

At your if(ScriptDebugOn))) and void OnStart(), you forgot the ending bracket "}". Also, you forgot the "" at RemoveItem.


RE: Please check the troubleshooting guides before posting! - slater899 - 06-29-2012

(06-29-2012, 07:07 PM)FastHunteR Wrote: At your if(ScriptDebugOn))) and void OnStart(), you forgot the ending bracket "}". Also, you forgot the "" at RemoveItem.
Now it says unexpected token for if and for?


RE: Please check the troubleshooting guides before posting! - Cruzore - 06-29-2012

Change this:
GiveItemFromFile("tinderbox", "tinderbox.ent");
to this:
GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
After correcting this and it still doesn't work, post the whole corrected script again.


RE: Please check the troubleshooting guides before posting! - Your Computer - 06-29-2012

He also should correctly close OnEnter.

Then again, learning the basics would have avoided all of this.


RE: Please check the troubleshooting guides before posting! - Cruzore - 06-30-2012

True. the worst is the people who ask for the whole script or tell you to hurry up but are themselves too lazy to watch tutorials on how to script properly/understand the very, very basics.
Anyway, after that it should work. Depends if you made another mistake somewhere in the level editor. Just try it out.