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

#1741
Quote from: Kristian on Wed 03/01/2024 08:35:12Every time I create a new game with this release, Windows Defender picks up a suspected trojan called Bancteian!pz. Is this a known issue?

Yes, it's a known issue that AGS engine and therefore produced games are often cause false positive virus detection in some anti-virus programs, Windows Defender and Avast were doing this quite often.
#1742
Alright, a user hinted me that the "legal" page is linked from the "AGS FAQ" page:
https://www.adventuregamestudio.co.uk/site/ags/faq/

And *that* page is outdated like for 2 decades.
#1743
Someone pointed me out to this, the AGS Licensing page has been outdated for a while now.

https://www.adventuregamestudio.co.uk/site/ags/legal/

Large parts of it about used libraries are no longer matching starting with 3.6.0.
However there are also smaller bits that are probably not relevant for decades... like the bit about "default font ripped from Sierra games".

For the reference, this is the copyright page in the manual now:
https://github.com/adventuregamestudio/ags-manual/wiki/Copyright

On a side note, I could not find how exactly do you get to this "legal" page from the main page...
#1744
@NegaByte I don't know exactly, but if the game used sprites or actual characters from Maniac Mansion, then you might check the Maniac Mansion Mania website, they've been making MM fan games for decades:

https://maniac-mansion-mania.com/index.php/en/

Not if that was a "Day of Tentacle" sprite style though.
#1745
Quote from: Rulaman on Tue 02/01/2024 19:57:57The conversion (from AGS 3.6.12 beta 13) was ok, but the crm files did not get deleted. (I expected this)

The crm files are still used in a compiled game, but they are strictly output files now. They are updated when you do Build game and put inside game data. On another hand, when the game is run from editor in "Test run" mode, the game files are not packed and engine reads these files directly from disk. This makes game test launch faster. They are never deleted for the same reason: to make things faster if you re-run test game repeatedly.
This may be a good idea to move these into some "intermediate output" folder though, so to not confuse people.

Quote from: Rulaman on Tue 02/01/2024 19:57:57And I could not display any rooms objects

<...>

I think there is some problem with the conversion.

When I get back in the callstack, i get the sprite info which is Format16bppRgb565
but this will be put over a Format32bppArgb image.

Quoteusing (Bitmap sprite = Factory.NativeProxy.GetBitmapForSprite(obj.Image))
using (Bitmap sprite32bppAlpha = new Bitmap(sprite.Width, sprite.Height, PixelFormat.Format32bppArgb))
{
    sprite32bppAlpha.SetRawData(sprite.GetRawData());
    graphics.DrawImage(sprite32bppAlpha, xpos, ypos, spriteSize.Width, spriteSize.Height);
}

So your object sprite is 16-bit but it tries to interpret its pixel data as 32-bit? I will test this myself too and open a bug ticket.


Quote from: Rulaman on Tue 02/01/2024 19:57:57
Code: ags
The code tags looks very ugly.

If you have problems with these please mention this in "Site & Forum Reports", the forum and website is not something that AGS developers are responsible for:
https://www.adventuregamestudio.co.uk/forums/site-forum-reports/
#1746
@oluisheavy, Hello. If I remember correctly, this kind of error happens when you have function name inserted into "events" table, but not present in script.

Where did you insert this text "E um poster de um jogo classico"? Probably you put it into "events" by mistake.
#1747
Quote from: zeta_san on Sat 30/12/2023 19:49:23hi, I tried to insert this into my Tumbleweed style code, but it doesn't work.. it gives me error

Hello. Please always post the relevant piece of code and tell what the error message is. It's difficult to answer questions without knowing that.
#1748
Updated to Beta 16
(Please use download links in the first post)

This is a minor update, done soon after Beta 15 because there had to be a change in game save format.
WARNING: this update makes any runtime saves done in Beta 15 incompatible. We're sorry for this inconvenience. (Older saves WILL work.)

Changes in this update:

Editor:
- Fixed a rare exception when scrolling the room in the editor.

Engine:
- Remade changes to a save format introduced by 3.6.1.14 (Beta 15). Saves done by a 3.6.1.14 engine will no longer load correctly. (This does not affect any older saves.)
- Engine will now safeguard plugin's reading and writing of game saves, so that any mistakes done by plugins won't affect other parts of a save.
- Fixed Character.Name property's was not returning a new value in case if deprecated Character.name field was written to using a old-style string function like StrCopy (regression since Beta 15).
- Fixed PlayMP3File() crashing with null ptr access (regression since an earlier 3.6.1 Beta).
- Fixed PlayMP3File() function limiting filename argument by an arbitrary number of characters.

