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 - Monsieur OUXX

#1
The AGS4 compiler allows this:

Code: ags
int x=0; // declare outside loop
while(x!=1) {
  int x=0; // declare again inside loop, with same name
  x=1;
}

I cannot say for sure if the example above will loop infinitely because I don't remember the exact piece of code that made me notice the issue, but I definitely got indices mistakes caused by the fact that the inner variable was silently taking the spot of the outer variable with the same name.

I'm not sure what's allowed and not allowed in terms of re-declaring variables in inner blocks. I'm just reporting it in case it's an oversight.
#2
Quote from: eri0o on Mon 21/07/2025 13:37:17I guess it would be better if it had two separate strategies for looking into things, one for files that are open and unsaved and one for the others, and then use the mostly appropriate strategy.


Yes, but even just two different shortcuts would make me so, so happy.
#3
Not directly related, but I'm in the process of writing my own json parser for AGS 4 compiler.
I didn't do it on purpose, I just never noticed this module (I should have researched it, yes).

BUT the two modules don't really overlap, because:
- mine is probably one order of magnitude slower (which doesn't really matter for small json files like we all probably use), but:
- has however a fraction of the boilerplate code for maintaining nodes and lists. My module relies on all sorts of toy data structure classes which I've created for AGS 4 (stacks, filereader, buffers, etc.)

So it depends on the end-user's taste : faster module = this one, smaller module = mine (probably).
#4
Flawless answer. Thanks a lot!
(keep some time for yourself!!! No burnout please <3 )
#5
It's an open question.

I just want to know if there's some progress in the direction of polymorphism (whether be through casting or interfaces or whatnot).
- If yes, then please point me in the right direction (I did a search in the forums but couldn't find anything).
- If not, then don't waste time providing workarounds. It's OK, I know how to do it the hard way. I'm only asking if there's now an easy way ;)

===========

By polymorphism I mean this kind of scenarios (pseudo code) :

Code: ags
managed struct Parent {
    int Id;
};


managed struct Child extends Parent {
    String whatever;
};


Parent DoThingWithAnythingDerivedFromParent(Parent obj) {
    return obj;
}

void game_start() {
    Child child = new Child;
    Child child2 = (Child) DoThingWithAnythingDerivedFromParent(child);
}

#8
Quote from: Crimson Wizard on Sat 19/07/2025 19:27:05That operation is supposed to restore sprites in game so long as the sources are available. Were they available?
No, they were not -- that's what I meant. The project is about 10 years old, most of the sources are long gone and exist only inside the project's Sprites. The "of course" was not meant to be sarcastic :-)


Quote from: Monsieur OUXX on Fri 18/07/2025 18:26:43We may have this as a setting in Editor Preferences though.
Yes. Most people will want more than one backup for sure -- by googling, I can find several instances of people panicking because the backup got instantly overwritten by the new file (the corrupt file).

I think there should be two backup files, and people with large projects would go to the settings to reduce it to only one (not the other way around -- not one as default and people needing to increase to two).
#9
Completed Game Announcements / Re: Flight
Sat 19/07/2025 01:31:20
Incredible attention to polishing up details! And interesting gameplay ideas.
#10
ISSUE #7 : Catastrophic failure

This issue is probably not new, but reveals an old problem of AGS :
- I had an exception while saving the game. This time, the "out of memory" issue hit the JsonWriter.
- I told myself : "Nevermind, I'll close it and re-open it".
- When I re-opened AGS and the game, I had a message that over a thousand sprites were missing.
- I exited the game without saving and did a copy of my game folder.
- Then, I re-opened AGS and I helped the game going back to a healthy state by doing "File -> Restore all sprites from source".
- But then the sprites themselves were of course still missing.

NONE OF THE BACKUP FILES HELPED:
  - game.agf.bak was the exact same as game.agf
  - acsprset.spr had been partly overwritten by the corrupt data (incomplete file)

I'm not allowing myself to panic yet because I still have the files from before my AGS 4 upgrade. EDIT: I used the acsprset.spr file straight from after my AGS 3.6 upgrade, and it worked directly.

But I think this highlights the need of a better recovery mechanism :
-  If the saving crashes in the middle, then the critical files SHOULD NOT be overwritten. They should be swapped only after the save is successful.
- Or, at least, there should be more than one backup file generated. It's no longer 2005, we could have 10 of them (I'm exaggerating to make a point) and it would still use close to no resources.
#11
Quote from: Crimson Wizard on Fri 18/07/2025 17:35:12So, I did some tests and can confirm that this starts happening after "Watch Panel" gets enabled. It even keeps happening if I hide "Watch Panel", the only way to make it stop is to restart the Editor.

Not that you need it, but I can confirm that you're on the right track, because to my great surprise the issue DIDN'T happen to me for a few minutes, and I noticed that the panels being displayed were not the same as before (I might have closed one of them by accident). I tried investigating it by opening and closing some panels but couldn't find the correct state of open/closed panels (no wonder, if like you said it can't be fixed until restart).

