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

Messages - EnterTheStory (aka tolworthy)

#141
edit: Solved! Thanks to your suggestions.

Saves are queued until control returns to the user. This did not happen until the new game was loaded. I checked the saved game in Notepad, and it contained the name of the SECOND game (I wanted to save the FIRST game). I suspect it contained data from the first, which would explain why AGS crashed and complained about changed views. (Normally if you load a saved game from another game, the correct game is automatically launched)

Anyway, I used rep_ex to ensure a non-blocking gap between saving the game and changing games, and everything is behaving itself.

Now I can walk backward and forward between any room in game 1 and any room in game 2, with everything neatly saved or transferred in the background. Happy day!
#142
Each time I delete all savegames. Then:
1. Start game 1 normally.
2. jump to room 82 (my 'between games' room).
3. save 'between games' variables to a DAT file.
4. save game 1 as 'agssave.101' (so it won't show up in any load game list, which only looks for the first 50 games).
5. jump to game 2 using RunAGSHGame(gamename, 1,1).
6. game 2, before the game starts, reacts to the last '1' argument and jumps to room 82 instead of the normal intro
7. room 82, when player enters, detects that there is no 'previous room' and hence this is for entering the game and not leaving.
8. room 82 looks for a saved game (at this stage there is none)
9. room 82 reads the 'between game' variables and jumps to the desired room as specified in 'between games.dat'.
So far so good.
10. I then use a hotkey to reverse the process, going back to game 1. This time game 1 already has a saved game, and hence CRASH with the error message given above.

Quote from: GarageGothic on Sat 18/04/2009 22:36:04
Have you checked that you're restoring the right slot and that the savegame folders are set up correctly?

My current thinking is maybe I'm naming the saved games in some stupid way. Maybe I've somehow told the second game to read the first game file. I name the games based on the name of the current game, but when game 1 launches game 2, game 1's name still appears on the window bar (when running the game in a window). Maybe this is significant?

It's really the word "views" in the error message that throws me. Maybe it's distracting me from something more mundane.

Anyway, thanks for the response. Much appreciated. It's getting late here in Scotland and I'm even more stupid than normal when I'm tired, so in the morning I'll have a close look at the game naming code and get back to you.
#143
I'm writing code for moving back and forth between games, using 'RunAGSGame.' Before leaving a game I save it. When coming back I load the saved game. But on the way back I always get this error message:


Code: ags

---------------------------
Adventure Game Studio
---------------------------
An error has occured. Please contact the game author for support, as this
is likely to be a scripting error and not a bug in AGS.
(ACI version 2.72.920)

Error: Restore_Game: Game has changed (views), unable to restore position

---------------------------
OK   
---------------------------


Any idea what I should do? Any ideas would be greatly appreciated!
#144
Thanks. There's no way to avoid duplicate names then? Fair enough. My original method was to have separate input and output functions, but found that keeping each item on the same line means I make fewer errors.
#145
My pointer skills are very rusty, so I'm appealing to all you programming jocks out there. This code requires me to write the same variable name twice on each line. I'm sure this must be bad practice. Is there any way to re-write it ina simpler form? Thanks!

Code: ags

function readWriteBetweenGames(bool read) //
{	File	*f;	
	if(read) { f = File.Open("between games.dat", eFileRead);	if (f==null) return 999;}
	else	 { f = File.Open("between games.dat", eFileWrite);if (f==null) return 999;}	
	// rc people
	if(read){if(f.EOF)return 1; rightClickedPerson = f.ReadStringBack();} else f.WriteString(rightClickedPerson);	
	if(read){if(f.EOF)return 1; rcPersonX 			 	 = f.ReadInt();			  } else f.WriteInt(rcPersonX);	
	if(read){if(f.EOF)return 1; rcPersonRoom	  	 = f.ReadInt();			  } else f.WriteInt(rcPersonRoom);	
	if(read){if(f.EOF)return 1; rcPersonGame		   = f.ReadInt();			  } else f.WriteInt(rcPersonGame);	
	// memory objects
	int n =1; while(n <=10)
	{	if(read){if(f.EOF)return 1; memoryWhat[n] 	 = f.ReadStringBack();} else f.WriteString(memoryWhat[n]);	
		if(read){if(f.EOF)return 1; memoryWhatWho[n] = f.ReadInt();			  } else f.WriteInt(memoryWhatWho[n]);	
		if(read){if(f.EOF)return 1; memoryWhatGame[n]= f.ReadInt();			  } else f.WriteInt(memoryWhatGame[n]);	
		if(read){if(f.EOF)return 1; memoryWhatRoom[n]= f.ReadInt();			  } else f.WriteInt(memoryWhatRoom[n]);	
		n++;
	}	if(read){if(f.EOF)return 1; memoryWhatNow		 = f.ReadInt();			  } else f.WriteInt(memoryWhatNow);	
	f.Close();
}


Thanks in advance. (PS the actual function is a lot longer)
#146
Quote from: Xenogia on Wed 15/04/2009 11:32:22
I am having troubles finding ttf fonts that look nice in ags. Any ideas of what font and size (640x480)??
I find it depends entirely on the size. A font that looks great at size 11 might look ugly at size 12, and vice versa. I'm afraid the only way to be sure is to experiment.
#147
Fair enough. Thanks. I didn't mean to impute anything wrong with 3.0. Sometimes I have to remind myself that my priorities are not the same as everyone else's priorities. :)
#148
Many thanks! That's very, very interesting.
#149
Quote from: Akatosh on Sun 12/04/2009 16:23:49
I don't think the difference between the two is measurable, if one even exists. Also... a few hundred times every frame sounds a little bit exaggerated... I may be mistaken, but I've always been under the impression that, say, five times a frame would already be overkill.
Thanks. I need this when moving the mouse over a hotspot that changes according to the story. This is a global function (as most rooms use it) so it involves checking a list of "if player.room ==" choices. Plus checking and changing hotspot text, all in a single frame while other demanding animations may be playing. All those  "if...then" decisions quickly add up!
#150
I'm trying to optimize the following code:
Code: ags

