Frictional Games Forum (read-only)
[SCRIPT] It just doesn't work! <-[SOLVED] 1 more thing...[SOLVED] - 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] It just doesn't work! <-[SOLVED] 1 more thing...[SOLVED] (/thread-13248.html)



It just doesn't work! <-[SOLVED] 1 more thing...[SOLVED] - Zjurc - 02-11-2012

I'm at the edge of my nerve system now because I am JUST ABOUT to finish my custom story and I have 4 script areas left.
3 of them is to display a message (to close the plot, of course) and the last 1 is the credits area.


I have set them up and everything is correct
(otherwise the game would display errors and the map wont open entirely) and etc.

Soooo what's the problem?

They. Simply. Refuse. To work.

Here's the HPS (its not a complete hps, of course. just the 4 areas):

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "TruthOne", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "TruthTwo", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "TruthThree", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "credits", true, 1);
}

void TruthOne(string &in asEntity, int alState)
{
SetMessage("Truth", "One", 0);
SetPlayerRunSpeedMul(0.1);
StopSound("01_amb_darkness.ogg", 3);
}

void TruthTwo(string &in asEntity, int alState)
{
SetMessage("Truth", "Two", 0);
PlayMusic("01_paper_self.ogg", true, 1.0, 0, 0, false);
}

void TruthThree(string &in asEntity, int alState)
{
SetMessage("Truth", "Three", 0);
}

void credits(string &in asEntity, int alState)
{
FadeOut(0.1);
StartCredits("ending.ogg", true, "Ending", "MainCredits", 0);
}

Any ideas on why aren't they working?

PS: the 'ending.ogg' is in my CustomStoryName>music file. I guess it will work?

Thanks in advance :]


RE: It just doesn't work! - Your Computer - 02-11-2012

You have the callback syntax wrong.


RE: It just doesn't work! - flamez3 - 02-11-2012

To clarify:

(string &in asEntity, int alState) Isn't the right syntax for AddEntityColideCallback c:



RE: It just doesn't work! - Zjurc - 02-11-2012

LOL okay im mentally retarded..... well whats the right one then?


RE: It just doesn't work! - flamez3 - 02-11-2012

You can find it here:

http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#player


c:


RE: It just doesn't work! - Zjurc - 02-11-2012

Oh found it! Thank you very much! Ill go and set it up now and report if it works Big Grin
Yep. Works now! Thank you both for helping me Big Grin


RE: It just doesn't work! - Zjurc - 02-11-2012

1 More thing - and hopefully this will be my last question to annoy you guys:

This is the most retarded question you will get and you will probably laugh too, but how to Save? I mean, for example you enter a map and I want to save just there. So probably the Save command will go on Void OnStart?

I guess the command is " AutoSave(); "? But still when I put it, it still just says 'Exit'

If you didn't understand entirely: when I want to quit, I want it to say 'Save And Exit' instead of 'Exit'.

My map is quite long (~1-2hrs) so its kinda important for me. Thanks!


RE: It just doesn't work! <-[solved] 1 more thing... - Your Computer - 02-11-2012

Make sure ExitMenuDirectly is false: http://wiki.frictionalgames.com/hpl2/amnesia/devenvguide


RE: It just doesn't work! <-[solved] 1 more thing... - Zjurc - 02-11-2012

Ahh thank you very much! I'm so sorry for taking your time at these retarded things!