Frictional Games Forum (read-only)
[SCRIPT] Wake up script - 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] Wake up script (/thread-15188.html)

Pages: 1 2 3 4 5 6 7 8


Wake up script - Saren - 04-30-2012

Hey guys, I've TRIED to make a wake up script but sadly, no worky, worky, so, if you could tell me what's wrong, that'd be great, might be something simple I dunno... ^^

SetPlayerActive(False);
FadeOut(0);
FadePlayerRollTo(65, 20, 20);
MovePlayerHeadPos (-1, -0.45, -1.1, 29, 1);
AddTimer("activate_player", 3, "FadeIn");
void FadeIn (string &in timer_name)
{
FadeIn(2);
Addtimer("Start", 2, "WakeUp");
}
Void WakeUp (string &in timer_name)
{
if (timer_none == "Start")
{
AddTimer("MoveHead", 1, "WakeUp");
}
else if (timer_name == "MoveHead")
{
MoverPlayerHeadPos(0.5, -0.2, 1.1, 2, 2);
FadePlayerRollTo(0, 1.7, 500);
AddTimer("ActivatePlayer", 2, "WakeUp");
}
else if (timer_name == ActivatePlayer")
{
MovePlayerHeadPos(0, 0, 0, 2, 2);
SetPlayerActive(true)
}



RE: Wake up script - trollox - 04-30-2012

Well you got 2 { { at

Void WakeUp (string &in timer_name)
{
if (timer_none == "Start")
{



Then again if i'm not wrong timers have their own { so it might not be wrong maybe you're missing one } , sorry if i'm not of much help scripting isn't my best thing xD i'm more of a mapper.


RE: Wake up script - Saren - 04-30-2012

(04-30-2012, 11:50 AM)trollox Wrote: Well you got 2 { { at

Void WakeUp (string &in timer_name)
{
if (timer_none == "Start")
{



Then again if i'm not wrong timers have their own { so it might not be wrong maybe you're missing one } , sorry if i'm not of much help scripting isn't my best thing xD i'm more of a mapper.
You and me both bro xD
It is however, correct, I watched this stuff in a video so.... not that xD




RE: Wake up script - Your Computer - 04-30-2012

You have several syntax errors. For starters, it's void not Void. Secondly, it's timer_name not timer_none. Thirdly, you're missing the starting quotation mark for the string ActivatePlayer. I can't comment on anything else because i'm not sure to what point the copy-and-paste of your code has gone to.


RE: Wake up script - Saren - 04-30-2012

(04-30-2012, 12:27 PM)Your Computer Wrote: You have several syntax errors. For starters, it's void not Void. Secondly, it's timer_name not timer_none. Thirdly, you're missing the starting quotation mark for the string ActivatePlayer. I can't comment on anything else because i'm not sure to what point the copy-and-paste of your code has gone to.
.... Maybe I should'nt script when I tired......
Also, fixed those things, still saying the same...
and watchu mean, the script is written not copied xD




RE: Wake up script - Your Computer - 04-30-2012

(04-30-2012, 12:31 PM)Saren Wrote: and watchu mean, the script is written not copied xD

So when you posted the code you wrote it instead of copying it from the editor? <-- That's my point.


RE: Wake up script - Saren - 04-30-2012

(04-30-2012, 12:38 PM)Your Computer Wrote:
(04-30-2012, 12:31 PM)Saren Wrote: and watchu mean, the script is written not copied xD

So when you posted the code you wrote it instead of copying it from the editor? <-- That's my point.
Oh, you mean here? Yea, I copied all of it, that's the end... well, except the other scripts that work ofc and the void on start and leave... lol



RE: Wake up script - Adrianis - 04-30-2012

Void WakeUp (string &in timer_name)
{
if (timer_none == "Start")
{
AddTimer("MoveHead", 1, "WakeUp");
}
else if (timer_name == "MoveHead")
{
MoverPlayerHeadPos(0.5, -0.2, 1.1, 2, 2);
FadePlayerRollTo(0, 1.7, 500);
AddTimer("ActivatePlayer", 2, "WakeUp");
}
else if (timer_name == ActivatePlayer")
{
MovePlayerHeadPos(0, 0, 0, 2, 2);
SetPlayerActive(true)
}

Your missing a '}' at the end. You've closed your final 'else if' but you havn't closed the function. If that still isn't it, then there may be any number of issues with your logic that we can't see. I recommend you add some debugging to find the point at which it's not working, then itll be easier to figure out why



RE: Wake up script - Saren - 04-30-2012

(04-30-2012, 01:16 PM)Adrianis Wrote: Void WakeUp (string &in timer_name)
{
if (timer_none == "Start")
{
AddTimer("MoveHead", 1, "WakeUp");
}
else if (timer_name == "MoveHead")
{
MoverPlayerHeadPos(0.5, -0.2, 1.1, 2, 2);
FadePlayerRollTo(0, 1.7, 500);
AddTimer("ActivatePlayer", 2, "WakeUp");
}
else if (timer_name == ActivatePlayer")
{
MovePlayerHeadPos(0, 0, 0, 2, 2);
SetPlayerActive(true)
}

Your missing a '}' at the end. You've closed your final 'else if' but you havn't closed the function. If that still isn't it, then there may be any number of issues with your logic that we can't see. I recommend you add some debugging to find the point at which it's not working, then itll be easier to figure out why
Alright, thx man, I'll see if I can make this work




RE: Wake up script - JetlinerX - 04-30-2012

No capital V on "Void"

Its only void.