How to tell if it is a development buid or release build

Posted By: FoxHound

How to tell if it is a development buid or release build - 10/26/15 17:26

I want to have some stuff show up in the development build that won't show up in the release build. I've searched the manual and so far no go.
Posted By: Superku

Re: How to tell if it is a development buid or release build - 10/26/15 17:52

You could just define a new variable (or #define RELEASE) yourself and change it prior publishing.
Posted By: Anonymous

Re: How to tell if it is a development buid or release build - 10/26/15 19:12

http://www.conitec.net/beta/run_mode.htm
run_mode > 7


Posted By: FoxHound

Re: How to tell if it is a development buid or release build - 10/26/15 19:18

I wanted something more automatic.

Any idea on how to get the date the game was released?
Posted By: Superku

Re: How to tell if it is a development buid or release build - 10/26/15 19:27

@Malice: Thanks, I thought there was something like that but just couldn't remember.

@FoxHound: You could define a variable for that also. How often do you plan on publishing anyway?
Posted By: FoxHound

Re: How to tell if it is a development buid or release build - 10/26/15 19:49

Multiple times a week. This way the artist can see the update and bug fixes. Sometimes I can't tell which build. Not to hard really but I like a fool proof version better than trying to remember.
Posted By: Superku

Re: How to tell if it is a development buid or release build - 10/26/15 20:22

Maybe this helps: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724320(v=vs.85).aspx
Posted By: Anonymous

Re: How to tell if it is a development buid or release build - 10/26/15 21:22

Can I point out the easy stuff.
1) rename the published exe to include the current date.
2) right click the file - select properties and look at the 'creation date'
3) view the file in windows explore with details - creation date listed

#define last_build 10_25_15
#define this_build 10_26_15
#define RELEASE 99999

Just idea's

Have fun
Mal
Posted By: FoxHound

Re: How to tell if it is a development buid or release build - 10/27/15 00:05

What I want is to setup for the release build to say the date of creation in the window name itself. I can write all these manually however it is helpful to have the engine do it itself to prevent the simple issues, such as me forgetting to. We did have an issue awhile back where an old build was used instead of the current one I had sent. This is more preventive maintenance than anything else.

Currently it tells me if it is in development or release. Helpful when I have to run the release on my computer to make sure it works and forgetting which one I am actually running.
Posted By: Anonymous

Re: How to tell if it is a development buid or release build - 10/27/15 00:21

http://www.conitec.net/beta/asys_day.htm
day
http://www.conitec.net/beta/asys_month.htm
month
http://www.conitec.net/beta/asys_year.htm
yesr
http://www.conitec.net/beta/asys_hours.htm
hour
http://www.conitec.net/beta/asys_minutes.htm
minutes
http://www.conitec.net/beta/aapp_name.htm
string for name of main file and exe name (however READ-ONLY)

However there is not way to add it to the name.

When running File->Publish main script from sed, why not just add date and time before .exe manually
office.exe
office_10_25_2015_6pm.exe
You get to edit the name before the exe is published.
Posted By: Anonymous

Re: How to tell if it is a development buid or release build - 10/27/15 01:05

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
Posted By: FoxHound

Re: How to tell if it is a development buid or release build - 10/28/15 04:59

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.
Posted By: Anonymous

Re: How to tell if it is a development buid or release build - 10/28/15 05:40

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

Posted By: FoxHound

Re: How to tell if it is a development buid or release build - 10/28/15 06:08

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.
Posted By: Anonymous

Re: How to tell if it is a development buid or release build - 10/28/15 06:17

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
Posted By: Superku

Re: How to tell if it is a development buid or release build - 10/28/15 08:55

Originally Posted By: Superku
Maybe this helps: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724320(v=vs.85).aspx
© 2024 lite-C Forums