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

#121
Thanks a lot for answers ! so quick, as usual :)

The module has been made by a french AGSer, long time ago, perhaps pre-3.6. The thing is that it's a full module to write text like in Word or things similar, with possibility to select, copy/paste etc...

As I understand, the new function on_text_input is ONLY for letters, so for this kind of module it can't be only this function that handles text writing as we need also symbols and numbers.

So perhaps I will try to create my own function to "emulate" the keyboard, with all the symbols and MAJ/ALT combinations.

Quote from: Crimson Wizard on Mon 01/04/2024 13:35:18I could not understand the purpose of the script under "// Appui sur un caractère à afficher".
This part of the code is to manage keycodes that are not letters. So if keycode value is not under 32 (because under 32 it's Ctrl+Key keycodes), not between 65 and 91 (it's letters) and not over 255 (certainly because it's not keycodes that mean a character, letter or symbol, like "enter", "space" and things like that).
I think he did it to make a difference for letters when MAJ is on, that he didn't want for other keys. But I will change his code to manage missing characters.

So the thing is that if my keyboard has got keys without keycode (I wrote a "display(%d, keycode)" line in my on_key_press function, and some keys don't display anything, so keycode isn't existing for those), I can't detect them at all for my game ?

#122
Hi !

I'm using a BlocNotes module to allow writing text in my ags game.

I encounter some problem : with that module, using keycodes to recognize the wanted characters, I can't write things like ( ' " é ù _ - (mostly things that can be found with the numerical keys).

I want (and need !) to be able to have, for these keys :
- when MAJ (or capslock) is off, it returns the symbol (like ' " é ç etc...)
- when MAJ (or capslock) is on, it returns the number (1 2 3 4 etc)

In AGS, it seems to return each time the number, even if MAJ (or capslock) is off...

Also, I don't know if AGS has a keycode for éèâ characters ? And how to find them ?

I've read the help files, but didn't find the answer...

Here is my code :

Code: ags
function on_key_press(int keycode)
{
// Appui sur une touche alphabétique
  if (('A' <= keycode) && (keycode <= 'Z')) {
    char lettre;
    // Si aucun shift n'est pressé et que le capslock n'est pas activé ou s'il l'est et qu'un shift est pressé >> minuscule
    if ((!(IsKeyPressed(403)) && !(IsKeyPressed(404)) && (!System.CapsLock)) || ((System.CapsLock) && (IsKeyPressed(403) || IsKeyPressed(404))))
      lettre = keycode + 32;
    else lettre = keycode;
    SetBlocTexte(BlocTexte.InsertAt(curs, lettre));
    curs++;
  }
  // Appui sur un caractère à afficher
  if (((32 <= keycode) && (keycode <= 64)) || ((91 <= keycode) && (keycode <= 255))) {
    SetBlocTexte(BlocTexte.InsertAt(curs, keycode));
    curs++;
  }
}

EDIT : I can imagine that a workaround is to have a function that "converts" combinations like "MAJ+6" => "-", "AltGr+3" => "#" etc... But perhaps there is a better solution ?
Also, AGS seems to have no keycode for "ù", "*" (both near the enter key) and "²" keys.
#123
I tried to build my game, using the AGS 3.6.1.21 version, and for the first time, I got a message :
"Unable to set EXE name/description: LoadLibrary failed"

Also Windows Defender detected a Trojan just at this moment.

but the game seems to have been built successfully...

Any idea ?
#124
Hey again, sorry for asking again, but will AGS 4.0 be able to manage PNG files in Dynamic Sprites ? It would be so great especially for transparent backgrounds...
#125
That's exactly what I did : I openned my game with AGS4.0, it converted the rooms, but I didn't save the project with AGS 4.0 the first time. So the .asc files were deleted at the second launch of AGS4.0 as Alan v.Drake just said. Sorry, it was my fault  :-[

I will try to upgrade fully my game soon, and will tell you if I encounter any bug !

Thanks a lot for helping !
#126
Copy/paste the .asc files from the back up seems to work. but upgrading deletes the asc files... Could it be fixed ?
#127
Ahah, thanks a lot for your answers (and congrats to CW the man who answers faster than his shadow !)

I don't see any .asc file in the room folder, but there were .asc files for each of my rooms in the 3.6 version of my game. I could try to re-upgrade my game from a backup version, but it's exactly what I did before, so it should be the same result...

Perhaps I could try to copy/paste manually the .asc files from my back up directly into rooms folder in the upgraded version ?

I will try to reupgrade too and tell you if it worked (it's an other pc where I can't go often, but perhaps in the evening today)
#128
Now, yes ! I hav a "Room" folder with all of my 17 rooms folders, and inside of each one there are "background", "walkable area", "hotspot", "regions", "walkbehind" and "data" files.

The scripts seem to be .crm files, but they are at the root of the game's folder (with othr scripts)
#129
The game doesn't launch, so it crashes just after I click the "run" button.
#130
I can't look at the project now, but during the upgrade, when I loaded my game into the editor 4.0, I saw a message saying "updating rooms in open format", and it seemed to work well !

Will look at the project asap.
#131
Good news thanks Crimson !

I tried to upgrade my game with 4.0, but when I run it, it crashes and says for all my rooms "if you have deleted roomX.asc, use the Exclude From Game option". What is it intended ?
#132
Hi !

I'm sorry if I missed something, but are the jagged arrays available for custom structs too ? (I mean for structs I created myself).
#133
Nice thanks ! Let me know when the next update is done for 3.6.1 :)
#134
OK, thanks for precisions Crimson Wizard !

I 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 ?
#135
Hi !

In 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$.
#136
Also, I found that sometimes, the compiler doesn't see mistakes in sintax. I wrote that :

String a=String.Format("%d", dalle.typepion);

The compiler ran, and "a" was "0".

BUT typepion is an array in the "dalle" struct.

Code: ags
struct dalle
{
int typepion[10];
};

The compiler didn't tell "you can't make an int equal to an array". It should, isn't it ?
#137
I don't know if it's possible to implement this in AGS 3.6.1, but could it be possible to add the "eWheeleast" and "eWheelwest" parameters for mousebuttons ? With any mouses, you can't do that, but with a pad (I don't know the name in english, but the square used with the fingers near the keys in a laptop that replaces the mouse)  you can do that. It could be great !
#138
Quote from: Crimson Wizard on Fri 24/11/2023 19:29:43Ah, I'm sorry, I now see why do you need this.

Because in AGS 3 you cannot have Strings in managed structs, and only managed structs in dynamic arrays, the existing solutions are:
1) Have each parameter in a separate dynamic array.
2) Create a dynamic array of Strings, and store all the preloaded data in a single string, for example, separating values with commas or another sign.
3) Use "Dictionary" type, as eri0o suggested.

