Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - incobalt

#1
I pose before the masses a simple question: What are adventure games?

Mood for discussion: serious, thoughtful, contemplative.

I'm trying to suss out a community definition of "Adventure Game" and what better community to do it than this one.

`TygerWulf~
#2
It seems my function has decided to stop processing if statement conditions.  I am perplexed.  I can't seem to find any missing brackets or anything that would make if statements go haywire.  I've even tried to get a response out of it by making something purposefully true, but it even seems to be ignoring if(true).  Could anybody help me out here and point out my, possibly idiot mistake in the following function (my finageling, you can see in the last set of if statements.)

Code: ags

String GameTime::GetDuration(int sec)
{
	if(sec < 60 && sec > 1)
		return String.Format("%d seconds", sec);
	if(sec == 1)
		return "1 second";
	if(sec < 1)
		return "no time at all";
	mDateTime holder;
	holder.Second = 0;
	holder.Minute = 0;
	holder.Hour = 0;
	holder.DayOfMonth = 0;
	holder.Month = 0;
	holder.Year = 0;
	holder.AddSec(sec);
	String rStr;
	rStr = "";
	if(holder.Year != 0){
		rStr.Append(String.Format("%d year",holder.Year));}
	if(holder.Year > 1){
		rStr.Append("s");}
	if(holder.Month != 0)
	{
		if(rStr != ""){
			rStr.Append(", ");}
		rStr.Append(String.Format("%d month",holder.Month));
	}
	if(holder.Month > 1){
		rStr.Append("s");}
	if(holder.DayOfMonth != 0)
	{
		if(rStr != ""){
			rStr.Append(", ");}
		rStr.Append(String.Format("%d day",holder.DayOfMonth));
	}
	if(holder.DayOfMonth > 1){
		rStr.Append("s");}
	if(holder.Hour != 0)
	{
		if(rStr != ""){
			rStr.Append(", ");}
		rStr.Append(String.Format("%d hour",holder.Hour));
	}
	if(holder.Hour > 1){
		rStr.Append("s");}
	if(holder.Minute != 0)
	{
		if(rStr != ""){
			rStr.Append(", ");}
		rStr.Append(String.Format("%d minute",holder.Minute));
	}
	if(holder.Minute > 1){
		rStr.Append("s");}
	Display("%d", holder.Second != 0); //this executes
	if(true)
	{
		Display("%s", rStr); //this does not execute
		if(rStr != ""){
			rStr.Append(", ");}
		rStr.Append(String.Format("%d second",holder.Second));
	}
	if(holder.Second > 1)
		rStr.Append("s");
	
	return rStr;
}


I apologize for the long block of code.  I'm sure the error is in there somewhere, but I can't find it.  The if(true) statement was previously if(holder.Second != 0), which evaluates to true as well, according to the Display() call.
SMF spam blocked by CleanTalk