Display a message

Posted By: ayks

Display a message - 09/16/09 03:02

hi, this time i'm trying to display a simple message..
(tried to look in aum and i have dl demo, + tried to do something with messages.wdl but can't succeed for now, prolly due to noobness --)

so, if someone could explain me briefly just how to display a single message, would be sufficiant:|
Posted By: delinkx

Re: Display a message - 09/16/09 03:49

how u want to display this message ? by a system box or within the screen ?

if system box, see "printf" under manual.
if on screen then see "panels" under manual or "text"
Posted By: SomebodyNew

Re: Display a message - 09/16/09 07:38

I think this is exactly what you are looking for.

Enjoy
Posted By: Widi

Re: Display a message - 09/16/09 11:39

Yes, as SomebodyNew says: make the Workshop!
Posted By: ayks

Re: Display a message - 09/16/09 13:36

thx for answers, i ll go look it now and i wanna make a system box message laugh (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-.
Posted By: ayks

Re: Display a message - 09/17/09 20:08

still trying to do something.. i found a script on this forum and i'm trying to make it work for starts something, but i got an error (original --')

here the error screen (i put the action on a basic model)

here the script (.c) or here

and here the include of the script in the main .wdl of the project

can someone tell me what i'm supposed to do for remove the first screen's error please -'
Posted By: Cowabanga

Re: Display a message - 09/17/09 21:15

Actually, you can't include Lite-C files in a C-Script file
Posted By: ayks

Re: Display a message - 09/17/09 21:22

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 laugh




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..)
Posted By: DJBMASTER

Re: Display a message - 09/18/09 07:52

try "key_w==1" instead of on_w.
Posted By: Xarthor

Re: Display a message - 09/18/09 07:55

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)
Code:
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
Posted By: ayks

Re: Display a message - 09/18/09 14:04

ok, thx, i ll try and give news later.

djbmaster=> already tried with it, haven't succeed with it, but mb it will serve me another time :l

last edit : finally did it, was writing a message for say that i can't make it works (:x) and i tried again and did it, y i know im meganoob.. 500 try just for it :x
here the noob code (sounds are here for see where it work/dont work)

tried ur codes xarthor but i encountered some problem due to my noobness, they helped me understand some things anyway, so tx, and djbmaster, finally i did it with ur "tip" :x

next step, try to display a message in a nice "dialog box" like in rpg (well.. i'm not really thinking about making an rpg with my noskill but if i can at least do it (the "dialog box), would be a one more step for me :x).
i dont ask help for do it (for now, hope i wont have to do another topic in somes days for it) so end of this topic laugh

© 2024 lite-C Forums