Gamestudio Links
Zorro Links
Newest Posts
Lapsa's very own thread
by Lapsa. 06/26/24 12:45
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 833 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 3 1 2 3
Re: Number of elements in an array? [Re: NITRO777] #328842
06/15/10 15:58
06/15/10 15:58
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline OP
Expert
NITRO777  Offline OP
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
Ahhh ok so that is in c, I was wondering because I had not recognized the commands from lite-c, can I use this code in a lite-c program? I never have investigated lie-c's abil;ity to do that...interesting

Re: Number of elements in an array? [Re: NITRO777] #328846
06/15/10 16:09
06/15/10 16:09
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
one measly line missing jumps out at me...
Code:
.		...
		while(file_find(filehandle, " ")>=0)	count++;
		globalTester = count;//to watch the variable
		file_seek (filehandle, 0, 0);	// reset read position back to start of file
		         
		while(temp < count)
		...




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Number of elements in an array? [Re: EvilSOB] #328851
06/15/10 16:22
06/15/10 16:22
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline OP
Expert
NITRO777  Offline OP
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
That was it!! grin

It works fine now, of course I will be testing it with many more files than the two files and two entities I have now, but I believe you have helped me solve this problem big thanks to you evilSOB and everyone who helped. I'll post a video later of the stuff that I am doing with this code just so you all can see what you helped me do. Excellent. Thank you.

Re: Number of elements in an array? [Re: NITRO777] #328856
06/15/10 16:55
06/15/10 16:55
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
FYI :: if it tickles your fancy, as it does mine, the "action" code can be compressed
down to a single line in lite-c....
Code:
//originally

	// these 3 lines have to be added to every entity that needs to be recorded
	max_ents += 1; // get a unique entity number 
	my.skill99 = max_ents; // and store it inside skill99 
	play(my.skill99); // put this line here

//becomes

	// now its just this one line, and it still does everything the old one did.
   	play((my.skill99=max_ents++));


and before you ask, "yes", the doubled brackets ARE required.

And Im pretty certaing you could just put
play(max_ents++);
in the action if you put
my.skill99 = max_ents;
into the first line of the 'play' function...



Last edited by EvilSOB; 06/15/10 17:00. Reason: second thoughts...

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Number of elements in an array? [Re: EvilSOB] #328860
06/15/10 17:12
06/15/10 17:12
Joined: Mar 2003
Posts: 3,010
analysis paralysis
NITRO777 Offline OP
Expert
NITRO777  Offline OP
Expert

Joined: Mar 2003
Posts: 3,010
analysis paralysis
Im just happy it works, but yes I'll take all the optimization help I can get. Thanks again.

Re: Number of elements in an array? [Re: NITRO777] #328861
06/15/10 17:17
06/15/10 17:17
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Im looking forward to seeing your results...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 3 of 3 1 2 3

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