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 - EnterTheStory (aka tolworthy)

#81
I have the same problem that is described in part 2 of this thread: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=14325.0
Pumaman said he's add it to his list of things to fix. That was in 2004. Any update?

More details:
I have around forty characters on screen who walk randomly using "walkStraight" and they work perfectly. But the main character uses "walk" and jumps by around 70 pixels at a time. Antiglide is on, and all characters have solid turned off. Any idea what might be happening, or how to fix it?
#82
Edit: after seven hours of trying I finaly found the solution. This code was being called twice. Nothing to see here.

[original post:]
I need to change rooms several times in the same cutscene. I understand that 'ChangeRoom' has to run as the last item in any script. So I wrote the following code (The actual function is very, very long, but I think these are the relevant parts:)

Code: ags

function runCutScene(String cutSceneName)
{	if(cutSceneName =="room1") {
	StartCutscene(eSkipAnyKeyOrMouseClick); 
	character[1].Say("I am now in room1");
	EndCutscene(); 
	player.ChangeRoom(2) return; }
	if(cutSceneName =="room2") {
	StartCutscene(eSkipAnyKeyOrMouseClick); 
	character[2].Say("I am now in room2");
	EndCutscene(); 
	player.ChangeRoom(3) return;}
}

A user clicks in room 1 to call runCutScene(1).
runCutScene(2) is called automatically when room 2 loads, after fade in.
Result: CRASH: AGS complains about two instances of 'ChangeRoom' being queued.
So I tried again:

Code: ags

function runCutScene(String cutSceneName)
{	if(cutSceneName =="inside") {
 StartCutscene(eSkipAnyKeyOrMouseClick); 
	character[1].Say("I am now inside");
	EndCutscene();
	setTimerToWaitThenChangeScene(2); return; }
	if(cutSceneName =="outside") {
	StartCutscene(eSkipAnyKeyOrMouseClick); 
	character[2].Say("I am now outside");
	EndCutscene(); 
	setTimerToWaitThenChangeScene(3);
	return; }
}

This is the same, except runCutScene(1) ends by setting a global timer. This is checked by repeatedlyExecute. When the timer ends, the player moves to the new room. This time the room loads properly, but "I am now in room2" is spoken in room 1, BEFORE the room changes!

Any idea what's happening, and how I can fix it?

(edited to clarify what room is what)
#83
Is there some way to get GUI buttons in a different color than grey/gray? If I use a custom graphic then the entire image is shown, and I need three images per button. But all I want is buttons that aren't grey. Any ideas?
#84
Is it possible to selectively turn off pixel perfect clicking? I need to be pixel perfect for large or stationary characters, but small and fast moving characters are almost impossible to click on :)
#85
I call the first function, then change games twice using RunAGSGame, then call the second function. And I get this error message:
in misc code (line 1473)
Error: FileReadInt: File read back in wrong order
Any idea what's wrong?
And why line 1473 is any different from the others?

(Global.Get and Global.Gets are from the DeNGVaT module. They call an int or a string. None of them have been set before this code is run. If DeNGVaT calls a variable that does not exist, the variable is created.)

Code: ags

function write_between_games() 
{	File	*output;
	int	i;		int	status;		int myInt;
	String str;
	output = File.Open("between games.dat", eFileWrite);
	if (output==null)	status = false;			// Open file
	else 
	{	status = true;											// Write data
		str =Global.Gets("rightClickedObject");				output.WriteString(str);
		str =Global.Gets("rightClickedObjectRoom");		output.WriteString(str);
		str =Global.Gets("cutscene_waiting");					output.WriteString(str);
		myInt =Global.Get("rightClickedObjectPerson");output.WriteInt(myInt);
		myInt =Global.Get("rightClickedPerson");			output.WriteInt(myInt);
		myInt =Global.Get("rightClickedPersonRoom");	output.WriteInt(myInt);
		myInt =Global.Get("rightClickedPersonX");			output.WriteInt(myInt);
		str 	=Global.Gets("rightClickedPersonGame");	output.WriteString(str);
		output.Close();
	}
	return status;
}
function read_between_games() 
{	File	*input;
	int	i;		int	status;		int myInt;
	String str;
	input = File.Open("between games.dat", eFileRead);
	if (input==null)	status = false;			// open file
	else 																	// Read data				
	{	status = true;
		if(input.EOF)return; str	= input.ReadStringBack(); Global.Sets("rightClickedObject",str);			
		if(input.EOF)return; str	= input.ReadStringBack(); Global.Sets("rightClickedObjectRoom",str);	
		if(input.EOF)return; str	= input.ReadStringBack(); Global.Sets("cutscene_waiting",str);				
		if(input.EOF)return; str	= input.ReadStringBack();																				
		if(input.EOF)return; myInt = input.ReadInt();      Global.Set("rightClickedObjectPerson",myInt);				
		if(input.EOF)return; myInt = input.ReadInt();      Global.Set("rightClickedPerson",myInt);		
		if(input.EOF)return; myInt = input.ReadInt();      Global.Set("rightClickedPersonRoom",myInt);
		if(input.EOF)return; myInt = input.ReadInt();      Global.Set("rightClickedPersonX",myInt);		// line 1473
		if(input.EOF)return; str	= input.ReadStringBack(); Global.Sets("rightClickedPersonGame",str);
						if(testmode) Display("right clicked person is '%d', RightClickObject is '%s'",Global.Get("rightClickedPerson"),Global.Gets("rightClickedObject"));
		input.Close();	
	}
	return status;
}

