Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, ozgur, Quad), 858 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: How to tell if it is a development buid or release build [Re: ] #455669
10/27/15 01:05
10/27/15 01:05

M
Malice
Unregistered
Malice
Unregistered
M



I'm sure this isn't good enough, but here is something to look at.
Code:
STRING* str_hour="";
STRING* str_minute="";
STRING* str_mode="";

TEXT* txt_date_info = 
{
	layer = 1;
	pos_x = 50;
	pos_y = 10;
	string (str_month,str_day,str_year,str_hour,str_minute,str_mode);
	flags = CENTER_X  | SHOW;
	
} 

function get_date()
{
	var file_handle=0;
	
	
		if(file_exists("date.txt"))
		{
		
		file_handle=file_open_read("date.txt");
		var i=0;
		for(i=0;i<6;i++)
		{
			
			file_str_read(file_handle,(txt_date_info.pstring)[i]);
		}
		
		if(run_mode > 7)
	{
		str_cpy((txt_date_info.pstring)[5],"RELEASE,");}
		file_close(file_handle);}
	
}

function store_date()
{
	if(run_mode>7)
	return;
	var file_handle=0;
	var dates[5];
	dates[0]=sys_month;
	dates[1]= sys_day;
	dates[2]=sys_year;
	dates[3]=sys_hours;
	dates[4]=sys_minutes;
	beep();
		file_handle=file_open_write("date.txt");
		var i=0;
		for(i=0;i<5;i++)
		{
			str_for_num((txt_date_info.pstring)[i], dates[i]);
			str_cat((txt_date_info.pstring)[i],",");
			file_str_write(file_handle,(txt_date_info.pstring)[i]);
		}
		str_cpy((txt_date_info.pstring)[5],"DEVELOPMENT,");
		file_str_write(file_handle,(txt_date_info.pstring)[5]);
		file_close(file_handle);
		get_date();	
}
function main()
{
  vec_set(screen_size,vector(800,400,0));
  vec_set(screen_color,vector(50,1,1)); // dark blue
  vec_set(sky_color,vector(50,1,1)); // dark blue
  video_window(NULL,NULL,0,"My New Game");
  d3d_antialias = 1;
  shadow_stencil = 3;
  
  level_load(NULL);
   
  vec_set(camera.x,vector(-250,0,50));
  vec_set(camera.pan,vector(0,-15,0));
	wait(1);
	on_p=store_date;
	get_date();
}



You can change your on_p to if(run_mode<7) store_dates; - This will cause the date.txt to be updated every time the dev build is run.

On screen "development" for pre-published - build read "RELEASE" on-screen.

EDIT -
Also if you want info in the strings STRING* str_month="month ";
than I think you can do this in function store_dates
str_cat((txt_date_info.pstring)[i],str_for_num(NULL, dates[i]));
--- Actually there is issue here, you have to cut the ends per var length, because get_dates() fills the after the first save..

But enough of this... Good night

EDIT2 - More functions I didn't know about that can be used to shorten the above code.
http://www.conitec.net/beta/txt_for_dir.htm
http://www.conitec.net/beta/atxt_load.htm

EDIT3 - may be the key to what you want to do file_date
http://www.conitec.net/beta/file_date.htm
Have fun.
Mal

Last edited by Malice; 10/28/15 02:58.
Re: How to tell if it is a development buid or release build [Re: ] #455706
10/28/15 04:59
10/28/15 04:59
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline OP
Expert
FoxHound  Offline OP
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
File_date seems what I want, however A7 says it doesn't know it. The online setup says it was for 7.82 and I have 7.86.6

My plan was to get the time and then subtract it from the current time and show in the status bar how old the build is.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: How to tell if it is a development buid or release build [Re: FoxHound] #455707
10/28/15 05:40
10/28/15 05:40

M
Malice
Unregistered
Malice
Unregistered
M



Ok first,run any build or sed run. Check your version number in the start-up screen.
Or check the "version" engine var http://www.conitec.net/beta/aversion.htm
Makes sure your engine version.
Code:
STRING* str_show_v="";
TEXT={string(str_show_v);flags|= SHOW;}

function main()
{
......
str_for_num(str_show_v,version);
}



Next - there is issue with "file_date" it's a long that hold all second since 1/1970 till file creation - super stupid. I was unable to use it to find the actual file creation date and have conversion errors with the long'

Totally untested and guess code, check also the math in second conversions
Code:
var total=0;
var years= sys_year-1970; 
var month=sys_months
var day=sys_day; 
day=day*86400:
month=month*2592000;
year=year*31104000;
total=(year+month+day)-file_date; // ERROR var to long
// convert total back to hours or days
total/=86400;
//total should now be a var/fixed of days old the build is


Last edited by Malice; 10/28/15 05:50.
Re: How to tell if it is a development buid or release build [Re: ] #455710
10/28/15 06:08
10/28/15 06:08
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
FoxHound Offline OP
Expert
FoxHound  Offline OP
Expert

Joined: Jun 2004
Posts: 2,234
Wisconsin USA
if you type any gibberish in your code the start up screen will hold in place allowing you to see it without having to check instantly. I have 7.86.6

I read the instructions but really it didn't matter as even if I don't accept the return and put nothing in the parameter it will still say "file_date" undeclared identifier.


---------------------
There is no signature here.


QUIT LOOKING FOR ONE!
Re: How to tell if it is a development buid or release build [Re: FoxHound] #455711
10/28/15 06:17
10/28/15 06:17

M
Malice
Unregistered
Malice
Unregistered
M



http://manual.3dgamestudio.net/beta.htm

Quote:
V7.81.3b beta - released September 28, 2009
The str_printf function copies formatted text and variables into a target string.

The file_date function can be used to compare the modification dates of two files.


Guess you'd have to take it up with jcl as it should be there. However, if I guess correctly, he'll tell you to buy a upgrade to A8

Anyway bedtime for me
Have fun
Mal

Re: How to tell if it is a development buid or release build [Re: Superku] #455716
10/28/15 08:55
10/28/15 08:55
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Originally Posted By: Superku
Maybe this helps: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724320(v=vs.85).aspx


"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
Page 2 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