Frictional Games Forum (read-only)
Does anyone have links to scripting for scary events? - 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: Hints, help and spoilers (https://www.frictionalgames.com/forum/forum-34.html)
+--- Thread: Does anyone have links to scripting for scary events? (/thread-9794.html)



Does anyone have links to scripting for scary events? - zeravia - 08-16-2011

i want to trigger some scary events like suits of armor loosing their heads and bug scares. but i can't seem to find anything on them, i don't know what the commands are myself, does anyone have links to all the scripting of scary events like those?


RE: Does anyone have links to scripting for scary events? - graykin - 08-16-2011

There is a section on the HPL2 Wiki with all of the Script commands listed and explained (for the most part) fairly well.

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

If you're completely unfamiliar with programming, you might want to check out a few tutorials (some on the Wiki, some not) on some basic principles, but it should be easy enough to learn.


RE: Does anyone have links to scripting for scary events? - zeravia - 08-16-2011

(08-16-2011, 07:39 PM)graykin Wrote: There is a section on the HPL2 Wiki with all of the Script commands listed and explained (for the most part) fairly well.

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

If you're completely unfamiliar with programming, you might want to check out a few tutorials (some on the Wiki, some not) on some basic principles, but it should be easy enough to learn.

i have that page open while doing this, but i don't know what is what there... how do i know what i need to activate what is what i'm talking about...


RE: Does anyone have links to scripting for scary events? - graykin - 08-17-2011

So what you're asking for is, basically, just general guidance on what specific scripts do and how you utilize them?

It might help if you had a question about a specific thing you wanted to accomplish. Like, say, you wanted a suit of armor to fall to pieces when the player interacts with a door, or if you wanted a monster to spawn when you reach a certain portion of the map.

But basically, you need three key things--a Script Area in your map, a function that gets called when the player either collides into or interacts with the Script Area, and the functions within that function that actually do whatever it is you want.

If you wanted the chair to get skyrocketed, you would call the function:

AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);

"string& asName" would be replaced with whatever the name of the chair is.
"float afX" "float afY" "float afZ" would be replaced with how strongly you wanted to push the chair in the x, y, and z axes respectively (i.e. 5.0f, 25.0f, 0.0f --- this would push the chair with a force of "5" in the x-axis, and a force of "25" in the y-axis--or directly upwards. It would not move at all in the z-axis)
"string& asCoordSystem" would just be replaced with, simply, "world."

If you wanted a monster to appear you would have to place a monster on the map with the Activated checkbox unchecked, and you would use the function:

SetEntityActive(string& asName, bool abActive);

"asName" would be the name of the monster
"abActive" would be "True" if you wanted the monster to appear. "False" if you wanted the monster to disappear.

The best thing to do is just to start fiddling with the functions, doing simple things like that. If you have any specific questions, we'll be glad to help. As it is, I hope this helped at least a little bit. Smile


RE: Does anyone have links to scripting for scary events? - zeravia - 08-17-2011

Well, at the moment i am trying to get my Demo running but that's just a bit of story telling, I can't seem to get my Notes and Sound files to work together... :\