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 - jomalin

#1
Quote from: Crimson Wizard on Wed 01/01/2020 11:03:35
Quote from: Fetito on Wed 01/01/2020 01:34:32
Nevermind. I deleted the corresponding user directory and created a new project. Now it works. False alarm. Issue resolved. Probably there was still an old file that could not be updated to patch 1.

Hmm, this may be an issue. AGS now reads templates from 2 places: "Templates" inside Editor program folder (default) and also user folder - this is where templates are saved by default when you create them. Patches - they only change contents of Editor installation if you install over older program.

Do you remember how did you get templates in the user folder?

I installed AGS in a new clean Windows 10 installation and i also get this error and then dozens more related to the same kind of thing. I fixed it by myself changing the function calls to the new scripting API ones (but i checked also this can be solved changing the API compatibility to the old one without doing any changes in the code). I think the template should use the new scripting API functions instead of the old ones. I can't remember now if i downloaded the 3.5 or the 3.5 Patch1 (that PC is not in the city where i live now)
#2
Quote from: Gurok on Sat 29/11/2014 09:30:48
Quote from: jomalin on Sat 29/11/2014 09:29:14
Are you planning to do a completely rewritte of AGS to have clear source code? As you know, having tangled code make software having many bugs and more difficult to make modifications when it's needed.

http://www.joelonsoftware.com/articles/fog0000000069.html

Hi Gurok, why did you post that link about Netscape? Sorry, i don't understand what are you trying to say me with that.
#4
Quote from: Crimson Wizard on Fri 28/11/2014 20:51:01
I accept your suggestion about letting developer to specify room offset on screen; that is something I was thinking about some time ago too.
Thank you for accepting my suggestion! Does i need to paste it on any web or to-do list?

Quote from: Crimson Wizard on Fri 28/11/2014 20:51:01
Can't tell if that will be easy to do, AGS program code is pretty tangled one.

