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
Script Help Easy Cuestion
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#1
Wink  Easy Cuestion

Just to ask what script does turn player oround (automaticly) i mean behind him :

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

Or This one:void FadePlayerRollTo(float afX, float afSpeedMul, float afMaxSpeed);

Or this one:void MovePlayerHeadPos(float afX, float afY, float afZ, float afSpeed, float afSlowDownDist);

I just ask if somebody can answer if know what i mean


Smile

Ugh edit:


It can be this one i think ^.^

void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);
void StopPlayerLookAt();

(This post was last modified: 03-11-2014, 08:44 PM by Straxedix.)
03-11-2014, 08:42 PM
Find Reply
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: Easy Cuestion

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

FadePlayerRollTo = Rotates the position of the camera on the player's body. (not turning the player around)

MovePlayerHeadPos = Changes the position of the camera on the player's body. (For example, making it look like the player is lying on the floor)

The last ones are the functions you need.

I hope at least you know how to use those.
03-11-2014, 08:50 PM
Find Reply
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#3
RE: Easy Cuestion

Yeah i'l find way thanks a lot it means me and sorry for taking you'r time Smile

I forgot to say solved thread and you solved it Tongue Neelke.

Ughhhhh

I think i DON'T understand THIS

void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);
void StopPlayerLookAt();
Forces the player to look at a certain entity until StopPlayerLookAt is used.

asEntityName - the entity to look at
afSpeedMul - how fast should the player look at the entity
afMaxSpeed - maximum speed allowed
asAtTargetCallback - function to call when player looks at target

it's a script but i don't get it... it should got some Area when he enter to look there or he just when he spawn he will look in it... not really sure what gonna happen

(This post was last modified: 03-11-2014, 09:06 PM by Straxedix.)
03-11-2014, 08:53 PM
Find Reply
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#4
RE: Easy Cuestion

He will just look into it, nothing else. Then use StopPlayerLookAt() to making him stop.
03-11-2014, 09:17 PM
Find Reply
Mudbill Online
Muderator

Posts: 3,815
Threads: 59
Joined: Apr 2013
Reputation: 177
#5
RE: Easy Cuestion

What you'd do here is to make a script area where you want the player to start looking behind, then add the AddEntityCollideCallback("Player", "AreaName", "FunctionName", true, 1); inside OnStart(). Don't forget to edit the AreaName to your area, and the FunctionName to whatever you'd like to name the event.

Then add this:
void FunctionName(string &in asParent, string &in asChild, int alState)
{
    StartPlayerLookAt("DoorName", 20, 25, "CallbackName");
}
Again, don't forget to edit it to your DoorName and another CallbackName. You can edit the numbers to change the speed at which the player turns.

Lastly:
void CallbackName()
{
    StopPlayerLookAt();
}

(This post was last modified: 03-11-2014, 09:22 PM by Mudbill.)
03-11-2014, 09:20 PM
Find Reply
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#6
RE: Easy Cuestion

Like this ?
void OnStart()

{

AddUseItemCallback("", "Key123", "Door123", "UseKeyOnDoor", true);
AddUseItemCallback("", "Study123", "Doors122", "UseKeyOnDoor2", true);
AddEntityCollideCallback("Player", "Area1", "LookBack, true, 1)
}

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

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

void FunctionName(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Door123", 20, 25, "CallbackName");
}

void CallbackName()
{
StopPlayerLookAt();
}

(This post was last modified: 03-11-2014, 09:37 PM by Straxedix.)
03-11-2014, 09:30 PM
Find Reply
Mudbill Online
Muderator

Posts: 3,815
Threads: 59
Joined: Apr 2013
Reputation: 177
#7
RE: Easy Cuestion

Yeah, try that, although you'd want more details to it to make it more smooth. It should work as it is though.

03-11-2014, 09:38 PM
Find Reply
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#8
RE: Easy Cuestion

Ugh i have BAD news not working for this...
void CallbackName()
{
StopPlayerLookAt();
}

it have no end file... what should i type there?

03-11-2014, 09:41 PM
Find Reply
Mudbill Online
Muderator

Posts: 3,815
Threads: 59
Joined: Apr 2013
Reputation: 177
#9
RE: Easy Cuestion

You forgot the semi-colon at the first AddEntityCollideCallback up top in your OnStart.

03-11-2014, 09:57 PM
Find Reply
Straxedix Offline
Senior Member

Posts: 426
Threads: 52
Joined: Mar 2014
Reputation: 5
#10
RE: Easy Cuestion

Can send me .hps file how it should be... ?

03-11-2014, 09:59 PM
Find Reply




Users browsing this thread: 1 Guest(s)