#12
ISSUE #6: Editor "out of memory for bitmap"

After building the game with F5, I got this :
Code: ags
Error: Out of memory.
Version: AGS 4.00.00.18

System.OutOfMemoryException: Out of memory.
   at System.Drawing.Bitmap..ctor(Stream stream)
   at AGS.Editor.BitmapTransparencyFixUp.LoadBitmap(Byte[] data)
   at AGS.Editor.Components.RoomsComponent.LoadBackground(Int32 i)
   at AGS.Editor.Components.RoomsComponent.LoadImageCache()
   at AGS.Editor.Components.RoomsComponent.LoadNewRoomIntoMemory(UnloadedRoom newRoom, CompileMessages errors)
   at AGS.Editor.Components.RoomsComponent.RecompileAnyRoomsWhereTheScriptHasChanged(CompileMessages errors, Boolean rebuildAll)
   at AGS.Editor.Components.RoomsComponent.AGSEditor_PreCompileGame(PreCompileGameEventArgs evArgs)
   at AGS.Editor.AGSEditor.PreCompileGameHandler.Invoke(PreCompileGameEventArgs evArgs)
   at AGS.Editor.AGSEditor.CompileGame(Boolean forceRebuild, Boolean createMiniExeForDebug)
   at AGS.Editor.Components.BuildCommandsComponent.TestGame(Boolean withDebugger)
   at AGS.Editor.Components.BuildCommandsComponent.CommandClick(String controlID)
   at AGS.Editor.GUIController._mainForm_OnMenuClick(String menuItemID)
   at AGS.Editor.MainMenuManager.MenuEventHandler(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripMenuItem.ProcessCmdKey(Message& m, Keys keyData)
   at System.Windows.Forms.ToolStripManager.ProcessShortcut(Message& m, Keys shortcut)
   at System.Windows.Forms.ToolStripManager.ProcessCmdKey(Message& m, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

This happened randomly and doesn't happen again if I close the Editor and open it again.
I don't need an answer on this, just reporting it.
#13
Suggestions :

1) [EASY] A separate shortcut for "search al files" and "search this file".

At the moment, pressing Ctrl+F opens the search dialog box. It is set on "Current document". In order to search all documents, the user has to press "Tab" followed by "down arrow".
It would be better if there was two separate shortcuts, which would either open this popup window directly on "current document" or directly on "current project".
Note: Unfortunately Shift+Ctrl+F is already taken by "Find All" which has a different meaning (it produces a list of results).

Which leads me to...

2) [EASY-MEDIUM] "Search this document" should have its own, smaller GUI control

(this one only requires to duplicate the search popup, and change the layout of the copy)

Look at how it's done in VSCode or IntelliJ or other UIs. When searching the currently-open document, the search box is a tiny widget in the top-right corner of the open document. The "Look in" dropdown does not exist because it is accepted that it will search only here. the "case sensitive" tick box is just a small button with an icon. The "find next" button is just an "arrow down" icon, with F3 as a shortcut.
"Replace" would be the same widget but with an extra textbox underneath, for the new text.

Which leads me to...

3) (MAYBE) "Look in current project" (i.e. "search all files") should just be the "Find all" which I mentioned before.

The popup window could disappear entirely.
This one is a bit trickier than the to previous suggestions because I'm not sure how "replace all" would work in that situation. Don't spend time on this.


All in all, the center of the suggestion is to make "search all files" immediately accessible.

And an extra suggestion :

4) Add a shortcut for opening a script by name OR add filter to tree items

Now, an AGS game can have many script files.
In VSCode and IntelliJ, there's a shortcut which opens a textbox (Ctrl+P in VSCode). You start typing the name of a file in the textbox. It offers suggestions of files (scripts) that match.You select the file you want, you press enter, it opens it.
ALTERNATIVELY, add a small search textbox on top of the game tree (in the Editor's right panel) and let the user filter on that name. Of course it would search in tree items that are not currently expanded, otherwise it defeats the purpose.

At the moment, the two available flows are :
a) Shift+Ctrl+G to open the global script, then Ctrl+F to open the search, then Tab followed by arrow down to select "current project" (i.e. search all files), then press "find next" or use right-click+Go to definition, to open the wished script.
OR
b) click in the list of items in the right-side panel of the editor, and type the first letters of the script. It will select it IF IT'S OPEN (i.e. visible) IN THE GAME TREE.


Finally:

5) (BUGFIX) Fix the scrolling to the highlighted line of code

I'm working with a very wide screen (3840x2160). When I search for text in a file, it often happens that the highlighted result is actually outside of the file's viewport (i.e. a few lines of code below the last line of code currently visible). In other words: The search doesn't make the file scroll low enough to see the result.