Engine Plugin API:
- Fixed IAGSStream::Seek return value - should return new position now, instead of true or false.

#1749
Quite a few actually, but if to count games that I played for the most part and could not make myself finish, then recently it's been "Subnautica: Below Zero".
I consider the first "Subnautica" be among the best games I ever played, and it stood out for many reasons: somehow it managed to be both a pretty scary game (where 99% of the gameplay is underwater) and have a very interesting and exciting world to explore.
"Subnautica: Below Zero", either a sequel or a side-quel of the first game, turned out to be a big disappointment for me, because it contained a shallow world (both literally and figuratively, as someone said in the Steam comments), constructed in seemingly random mix of biomes. Which is a shame, because it contained certain new elements which I liked, but they were not enough to make the whole experience enjoyable. Not even close to the first one at least.

I think I reached something like 85-90% of the game, made a pause, and then realized that I do not really want to come back to it.
#1750
Hello.

If you want some continuous action to run while the rest of the game keeps going, then the usual solution is to do checks in repeatedly_execute. In case of a music it is better to use repeatedly_execute_always, because music also keeps playing when game is paused.

But for that you would need to save the audio channel this music is playing on. So you would need to create a global variable for this. Also, perhaps, create a variable to store the position at which to stop the music.

Let's say you created a global variable of type "AudioChannel*" called "songToStop" and variable of type "int" called "songToStopMs". Then the code will be like:

Code: ags
function repeatedly_execute_always()
{
    if (songToStop != null && songToStop.PositionMs >= songToStopMs)
    {
        songToStop.Stop();
        songToStop = null; // reset the variable
    }
}

And when you start the song, then you do like:
Code: ags
songToStop = aSong.PlayFrom(1000);
songToStopMs = 2000;
#1751
Quote from: Baguettator on Mon 25/12/2023 19:19:19I encountered a crash when I used the PlayMP3File command, using the 3.6.1.12 version of AGS editor.

https://drive.google.com/file/d/1IFszo6XzSL4t4ktSzoaBlmPnV5ecJGhI/view?usp=drive_link

We can't anymore use this function ?

The error messages like this, with "Illegal exception" title, mean that there's a error in the engine.
I shall look into this.

EDIT: found the problem, it was broken in 3.6.1 Beta around July-August.
#1752
Right, sorry, I could explain these bits further if necessary.
Most of these things are explained in the manual, but it's not organized well in some parts, so it takes time to find what you need.
#1753
It should be something like this:

Code: ags
function AddTextToNextLabel(GUI *mygui, String text)
{
   for (int i = 0; i < mygui.ControlCount; i++)
   {
      Label *label = mygui.Controls[i].AsLabel;
      if (label == null)
         continue; // not a label, skip

      if (label.Text == "")
      {
         label.Text = text;
         break; // stop loop here
      }
   }
}

Then you call this function
Code: ags
AddTextToNextLabel(gMyGuiWithLabels, "bla bla");


Relevant articles in the manual:
https://adventuregamestudio.github.io/ags-manual/GUI.html#guicontrols
https://adventuregamestudio.github.io/ags-manual/GUIControl.html#guicontrolastype
About loop keywords "for", "break" and "continue":
https://adventuregamestudio.github.io/ags-manual/ScriptKeywords.html#for

EDIT: argh, reading the article about "GUI.Controls" makes me cringe, because it sais that it is only for "legacy code", which is wrong.
The article should be rewritten, and have a better example.
#1754
Quote from: Baguettator on Sat 23/12/2023 19:28:38In a near future, would it be possible to open a .txt File (using File.Open command, with eFileRead as a parameter, or eFileWrite) located in the game's directory ? I read that's it's not allowed because of Windows restrictions, but it could be very nice. I have manny data in my game saved into .txt files, I have placed them in $SAVEGAMEDIR$ folder, but if I update my game (especially these files), the players need to download them and place them manually in $SAVEGAMEDIR$.

You can always open these files for reading using $INSTALLDIR$ path.
Also, it is possible to package custom files inside the game and read back using $DATA$ path. The custom files packaging is configured by General Settings -> Compiler -> Package custom data folders.
https://adventuregamestudio.github.io/ags-manual/File.html#fileopen
https://adventuregamestudio.github.io/ags-manual/GeneralSettings.html#compiler

