Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a break???
Everlone Offline
Member

Posts: 178
Threads: 11
Joined: Oct 2010
Reputation: 2
#1
How to make a break???

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.

[Image: 555233.jpg]
11-08-2010, 12:20 PM
Find
anzki Offline
Member

Posts: 88
Threads: 6
Joined: Apr 2010
Reputation: 1
#2
RE: How to make a break???

SetTimer("FunctionThatIsCalled", Time);

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

[Image: 2qnr5av.png]
(This post was last modified: 11-08-2010, 12:52 PM by anzki.)
11-08-2010, 12:51 PM
Find
Everlone Offline
Member

Posts: 178
Threads: 11
Joined: Oct 2010
Reputation: 2
#3
RE: How to make a break???

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

where i set the time???

[Image: 555233.jpg]
11-08-2010, 02:43 PM
Find
anzki Offline
Member

Posts: 88
Threads: 6
Joined: Apr 2010
Reputation: 1
#4
RE: How to make a break???

(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)

[Image: 2qnr5av.png]
(This post was last modified: 11-08-2010, 02:54 PM by anzki.)
11-08-2010, 02:53 PM
Find
Hooumeri Offline
Member

Posts: 57
Threads: 11
Joined: Oct 2010
Reputation: 0
#5
RE: How to make a break???

(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
(This post was last modified: 11-08-2010, 03:04 PM by Hooumeri.)
11-08-2010, 02:58 PM
Find
Everlone Offline
Member

Posts: 178
Threads: 11
Joined: Oct 2010
Reputation: 2
#6
RE: How to make a break???

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);
}


[Image: 555233.jpg]
11-08-2010, 03:01 PM
Find
Hooumeri Offline
Member

Posts: 57
Threads: 11
Joined: Oct 2010
Reputation: 0
#7
RE: How to make a break???

(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
11-08-2010, 03:06 PM
Find
Everlone Offline
Member

Posts: 178
Threads: 11
Joined: Oct 2010
Reputation: 2
#8
RE: How to make a break???

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.

[Image: 555233.jpg]
(This post was last modified: 11-08-2010, 03:13 PM by Everlone.)
11-08-2010, 03:12 PM
Find
anzki Offline
Member

Posts: 88
Threads: 6
Joined: Apr 2010
Reputation: 1
#9
RE: How to make a break???

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

[Image: 2qnr5av.png]
11-08-2010, 03:19 PM
Find
Everlone Offline
Member

Posts: 178
Threads: 11
Joined: Oct 2010
Reputation: 2
#10
RE: How to make a break???

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

[Image: 555233.jpg]
11-08-2010, 03:26 PM
Find




Users browsing this thread: 1 Guest(s)