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".
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;
Sorry don't understand well. Can you or someone please write it more particularly?
This should do it, just enter your own category, names, etc.
Code:
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.
Have it now. Thank you
Oh is it possible that you only can click once till the message end?
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
...
(03-04-2013, 09:52 PM)darksky Wrote: [ -> ]yes. there are multiple ways
1. use additional bool variable
..
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
or improve programming in general, which will help you with coming up with certain solutions
(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