if(player.variable ==1) dothis();
if(player.variable ==2) dothat();
if(player.variable ==3) dothis();
if(player.variable ==4) dothat();
if(player.variable ==5) dothis();
// repeated a hundred times every frame

Would there be a tiny speed increase to do this:
Code: ags

int n = player.variable;
if(n ==1) dothis();
if(n ==2) dothat();
if(n ==3) dothis();
if(n ==4) dothat();
if(n ==5) dothis();
// etc.

In other words, is finding player.variable a single step, or does it take a couple of steps (find player, find variable)?

Sorry if this is an idiot question!
#151
The only serious speed problem I ever had was when I'd click on someone to talk and they'd wait a couple of seconds to respond. For me it was because I'd happened to click while the animation was on a frame (usually in their idling animation) that lasted several seconds. Beyond that I can't help. Sorry.
#152
If you don't have many pictures, it might be easier to make each object a character, then use the tint function to change its color. This would also allow you have shaded images, even photographs. In my game the characters are mostly white, but there's an Easter Egg (how appropriate!) that lets the player color them.
#153
Quote from: Wayne Adams on Sun 12/04/2009 06:00:30
Why is there a random pause when my player character goes from walking to idle.. sometimes it's 4 seconds long, sometimes its about 2 seconds.. does AGS support some sort of stopping animation that plays between the walk and idle?

Thanks in advance for the assist.
:)


Do any of your animations have frames that last 2 or 4 seconds long? If you stop at that frame, the character won't respond until the frame is complete. That used to happen to me all the time. Now I make sure than all my animation frames are less than one second.
#154
Several very old threads request the ability to delete characters. In 2005 Pumaman said it was on the 'to do' list. Did this ever happen?

No doubt 3.0 fixes this, but I use 2.72 for greater Linux compatibility. (My users' comfort is more important than my comfort.)

Manually overwriting a character is non-trivial, as many of my views use over two hundred sprites. I'd love to use the "import character" function but it won't work after 300 characters.

Are there any workarounds? Like importing over an identical name, changing an AGS file in a hex editor, etc.?
#155
EDIT:
I found a workaround. The character now thinks it's staying still, but I sneakily change it's X and Y coordinates using repExAlways. It's not elegant, but it works reliably.
#156
I have a few characters where the same animation should play continuously, regardless of whether the character is moving or stops.

I could use the same animation for walking and idling, but as far as I can tell, every time a character moves the walking animation starts from frame 1. And when they stop the idle animation starts from frame 1. Is there any way to just have one long animation loop continuously? (I'm using 2.72)
#157
On an abstract level, I'd say, offer something people want, but they can't get without paying you. That's what I'm aiming for. Something that's really. really different.

Dave Gilbert is right. It's the same advice to any new business - expect to make mistakes, and expect it to take a very long time.

Like Dave, I sold my first game commercially, and like him I made plenty of mistakes. But I ignored the common sense advice of starting small. I'm aiming for the moon, and then some. It took ten years of planning before the first version of my game came out, and it will take at least another five years before I have a version that says what I really want it to say.

If you want to follow in the footsteps of other commercial games then I guess your game needs to look and play like theirs. But if you want to really break out and do something amazing, you need to be different. And have a huge, huge, HUGE amount of insane blind dedication.

Just my 2c

PS in the short to medium term - the first five years at least - you'll always make more money by flipping burgers at McDonalds.
#158
Quote from: GarageGothic on Mon 09/03/2009 00:13:12How long is bigString, by the way? I seem to remember translations having trouble with too long Strings.
Thanks for the suggestion. It might be that. Many of my Strings are pushing 500 characters, and the translation (to Dutch) will be longer. But in tests I managed to show 1000 character lines, so I hope that's not the problem.

EDIT NEXT MORNING:

Found the problem. When I add a line of comment above some complex code I often add a blank line to make it readable. Adding blank lines to the translation source is a Very Bad Idea, I now realize. Problem solved.
#159
EDIT:

I'm getting somewhere now.

After much experimenting, it seems that I was wrong. The problem seems to be in the translation file somewhere. I tried a one-line translation source, and it worked perfectly. Then I tried the original full translation (before I added new lines) and AGS complains that it has an uneven number of lines. I can't see where the uneven lines are (the text file is 2.5 MB long) but I'll go and hunt them down.
#160
I'm using a translation source, but my characters still speak English.

EDIT: I guessed the wrong problem - see later answer.

[deleted code]
SMF spam blocked by CleanTalk