void wakeUp()
{
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 5.9f, "beginStory"); // Change '5.9f' to however long you want the 'unconciousness' to last
}
You had quotes around the false at FadeEnemy, and quotes around a float at the path nodes. If the value is false/true or a number, you almost never need a quotation mark (unless your item is named 1 or true, of course)
void wakeUp()
{
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 5.9f, "beginStory"); // Change '5.9f' to however long you want the 'unconciousness' to last
}
You had quotes around the false at FadeEnemy, and quotes around a float at the path nodes. If the value is false/true or a number, you almost never need a quotation mark (unless your item is named 1 or true, of course)
Okay I can run the map now, but I need to know where I put void DisableEnemyTriggers("servant_grunt_1" true);
And they Wake Up function doesn't work. No more errors for the moment
EDIT: I edited the Cells5.hps and added wakeUp(); to the OnStart() section, not sure if it fixed the Wake Up, will try in the morning.
I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
(This post was last modified: 05-24-2011, 04:07 AM by RawkBandMan.)
void TimerBlackOut(string &in asTimer)
{
AddLocalVarInt("BlackoutStep", 1); //What step to play in the event
float fEventSpeed = 0.5f; //The default time between steps in an event
void TimerBlackOut(string &in asTimer)
{
AddLocalVarInt("BlackoutStep", 1); //What step to play in the event
float fEventSpeed = 0.5f; //The default time between steps in an event
RE: extra_english now is working, but I need help with a different script :)
RemoveTimer("BlackOut");
that is outside any function
Also yout case/break thingie wont work... there is nothing triggering the timer after the first one
I created this simple switch timer thingie for everyone to use. If someone has questions about how it really works, ask me!
//SIMPLE SWITCH TIMER THINGIE//
//FIRST SOMETHING TO START IT (timer in some function you want it to start from)
AddTimer("", 0.0f, "ThisIsTheTimer");
void ThisIsTheTimer(string &in asTimer)
{ AddLocalVarInt("Stage", 1);
float fEventSpeed = 1.0f;
switch(GetLocalVarInt("Stage"))
{case 1:
//Whatever you wantto happen goes in between case and break
break;
case 2:
//TYPICAL WAKE UP/BLACK OUT FUNCTONS:
//MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist); If I remember right, float afY at 1.0f is the normal head position
//FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed); float afX is normal when its 0.0f
//SetPlayerCrouchDisabled(bool abX);
//SetPlayerJumpDisabled(bool abX); These are so that the player cant jump or crouch underground while passing out...
//SetPlayerRunSpeedMul(float afMul);
//SetPlayerMoveSpeedMul(float afMul); These so that the player cant run when down on the ground...
//FadeOut(float afTime); //self explanatory...
break;
}
if(GetLocalVarInt("Stage") < 6) AddTimer("ThisRepeatsTheTimer", fEventSpeed, "ThisIsTheTimer");
}
(This post was last modified: 05-26-2011, 06:36 PM by Khyrpa.)
RE: extra_english now is working, but I need help with a different script :)
(05-26-2011, 06:16 PM)Khyrpa Wrote: RemoveTimer("BlackOut");
that is outside any function
Also yout case/break thingie wont work... there is nothing triggering the timer after the first one
I created this simple switch timer thingie for everyone to use. If someone has questions about how it really works, ask me!
//SIMPLE SWITCH TIMER THINGIE//
//FIRST SOMETHING TO START IT (timer in some function you want it to start from)
AddTimer("", 0.0f, "ThisIsTheTimer");
void ThisIsTheTimer(string &in asTimer)
{ AddLocalVarInt("Stage", 1);
float fEventSpeed = 1.0f;
switch(GetLocalVarInt("Stage"))
{case 1:
//Whatever you wantto happen goes in between case and break
break;
case 2:
//TYPICAL WAKE UP/BLACK OUT FUNCTONS:
//MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist); If I remember right, float afY at 1.0f is the normal head position
//FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed); float afX is normal when its 0.0f
//SetPlayerCrouchDisabled(bool abX);
//SetPlayerJumpDisabled(bool abX); These are so that the player cant jump or crouch underground while passing out...
//SetPlayerRunSpeedMul(float afMul);
//SetPlayerMoveSpeedMul(float afMul); These so that the player cant run when down on the ground...
//FadeOut(float afTime); //self explanatory...
break;
}
if(GetLocalVarInt("Stage") < 6) AddTimer("ThisRepeatsTheTimer", fEventSpeed, "ThisIsTheTimer");
}
I'd have to ask yo how it actually works, and what I could put in each thing....
I copied it from the 25_nave_tunnels.map from Main or whatever the map is called and I thought it would basically work without much editing.
I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
I marked each particular part of the code in numbers so I can explain them here:
1. The timer inside the timer does exactly what you'd think it does. Every 2 seconds the "TimerItself" is called.
2. This makes sure the actions progress, meaning that when this first comes the "Stage" variable will become 1. And every time the "TimerItself" function is called, this adds +1 into the variable.
3. I don't know the specifics about this thing, but it checks how big the variable is (in this case its "Stage") and picks the case with the same number.
4. In between the case and break, you can put functions you want to use. And in this case the next case comes every 2 seconds
Here I'm going to complicate it a little bit so it can be utilized better. This is how it will look (color coding for easier explanation and I suggest you copy pasting this into notepad ++ and setting the Language to C++):
So the function above does exactly the same as the simpler one except that the second FadeOut(1.0f); comes 3 seconds later.
if(GetLocalVarInt("Stage") < 4) AddTimer("SPAM", fEventSpeed, "TimerItself"); has to be placed in the end of the function so that the first float fEventSpeed = 2.0f; is before fEventSpeed = 5.0f; so that the second event speed effects the if(getblehblah litany.
Because the fEventSpeed = 5.0f; is in case 2:, case 4 would trigger 2 seconds after case 3 (the function ingnores all other cases than the one that fits to the "Stage" variable).
if(GetLocalVarInt("Stage") < 4) simply means that you can decide when the timer stops looping itself (when cases end, without this part the timer would stay and loop without anything happening. That could possibly slow the game down or something).
the < 4 part means that "TimerItself" is called 4 times then stop ("Stage" variable would be 4).
Checking the color coding and with a little logic this should be possible to understand. If anyone has any more questions, I could try and explain... again
(This post was last modified: 05-27-2011, 09:19 PM by Khyrpa.)
I marked each particular part of the code in numbers so I can explain them here:
1. The timer inside the timer does exactly what you'd think it does. Every 2 seconds the "TimerItself" is called.
2. This makes sure the actions progress, meaning that when this first comes the "Stage" variable will become 1. And every time the "TimerItself" function is called, this adds +1 into the variable.
3. I don't know the specifics about this thing, but it checks how big the variable is (in this case its "Stage") and picks the case with the same number.
4. In between the case and break, you can put functions you want to use. And in this case the next case comes every 2 seconds
Here I'm going to complicate it a little bit so it can be utilized better. This is how it will look (color coding for easier explanation and I suggest you copy pasting this into notepad ++ and setting the Language to C++):
So the function above does exactly the same as the simpler one except that the second FadeOut(1.0f); comes 3 seconds later.
if(GetLocalVarInt("Stage") < 4) AddTimer("SPAM", fEventSpeed, "TimerItself"); has to be placed in the end of the function so that the first float fEventSpeed = 2.0f; is before fEventSpeed = 5.0f; so that the second event speed effects the if(getblehblah litany.
Because the fEventSpeed = 5.0f; is in case 2:, case 4 would trigger 2 seconds after case 3 (the function ingnores all other cases than the one that fits to the "Stage" variable).
if(GetLocalVarInt("Stage") < 4) simply means that you can decide when the timer stops looping itself (when cases end, without this part the timer would stay and loop without anything happening. That could possibly slow the game down or something).
the < 4 part means that "TimerItself" is called 4 times then stop ("Stage" variable would be 4).
Checking the color coding and with a little logic this should be possible to understand. If anyone has any more questions, I could try and explain... again
I have just one more question.
What would the function to make Daniel roll to look like he is laying, then to get back up? (I think its like FadePlayerRollTo(X Axis,Y axis, Z axis) or something). But what would be the Numbers for the X, Y, and Z axis?? (For the laying on the ground like sleeping, and the default.)
I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
RE: extra_english now is working, but I need help with a different script :)
(05-27-2011, 10:59 PM)XxRoCkBaNdMaNxX Wrote: What would the function to make Daniel roll to look like he is laying, then to get back up? (I think its like FadePlayerRollTo(X Axis,Y axis, Z axis) or something). But what would be the Numbers for the X, Y, and Z axis?? (For the laying on the ground like sleeping, and the default.)
Well you would just have to tweak and test and tweak these:
MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);
if you want your head close to the ground change float afY to -1 or something.
then there is this what youre mainly after I guess:
FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);
change float afX to -45 or 45 and your view is turned 45 degrees