In AGS 4 you could do more, but if you already have a complete game that may not be easy to upgrade.

OK, so I'll use the solution 2 ! (why I haven't think about it..?) The Dictionnaries seem nice, but perhaps more complicated because I'll need to use another material just for that thing.

Why upgrading to AGS 4 would be not so easy ? My game is large, but uses very "simple" things like Dynamic Sprites, some Draw functions, many custom structs to store datas in memory, and a lot of GUIs. When upgrading, which things need to be reworked ? And what are the "in AGS 4 you could do more" things ?
#139
The main goal is to access to some of their data quicker than using "File.Open" hundred of times. All of their data is stored in .txt files, but I want to sort maps at a moment and accept those the player can play and those the player can't. So it's quicker if I remember once (when the game is launching the first time) some of their data instead of doing "File.Open, ReadRawLineBack" hundred of times to find their data and sort them.
#140
Hi !

I want to find the easiest way to code that. I was sad when I understood that I can't make a dyanmic array of a unmanaged struct :

Code: ags
struct Item
{
  String name;
};

Item items[]; // Game Editor allows declaring that without crashing
items = new Item [50]; // Game Editor doesn't allow it and crashes !

So,my goal was to have a struct like this :

Code: ags
struct Map
{
  String titlecode;
  String titleFR;
  String titleEN;
  bool categories[17]; // true if the map is in that category
};

Map maps[];

maps=DynamicArray_AddMap(); // My custom function that adds a new "raw" for this dynamic array, I made it also for strings, int etc...

I want dynamic arrays because I allow the player to create his own maps, and so I don't want to :

- limit the player to X maps
- take too much memory for the game if I make a limit like "Map maps [1000]", that couldn't be reached but is not needed too...

As I can't make dynamic array of my struct Map, how would you do that ?

Any help appreciated :)
SMF spam blocked by CleanTalk