Taking a cue from the error message, I tried reading back the lines in the opposite order, but got the same error message from the same line, 'rightClickedPersonX'. Any suggestions?
#86
Now that 3.x has bedded in, how many of us are still using 2.7x with no immediate plans to change? I ask because I don't want to keep posting questions about a release that is no loger supported.

I wish I could upgrade, but for me, Linux compatibility is very important, so 3.0 is not an option. Even if a Linux port is made, I'll probably still be with 2.7x forever, since my game is being released in separate sections that link using RunAGSGame. Are any other developers committed to 2.7x?

Apologies if this is the wrong forum (or has been discussed before) but I couldn't find this particular question on recent threads.
#87
If there a maximum number of && and || in an if statement? And what about using brackets? For example, if I was to write this, would it work? I'm not planning to (yet!) but I like to know how far I can push the envelope...
Code: ags

if((((A==1)&&(B==2))||((C!=3)&&(D!=-4))||E)||F||G||(H>I)||(J<=K)||((M&&N&&O&&!P)||(Q+1==R))||(S==null)||(bla(T))||U||V||(W&&X&&!Z)){Display("whew!");}
#88
Can someone clarify where variables can be imported and exported?

//this is declared near the top of the global script:
int name[300];
String name2[300];
int name3[300];

//this is at the bottom of the global script:
export name[300];
export name2[300];
export name3[300];

// this is imported in the script header
import int name[300];
import String name2[300];
import int name3[300];

// this is called in a module:
if(name2[n] == "bla bla bla"){}

This compiles happily. But when I run the game I get:
" Script link failed: Runtime error: unresolved import 'name2' "

So I imported it in the module header instead: same result.

I searched the forums, and found the following advice:
"You can only export a variable from the global script"
and
"You need to export the variable in the one place where it is declared, which should be the first script in the order in which scripts are listed. The global script is usually the last script."

Now I am more confused! Is the global script compiled after the other modules? Should variables be declared and exported earlier then? Am I getting rooms and modules confused? Or is my real problem that I'm trying to export an array of String? Any advice would be appreciated.
#89
Code: ags
[code]Character names are sometimes interpreted as integers, e.g.
[code] int i =EGO; 

will compile. Is it possible to manually define other strings as equal to integer values?

E.g. now:
Code: ags

runCutscene(278)
runCutscene(279)


Desired:
Code: ags

runCutscene(EGO_ENTERS)
runCutscene(STRANGE_THINGS_HAPPEN)


The 'runScene' code would convert to an integer, and other code would convert back, so I could happily type names, but know that I could pass them to global integer arrays. I've tried workarounds - such as writing hundreds of seperate functions, or adding extra arguments, but they end up ugly and awkward. I'd prefer to just use integers with meaningful names. Is it possible?[/code][/code]
#90
This is probably a very stupid question, so apologies in advance.

At the start of my game I need to create several thousand variables. I suppose I would need to run a function at assign these at startup. Would this cause a noticable pause in the first room starting up?

I plan to seamlessly switch between different games using runAGSGame, so even a tiny delay is bad. If there is a tiny delay, is there some way to have variables pre-assigned so there is no need to run through a function to add them one by one?
#91
Is there a limit to the number of "if" statements I can use in a function?

My previous game engine stored such things as bytes, so would allow up to 255 and no more.

Example: one of my functions has 33 top level "if" statements. Each of these leads to another 10-20 'if's, and each of those leads to more "if"s containing the actual code.  Should I split the functions up if it they grow over a certain size?
#92
What's the best way to tell if blocking is on?

I write a line in "repeatedly execute always" that checks the mouse mode for "wait." But when blocking starts the mouseMode is no longer updated. So the mose is reported as being the last mode BEFORE waiting.

Any suggestions?
#93
I have a number of characters who fire guns.
At the frame where the gun fires I trigger a sound (e.g. "bang!") but also need to trigger an animation (a puff of smoke)? These are old fashioned guns so the smoke is important.

What I've tried so far:
1. Just incorporating the smoke into each animation. Bad idea. The gunsmoke animation has many large frames (so the smoke spreads out smoothly) so it greatly increases the file size of each sprite. 

2. Creating a new gunsmoke view for each character (using the same images, so there is no impact on file size).  Character views typically have 10 frames (with variable speeds) and the gunsmoke loop has about 50 frames. Both need to be sybnchronized over many repeated loops, and I need to often change their speed. Extremely time consuming.

