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 - Crimson Wizard

#1241
Adventure Related Talk & Chat / Re: AGS Wiki
Fri 28/06/2024 15:13:52
Please also update the Open Source Games

Here's a sticky list of more of them found in the more recent years:
https://www.adventuregamestudio.co.uk/forums/advanced-technical-forum/a-sticky-list-with-open-source-ags-games/
#1242
In regards to a custom MaskPathfinder, here's a new PR which allows to create and load 8-bit sprites in 32-bit games keeping their 8-bit format (which was not possible to do in AGS, because everything got converted to the game resolution):
https://github.com/adventuregamestudio/ags/pull/2455

After this the MaskPathfinder could be re-enabled.

This is rather straightforward in terms of coding, but at the moment the biggest question is the form of the options in script commands (as explained in the ticket).
#1243
@edmundito

Having a permissive license for this module is more important than its presence on Github.

I quickly checked this module's download, and in "AGSLighting_doc_ENG.txt" there's a paragraph containing a MIT license text.

This license allows anybody to upload this source to anywhere, in original or modified form.
#1244
You maybe are mixing 2 variables, you are checking varGALLOCAFE variable, but change varGALLO.

Another thing that I must point out: that you are using wrong combination of "if" commands. In your current script "cGallo_Talk", it first checks "if (varGALLOCAFE == 1)", there it sets varGALLOCAFE = 2. Then it checks "if(varGALLOCAFE == 2)", but it is already set to 2, so it will run the second case right away, and so on.

