Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 1,151 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
enter text #215817
07/13/08 15:12
07/13/08 15:12
Joined: Aug 2006
Posts: 152
vector(200,45,338)
Marwan Offline OP
Member
Marwan  Offline OP
Member

Joined: Aug 2006
Posts: 152
vector(200,45,338)
I have a string that carries up to 50 chars , how can I devide it into several lines instead of filling it during runtime in one long line

like when the first line is filled with 10 chars it automaticly jumps to the line below and so on
and also how can I make it apear like that when I re open it later

THANKS FOR READING


age:16 game design and programming experience:2 years
Re: enter text [Re: Marwan] #216275
07/16/08 09:18
07/16/08 09:18
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
I'm not shure I understood what you want smile
You can type "\n" in your text for a new line (but I'm not shure this works).
You could also check the length of your string and split it in smaller sections. str_len(string) if > 10 than copy the string into a new one , clip 10 characters from the first string , trunc (str_len - 10) from the second string. You get the rest of the text in the first string , and the first line of text in the second string. Repeat the process for more strings.


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: enter text [Re: EpsiloN] #216286
07/16/08 10:36
07/16/08 10:36
Joined: Aug 2006
Posts: 152
vector(200,45,338)
Marwan Offline OP
Member
Marwan  Offline OP
Member

Joined: Aug 2006
Posts: 152
vector(200,45,338)
What I ment is , instead if writing a text like this:

example:

whats up mom , Im going to school today , dont foget to give me my sandwiches and when I comeback I will do my HW etc etc etc etc bla bla bla bla bla bla

I want it like this

example:

whats up mom , Im going to school today
, dont foget to give me my sandwiches
and when I comeback I will do my HW etc
etc etc etc bla bla bla bla bla bla


age:16 game design and programming experience:2 years
Re: enter text [Re: Marwan] #216341
07/16/08 16:06
07/16/08 16:06
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Again , not shure about this , but I think there was an example in the AUM about this. I'm not shure if its dynamic (eg. you enter the text) or static (Predefined text message split into predefined lines). Look for Morrowind,I think.


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: enter text [Re: EpsiloN] #216412
07/16/08 22:24
07/16/08 22:24
Joined: Aug 2006
Posts: 152
vector(200,45,338)
Marwan Offline OP
Member
Marwan  Offline OP
Member

Joined: Aug 2006
Posts: 152
vector(200,45,338)
ok man , Thanks smile


age:16 game design and programming experience:2 years
Re: enter text [Re: Marwan] #218319
07/27/08 22:28
07/27/08 22:28
Joined: Apr 2006
Posts: 159
Latvija
Arrovs Offline
Member
Arrovs  Offline
Member

Joined: Apr 2006
Posts: 159
Latvija
get it to seen next time after game open is easy with
file=file_open_read("valoda.dat");
and further information can get with file_str_read(file,string);//and other ways because it stops in , and other stupid simbols and in this case you can use read_to!
Example:

val_dok = file_open_read("valoda.dat"); // open language file
valoda = file_var_read(val_dok); //read which language is set
file_close(val_dok);
varonis_dat = file_open_read("varonis.dat"); // open info file
file_find(varonis_dat,"Vards:");//find this name and put cursor behind it
file_str_readto(varonis_dat,strIevadesfin,",IP:",null);//read name till "IP:" text!
file_find(varonis_dat,"IP:");//find this text and put cursor behind it
file_str_read(varonis_dat,strIP); // and read which IP is inputted
file_close(varonis_dat);

In this way you can read any text from start till your own maded end string.

And now how to do this writing in game time from my opinion:

function input_check
{
if(str_len(txt_str)=10)
{str0=create_string("#10");
str0.sring=txt_str;//set second string pos to first string
inkey_active=off;
//and now first to next line
txt_str=str0.pos_y+str0.char_y;//if need put some more pixels
str_cpy(txt_str,"");
input();
}
}

funtion input
{
input_check();
inkey(txt_str);
//after enter
fails=file_open_write(fails.dat);//save result
file_str_write(fails,txt_str);//use if or anything else to check other maded or defined strings
file_str_read(fails,"!END#$%");//your read end part to let read all commas and other stupid reading breakers.
file_close(fails);
}

for short version is good, but much to improve(almost not tested, but if you know how to do programming all will be good).


Arrovs once will publish game

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1