3. Have a "run always" function to always check if a gun was on screen, and make some calculations for when the smoke is likely to be needed. Again this is time consuming and clumsy, as there may be several guns on screen at once. I can't see how this would work without endless tweaking.

Any other ideas?
#94
I plan to load a game from within a game, then close the original game. Are there any known issues with doing this on different systems? E.g on a slower computer, on Linux?

If game 1 to end with a white screen, then game 2 starts with a white screen, is there a danger of a black screen (or, worse, seeing the desktop) in between?

Also, I am guessing that the following would be possible, but would appreciate any comments: Could game 1 could write a text file saying "start in room x" and then game 2 would read that file and start in room x?
#95
It looks like AGS has primitive collision detection built in all the time, that is, two characters cannot occupy the exact same xy location. Is that true?

Sometimes when characters are on or near the same point, first one is in front, then the other, then the first again, etc. So the costumes seem to flash as they rapidly change. Has anyone else seen this flashing? If so, any ideas on how to avoid it?
#96
This is a problem that can be masked by using anti-glide mode, but that only hides the underlying problem, and makes for jerky uneven movement. I'd appreciate any ideas for solving the underlying problem:

(a) How to cancel 'AddWaypoint' without using 'StopMoving'

(b) Any other suggestions for what I'm doing wrong?

I have thirty characters walking randomly across the screen. I found that using "Walk" caused everything to slow down (due to path finding) so instead I use "AddWaypoint" and every two seconds I check if a character is on a walkable area. This runs much faster, but sometimes (maybe one time in twenty) the character slides instead of walking. The slide lasts for two seconds until the next walk update, then they walk normally again.
Code: ags

		int dx = 40; if(GetGlobalInt(n + 100) !=1) dx = -40;	// go right, or go left
		int x = character[n].x + dx;
		int y = character[n].y -10 + Random(20);	// random element to avoid narrow lines
		
		//--------------------------------------------- aim for a walkable area --------------------------------------------		
		cFloorfinder.x = x;	cFloorfinder.y = y;	// place invisible "floor finder" character  there
		cFloorfinder.PlaceOnWalkableArea();	// find the nearest floor
		character[n].StopMoving();	// Needed to avoid crash from ever increasing number of Waypoints. 
		character[n].AddWaypoint(cFloorfinder.x, cFloorfinder.y);	// walk toward the new target


Even when the character walk properly there is a noticeable pause (just a couple of frames) at the 'StopMoving' command. That isn't nice, but I can probably live with it. The real problem is with not using the walk animation. "Antiglide" can stop the character at these points, but that causes more uneven walking.

Any ideas?
#97
This picture should explain my problem:


I am using 16 bit color. I realise that 32 bit color is needed for edge antialiasing, but I only need to antialias faces. All my characters have white edges and most of the backgrounds are white, so I don't care if the edges are jaggy. But where the heck are these dark artefacts coming from? There are no dark colors anywhere near the edges of the sprites, and the transparent color is pink. I've even added two pixels of white around the sprite, and the scaled screenshot is pretty close to 100 percent sprite size. But still the dark lines appear! What am I doing wrong?
#98
I know this has to be blindingly obvious. but I've searched for enter/leave/add/delete/remove/and all the other terms I can think of, in both the manual and the forums, and I'm stumped. How to I add a non player character to a room where they did not start? How do I remove a non player character?

My immediate need is for a very large scrolling text box, and after finding that the credits module doesn't compile in 2.72, the credits plugin doesn't work in Linux, and the scrolling module needs a later version, it seemed like the simplest thing to do is write the text on a bitmap and add it as a character. But I searched for "add character" or "character.delete" in vain. I'm sure there's something very simple that I'm missing here.

EDIT: after posting this I found a reference to "character.changeroom" - is that the answer? Maybe my problem is I'm too bloodthirsty. I assumed that I had the right to create and destroy characters at will (isn't the whole point of a game to satisfy one's god-complex?) But it looks like characters have to be treated with respect. Maybe I shouldn't be applying the meat cleaver every time I want some personal space, maybe I just need to suggest the character leaves when they are not wanted.
#99
My game has 140 rooms. I often want to call identical code from each room. Each time I have to open each room and press several buttons to get to the interaction I want, then add the code, press more buttons, save the room again... It takes ages.

Is there any "master room" that I can change that will automatically change all the others? Or some way to treat the rooms as text files so I can add an interaction using global search and replace? Or some other way to avoid the mind-numbing tedium of repeating the same actions 140 times?
#100
Not a problem, in fact this is a big thanks to CJ for making such an amazing program. I can't understand how it compiles so quickly (so yes, this is a beginner's technical question!) My game is currently 61 MB, and it compiles in the same time it would take to just copy the file - maybe half a minute or even less. But surely there's linking and compressing and table creation and all kinds of other stuff to do? The exact same game took five to ten minutes to compile in Sludge. So I got in the habit of having two versions - a quick version with just two rooms for testing new code, and the full version. Then going for a drink while it compiled. But all that has changed in AGS! What's the secret?
SMF spam blocked by CleanTalk