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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help I would very much like some help please!
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#11
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

I'm gonna assume that you didn't see my post, so I guess I have to do it for you -.-

void WakeUp(string &in timer_name)
{
if(timer_name == "Start")
{
SetLightVisible("BoxLight_1", true);
FadeIn(4);
AddTimer("MoveHead", 1, "WakeUp");
}

else if (timer_name == "MoveHead")
{
FadeImageTrailTo(0, 1);
FadeRadialBlurTo(1, 1);
MovePlayerHeadPos(-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);
AddTimer("Start", 1, "WakeUp");
}
}

I'm gonna assume this is how you want it to be.

Derp.
03-23-2014, 09:29 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#12
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

Somehow you make me how to say...

ugh now he wakes BUT

When he need to get up from bed he:
Go forward (picture normal AND picture upside-down)
Then backwards WITHOUT MOVING
and won't stop

see this

http://youtu.be/WWLgrSIbxYU?t=25m37s

and like you camera upside down with normal camera forward then backward,forward then backward and won't stop

(This post was last modified: 05-15-2014, 03:32 PM by Straxedix.)
03-23-2014, 09:37 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#13
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

void TimerWalk(string &in asTimer)
{
    if(GetLocalVarInt("Loop")==2) return;

        MovePlayerForward(5);
AddLocalVarInt("Loop", 1);
    AddTimer("loop", 0.0f, "TimerWalk");

  
}

Get this into the timer. You couldve told me from the start you wanted him to move forward too.

Derp.
(This post was last modified: 03-23-2014, 09:45 PM by Neelke.)
03-23-2014, 09:45 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#14
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

So it should looks like this?


Spoiler below!
PHP Code: (Select All)
void OnStart()