Are you planning to do a completely rewritte of AGS to have clear source code? As you know, having tangled code make software having many bugs and more difficult to make modifications when it's needed.
#5
Quote from: Scavenger on Fri 28/11/2014 19:42:57
I believe room background images are compressed, however, and by adding areas of pure black at the top and bottom, you're not likely to get much in the way of file size savings if you omit them and use code to compensate. I don't remember whether the compression algorithm is RLE or LZW (I THINK it's LZW? I know RLE is the sprite one), but it will compress large areas of flat colour incredibly well. You're likely to see little to no size increase if you buffer them with black areas. Likely at most around a few bytes per image.

Yes, file size will not be so much with compression, but the second point i told, is the main reason: if you modify the GUI (a verb panel for example) to a bigger one, now you must resize all the rooms to fit with it, so having the clear room and moving it by code will save so many time retouching each of the rooms.
#6
Quote from: Gurok on Fri 28/11/2014 19:01:46
Quote from: jomalin on Fri 28/11/2014 18:59:02
Thanks Gurok, i have added that property to my room correctly but now, where i write your code? I wrote it to the "Room script" and it gives me an error:
Undefined token 'ShiftRoomY'

Looks like it is not taking the ShiftRoomY function... Why?

You should be able to add that code to your global script and have it work for every room. Make sure ShiftRoomY occurs before on_event in the code (as shown above).

EDIT: Oh yes, GetRoomProperty is actually the correct function. I was working with a future version of the engine.

Code: ags
function ShiftRoomY(int offsetY)
{
        DynamicSprite *background;
        DrawingSurface *surface;

        background = DynamicSprite.CreateFromBackground();
        surface = Room.GetDrawingSurfaceForBackground();
        surface.Clear(0);
        surface.DrawImage(0, offsetY, background.Graphic);
        surface.Release();

        return;
}

function on_event(EventType event, int data)
{
        if(event == eEventEnterRoomBeforeFadein)
                ShiftRoomY(GetRoomProperty("OffsetY")); // You would need to define this first in the schema as outlined above

        return;
}


It Works but now the walkable area of that room does not fit :-( I must also move all the areas of the room by code (walkable área, edges, etc)? :-(
#7
Quote from: Gurok on Fri 28/11/2014 18:12:07
You could use a custom property for this. Click the Properties (Properties) entry in the properties list of the room you're editing. Click Edit Schema..., then right click to add a new property. In your case, something like OffsetY with a default of 16. You could then adjust the viewport in the on_event function (eEventEnterRoomBeforeFadein).

Edit: formica's SetViewport suggestion didn't seem to work for me. You might be better off with a functions like this:

Code: ags
function ShiftRoomY(int offsetY)
{
	DynamicSprite *background;
	DrawingSurface *surface;

	background = DynamicSprite.CreateFromBackground();
	surface = Room.GetDrawingSurfaceForBackground();
	surface.Clear(0);
	surface.DrawImage(0, offsetY, background.Graphic);
	surface.Release();

	return;
}

function on_event(EventType event, int data)
{
	if(event == eEventEnterRoomBeforeFadein)
		ShiftRoomY(Room.GetProperty("OffsetY")); // You would need to define this first in the schema as outlined above

	return;
}


Thanks a lot Gurok, it Works!

But it is to be written like this (i am using last AGS: v3.3.2, maybe some objets and methods have changed):

function on_event(EventType event, int data)
{
   if(event == eEventEnterRoomBeforeFadein)
      ShiftRoomY(GetRoomProperty("OffsetY")); // You would need to define this first in the schema as outlined above
   return;
}
#8
Quote from: Crimson Wizard on Fri 28/11/2014 08:37:02
jomalin, for some reason AGS does not support having room image smaller than the chosen game resolution.
AGS let me import the room that is 1280x128! (not those images i posted here). It makes me black borders automatically downside of the room (to add 72 pixels of black border (200-128)).

Thank you for your responses.

I'm trying to mimic the Maniac Mansión behaviour ("engine") in AGS, so i have analized and measured some things: you can only move the mouse arrow every 8 pixels in the X axis, but pixel by pixel in the Y axis, the characters moves every 8 pixels also in the X axis, also i have created a ttf font with the letters from the game and they are pixel perfect, etc. I am so perfectionist, and also as i do computer programming, i always like to do things in the more optimal way... So this is my visual explanation, there is 16 pixels upside the room and 56 downside the room:


And the room itself (128 of height):


If it is not possible, maybe it will be good to add this suggestion: have the possibility to enter the initial position (X and Y) of each room in the editor (and also make possible to get and set it from scripting). That will let us:

- having clear image rooms
AND THE MOST IMPORTANT:
- if in some part of the game development, we change the GUI dimensions (verbs panel), only changing two constants from our code (X and Y position value for all of our rooms), will make all the rooms fit perfectly with the modified GUI, instead of changing each of our room images in a image editor to add or supress black borders...

NOTE: Rooms internally in Maniac Mansion are stored as 128 pixeles of height (room without any borders), it is drawn 16 pixels down starting from the top of the screen by code (see my first image).

Tell me your opinion

THANKS!
#9
Hi, i'm a computer programmer, but i am completely new in AGS. Sorry about my english please.

I want to try doing a 320x200 adventure game. I have successfully loaded a large room that is 1280 x 128 pixels, so obviously, it has horizontal scrolling to make the character walk around all that room, but as the height of the room is 128, and my game height is 200, there is a black border below the room, so the question is, can i move the room vertically in the editor, to have a black border upside and downside of the room? I don't see any option to let me move the room in the editor in the Y axis (neither in the X axis). I know i can do an image for the room having 200 pixels of height and adjust the room pixels inside my image, but i would like to have the posibility to move the room instead. That will let me to have smaller rooms images and smaller game size.

THANKS!
#10
I'm new to AGS and I'm using the last version (3.2.1).

I'm debugging a game, I know AGS has the possibility to put breakpoints, and execute lines step by step, but, how can I see the value of variables like traditional debuggers? Has AGS got this feature?

THANKS
#11
You are executing the game (the exe file) from the folder "_Debug", you must execute it from the "Compiled" folder.
#12
Quote from: Pumaman on Sun 03/04/2011 19:08:41
If no major issues are reported in the next week or so, I'll create the RAR release and update the website.

Sorry but I don't believe you... xD
#13
I think AGS is a very good adventure game editor, but it has one lack... It only runs on Windows: the AGS Editor needs .NET framework (Windows) and the games produced with AGS Editor are win32 specific (they use directly the Windows API).

So, there is a prime question for the AGS future... Which libraries should ags EDITOR and ags GAMES use?

AGS EDITOR: Qt4? GTK+? wxWidgets?
AGS GAMES produced with AGS EDITOR: I think SDL will be the best thing
SMF spam blocked by CleanTalk