I know these kind of issues are not easy, because there's a lot of geometry and assumptions involved. It can probably be reproduced by opening the AGS Editor and resizing the window to be short but very wide.

#14
Quote from: Crimson Wizard on Fri 18/07/2025 01:57:55Does the popup immediately disappear with 3.6.2?
No, I just tried. It works properly in 3.6.2
I have some kind of hunch that it could also be a concurrency issue. Something along the lines of: "the startup process of the game overlaps its immediate interruption. For example: The new compiler switches to the Log Panel or the Watch Panel just as the game ends and the Editor tries to display the window. One of the two processes wins the race, and the window gets closed".

Quote from: Crimson Wizard on Fri 18/07/2025 01:57:55Did it not display warnings about the currently opened room which you edited?
No. Even when saving manually (ctrl+S).
(At least, not when I didn't change anything in the room after previous save -- the one that generated the warnings).



Quote from: Crimson Wizard on Fri 18/07/2025 01:57:55There's likely no need to close current room anymore when compiling a game.
Good thinking!
#15
ISSUE #5: "warnings not generated again when saving room"
1) Do "rebuild all files"
2) I get all sorts of warnings about one of the rooms. OK why not.
3) I open the room to try and fix the problems -> As soon as I open the room, the contents of the "output" panel get cleared (all the warnings disappear).
4) I press F5 -> It does not regenerate the warnings
5) I run "rebuild all files" -> It does regenerate the warnings, but... closes the room.

In the end I had to take a screenshot of the warnings, to have both the room and the warnings side by side.
#16
Quote from: Crimson Wizard on Fri 18/07/2025 00:22:55How many monitors do you have on your system? A while ago we have had a report that this window may move to another monitor.
Usually yes, weird issues like this happen on multi-monitor setups. But today I'm purely on my laptop, with nothing else plugged in.

EDIT: I will try without the "DPI" thing activated.

EDIT 2 : I've reset all the settings to default (I changed the font, like I said before) but the issue is still there. I've recorded a video : https://www.mediafire.com/file/r4o3f4jitnx68cx/ags_troubleshooting.mp4/file
(WARNING: It will remain online only 3 days)

EDIT 3: My laptop is known for having a very high resolution combined with a very wide screen (3840 x 2160). Could it be that the coordinates of the popup window are so crazy that the system decides to close it? It's just a shot in the dark, because like I said I do see it flash briefly.

#17
ISSUE #4: (BLOCKING)

When the game crashes (because of any kind of script error, like "array out of bounds" or even an AbortGame(""); added on purpose) then the Editor stops, highlights the line of the error, and displays a popup window with the error message (as it always has).

But in the AGS 4 editor, the popup disappears instantly. I can see it flash but it closes itself before I have the time to read the message.


EDIT: if it's a known issue don't bother replying. I mean it CW, don't waste your time. I'm just reporting everything I find.
#18
Code snippet :

Code: ags

///////////// IN THE HEADER FILE ////////////////

struct MyStruct
{
  import static attribute int SomeStaticValue;
};


//////////// In THE BODY ////////////////////////

int get_SomeStaticValue(this MyStruct*)
{
  ...
}

void set_SomeStaticValue(this MyStruct*, int value)
{
  ...
}


The compiler complains that
Code: ags
'MyStruct::get_SomeStaticValue' has the qualifiers '' here but 'static' elsewhere. See ./MyStruct.ash

If I change it like this :
Code: ags
static get_SomeStaticValue(this MyStruct*)
It still doesn't work.
Error:
Code: ags
Expected 'static', found 'this' instead
#19
Quote from: Crimson Wizard on Thu 17/07/2025 22:54:32I suppose that in this particular case AGS 4 could skip these and continue, with a warning.

Whatever works!
#20
In case it went unnoticed : The AGS 4 compiler is now stricter on "enum versus int" when it comes to declaring attributes (and their dedicated setter/getter).
For me it's a non-issue, I'm just reporting it. If it's by design just ignore it.

Code snippet (actually from the Thumbleweed module or one of its dependencies) :
Code: ags

// The struct that holds the dynamic array 
struct MyStruct {
  import static attribute int SomeArray[]; // Declared as int
}

// The array setter
void seti_SomeArray(static MyStruct, eSomeEnum index,  int value)  //the index is an enum instead of an int
{
   ...
}

The new compiler complains that "index" should be an int. It is (obviously) solved it by changing the type to int.

=========

Also, not directly the same issue: The author of the module originally made the setters return a boolean, like this :

Code: ags
bool seti_xxx(...) {  // Returns bool instead of void
{
   ...
}
The new compiler wants void as return type. In this case it doesn't matter because the method wasn't returning anything (no "return" statement at all). No idea if it was a bug or by design (again: I personally never use those setters).

I solved it by changing the return type to void.
SMF spam blocked by CleanTalk