Frictional Games Forum (read-only)
Easy to answer question Can I do this? - 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: Easy to answer question Can I do this? (/thread-16499.html)



Easy to answer question Can I do this? - Jagsrs28 - 06-25-2012

void OnStart()

{
AddEntityCollideCallback("Player", "ScriptArea_8", "void FadeOut1(5);", true, 1);
}


Whenever I walk into ScriptArea_8 Will void FadeOut1(5) work?
If not could you tell me how I would set this up?


RE: Easy to answer question Can I do this? - bored2tears - 06-25-2012

No. That will not work.

I am not so good at scripting yet, but try this:

Code:
void OnStart()



{

AddEntityCollideCallback("Player", "ScriptArea_8", "Fade", true, 1);

}

void Fade(string &in asParent, string &in asChild, int alState)
{
FadeOut(5)
}

The third thing in quotes is the name of the function that you have to call. This should work.


RE: Easy to answer question Can I do this? - Jagsrs28 - 06-25-2012

(06-25-2012, 10:10 PM)bored2tears Wrote: No. That will not work.

I am not so good at scripting yet, but try this:

Code:
void OnStart()



{

AddEntityCollideCallback("Player", "ScriptArea_8", "Fade", true, 1);

}

void Fade(string &in asParent, string &in asChild, int alState)
{
FadeOut(5)
}

The third thing in quotes is the name of the function that you have to call. This should work.
Thanks dude you really helped me out! It crashed at first and said I needed a ; so I added it in:



void Fade(string &in asParent, string &in asChild, int alState)
{
FadeOut(5);
}


RE: Easy to answer question Can I do this? - bored2tears - 06-25-2012

(06-25-2012, 10:23 PM)Jagsrs28 Wrote: Thanks dude you really helped me out! It crashed at first and said I needed a ; so I added it in:


void Fade(string &in asParent, string &in asChild, int alState)
{
FadeOut(5);
}
Ah, forgot the damn semicolon. Always remember the semicolon. :3