Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (degenerate_762), 1,500 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Enter Name for Highscore #327679
06/07/10 20:05
06/07/10 20:05
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Hey guys!

Just a few minutes after my last question, I have to ask another one (hope you won't blame me for that =D). But I am working on a High Score System which works fine so far, but I need to know how I can create something which lets the player enter his name...Maybe a field or something like that.

Hope you'll understand my request.

Greetz, Minamato

Re: Enter Name for Highscore [Re: Minamato] #327680
06/07/10 20:09
06/07/10 20:09
Joined: May 2010
Posts: 23
Germany
h34dl4g Offline
Newbie
h34dl4g  Offline
Newbie

Joined: May 2010
Posts: 23
Germany
There was a function which saves the last pressed key. You could ask for the last pressed ones and display them at the same time, so it would be the same as writing. First you have to display a panel to write or something like that. Don't know the code exactly right now.

-h34dl4g


1338, beyond leet.
Re: Enter Name for Highscore [Re: Minamato] #327681
06/07/10 20:10
06/07/10 20:10
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
search for "inkey" in the manual

Re: Enter Name for Highscore [Re: Widi] #327682
06/07/10 20:13
06/07/10 20:13
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Thanks guys, try my best =)

Re: Enter Name for Highscore [Re: Minamato] #327684
06/07/10 20:33
06/07/10 20:33
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Can someone please give me an example? I think that I don't really understand what stands in the manual...^^"

Re: Enter Name for Highscore [Re: Minamato] #327686
06/07/10 20:45
06/07/10 20:45
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Use a TEXT with a string and make this TEXT visible. Now use "inkey(my_string)" and you can edit this string. The script waiting during you edit the string. If you press enter (or esc, tab and others, see manual) the script continues.

Re: Enter Name for Highscore [Re: Widi] #327740
06/08/10 11:12
06/08/10 11:12
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Oh! I just didn't made the text VISIBLE...^^" stupid mistake...but thanks!

Re: Enter Name for Highscore [Re: Minamato] #327841
06/08/10 19:45
06/08/10 19:45
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
just a little question:

Code:
#include <acknex.h>
#include <default.c>

STRING* string1 = "";
STRING* string2 = "";
STRING* entry_str = "                      "; // long empty string

TEXT* name_show =
{
	pos_x = 50;
	pos_y = 50;
	layer = 1;
	font = "#16";
	string(string1);
	flags = SHOW;
}

TEXT* name_show2 =
{
	pos_x = 50;
	pos_y = 50;
	layer = 1;
	font = "#16";
	string(string2);
	flags = SHOW;
}


function process_entry(STRING*)
{
   while(1)
   {
   	if (inchar(string1) == 13) break;
   	str_cat(string2,string1);
   }
}

function main ()
{
	video_mode = 7; // Bildschirm der Größe 1280x800
	mouse_mode = 4; // aktiviere Maus
   var key = inkey(entry_str); // wait until [enter] pressed
   if (key == 13) process_entry(entry_str); 
}



which of the three strings is the one which displays the name in the end? When I use them in my highscore-send function, the show nothing, allthough the name was displayed before (while entering it)...

greetz, Minamato

Re: Enter Name for Highscore [Re: Minamato] #327845
06/08/10 20:23
06/08/10 20:23
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
inkey(entry_str); --> it is entry_str.

You call this function with this string as parameter:
process_entry(entry_str);
but in this function is notting to take this parameter:
function process_entry(STRING* my_str)
Now use str_cpy to copy the entry_str in the string1 or string2
str_cpy(string1,entry_str);


Last edited by Widi; 06/08/10 20:24.
Re: Enter Name for Highscore [Re: Widi] #327853
06/08/10 20:45
06/08/10 20:45
Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
Minamato Offline OP
Junior Member
Minamato  Offline OP
Junior Member

Joined: Feb 2009
Posts: 80
STRING* location = "Germany";
thanks =)

Page 1 of 2 1 2

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