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
Click on entity for message
User01 Offline
Member

Posts: 97
Threads: 30
Joined: Feb 2013
Reputation: 0
#1
Click on entity for message

Okay I want to make that, when a character is in front of me that I need to click on him and then a message should appear, after a short time should another another message appear. And the second message should be repeated always when you click another time on him.
I hope you understand me well, and I have no idea how to make this, so I appeal for help. I also found nothing about "click on entity".
(This post was last modified: 03-23-2013, 02:08 AM by plutomaniac.)
03-04-2013, 06:19 PM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#2
RE: Click on entity for message

make a scriptbox with an interact callback

int i = 0;

and in the callback

if (i==0) display first message
else display second message
i++;

edit:

better solution

bool first = true;

in callback
{
if (first) display firstmessage; addtimer with second message
else display second message;
}

and in the timer callback

display second message;
first = false;
(This post was last modified: 03-04-2013, 07:17 PM by darksky.)
03-04-2013, 07:15 PM
Find
User01 Offline
Member

Posts: 97
Threads: 30
Joined: Feb 2013
Reputation: 0
#3
RE: Click on entity for message

Sorry don't understand well. Can you or someone please write it more particularly?
(This post was last modified: 03-04-2013, 07:40 PM by User01.)
03-04-2013, 07:38 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#4
RE: Click on entity for message

This should do it, just enter your own category, names, etc.

void OnStart()
{
    SetLocalVarInt("message", 0);
    SetEntityPlayerInteractCallback("Object", "function1", false);
}

void function1(string &in asEntity)
{
    if(GetLocalVarInt("message") == 1)
    {
        SetMessage("Category", "Entry2", 2);
    }
    else
    {
        SetMessage("Category", "Entry1", 2);
        AddTimer("", 2, "secondmessage");
    }
}

void secondmessage(string &in asTimer)
{
    SetMessage("Category", "Entry2", 2);
    AddLocalVarInt("message", 1);
}

Please correct me if I'm wrong.
03-04-2013, 07:44 PM
Find
User01 Offline
Member

Posts: 97
Threads: 30
Joined: Feb 2013
Reputation: 0
#5
RE: Click on entity for message

Have it now. Thank you Smile
03-04-2013, 08:14 PM
Find
User01 Offline
Member

Posts: 97
Threads: 30
Joined: Feb 2013
Reputation: 0
#6
RE: Click on entity for message

Oh is it possible that you only can click once till the message end?
03-04-2013, 09:41 PM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#7
RE: Click on entity for message

yes. there are multiple ways

1. use additional bool variable
2. make two script areas. first one displays first message & second message and deactivates itself. after the message activate the second script area, which will only show second message

...
(This post was last modified: 03-04-2013, 09:53 PM by darksky.)
03-04-2013, 09:52 PM
Find
User01 Offline
Member

Posts: 97
Threads: 30
Joined: Feb 2013
Reputation: 0
#8
RE: Click on entity for message

(03-04-2013, 09:52 PM)darksky Wrote: yes. there are multiple ways

1. use additional bool variable
..
Huh
03-04-2013, 10:00 PM
Find
darksky Offline
Member

Posts: 52
Threads: 8
Joined: Nov 2012
Reputation: 2
#9
RE: Click on entity for message

you can use a bool variable
if true, the messages are displayed, if false then not
just set variable to false when starting the message and to true when the message is finished.

without offense : you could do a bit more thinking Smile or improve programming in general, which will help you with coming up with certain solutions
03-04-2013, 10:04 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#10
RE: Click on entity for message

(03-04-2013, 09:52 PM)darksky Wrote: yes. there are multiple ways

1. use additional bool variable
2. make two script areas. first one displays first message & second message and deactivates itself. after the message activate the second script area, which will only show second message

...

Isnt that what I just did without scriptareas?

(03-04-2013, 09:41 PM)User01 Wrote: Oh is it possible that you only can click once till the message end?

I'll create the script for you when I'm back on my computer
(This post was last modified: 03-04-2013, 10:10 PM by OriginalUsername.)
03-04-2013, 10:06 PM
Find




Users browsing this thread: 1 Guest(s)