3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
|
Malice
Unregistered
|
Malice
Unregistered
|
I'm sure this isn't good enough, but here is something to look at.
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.htmhttp://www.conitec.net/beta/atxt_load.htmEDIT3 - may be the key to what you want to do file_date http://www.conitec.net/beta/file_date.htmHave 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
OP
Expert
|
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
|
Malice
Unregistered
|
Malice
Unregistered
|
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.htmMakes sure your engine version.
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
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
OP
Expert
|
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
|
Malice
Unregistered
|
Malice
Unregistered
|
http://manual.3dgamestudio.net/beta.htmV7.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
|
|
|
|