It should be "if/else if" combination instead (in both functions):
Code: ags
if (varGALLOCAFE == 1) { 
else if (varGALLOCAFE == 2) {
else if (varGALLOCAFE == 3)  {

In this case script will only run one of these choices, and ignore others.
#1245
In regards to the "Watch Variables", make sure that you do full game rebuild before using it, currently there are possible errors if some scripts were not recompiled in the new version.
#1246
Quote from: Gal Shemesh on Fri 21/06/2024 15:56:12So I'm really not sure how to be able to reproduce such mixed aspect ratio game in AGS. Technically, this would need to be a 320x200 game, where the rooms should be in 160x200 which should be shown in 2:1 aspect ratio (all of the GUIs and fonts should remain in 1:1 aspect ratio on top of it). And all sprites should also be shown in 2:1 aspect ratio.

If GUIs are 1:1 and rooms are 2:1, then solution is creating rooms in 160x200 and scaling them at runtime by resizing Viewport (make it double width compared to Camera), as I suggested from the very beginning:
https://adventuregamestudio.github.io/ags-manual/Camera.html
https://adventuregamestudio.github.io/ags-manual/Viewport.html
#1247
I suppose this may be solved by adding a per-character property. Then engine would test that property whenever character is stopping after movement, and either reset or not reset frame to 0.
#1248
I had to fix one bad error in the latest update, and reuploaded the version. Please download again (same links).
#1249
Please post your scripts that did not work, it may be easier to tell how to fix the script.

Also, you say that "the inventory is just a simple list of words", but then mention that something cannot be converted to  'inventory item*'. Are you trying to also use Inventory Items somewhere in this?
#1252
Updated to Alpha 11
(Please use download links in the first post)

This update comes with several important new features (see below).

Contains updates and fixes from 3.6.1 Patch 3 (except ones related to backwards compatibility).

Other changes:

Editor:
- Added "Watch Variables" panel which lets to watch values of the selected script variables while running the game. This feature is working only if game is built in Debug mode.
- Support importing 1-bit (monochrome) and 4-bit images as sprites, room backgrounds and masks (converted to 8-bit).
- Ensure that Editor exports room backgrounds in their actual color depth.
- Improved scrolling of drop-down lists in the Room's navigation bar: made scroll buttons larger, and support mouse wheel.
- Fixed breakpoints not working in room scripts.

Script API:
- Added Pathfinder struct, which lets to search walkable paths in certain two-dimensional "space", and returns them as an array of Points.
- Added Room.PathFinder property that returns a Pathfinder object, searching paths over this room's walkable areas.
- Added Character.MovePath() and WalkPath(), which makes character to move along an arbitrary list of coordinates, and Character.GetPath() that returns current character's walking path.
- Added Object.MovePath() and Object.GetPath() functions, that work similar to Character's.
- Added GUI.ScaleX and ScaleY properties, GUI.SetScale() function.
- Added GUI.GUIToScreenPoint() and GUI.ScreenToGUIPoint() functions.
- Added Speech.SpeakingCharacter that returns currently speaking character (for blocking speech).

Engine:
- Ensure that Character.Speaking returns true even if character has no speech view.
- DynamicSprite.CreateFromFile() may now load 1-bit and 4-bit bitmaps, converting to 8-bit.
- Fixed VideoPlayer's looping mode not working.

Engine Plugin API:
- Added IAGSEngine.Log(), which lets plugins to print using engine's log system.



"Watch Variables" panel is a long waited method for reading the values of the script variables when running the game from Editor. It may be toggled in the Windows menu. Users may add variable names to it, and whenever game hits a breakpoint these variable values will be retrieved and updated.
NOTE: this only works if the game is compiled in Debug mode.

An example of how it looks like on this screenshot:
https://i.imgur.com/D1L69LH.png



Pathfinding API lets you to find paths using internal AGS pathfinder, and use them for your purposes.
OTOH it also lets you pass your own custom path to Character or Room Object, and make them move along one.
Paths are represented as a dynamic array of Points.

Under spoiler is a script example, which draws found path on screen overlay:
Spoiler
Code: ags
DynamicSprite *pathspr;
DynamicSprite *mask_copy;
Overlay *pathover;
Point* last_path[];

function on_mouse_click(MouseButton button)
{
	if (pathover == null)
	{
		pathspr = DynamicSprite.Create(Room.Width, Room.Height);
		pathover = Overlay.CreateRoomGraphical(0, 0, pathspr.Graphic);
	}
	
	if (mask_copy == null)
	{
		mask_copy = DynamicSprite.Create(Room.Width, Room.Height);
	}
	
	DrawingSurface *mask_copy_ds = mask_copy.GetDrawingSurface();
	DrawingSurface *mask = WalkableArea.GetDrawingSurface();
	mask_copy_ds.Clear(30);
	mask_copy_ds.DrawSurface(mask, 0, 0, 0, mask_copy_ds.Width, mask_copy_ds.Height);
	mask.Release();
	mask_copy_ds.Release();
  
	Point *goal = Screen.ScreenToRoomPoint(mouse.x, mouse.y);
	Pathfinder *finder = Room.PathFinder;
    
	player.Solid = false;
	Point *path[] = finder.FindPath(player.x, player.y, goal.x, goal.y);
	Point *trace = finder.Trace(player.x, player.y, goal.x, goal.y);
	player.Solid = true;
	
	DrawingSurface *ds = pathspr.GetDrawingSurface();
	ds.Clear(COLOR_TRANSPARENT);
	ds.DrawImage(0, 0, mask_copy.Graphic, 50);
	
	if (path != null)
	{
		for (int i = 0; i < path.Length; i++)
		{
			if (i > 0)
			{
				ds.DrawingColor = 1;
				ds.DrawLine(path[i - 1].x, path[i - 1].y, path[i].x, path[i].y);
			}
			ds.DrawingColor = 4;
			ds.DrawRectangle(path[i].x - 1, path[i].y - 1, path[i].x + 1, path[i].y + 1);
		}
	}
	
	if (trace != null)
	{
		ds.DrawingColor = 12;
		ds.DrawLine(player.x, player.y, trace.x, trace.y);
	}
	
	ds.Release();
	
	last_path = path;
}
[close]


The new MovePath and WalkPath functions have additional eRepeatStyle and eDirection parameters, which let you create a repeating walking paths for characters or objects.
Here's a trivial example of a character patrolling between 2 points:

Code: ags
Point* path[] = new Point[3];
path[0] = new Point; path[0].x = 100; path[0].y = 100;
path[1] = new Point; path[1].x = 200; path[1].y = 100;
path[2] = path[0]; // make it circular

cGuard.WalkPath(path, eNoBlock, eRepeat);
#1253
This is a separate update which adds RepeatStyle and Direction parameters to MovePath and WalkPath functions:
PR: https://github.com/adventuregamestudio/ags/pull/2444
Download: https://cirrus-ci.com/task/4873137047732224

Now it lets to do patrolling without repeatedly_execute:
Code: ags
Point* path[] = new Point[3];
path[0] = new Point; path[0].x = 100; path[0].y = 100;
path[1] = new Point; path[1].x = 200; path[1].y = 100;
path[2] = path[0]; // make it circular

cGuard.WalkPath(path, eNoBlock, eRepeat);
#1254
Very well; this fix will be included into the next 3.6.1 patch then.
#1255
I am afraid there's no simple way to do this at the moment.

The two available methods are:
- resize the sprites and reimport them, like you did;
- use dynamic sprite API and resize sprites programmatically at runtime, then reassign them to all gui and buttons. This method has a number of downsides, the major being extra runtime memory consumption and larger game saves, as dynamic sprites are kept in memory at all times, and also stored in saves. This problem may be somewhat mitigated by scripting your own "sprite manager", but I don't think it's worth it for this particular case.

There will be a GUI dynamic scaling support in the next major version of AGS (4.0), but it's currently in experimental stage.
#1256
This error is not related to GUI upscaling. According to the error message, some other process have locked one of the game files, and Editor is unable to save it after changes.

Try restarting AGS Editor and repeat the sprite replacement. If that does not work, maybe try restarting operating system and repeat this action.

If this problem persists, maybe you have an antivirus or a program like Windows Defender blocking AGS Editor from performing file operations.
#1257
Quote from: FortressCaulfield on Sat 15/06/2024 18:23:41Someone recommended me this mod for moving chars or objects in a smooth arc and I don't understand how I would make it do that. Any help?

I am not an expert in this module, but I imagine that the solution could be to process 2 coordinates (x,y) using two separate tweens, one linear and another non-linear with "InOut" effect (for returning back). For example: eEaseInOutCircTween sounds like something suitable.
https://edmundito.gitbook.io/ags-tween/basic/enums[]

EDIT: hmm, no, I am mistaken. This easing does not do what I thought. Maybe it's not doable with 1 tween for a coordinate, but 2 sequential tweens, unless someone knows better.
#1258
While I've been working on a pathfinding API, where functions like WalkPath and MovePath were added, others suggested to add a way to instigate a "patrol" mode over a single path, where character would move back and forth. In other words, something like a Repeat parameter, but which would tell to alternate directions instead of repeating same direction.

This reminded me that I was thinking of expanding RepeatStyle enum for Animations a while ago.

At some point I noticed that in the engine RepeatStyle consists of 3, not 2, variants, except one of them is "hidden" and supported only for a deprecated AnimateObject function (iirc). This third variant is "OnceReset", which means that the animation is played once, but then reset to the starting frame, as opposed to stopping at the last frame.
Unfortunately its support is inconsistent, and this constant is not a "official" part of RepeatStyle enum in script.

Anyway, I've been thinking about expanding animation parameters, which, I suppose, could be also applied to any function that involves a repeatable action, such as WalkPath.

The idea is to have a standard group of parameters for this. Such as:
- start frame
- end frame
- RepeatStyle
- direction, which means "starting direction".

Start frame and end frame would define a (optional) range of frames, and RepeatStyle would define how the animation is run between them.

The RepeatStyle I've been thinking was:
- Once - goes from start to end frame and stops at end frame;
- OnceReset - goes from start to end frame and resets to start frame;
- OnceAndBack - goes from start to end frame, and then goes backwards to start frame;
- Repeat - loops between start and end frame, using the starting direction;
- RepeatAlternate - loops between start and end frame, changing direction each time it reaches either of these two.

Range parameters should be made so that it's possible to have wrapping ranges, e.g. in a loop of 0-10 frames one may have a starting frame 8 and ending frame 4, so that animation went 8,9,10,0,1,2,3,4 if direction is forward.

Do you see any other useful options here?



Another thing, while thinking about this, I realized that logically there's a place to add a "Tween style" (or "easing") in this list of parameters, if we'd like to implement "tweening" into the engine (at least to functions like Animate).
#1259
Please try replacing AGS.Native.dll in the Editor files with this version and see if that fixes your problem:
https://www.dropbox.com/scl/fi/robaxi2d9yme753entfb6/AGS.Native-361-fix-templateextract.zip?rlkey=h60rkesx9hgjq9x45dhm48vrp&st=ajba45so&dl=0
#1260
Quote from: TheVolumeRemote on Fri 14/06/2024 22:53:53CW if these warning aren't enough direction to fix this, I'll send you my games template, just a heads up it's a gigantic 2.5gb file. I'll upload it asap and have it ready to DM you :)

I was just waiting for that template, I did not know it's that big.

I can see that there's some bad error during template extraction, and everything is likely a consequence of that, maybe the error occured during unpacking of the "acspreset.spr" file, and it got locked.

Maybe this is related to files being of big size. I will investigate the extraction function and see if anything may be wrong there.
SMF spam blocked by CleanTalk