Frictional Games Forum (read-only)
How to make a break??? - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: How to make a break??? (/thread-5366.html)



How to make a break??? - Everlone - 11-08-2010

how i can make a break in a script.
ill make a special start up but the scripts are loading to fast.
i will make a similar intro like amnesia.


Sorry for questions about scripting, but iam a noob and try at first time to write scriptes. i understand something but with many things i have problems.


RE: How to make a break??? - anzki - 11-08-2010

Code:
SetTimer("FunctionThatIsCalled", Time);

void FunctionThatIsCalled(string &in asTimer)
{
//Stuff that happens after the timer.
}



RE: How to make a break??? - Everlone - 11-08-2010

it wont work. no matter what i try, it crashed.

where i set the time???


RE: How to make a break??? - anzki - 11-08-2010

(11-08-2010, 02:43 PM)Everlone Wrote: it wont work. no matter what i try, it crashed.

where i set the time???

Where it read's Time. Also you must place SetTimer inside some function. For example void OnStart().
EDIT: Also time need to be in form 10.0f(=10 seconds)


RE: How to make a break??? - Hooumeri - 11-08-2010

(11-08-2010, 02:43 PM)Everlone Wrote: it wont work. no matter what i try, it crashed.

where i set the time???

Here is an example for you

void [what ever your using as Collide](string &in asParent, string &in asChild, int alState)
{
AddTimer("Put here the name of your timer, it wont matter what you call it",(Put here the time you want until the timer is activated, for example 1.5f. use f as the "unit". remember no quotations here "".) "And place here the area when what triggers the timer (I'm not 100% what to place here, but I've placed this and it always has worked));
}

for example AddTimer("Agrippakatoaa_01",3.5f,"Agrippakatoaa1");
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Now lets tell the game what it should do when the timer is activated (activation happens in 1,5secs, in my occasion)
This is one of my timers: It creates an particle system to my entity. You can insert what ever you wish inside the { }

void Agrippakatoaa_01(string &in asTimer)
{
CreateParticleSystemAtEntity("ps_fire_smoke_epoxy", "ps_fire_smoke_epoxy.ps", "TuliArea_13", false);

AddTimer("Agrippakatoaa_02",3.5f,"Agrippakatoaa2"); ///////////////Now this is just me adding another timer that kicks in after this. Of course you could make it so that it repeats the timer unlimited times, by doing this
}

Hope I cleared things up :p


RE: How to make a break??? - Everlone - 11-08-2010

yes i try it, but i think he have a problem with another script on start up.

Spoiler below!

void OnStart()
{
AddUseItemCallback("", "Key1", "door1", "KeyOnDoor", true);
AddUseItemCallback("", "Key2", "cabinet1", "KeyOnDoor1", true);
AddUseItemCallback("", "Key3", "bedroom", "KeyOnDoor2", true);
AddUseItemCallback("", "Key4", "bathroom", "KeyOnDoor3", true);
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("cabinet1", "AreaDesk", "CollideAreaDesk", true, 1);
AddEntityCollideCallback("Player", "Area51", "Area51Func", true, 1);
AddEntityCollideCallback("Player", "Area52", "Area52Func", true, 1);
AddEntityCollideCallback("Player", "exitdoor", "closedoor", true, 1);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerRunSpeedMul(0);
FadePlayerRollTo(75, 10, 100);
MovePlayerHeadPos(-1.2f, -1.3f, 0, 10, 0.5f); //x(0 def), y(0 def), z(0 def), speed,

slowdowndist
SetPlayerMoveSpeedMul(0.05f);
SetPlayerLookSpeedMul(0.05f);
}




RE: How to make a break??? - Hooumeri - 11-08-2010

(11-08-2010, 03:01 PM)Everlone Wrote: yes i try it, but i think he have a problem with another script on start up.

Spoiler below!

void OnStart()
{
AddUseItemCallback("", "Key1", "door1", "KeyOnDoor", true);
AddUseItemCallback("", "Key2", "cabinet1", "KeyOnDoor1", true);
AddUseItemCallback("", "Key3", "bedroom", "KeyOnDoor2", true);
AddUseItemCallback("", "Key4", "bathroom", "KeyOnDoor3", true);
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("cabinet1", "AreaDesk", "CollideAreaDesk", true, 1);
AddEntityCollideCallback("Player", "Area51", "Area51Func", true, 1);
AddEntityCollideCallback("Player", "Area52", "Area52Func", true, 1);
AddEntityCollideCallback("Player", "exitdoor", "closedoor", true, 1);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerRunSpeedMul(0);
FadePlayerRollTo(75, 10, 100);
MovePlayerHeadPos(-1.2f, -1.3f, 0, 10, 0.5f); //x(0 def), y(0 def), z(0 def), speed,

slowdowndist
SetPlayerMoveSpeedMul(0.05f);
SetPlayerLookSpeedMul(0.05f);
}


Tell us exactly what you're trying to do with the timer. If the game gives an error message, post it here with your script file


RE: How to make a break??? - Everlone - 11-08-2010

The player lies in bed on start up. but when start the game you see the player roll her head to left.
I will that the charakter slowly comes to himself. like amnesia intro. the charakter lies too but dont see how he lies down

Spoiler below!

void OnStart()
{
FadeOut(0)
AddTimer("wake",10,"TimerWake");
AddUseItemCallback("", "Key1", "door1", "KeyOnDoor", true);
AddUseItemCallback("", "Key2", "cabinet1", "KeyOnDoor1", true);
AddUseItemCallback("", "Key3", "bedroom", "KeyOnDoor2", true);
AddUseItemCallback("", "Key4", "bathroom", "KeyOnDoor3", true);
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("cabinet1", "AreaDesk", "CollideAreaDesk", true, 1);
AddEntityCollideCallback("Player", "Area51", "Area51Func", true, 1);
AddEntityCollideCallback("Player", "Area52", "Area52Func", true, 1);
AddEntityCollideCallback("Player", "exitdoor", "closedoor", true, 1);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerRunSpeedMul(0);
FadePlayerRollTo(75, 10, 100);
MovePlayerHeadPos(-1.2f, -1.3f, 0, 10, 0.5f); //x(0 def), y(0 def), z(0 def), speed,

slowdowndist
SetPlayerMoveSpeedMul(0.05f);
SetPlayerLookSpeedMul(0.05f);
}

void TimerWake(string &in asTimer)
{
FadeIn(15);
}

that is i try.


RE: How to make a break??? - anzki - 11-08-2010

At least that FadeOut(0) need ; after it.


RE: How to make a break??? - Everlone - 11-08-2010

oh ^^ it worked ^^ thx thx thx Smile big thx Smile