Jump to content

while (char_ok(i) == 0)


gcmaxxon

Recommended Posts

Hi,

Here is a piece of "for next" coding , Ops!, wrong language,

that I do not quite understand.

 

Quote:

For example (i.e.) :

 

i = 0

while (char_ok(i) == 0)

{i = i + 1; }

...

append_char_name(i);

...

I guess my questions are : what character's name is appended?

and just how is it displayed to the player?

 

Thanks before hand for any help.

gcmaxxon confused

Link to comment
Share on other sites

I'm guessing that he got that code out of one of my scenarios — the bracketing is distinctive.

 

The idea is that the while loop finds the first living character. It starts with 0, and if 0 is dead, it checks 1, and so on until it finds the party leader.

 

So i is the first living character, and that character's name is appended to the text buffer. That displays nothing. Notice a few lines later that there's this:

 

Code:
 get_buffer_text(dlgstr);message_dialog(dlgstr,""); 
Or something along those lines. The get_buffer_text saves the text buffer to dlgstr, and then message_dialog pops up dlgstr.

 

This is the way to make a message box address the leading character by name.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...