{
     
AddUseItemCallback("""Key123""Door123""UseKeyOnDoor"true);
    
AddUseItemCallback("""Study123""Doors122""UseKeyOnDoor2"true);
    
AddEntityCollideCallback("Player""SoundArea""crossarea"true1);
    
SetEntityPlayerInteractCallback("Tomby1""ActivateMonster"true);
    
AddEntityCollideCallback("Player""area1""Open_Door"true1);
    
AddEntityCollideCallback("Player""Look2""LookBack"true1);
    
AddUseItemCallback("""Tomby1""Wooden""UseKeyOnDoor3"true);
    
AddEntityCollideCallback("Player""LightScript""lightsdown"true1);
    
AddEntityCollideCallback("Player""LookDoooor1""LookBack2"true1);
    
SetEntityPlayerInteractCallback("Tower1""ActivateMonster2"true);
    
AddUseItemCallback("""Torture12""Door32""UseKeyOnDoor4"true);
    
AddEntityCollideCallback("Player""Text""Omgtext"true1);    
    
FadeOut(0);
    
FadePlayerRollTo(652020);
    
MovePlayerHeadPos(-1, -0.45, -1.1201);
    
AddTimer("ActivatePlayer"3"WakeUp");
    
SetLightVisible("BoxLight_1"false);
    
FadeImageTrailTo(31);
    
FadeRadialBlurTo(11);
}

void UseKeyOnDoor(string &in asItemstring &in asEntity)
{
        
SetSwingDoorLocked("Door123"falsetrue);
        
PlaySoundAtEntity("""unlock_door""Door123"0false);
        
RemoveItem("Key123");
}

void UseKeyOnDoor2(string &in asItemstring &in asEntity)
{
        
SetSwingDoorLocked("Doors122"falsetrue);
        
PlaySoundAtEntity("""unlock_door.snt""Doors122"0false);
        
RemoveItem("Study123");
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("Alexander1"true);
AddEnemyPatrolNode("Alexander1""PathNodeArea_1"0"idle");
AddEnemyPatrolNode("Alexander1""PathNodeArea_2"0"idle");
AddEnemyPatrolNode("Alexander1""PathNodeArea_3"0"idle");
    
SetPlayerActive(false);
    
AddTimer(""5.0f"Walkagain");
    
StartPlayerLookAt("Alexander1"5.0f5.0f"");
}

void Open_Door(string &in asParentstring &in asChildint alState)
{
SetSwingDoorClosed("door1"falsetrue);
SetSwingDoorDisableAutoClose("door1"true); // Disable autoclose means its not gonna close by it self.
AddTimer(""0.5"Door_Effect"); // Leading to functions in Door_Effect script.
}

void Door_Effect (string &in asTimer)
{
CreateParticleSystemAtEntity("""ps_dust_whirl""AreaOpenEffect"false); // Makes a patricle system at the scriptbox AreaOpenEffect.
PlaySoundAtEntity("AreaOpenEffect""scare_wind.snt""Player"1true); // Plays a sound at the scriptbox named AreaOpenEffect.
AddPropForce("door1"005000"world"); // Gives the door a push so it goes open.
AddTimer(""0.5"Door_Scare"); // For adding more effect like Sound/Sanity Damage.
}

void Door_Scare(string &in asTimer)
{
PlaySoundAtEntity("scare""react_scare.snt""Player"1true); // For better scare effect.
GiveSanityDamage(25true); // Your screen goes a bit forward to scare you more.
}

void LookBack(string &in asParentstring &in asChildint alState)
{
StartPlayerLookAt("door1"225"CallbackName");
    
SetPlayerActive(false);
    
AddTimer(""3.5f"Walkagain2");
}

void CallbackName()
{
StopPlayerLookAt();
}

void UseKeyOnDoor3(string &in asItemstring &in asEntity)
{
        
SetSwingDoorLocked("Wooden"falsetrue);
        
PlaySoundAtEntity("""unlock_door.snt""Wooden"0false);
        
RemoveItem("Tomby1");
}

void lightsdown(string &in asParentstring &in asChildint alState)
{
SetLampLit("Torch1"falsefalse);
SetLampLit("Torch2"falsefalse);
SetLampLit("Torch3"falsefalse);
SetLampLit("Torch4"falsefalse);
SetLampLit("Torch5"falsefalse);
SetLampLit("Torch6"falsefalse);
}


void LookBack2(string &in asParentstring &in asChildint alState)
{
StartPlayerLookAt("Mansion11"225"CallbackName");
}

void ActivateMonster2(string &in asEntity)
{
SetEntityActive("Creepy1"true);
AddEnemyPatrolNode("Creepy1""PathNodeArea_4"0"idle");
}

void UseKeyOnDoor4(string &in asItemstring &in asEntity)
{
        
SetSwingDoorLocked("Door32"falsetrue);
        
PlaySoundAtEntity("""unlock_door.snt""Door32"0false);
        
RemoveItem("Torture12");
}

void Walkagain(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
}

void Walkagain2(string &in asTimer)
{
SetPlayerActive(true);
}

void WakeUp(string &in timer_name)
{
if(
timer_name == "Start")
{
SetLightVisible("BoxLight_1"true);
FadeIn(4);
AddTimer("MoveHead"1"WakeUp");
}

else if (
timer_name == "MoveHead")
{
FadeImageTrailTo(01);
FadeRadialBlurTo(11);
MovePlayerHeadPos(-0.5, -0.2, -1.122);
FadePlayerRollTo(01.7500);
AddTimer("ActivatePlayer"2"WakeUp");
}

else if (
timer_name == "ActivatePlayer")
{
MovePlayerHeadPos(00022);
SetPlayerActive(true);
AddTimer("Start"1"WakeUp");
}
}

void TimerWalk(string &in asTimer)
{
    if(
GetLocalVarInt("Loop")==2) return;

        
MovePlayerForward(5);
AddLocalVarInt("Loop"1);
    
AddTimer("loop"0.0f"TimerWalk");

  



(This post was last modified: 05-15-2014, 03:33 PM by Straxedix.)
03-23-2014, 10:01 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#15
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

Well, there's no timer starting it.

AddTimer("loop", 0.0f, "TimerWalk");

Put this in the timer where you want the player to move forward.

Derp.
03-23-2014, 10:18 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#16
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

Can you just put .hps to copy it and give you reputation+ please ???

Edit:
Not working like i put so can you make it to copy???

(This post was last modified: 03-23-2014, 10:33 PM by Straxedix.)
03-23-2014, 10:33 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#17
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

else if (timer_name == "MoveHead")
{
FadeImageTrailTo(0, 1);
FadeRadialBlurTo(1, 1);
MovePlayerHeadPos(-0.5, -0.2, -1.1, 2, 2);
FadePlayerRollTo(0, 1.7, 500);
AddTimer("loop", 0.0f, "TimerWalk");
AddTimer("ActivatePlayer", 2, "WakeUp");
}

If it doesnt work the first time, keep testing. You could probably eventually get it.

Derp.
(This post was last modified: 03-23-2014, 10:35 PM by Neelke.)
03-23-2014, 10:34 PM
Find
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#18
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

It's like this AND NOT WORKING


Spoiler below!
PHP Code: (Select All)
void OnStart()

{
     
AddUseItemCallback("""Key123""Door123""UseKeyOnDoor"true);
    
AddUseItemCallback("""Study123""Doors122""UseKeyOnDoor2"true);
    
AddEntityCollideCallback("Player""SoundArea""crossarea"true1);
    
SetEntityPlayerInteractCallback("Tomby1""ActivateMonster"true);
    
AddEntityCollideCallback("Player""area1""Open_Door"true1);
    
AddEntityCollideCallback("Player""Look2""LookBack"true1);
    
AddUseItemCallback("""Tomby1""Wooden""UseKeyOnDoor3"true);
    
AddEntityCollideCallback("Player""LightScript""lightsdown"true1);
    
AddEntityCollideCallback("Player""LookDoooor1""LookBack2"true1);
    
SetEntityPlayerInteractCallback("Tower1""ActivateMonster2"true);
    
AddUseItemCallback("""Torture12""Door32""UseKeyOnDoor4"true);
    
AddEntityCollideCallback("Player""Text""Omgtext"true1);    
    
FadeOut(0);
    
FadePlayerRollTo(652020);
    
MovePlayerHeadPos(-1, -0.45, -1.1201);
    
AddTimer("ActivatePlayer"3"WakeUp");
    
SetLightVisible("BoxLight_1"false);
    
FadeImageTrailTo(31);
    
FadeRadialBlurTo(11);
}

void UseKeyOnDoor(string &in asItemstring &in asEntity)
{
        
SetSwingDoorLocked("Door123"falsetrue);
        
PlaySoundAtEntity("""unlock_door""Door123"0false);
        
RemoveItem("Key123");
}

void UseKeyOnDoor2(string &in asItemstring &in asEntity)
{
        
SetSwingDoorLocked("Doors122"falsetrue);
        
PlaySoundAtEntity("""unlock_door.snt""Doors122"0false);
        
RemoveItem("Study123");
}

void ActivateMonster(string &in asEntity)
{
SetEntityActive("Alexander1"true);
AddEnemyPatrolNode("Alexander1""PathNodeArea_1"0"idle");
AddEnemyPatrolNode("Alexander1""PathNodeArea_2"0"idle");
AddEnemyPatrolNode("Alexander1""PathNodeArea_3"0"idle");
    
SetPlayerActive(false);
    
AddTimer(""5.0f"Walkagain");
    
StartPlayerLookAt("Alexander1"5.0f5.0f"");
}

void Open_Door(string &in asParentstring &in asChildint alState)
{
SetSwingDoorClosed("door1"falsetrue);
SetSwingDoorDisableAutoClose("door1"true); // Disable autoclose means its not gonna close by it self.
AddTimer(""0.5"Door_Effect"); // Leading to functions in Door_Effect script.
}

void Door_Effect (string &in asTimer)
{
CreateParticleSystemAtEntity("""ps_dust_whirl""AreaOpenEffect"false); // Makes a patricle system at the scriptbox AreaOpenEffect.
PlaySoundAtEntity("AreaOpenEffect""scare_wind.snt""Player"1true); // Plays a sound at the scriptbox named AreaOpenEffect.
AddPropForce("door1"005000"world"); // Gives the door a push so it goes open.
AddTimer(""0.5"Door_Scare"); // For adding more effect like Sound/Sanity Damage.
}

void Door_Scare(string &in asTimer)
{
PlaySoundAtEntity("scare""react_scare.snt""Player"1true); // For better scare effect.
GiveSanityDamage(25true); // Your screen goes a bit forward to scare you more.
}

void LookBack(string &in asParentstring &in asChildint alState)
{
StartPlayerLookAt("door1"225"CallbackName");
    
SetPlayerActive(false);
    
AddTimer(""3.5f"Walkagain2");
}

void CallbackName()
{
StopPlayerLookAt();
}

void UseKeyOnDoor3(string &in asItemstring &in asEntity)
{
        
SetSwingDoorLocked("Wooden"falsetrue);
        
PlaySoundAtEntity("""unlock_door.snt""Wooden"0false);
        
RemoveItem("Tomby1");
}

void lightsdown(string &in asParentstring &in asChildint alState)
{
SetLampLit("Torch1"falsefalse);
SetLampLit("Torch2"falsefalse);
SetLampLit("Torch3"falsefalse);
SetLampLit("Torch4"falsefalse);
SetLampLit("Torch5"falsefalse);
SetLampLit("Torch6"falsefalse);
}


void LookBack2(string &in asParentstring &in asChildint alState)
{
StartPlayerLookAt("Mansion11"225"CallbackName");
}

void ActivateMonster2(string &in asEntity)
{
SetEntityActive("Creepy1"true);
AddEnemyPatrolNode("Creepy1""PathNodeArea_4"0"idle");
}

void UseKeyOnDoor4(string &in asItemstring &in asEntity)
{
        
SetSwingDoorLocked("Door32"falsetrue);
        
PlaySoundAtEntity("""unlock_door.snt""Door32"0false);
        
RemoveItem("Torture12");
}

void Walkagain(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
}

void Walkagain2(string &in asTimer)
{
SetPlayerActive(true);
}

void WakeUp(string &in timer_name)
{
if(
timer_name == "Start")
{
SetLightVisible("BoxLight_1"true);
FadeIn(4);
AddTimer("MoveHead"1"WakeUp");
}

else if (
timer_name == "MoveHead")
{
FadeImageTrailTo(01);
FadeRadialBlurTo(11);
MovePlayerHeadPos(-0.5, -0.2, -1.122);
FadePlayerRollTo(01.7500);
AddTimer("loop"0.0f"TimerWalk");
AddTimer("ActivatePlayer"2"WakeUp");
}

else if (
timer_name == "ActivatePlayer")
{
MovePlayerHeadPos(00022);
SetPlayerActive(true);
AddTimer("Start"1"WakeUp");
}



(This post was last modified: 05-15-2014, 03:34 PM by Straxedix.)
03-23-2014, 10:39 PM
Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#19
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

Straxedix Let me tell you somethin, I'm not trying to be mean but You are never going to learn if you keep taking scripts and asking people to do everything for you! Take a look at the wiki or engine scripts so you can improve more. But it's ok if you're a begginer, I was like you before until I got more fluently into coding Smile

(This post was last modified: 03-23-2014, 10:41 PM by Radical Batz.)
03-23-2014, 10:40 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#20
RE: Wtf ??? Never srsly never see this!!!! (this thread make me MAD)

void AddPlayerBodyForce(float afX, float afY, float afZ, bool abUseLocalCoords);

Pushes the player into a certain direction. Note that you need values above ~2000 to see any effects.

afX - amount along the X-axis
afY - amount along the Y-axis
afZ - amount along the Z-axis
abUseLocalCoords - If true, axes are based on where the player is facing, not the world.

Test with this, text below explains what it does. Enuff said.

Derp.
03-23-2014, 10:42 PM
Find




Users browsing this thread: 1 Guest(s)