As for writing, that's not a technical problem, but a design problem. Enabling this is simple, but as a result game authors may unintentionally produce games that cannot be run from certain locations, or on certain systems.
This is open for discussion though. If there are good ideas about how to make this safer, or have a backup plan in the engine, then we might implement them.

EDIT: One existing way to work around this restriction is to setup "custom savegame path" or "custom shared data path" either in Default setup, or individual player's setup. You may point them to the game folder using "." path (this means current dir), and then $SAVEGAMEDIR$ and $APPDATADIR$ will point to the game folder.

EDIT2: I might also notice that $SAVEGAMEDIR$ is a wrong place for the standard game files anyway, because default save location is in user's folder. This means that if there are multiple users on a PC, then they won't share these files. If you need to write some data shared among all players, then $APPDATADIR$ is a correct path.
But if you need custom files that you only read in game, then it's $INSTALLDIR$.
#1755
I see now.
AGS Editor does not write TRS files at "save project" command at all. There's no point, as currently you cannot edit them in editor, and users have to edit TRS files themselves in a text editor, where they save it.

Editor itself only ever writes TRS:
* When creating new translation.
* When user clicks on "Update" command on translation item: that scans through whole game and adds new original lines.

Programmatically TRS is written by Translation.SaveData() function call.

So for plugin you probably should do the same: call "host.CurrentGame.Translations[num].SaveData()" (for example).
#1756
Hello.

Quote from: Rulaman on Sun 17/12/2023 22:29:44When I save the game the file is not written.

Please clarify,
1. How do you save the game? by using AGS menu, or by some command from plugin?
2. When you say "the file is not written", do you mean that the TRS is not written at all, or that the new translation is not written?

Also, for the record, which version of AGS are you testing against?
#1758
Updated to Alpha 7
(Please use download links in the first post)

Contains updates and fixes from 3.6.1 Beta 13 to 15 (except ones related to backwards compatibility).

Other changes:

Editor:
- Fixed occasional crash when scrolling the room in the editor.
- Fixed room not getting recompiled with a new content if a background or a mask was modified externally.

Scripting:
- Multi-dimensional dynamic arrays, also known as "jagged arrays". These are arrays of arrays, where each parent array's element has to be created separately, but may be of any independent length.
- Regular arrays of dynamic arrays: that is a regular array where each element is a pointer to a dynamic array of the same type.
- Dynamic arrays of regular structs.



This update contains a wonderful addition to scripting by @fernewelten : multidimensional dynamic arrays. Also known as "jagged arrays", because each sub-element may have its own length.

In these each element of all dimensions except last one is a pointer to another dynamic array, and elements of last dimension are values of the array's type. All sub-arrays must be created individually, but also may have a independent length.

First you must create the "parent" array, then you may create sub-arrays for each of its elements. Each nesting level the sub-array has one dimension less. When you create actual arrays, only the first dimension must have a fixed size, and following dimensions still have undefined size.

About like this:
Code: ags
// declare a 3-dimensional array
int dyn_arr[][][];
// create 3-dimensional array of size 10
dyn_arr = new int[10][][];
// for the 5th element of the first dimension,
// create a 2-dimensional array of size 20
dyn_arr[5] = new int[20][];
// for the 6th element of the first dimension,
// create a 2-dimensional array of size 25
dyn_arr[6] = new int[25][];
// for the 15th element of the 5th element,
// create a 1-dimensional array of size 40
dyn_arr[5][15] = new int[40];
// finally we may access the actual integer values
dyn_arr[5][15][35] = 100;


Regular arrays of dynamic arrays are also supported, and also may be of any number of dimensions. For instance, you could have this "mixed" array:
Code: ags
int overcomplicated_array[10][20][][];

Here first upper dimensions are fixed in script memory, and the two last ones are dynamic.

Code: ags
overcomplicated_array[5][15] = new int[100][];
overcomplicated_array[5][15][50] = new int[200];
#1759
@Dave Gilbert the Beta 15 is reuploaded, please download again and try (same links).
#1760
Okay I found it, it was something I forgot to adjust in the engine after adding unlimited name fields to the character struct.

In very simple words, this caused either access of a wrong variable, or access of a wrong character altogether when using "character[]" array,

I will update the latest Beta download in a short while.
SMF spam blocked by CleanTalk