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


Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SetEntityPlayerInteractCallback!?!?!?
Jagsrs28 Offline
Member

Posts: 101
Threads: 25
Joined: Jun 2012
Reputation: 0
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: SetEntityPlayerInteractCallback!?!?!?

You have the wrong interact callback syntax.

Tutorials: From Noob to Pro
07-02-2012, 02:50 PM
Website Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#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.

I rate it 3 memes.
07-02-2012, 02:50 PM
Find
EXAWOLT Offline
Member

Posts: 113
Threads: 14
Joined: Apr 2012
Reputation: 3
#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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#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
Website Find
EXAWOLT Offline
Member

Posts: 113
Threads: 14
Joined: Apr 2012
Reputation: 3
#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
Jagsrs28 Offline
Member

Posts: 101
Threads: 25
Joined: Jun 2012
Reputation: 0
#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
LulleBulle Offline
Member

Posts: 101
Threads: 33
Joined: Feb 2012
Reputation: 0
#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
Jagsrs28 Offline
Member

Posts: 101
Threads: 25
Joined: Jun 2012
Reputation: 0
#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




Users browsing this thread: 2 Guest(s)