|
Re: Display a message
[Re: ayks]
#289897
09/16/09 07:38
09/16/09 07:38
|
Joined: Jul 2009
Posts: 36
SomebodyNew
Newbie
|
Newbie
Joined: Jul 2009
Posts: 36
|
I think this is exactly what you are looking for. Enjoy
|
|
|
Re: Display a message
[Re: ayks]
#289951
09/16/09 13:36
09/16/09 13:36
|
Joined: Sep 2009
Posts: 155 France
ayks
OP
Member
|
OP
Member
Joined: Sep 2009
Posts: 155
France
|
thx for answers, i ll go look it now and i wanna make a system box message  (printf remember me "C"'s souvenir :x) edit : dunno if its mega-old or what but the simple "script07" dont work, i got error like "parameter unknown pos_x". sort of annoying for follow the tutorial-.
Last edited by ayks; 09/16/09 21:06.
|
|
|
Re: Display a message
[Re: Cowabanga]
#290244
09/17/09 21:22
09/17/09 21:22
|
Joined: Sep 2009
Posts: 155 France
ayks
OP
Member
|
OP
Member
Joined: Sep 2009
Posts: 155
France
|
damn and thx for answer, i ll try to look for another method but its boring me, 2 days im trying to display a single message at the press of a key on a model t_t does anyone know use messages.wdl in order to display a message easily, tried to include it but can't do anything with it :\edit : i looked the workshop, "message", "action", etc, tried to start from the 1# but when i tried to do something in order to import them in my game i always get error -.
new edit : ok i succeeded in displaying a message on the screen (just added it at the end of messages.wdl :)) , now i just want to make that the message display only when i press CTRL face on a model, i return search but if i dont disagree if i can get some help  now, I just need to get a condition for make my message displays when ctrl or space is pressed on a model (character) screenshot here what i have for now but i don't know how to put the "on_w", i need something like "if (on_w && my.enable.scan = on) { my.event = key_pîckup;" } but it dont works so if someone has a solution for me.. (for now, i got the message which shows up when i go near the model, but i want the condition "on_w" as well, as a normal dialog box with a character..)
Last edited by ayks; 09/18/09 01:59.
|
|
|
Re: Display a message
[Re: ayks]
#290277
09/18/09 07:55
09/18/09 07:55
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
There are two other possibilities I can think of right away: 1. Give the entity action a while loop and check the distance to the player inside of it. If the player is in "communication-range" check if the "communicate-button" is pressed (with key_X not on_X .. X being any key, like w, a, and so on). If that is the case, show your dialogue. example code (quick 'n dirty)
action my_npc
{
while(!player) { wait(1); } // wait for the player pointer to become valid
while(me) // as long as the entities is alive
{
if(vec_dist(my.x,player.x) < 200)
{
if(key_w)
{
while(key_w) { wait(1); } //wait for the key to be released (fail safe)
show_dialog();
}
}
wait(1);
}
}
2. The second approach uses c_scan and the event function of the entities and might reduce the processing overkill by checking the distance to the player each frame. This will come in handy if you have a huge number of entities that can be talked to by the player. This would function like: - the player approaches a character he wants to talk to and faces him - if the player presses a key, a scan (c_scan) will be performed in a small circle segment to the front of the player, so hopefully the character he wants to talk to is the closest entity return by the scan function - now the entity has an event function which is triggered by the scan, if all checks are ok (scanning entity is the player etc.) than start the dialogue
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|