Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SetEntityPlayerInteractCallback!?!?!?
Author Message
Jagsrs28 Offline
Member

Posts: 101
Joined: Jun 2012
Reputation: 0
Post: #1
SetEntityPlayerInteractCallback!?!?!?
So I have been trying to make sort of a dramatic moment in my custom story, and It is not working. So basically there is a knife on the floor and you have to find it all drugged. When you pick it up a bunch of stuff happens.
Here is the script:



SetEntityPlayerInteractCallback("Knife_1", "Murder", true);
}

void Murder(string &in asParent, string &in asChild, int alState)
{
StopMusic(1, 0);
FadeIn(1);
AddTimer("Timer2", 4, "Into2");
GetPlayerSpeed();
SetPlayerJumpDisabled(false);
SetPlayerMoveSpeedMul(0)
}

void Into2(string &in asTimer)
{
FadeOut(1);
AddTimer("Timer3", 2, "Sounds1");
}

void Sounds1(string &in asTimer)
{
PlaySoundAtEntity("", "24_cut.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
AddTimer("Timer4", 27, "Neworld1");
}

void Neworld1(string &in asTimer)
{
ChangeMap("02.map", "PlayerStartArea_1", "", "");
}


I have the OnStart(), OnEnter(), OnLeave()
Have any questions I will be happy to answer them.



EDIT:
In the Level Editor, I named the knife, "Knife_1"
I also went into the .lang and put:



<Entry Name="ItemDesc_knife_1">Knife to cut.</Entry>
<Entry Name="ItemName_knife_1">Knife</Entry>

Special Custom Story for 2 special people!

[Image: LWFcAl]


(This post was last modified: 07-02-2012 02:52 PM by Jagsrs28.)
07-02-2012 02:47 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,236
Joined: Jul 2011
Reputation: 216
Post: #2
RE: SetEntityPlayerInteractCallback!?!?!?
You have the wrong interact callback syntax.

Tutorials: From Noob to Pro
07-02-2012 02:50 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Adny Offline
Posting Freak

Posts: 1,754
Joined: Mar 2012
Reputation: 169
Post: #3
RE: SetEntityPlayerInteractCallback!?!?!?
The callback syntax for the function "Murder" is incorrect; it should be (string &in asEntity) instead of the callback you currently have.

Timorem and Friends are Hungryâ„¢
07-02-2012 02:50 PM
Find all posts by this user Quote this message in a reply
EXAWOLT Offline
Member

Posts: 116
Joined: Apr 2012
Reputation: 3
Post: #4
RE: SetEntityPlayerInteractCallback!?!?!?
SetEntityPlayerInteractCallback will be called when "walking" on or touch the item.
SetEntityCallbackFunc("knife", "OnPickup"); = iwill be called when picking up the item.
void OnPickup(string &in asEntity, string &in type)
{
StopMusic(1, 0);
FadeIn(1);
AddTimer("Timer2", 4, "Into2");
GetPlayerSpeed();
SetPlayerJumpDisabled(false);
SetPlayerMoveSpeedMul(0)}

simply nuff said




07-02-2012 02:53 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,236
Joined: Jul 2011
Reputation: 216
Post: #5
RE: SetEntityPlayerInteractCallback!?!?!?
(07-02-2012 02:53 PM)EXAWOLT Wrote:  SetEntityPlayerInteractCallback will be called when "walking" on or touch the item.

Walking on an object is not a form of interaction.

Tutorials: From Noob to Pro
07-02-2012 03:13 PM
Visit this user's website Find all posts by this user Quote this message in a reply
EXAWOLT Offline
Member

Posts: 116
Joined: Apr 2012
Reputation: 3
Post: #6
RE: SetEntityPlayerInteractCallback!?!?!?
my wrong sorry, but i cant seem to edit my comment, somethings wrong:/

simply nuff said




07-02-2012 03:45 PM
Find all posts by this user Quote this message in a reply
Jagsrs28 Offline
Member

Posts: 101
Joined: Jun 2012
Reputation: 0
Post: #7
RE: SetEntityPlayerInteractCallback!?!?!?
Finished! Yeah, It was the wrong syntax thank you guys SO MUCH!

Special Custom Story for 2 special people!

[Image: LWFcAl]


07-02-2012 03:48 PM
Find all posts by this user Quote this message in a reply
LulleBulle Offline
Member

Posts: 102
Joined: Feb 2012
Reputation: 0
Post: #8
RE: SetEntityPlayerInteractCallback!?!?!?
(07-02-2012 03:48 PM)Jagsrs28 Wrote:  Finished! Yeah, It was the wrong syntax thank you guys SO MUCH!
Incase you want to make stuff happend when you walk on it put a small script area over it and use AddEntityCollideCallback.
07-02-2012 06:25 PM
Find all posts by this user Quote this message in a reply
Jagsrs28 Offline
Member

Posts: 101
Joined: Jun 2012
Reputation: 0
Post: #9
RE: SetEntityPlayerInteractCallback!?!?!?
(07-02-2012 06:25 PM)LulleBulle Wrote:  
(07-02-2012 03:48 PM)Jagsrs28 Wrote:  Finished! Yeah, It was the wrong syntax thank you guys SO MUCH!
Incase you want to make stuff happend when you walk on it put a small script area over it and use AddEntityCollideCallback.
I know ,but thanks anyways!

Special Custom Story for 2 special people!

[Image: LWFcAl]


07-02-2012 07:28 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)