Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Question Text File #386170
10/29/11 19:39
10/29/11 19:39
Joined: Mar 2011
Posts: 4
R
RyanZ Offline OP
Guest
RyanZ  Offline OP
Guest
R

Joined: Mar 2011
Posts: 4
I have created a "Who Wants to be a Millionaire" quiz game. Currently, the questions are coded into the game, but I would like to know if it is possible to create a text file of questions and answers that GameStudio can randomly choose from.

Thanks!

Re: Question Text File [Re: RyanZ] #386174
10/29/11 20:48
10/29/11 20:48
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
And what exactly is your question? It's of course possible, have a look at the file_... commands.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Question Text File [Re: Superku] #386606
11/06/11 12:25
11/06/11 12:25
Joined: Mar 2011
Posts: 4
R
RyanZ Offline OP
Guest
RyanZ  Offline OP
Guest
R

Joined: Mar 2011
Posts: 4
Sorry about the late response; I've been a bit held up trying to find time to get back on. Okay, great, it's possible, but even looking at the manual I can't figure it out how something like this works. If you or someone else could show me an example, I would greatly appreciate it.

Re: Question Text File [Re: RyanZ] #387459
11/18/11 21:57
11/18/11 21:57
Joined: Dec 2009
Posts: 128
China
frankjiang Offline
Member
frankjiang  Offline
Member

Joined: Dec 2009
Posts: 128
China
just enjoy it
Code:
//you can create 50 txt file in your desk.and than random chooes them 
	int i;
    int randomFileNum = 50;
	for(i = 0;i<randomFileNum;i++)
	{
		int a =  (int)random(randomFileNum);
		if(a==0)
		{	
			STRING* char1 = "yourRandomFile_";
			str_cat(char1,	str_for_num(NULL,a));
			str_cat(char1,".txt");
			
			STRING* sTest = "     ";
			var fhandle = file_open_read(char1);
			file_str_read(fhandle,sTest);
			file_close(fhandle);
			printf("%s",sTest->chars);//show your message about you want .
            ptr_remove(sTest);
			
			ptr_remove(char1);
		}		
	}




development 3d game is interesting!
Re: Question Text File [Re: frankjiang] #387476
11/19/11 14:40
11/19/11 14:40
Joined: Mar 2011
Posts: 4
R
RyanZ Offline OP
Guest
RyanZ  Offline OP
Guest
R

Joined: Mar 2011
Posts: 4
Thank you for this! I would have never been able to figure it out myself. grin


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