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 [SOLVED] An event after reading a note
Kiwi2703 Offline
Junior Member

Posts: 27
Threads: 5
Joined: Sep 2012
Reputation: 2
#1
[SOLVED] An event after reading a note

I have a simple question (I somehow couldn't find the answer anywhere..) - How to make certain events happen after reading a note? Player interaction callback doesn't work :/ Thanks in advance Smile
(This post was last modified: 09-07-2012, 05:15 PM by Kiwi2703.)
09-07-2012, 04:46 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: An event after reading a note

It should work.. It works for me. Or... I haven't tested it yet. I worked once.
I guess what happpens is that the event has 0.3 sec to start, and then the note pauses the game while you read it...

Trying is the first step to success.
09-07-2012, 04:56 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#3
RE: An event after reading a note

(09-07-2012, 04:46 PM)Kiwi2703 Wrote: I have a simple question (I somehow couldn't find the answer anywhere..) - How to make certain events happen after reading a note? Player interaction callback doesn't work :/ Thanks in advance Smile
In the Level Editor, select the note that you chose, click the "Entity" tab, then there is "PlayerInteractCallback". Enter "Note_Event" (for example, and without quotes).

In the script file, use the syntax
void Note_Event(string &in asEntity)
{
    (YOUR EVENT)
}

If this won't work, I don't know what will. Are you sure that the names are correct? Is the syntax (mentioned in code) correct?

If you had the map open in Amnesia while 'creating' the script file (not editing it, like creating the hps file after you loaded the map up), exit Amnesia, then start it back up.

EDIT: beecake got here sooner.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 09-07-2012, 05:02 PM by Robby.)
09-07-2012, 04:57 PM
Website Find
Steve Offline
Member

Posts: 178
Threads: 17
Joined: Jun 2012
Reputation: 7
#4
RE: An event after reading a note

http://imageshack.us/photo/my-images/37/thisl.png/
this and this:
void thishappens(string &in asEntity)
{
stuff to happen
}

Edit: I got ninjaed

CURRENTLY WORKING ON:
Final Light = 40%
Need of voice actors.
(This post was last modified: 09-07-2012, 05:06 PM by Steve.)
09-07-2012, 05:05 PM
Find
Kiwi2703 Offline
Junior Member

Posts: 27
Threads: 5
Joined: Sep 2012
Reputation: 2
#5
RE: An event after reading a note

Yesss, it works Smile Thanks Smile
The thing was, I had this:

void theprisoner(string &in asParent, string &in asChild, int alState)

instead of this:

void theprisoner(string &in asEntity)

because originally I set it to start when player collides with an area.
Thank you! Smile
(This post was last modified: 09-07-2012, 05:14 PM by Kiwi2703.)
09-07-2012, 05:06 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#6
RE: An event after reading a note

(09-07-2012, 05:05 PM)Steve Wrote: http://imageshack.us/photo/my-images/37/thisl.png/
this and this:
void thishappens(string &in asEntity)
{
stuff to happen
}

Edit: I got ninjaed
Kinda late, but also a great example.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
09-07-2012, 05:10 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: An event after reading a note

(09-07-2012, 05:06 PM)Kiwi2703 Wrote: Yesss, it works Smile Thanks Smile
The thing was, I had this:

void theprisoner(string &in asParent, string &in asChild, int alState)

instead of this:

void theprisoner(string &in asEntity)

because originally I set it to start when player collides with an area.
Thank you! Smile
Always remember to use the right syntax Wink

Trying is the first step to success.
09-07-2012, 05:57 PM
Find




Users browsing this thread: 3 Guest(s)