Frictional Games Forum (read-only)
[SCRIPT] Adding Delays - 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] Adding Delays (/thread-23926.html)

Pages: 1 2


RE: Adding Delays - RaideX - 11-23-2013

Alright, i stumbled upon another problem.

Is it possible for a function to take more parameters than default?

For instance:

Can i add a timer inside a function that calls the function again and takes the name of the timer?

So instead of this:
PHP Code:
void CollideFunction(string &in asParentstring &in asChildint alState)
{
AddTimer ("ExecFunctionXY_1"10.0f"FunctionXY"

this:
PHP Code:
void CollideFunction(string &in asParentstring &in asChildint alStatestring &in asTimer)
{
firstthingtohappen();
AddTimer ("ExecFunctionXY_1"1.0f"CollideFunction")
if (
asTimer == "ExecFunction_XY1") {
delayedthing();


I tried it but it doesnt seem to work. Maybe there's another way in doing this?


RE: Adding Delays - FlawlessHappiness - 11-24-2013

I see you understand the parameters.
Unfortunately if you change this to something custom it doesn't work, because there is no specification.

A such parameter-combination doesn't exist.

So you'd have to create 2 functions.

You're also having too much { in your function.



void CollideFunction(string &in asParent, string &in asChild, int alState)
{
firstthingtohappen();
AddTimer ("ExecFunctionXY_1", 1.0f, "CollideFunction")
}

void CollideFunction(string &in asTimer)
{
delayedthing();
}