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

Topics - Baguettator

#1
Hi !

I'm developping a Zombicide companion App since several years, to play with the tabletop game Zombicide (V1 modern version).

I'm looking for an interested graphic designer to work on rooms' backgrounds, representing the shelter of survivors. The app is a Colony's management simulation, and creates a campaign mode with new exclusive features.

Currently, there are several room backgrounds to create, in 1920*1080, following zombicide graphics' style, or I can think of another style if suggested ! Also, I need to create some new exclusive survivors' visuals, and also several game objects' visuals.

I have no money to give for that, as I earn none with this project, it's only a fan work and will stay as it :)

If anybody interested to join the adventure, let me know !

Baguettator

#2
Hi !

I don't know why, except that my windows seems bugguy from time to time, but I tried to load my game in editor today, and got that error message :

"unable to read the user preferences file. You may lose some of your Preferences settings and may not be able to access Source Control.

The error was: Element racine manquand."

And then I click OK, and see that message :

https://drive.google.com/file/d/1hxJOIuBuf4H_NRMF7p2RQOavViRbiUSg/view?usp=sharing

Any idea of what's going on ?? I don't want to loose my game... :(

Yesterday it was working perfectly !

Loading another game works. Creating a new one works too...

EDIT : I have a recent backup of that game, and I launched it perfectly. So in case of, I could only use the backup version, and copy/paste the scripts from the bugged version to have my game updated. But if I can solve the problem to the root...
#3
Hi,

I'm making a game that in fact is a map editor for a tabletop game, using tokens to place.

I would like to make a cancel/redo function, as in any program, so if I do something badly, I can cancel the thing I just did, or I could redo what I just canceled.

I'm asking here, because I don't know how it is implemented in other programs, and I would like to know what would be the best way to make it in AGS.

For now, I'm thinking about memorizing the action I just did in a string (a String[] that could increase in size, memorizing infinitely the actions), using tags to mean what action I did, and how. I'm not sure if it's the best thing...?

Any idea is welcome :)
#4
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.
#5
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 :)
#6
Hi there !

Simple question : if I remember well, it is possible in AGS to "force" a string to keep its basic value without using its translation, even if a translation is currently used by the player. Like doing it :

Code: ags
String a="Bonjour";

function Say(String s)
{
Display(s); // if s=a, I want to display "Bonjour", but not "Hello" even if I selected the English translation of my game
}

Is it possible in AGS ?
#7
Hi here !

What I want to do is to be able to :

- click on a GUIButton, and let the mouse button (left) down
- while the mouse button is down, I move the mouse down to decrease some value, and move up to increase some value
- in facts, the "value" is the angle of the sprite of the GUIButton.
- in other words, I want to do something similar to, let's say, changing the angle of an image in "Photoshop" : you select the image, then you click and hold the mouse button down on a square near the image,, and by moving the mouse up or down, you rotate the image to your taste.

I don't really know how to do this in the easiest way in AGS, I can imagine that I have to store the mouse.X and mouse.Y coordinates when I click the button and then in the repeatedly execute I look at if I'm moving up or down from there, and so I change the angle. But I think it's not the easiest way, and perhaps it's not THAT way that I can do it, so... I'm here to gather your suggestions/solutions :)

Thank you all for all the help I found here since several years learning coding !
#8
Hi there !

I'm looking for a module that allows to write texts like the simple program "Notepad" (or "Word") into an AGS game. My goal is to allow the player to write some texts in some "boxes", like the player clicks on a button (or something), and he can write a text that appears in this button. He could also select the text, copy/paste etc...

Is there anyone available for AGS ? I'm using the latest  release. I didn't find anything like that in the forum, but maybe I just badly understand english and so I didn't see the ones that exist :D

Let me know !

Thanks :)
#9
Hi there !

I have a question about the function DrawingSurface.DrawString(). I tried to draw this String :

"Hey man.[How are you ?"

And it has drawn :

"Hey man.[How are you ?"

Em... It was intended to be drawn :

"Hey man.
How are you ?"

Is it a problem in AGS ? Or is there a way to do that ? It would be so nice to be able to do that without "cheating" another way :)
#10
Hi there !

My question could be very stupid, but I have no idea of how ags handles that...

Imagine I have a DynamicSprite "f" that is a square ("rectangle" ?) with these attributes : f.Width=30, f.Height=34.

If I do : f.Rotate(90)

It makes : f.Width=34 and f.Height=30.

Right :)

BUT, if I do : f.Rotate(45)

What will be the width and height of f ?
#11
Advanced Technical Forum / About AGS "memory"
Mon 31/01/2022 13:13:29
Hi there !

I wonder how many data can be stored in an AGS game.

In my game, I stock the data for maps that are displayed in-game (it simulates a tabletop game). All the maps have many data, including tokens' x/y/orientation, tiles' positions, etc... often randomized between several possibilities. Currently the game owns about 200 different maps, and I plan to add more and more. The maps are managed within a structure.

As it represents a HUGE amount of data, and because you can imagine easily that the game also manages characters (about 150), GUIS (about 100), other scripts etc... Here's my question :

Is there a limit when the engine is lagging because of too many data stored, or simply can't memorize more data because of limitation ?

Sorry if my question is a bit "noob-style", but I don't know anything about these things... :(

Here is my structure for the maps, to let you see how "huge" it is :

Code: ags
struct Cartes
{
  String titre, histoire, dallesrequises;
  bool sansegout, sanslitbleu, sanslitvert; // vaut true si un de ces types de cartes ne doit pas être mis dans la carte
  int deckzombie[3]; // Les types de zombies qui vont être découverts grâce à l'exploration et donc confirmés
  int nbdalles;
  int hauteur, largeur;
  int x, y; // Permet de connaître le coin haut-gauche de la carte entière
  int dalles[14]; // stocke le "nom" de chaque dalle
  int orientationdalles[14]; // stocke l'orientation de chaque dalle
  int spritedalles[14]; // stocke la sprite de chaque dalle
  int xdalles[14], ydalles[14]; // coordonnées des dalles pour placement de la carte
  bool dallesplacementmanuel[14];
  bool zonesanspionzomb[50];
  int categorie; // stocke les cartes en fonction des boîtes nécessaires
  int nbzonesinvalea; // NECESSAIRE ?
  int tentesalea[11]; // Pour savoir si les tentes sont aléatoires ou non (dans TTS, avec la String)
  bool dallesansobjectif[14]; // Place des pions fouilles sans placer d'objectifs dans les zones de la dalle
  bool dallesansradio[14]; // Ne place pas de pions radio sur cette dalle
  int distance; // indique la distance de la carte par rapport à la colonie, influence le temps de déplacement et la durée de l'exploration
  int niveaudanger; // le niveau de danger de la carte
  
  int nbpionsamasquer;
  Button *pionsamasquer[50]; // Pointeurs vers les boutons qu'il faut masquer pour une raison ou une autre
  
  int spriteprecedente; // Mémorise la carte précédente pour les campagnes avec histoire adaptée
  bool queteenchainee; // Mémorise si ce scénario s'enchaîne, dans le cadre d'une mini-quête
  int objectifvert, objectifbleu, objectifjaune, objectifblanc, objectifviolet, objectifrose, objectifatrouver; // vaut 1 si un obj de couleur est caché
  
  int nbzonebatiment; // compte le nb de zones de bâtiment de la carte
  int xzonebatiment[100], yzonebatiment[100], typezonebatiment[100]; // Stocke toutes les zones de bâtiment de la carte
  int nbpionsfouille;
  int xpionsfouille[100], ypionsfouille[100], typepionsfouille[100];
  int nbobjectifs;
  int zonesobjectifs[100]; // indique pour chaque zone du batiment à quel objectif cela peut correspondre
  int changementtypesalle[30]; // Permet de changer le type de salle du pion objectif (PAS du pion fouille situé dessous !)
  int nbobjectifsmanuel;
  int indexobjectifsmanuel[50]; // on leur donne la valeur de l'objectif pour attribuer les infos ci-dessous à cet objectif
  int xobjectifsmanuel[50], yobjectifsmanuel[50]; // on stocke les infos pour des objectifs placés manuellement
  int xobjectifseul[30], yobjectifseul[30]; // coordonnées des objectifs placés seuls
  int nbobjectifscouleur;
  int xobjectifscouleur[10], yobjectifscouleur[10], couleurobjectifscouleur[10];
  int sansobjvert[50], sansobjbleu[50], sansobjviolet[50], sansobjjaune[50], sansobjblanc[50], sansobjrose[50]; // si vaut 1, l'objectif de couleur sera pas trouvé dans le pion fouille concerné
  int xobjectifspecial, yobjectifspecial; // coordonnées de l'objectifspecial
  int nbpionsdeclencheurs;
  int xpionsdeclencheurs[20], ypionsdeclencheurs[20];
  int nbinvasion;
  int xinvasion[10], yinvasion[10], sensinvasion[10];
  int nbinvasioncouleur;
  int xinvasioncouleur[10], yinvasioncouleur[10], couleurinvasion[10], sensinvasioncouleur[10];
  int nbinvasionfixe;
  int xinvasionfixe[10], yinvasionfixe[10], sensinvasionfixe[10];
  int nbinvasionalea;
  int xinvalea[100], yinvalea[100], sensinvalea[100];
  int nbexit;
  int xexit[30], yexit[30], sensexit[30];
  int nbdepart;
  int xdepart[30], ydepart[30];
  int nbvoitures; // Compte le nombre de voitures qui peuvent apparaître dans la carte
  int nbvoiture1, probavoiture1, indexvoiture1; // Index=index du véhicule si découvert en exploration. Vaut -1 si aléatoire. Le véhicule indexé de cette manière est transporté en room 11 avec son jumeau, tant que la mission n'est pas jouée
  int xvoiture1[10], yvoiture1[10], sensvoiture1[10]; 
  int nbvoiture2, probavoiture2, indexvoiture2;
  int xvoiture2[10], yvoiture2[10], sensvoiture2[10];
  int nbvoiture3, probavoiture3, indexvoiture3;
  int xvoiture3[10], yvoiture3[10], sensvoiture3[10];
  int nbvoiture4, probavoiture4, indexvoiture4;
  int xvoiture4[10], yvoiture4[10], sensvoiture4[10];
  int nbhelicoheliport, probahelicoheliport, indexhelicoheliport; // Index=idem que pour les voitures, mais pour l'hélico
  int xhelicoheliport[10], yhelicoheliport[10];
  int nbhelicorue, probahelicorue, indexhelicorue;
  int xhelicorue[10], yhelicorue[10];
  int nbvehiculespec;
  int xvehiculespec[5], yvehiculespec[5], sensvehiculespec[5], spritevehiculespec[5];
  int zoneexpcount; // compte les zones extérieures (rues)
  int typezoneexp[100], xzoneexp[100], yzoneexp[100]; // tableaux pour les zones extérieures (rue)
  int nbdecombres;
  int xdecombres[8], ydecombres[8], couleurdecombres[8], sensdecombres[8], tailledecombres[8]; // taille : 0 petit, 1 grand
  int nbportes;
  int xportes[50], yportes[50], couleurportes[50], sensportes[50], ouvertureporte[50]; // ouverture : 0 fermée, 1 ouverte
  bool portesinversees[50]; // vaut true si le pion porte correspondant doit être inversé
  int nbmirador;
  int xmirador[5], ymirador[5], sensmirador[5];
  int nbbarricades;
  int xbarricades[5], ybarricades[5], sensbarricades[5], ouverturebarricades[5];
  int nbsallecachee;
  int xsallecachee[5], ysallecachee[5], senssallecachee[5];
  int xsas, ysas, senssas, facesas; // SAS ROTATIF, face sas : 1 droit, 2 angle
  int xechelle, yechelle, sensechelle;
  int nbbarbeles;
  int xbarbeles[5], ybarbeles[5], sensbarbeles[5];
  int nbpionpersos;
  int xpionpersos[5], ypionpersos[5];
  int nbinterrupteurjaune;
  int xinterrupteurjaune[5], yinterrupteurjaune[5], sensinterrupteurjaune[5], lienbatimentinterrupteurjaune[5]; // indique si le bâtiment révèle un interrupteur
  int nbinterrupteurblanc;
  int xinterrupteurblanc[5], yinterrupteurblanc[5], sensinterrupteurblanc[5], lienbatimentinterrupteurblanc[5];
  int nbinterrupteurviolet;
  int xinterrupteurviolet[5], yinterrupteurviolet[5], sensinterrupteurviolet[5], lienbatimentinterrupteurviolet[5];
  int nbpionapparitions;
  int xpionapparitions[10], ypionapparitions[10], numeropionapparition[10];
  int nbindicateursinv;
  int xindicateursinv[10], yindicateursinv[10], numeroindicateursinv[10];
  int nbpiondepartsurv;
  int xpiondepartsurv[20], ypiondepartsurv[20];
  int nbpiondepartsurvsiege;
  int xpiondepartsurvsiege[50], ypiondepartsurvsiege[50];
  int nbpionzomb;
  int xpionzomb[50], ypionzomb[50];
  // TENTES
  int nbtentes;
  int xtentes[15], ytentes[15], senstentes[15], spritetentes[15];
  // Batiments
  // Batiments de 0 à 13, interrupteurs sont stockés en 14 (blanc), 15 (jaune) et 16 (violet)
  int xouvbat[17], youvbat[17]; // coordonnées des pions ouverture bâtiment
  int lieninterrupteurjaune[17], lieninterrupteurblanc[17], lieninterrupteurviolet[17]; // Vaut 1 si l'interrupteur est géré par le bâtiment
  int lienobjectifspec[17], lienobjectifbleu[17], lienobjectifvert[17], lienobjectifjaune[17], lienobjectifblanc[17], lienobjectifviolet[17], lienobjectifrose[17]; // idem pour objectifs couleur
  Button *lienvehicule1[17]; // idem pour un véhicule
  int zonesbatiment[100]; // indique pour chaque zone de bâtiments à quel bâtiment ça correspond
  int zonesinterrupteurjaune[100], zonesinterrupteurviolet[100], zonesinterrupteurblanc[100]; // idem pour les interrupteurs. Vaut 1 si cette zone est attribuée à l'interrupteur
  bool generationbatimentmanuelle[100]; // si vaut true, on génère dans ce bâtiment dès le début de l'expédition
  
  // MARQUEURS POUR L'EXPLORATION
  // Si >1 ou = à la valeur maximale de la carte, tout a été trouvé
  int exit, pionsobjectif, vehicules, typeszombie, danger;
  
  import void PresentationExp();
  import void StringTTS();
  
  import void Invasionaleatoire();
  
  import void PlacementPionZombies();
  import void ZonesExpedition();
  import void ZonesBatiment();
  
  import void CreationCartes(int sprite);
  import function T(int d, int p);
  import function X(int d, int p);
  import function Y(int d, int p);
  import void Reset();
  import void OrientationDalles(sens s0, sens s1=-1, sens s2=-1, sens s3=-1, sens s4=-1, sens s5=-1, sens s6=-1, sens s7=-1, sens s8=-1, sens s9=-1, sens s10=-1, sens s11=-1, sens s12=-1, sens s13=-1);
  import void Composition(NumDalles d1, NumDalles d2=-1, NumDalles d3=-1, NumDalles d4=-1, NumDalles d5=-1, NumDalles d6=-1, NumDalles d7=-1, NumDalles d8=-1, NumDalles d9=-1, NumDalles d10=-1, NumDalles d11=-1, NumDalles d12=-1, NumDalles d13=-1, NumDalles d14=-1);
  import void PortesCouleursOuvertesManuel(int d1, int x1, int y1, couleur c1, sens s1, int d2=-1, int x2=-1, int y2=-1, couleur c2=-1, sens s2=-1);
  import void PionDepartSurv(int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1, int n7=-1, int n8=-1, int n9=-1, int n10=-1);
  import void IndicateursInvasionS3Manuel(int numero1, int d1, int x1, int y1, int numero2=-1, int d2=-1, int x2=-1, int y2=-1, int numero3=-1, int d3=-1, int x3=-1, int y3=-1);
  import void ChangementTypesSalles(int n1, types t1, int n2=-1, types t2=-1, int n3=-1, types t3=-1, int n4=-1, types t4=-1, int n5=-1, types t5=-1, int n6=-1, types t6=-1, int n7=-1, types t7=-1);
  import void DecombresPetitsManuel(int d1, int x1, int y1, couleur c1, sens s1, int d2=-1, int x2=-1, int y2=-1, couleur c2=-1, sens s2=-1);
  import void DecombresGrandsManuel(int d1, int x1, int y1, couleur c1, sens s1, int d2=-1, int x2=-1, int y2=-1, couleur c2=-1, sens s2=-1);
  import void PortesMallFermees(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void DoublePorteMallFermee(int d1, int n1, couleur c1, int d2=-1, int n2=-1, couleur c2=-1, int d3=-1, int n3=-1, couleur c3=-1);
  import void DoublePorteMallOuverte(int d1, int n1, couleur c1, int d2=-1, int n2=-1, couleur c2=-1, int d3=-1, int n3=-1, couleur c3=-1);
  import void TentesAlea(int t0=-1, int t1=-1, int t2=-1, int t3=-1, int t4=-1, int t5=-1, int t6=-1, int t7=-1, int t8=-1, int t9=-1, int t10=-1);
  import void ZoneSansPionZomb(int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1, int n7=-1, int n8=-1, int n9=-1, int n10=-1, int n11=-1, int n12=-1, int n13=-1, int n14=-1);
  import void ZoneSansObjCouleur(couleur c, int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1, int n7=-1, int n8=-1, int n9=-1, int n10=-1, int n11=-1, int n12=-1, int n13=-1);
  import void PionsFouillesSemiManuel(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void PionsFouillesVidesSemiManuel(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void PionsFouillesVidesManuel(int d1, int x1, int y1, int d2=-1, int x2=-1, int y2=-1, int d3=-1, int x3=-1, int y3=-1, int d4=-1, int x4=-1, int y4=-1);
  import void PionsFouillesManuel(int d1, types t1, int x1, int y1, int d2=-1, types t2=-1, int x2=-1, int y2=-1, int d3=-1, types t3=-1, int x3=-1, int y3=-1);
  import void DallePlacementManuel(int d1, int d2=-1, int d3=-1, int d4=-1, int d5=-1, int d6=-1, int d7=-1, int d8=-1, int d9=-1, int d10=-1, int d11=-1, int d12=-1, int d13=-1, int d14=-1);
  import void DalleSansObjectifs(int d1, int d2=-1, int d3=-1, int d4=-1, int d5=-1, int d6=-1, int d7=-1, int d8=-1, int d9=-1, int d10=-1, int d11=-1, int d12=-1, int d13=-1, int d14=-1);
  import void PortesPrisonFermeesManuel(int d1, int x1, int y1, couleur c1, sens s1, int d2=-1, int x2=-1, int y2=-1, couleur c2=-1, sens s2=-1);
  import void PortesPrisonOuvertesManuel(int d1, int x1, int y1, couleur c1, sens s1, int d2=-1, int x2=-1, int y2=-1, couleur c2=-1, sens s2=-1);
  import void PortesStandardsFermeesManuel(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int d3=-1, int x3=-1, int y3=-1, sens s3=-1);
  import void PortesStandardsOuvertesManuel(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int d3=-1, int x3=-1, int y3=-1, sens s3=-1);
  import void CellulesBlancFermeesManuel(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int d3=-1, int x3=-1, int y3=-1, sens s3=-1);
  import void CellulesVioletFermeesManuel(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int d3=-1, int x3=-1, int y3=-1, sens s3=-1);
  import void PionExitManuel(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int d3=-1, int x3=-1, int y3=-1, sens s3=-1);
  import void SalleCachee(int d1, int x1, int y1, sens s1, int obj1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int obj2=-1);
  import void PionDepart(int n1, sens s1, int n2=-1, sens s2=-1, int n3=-1, sens s3=-1, int n4=-1, sens s4=-1, int n5=-1, sens s5=-1, int n6=-1, sens s6=-1, int n7=-1, sens s7=-1);
  import void PlacementBarricades(int d1, int x1, int y1, int ouverture1, sens s1, int d2=-1, int x2=-1, int y2=-1, int ouverture2=-1, sens s2=-1);
  import void PortesCouleursFermeesManuel(int d1, int x1, int y1, couleur c1, sens s1, int d2=-1, int x2=-1, int y2=-1, couleur c2=-1, sens s2=-1);
  import void Tentes(int sprite1, int d1, int n1, sens s1, int sprite2=-1, int d2=-1, int n2=-1, sens s2=-1, int sprite3=-1, int d3=-1, int n3=-1, sens s3=-1);
  import function IndicateursInvasionS3(int zone, int numero1, int numero2=-1, int numero3=-1, int numero4=-1, int numero5=-1, int numero6=-1);
  import void ObjectifsCouleur(int d1, int x1, int y1, couleur c1, int d2=-1, int x2=-1, int y2=-1, couleur c2=-1, int d3=-1, int x3=-1, int y3=-1, couleur c3=-1);
  import void InverserPortes(int p1, int p2=-1, int p3=-1, int p4=-1, int p5=-1, int p6=-1, int p7=-1, int p8=-1, int p9=-1, int p10=-1, int p11=-1, int p12=-1, int p13=-1, int p14=-1);
  import void PionExit(int n1, sens s1, int n2=-1, sens s2=-1, int n3=-1, sens s3=-1, int n4=-1, sens s4=-1, int n5=-1, sens s5=-1, int n6=-1, sens s6=-1, int n7=-1, sens s7=-1);
  import void SASManuel(int d, int x, int y, int face, sens s);
  import void SAS(int d, int face, sens s);
  import void PionsDeclencheurs(int d1, int d2=-1, int d3=-1, int d4=-1, int d5=-1, int d6=-1, int d7=-1, int d8=-1, int d9=-1, int d10=-1, int d11=-1, int d12=-1, int d13=-1, int d14=-1);
  import void VehiculesRue(int proba, int n1, sens s1, int n2=-1, sens s2=-1, int n3=-1, sens s3=-1, int n4=-1, sens s4=-1, int n5=-1, sens s5=-1, int n6=-1, sens s6=-1);
  import void VehiculesGarage(int proba, int n1, sens s1, int n2=-1, sens s2=-1, int n3=-1, sens s3=-1, int n4=-1, sens s4=-1, int n5=-1, sens s5=-1, int n6=-1, sens s6=-1);
  import void HelicoptereRue(int proba, int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1);
  import void HelicoptereHeliport(int proba, int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1);
  import void ZonesInvasionAlea(int n1, sens s1, int n2=-1, sens s2=-1, int n3=-1, sens s3=-1, int n4=-1, sens s4=-1, int n5=-1, sens s5=-1, int n6=-1, sens s6=-1, int n7=-1, sens s7=-1);
  import void ZonesInvasionAleaManuel(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int d3=-1, int x3=-1, int y3=-1, sens s3=-1);
  import void ZonesInvasionRougesFixesManuel(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int d3=-1, int x3=-1, int y3=-1, sens s3=-1);
  import void PionDepartManuel(int d1, int x1, int y1, int d2=-1, int x2=-1, int y2=-1, int d3=-1, int x3=-1, int y3=-1, int d4=-1, int x4=-1, int y4=-1);
  import void PionsRecherche(int d1, int x1, int y1, int d2=-1, int x2=-1, int y2=-1, int d3=-1, int x3=-1, int y3=-1, int d4=-1, int x4=-1, int y4=-1);
  import void ZonesInvasionRouges(int n1, sens s1, int n2=-1, sens s2=-1, int n3=-1, sens s3=-1, int n4=-1, sens s4=-1, int n5=-1, sens s5=-1, int n6=-1, sens s6=-1, int n7=-1, sens s7=-1);
  import void ZonesInvasionRougesManuel(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int d3=-1, int x3=-1, int y3=-1, sens s3=-1);
  import void ZonesInvasionRougesFixes(int n1, sens s1, int n2=-1, sens s2=-1, int n3=-1, sens s3=-1, int n4=-1, sens s4=-1, int n5=-1, sens s5=-1, int n6=-1, sens s6=-1, int n7=-1, sens s7=-1);
  import void ZonesInvasionCouleur(int n1, couleur c1, sens s1, int n2=-1, couleur c2=-1, sens s2=-1, int n3=-1, couleur c3=-1, sens s3=-1, int n4=-1, couleur c4=-1, sens s4=-1);
  import void ZonesInvasionCouleurManuel(int d1, int x1, int y1, couleur c1, sens s1, int d2=-1, int x2=-1, int y2=-1, couleur c2=-1, sens s2=-1);
  import void PortesExtStandardsFermees(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void PortesExtStandardsOuvertes(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void PortesIntStandardsFermees(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void PortesIntStandardsOuvertes(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void CellulesIntVioletFermees(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void CellulesIntBlancFermees(int d1, int n1, int d2=-1, int n2=-1, int d3=-1, int n3=-1, int d4=-1, int n4=-1, int d5=-1, int n5=-1, int d6=-1, int n6=-1, int d7=-1, int n7=-1);
  import void PortesPrisonIntFermees(int d1, int n1, couleur c1, int d2=-1, int n2=-1, couleur c2=-1, int d3=-1, int n3=-1, couleur c3=-1, int d4=-1, int n4=-1, couleur c4=-1);
  import void PortesPrisonIntOuvertes(int d1, int n1, couleur c1, int d2=-1, int n2=-1, couleur c2=-1, int d3=-1, int n3=-1, couleur c3=-1, int d4=-1, int n4=-1, couleur c4=-1);
  import void PortesPrisonExtFermees(int d1, int n1, couleur c1, int d2=-1, int n2=-1, couleur c2=-1, int d3=-1, int n3=-1, couleur c3=-1, int d4=-1, int n4=-1, couleur c4=-1);
  import void PortesIntCouleursFermees(int d1, int n1, couleur c1, int d2=-1, int n2=-1, couleur c2=-1, int d3=-1, int n3=-1, couleur c3=-1, int d4=-1, int n4=-1, couleur c4=-1);
  import void PortesExtCouleursFermees(int d1, int n1, couleur c1, int d2=-1, int n2=-1, couleur c2=-1, int d3=-1, int n3=-1, couleur c3=-1, int d4=-1, int n4=-1, couleur c4=-1);
  import void Mirador(int d1, int x1, int y1, sens s1, int fouille1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int fouille2=-1);
  import void Pionapparition(int numero1, int d1, int x1, int y1, int numero2=-1, int d2=-1, int x2=-1, int y2=-1, int numero3=-1, int d3=-1, int x3=-1, int y3=-1);
  import void LienPionsSpeciauxBatiment(int numerobatiment, int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1, int n7=-1, int n8=-1, int n9=-1, int n10=-1, int n11=-1, int n12=-1, int n13=-1);
  import void FormationBatiment(int numero, int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1, int n7=-1, int n8=-1, int n9=-1, int n10=-1, int n11=-1, int n12=-1, int n13=-1);
  import void FormationBatimentInterrupteur(couleur c, int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1, int n7=-1, int n8=-1, int n9=-1, int n10=-1, int n11=-1, int n12=-1, int n13=-1); 
  import void PlacementPionsFouilles(int d);
  import void PlacementObjectifs(int d);
  import void PlacementObjectifSpecialManuel(int d, int x, int y);
  import void GenerationBatimentManuel(int n1, int n2=-1, int n3=-1, int n4=-1, int n5=-1, int n6=-1, int n7=-1, int n8=-1, int n9=-1, int n10=-1, int n11=-1, int n12=-1, int n13=-1, int n14=-1);
  import void PionOuvertureBatimentSemiManuel(int numerobatiment1, int z1, int numerobatiment2=-1, int z2=-1, int numerobatiment3=-1, int z3=-1, int numerobatiment4=-1, int z4=-1, int numerobatiment5=-1, int z5=-1, int numerobatiment6=-1, int z6=-1, int numerobatiment7=-1, int z7=-1);
  import void PionOuvertureBatiment(int n1, int d1, int n2=-1, int d2=-1, int n3=-1, int d3=-1, int n4=-1, int d4=-1, int n5=-1, int d5=-1, int n6=-1, int d6=-1, int n7=-1, int d7=-1);
  import void PionOuvertureBatimentManuel(int numerobatiment1, int d1, int x1, int y1, int numerobatiment2=-1, int d2=-1, int x2=-1, int y2=-1, int numerobatiment3=-1, int d3=-1, int x3=-1, int y3=-1);
  import void PlacementObjectifsManuel(int numero, types type1, int xtype1, int ytype1, types type2=-1, int xtype2=-1, int ytype2=-1, types type3=-1, int xtype3=-1, int ytype3=-1, types type4=-1, int xtype4=-1, int ytype4=-1);
  import void PlacementObjectifsSemiManuel(int numero, int d1, int z1, int d2=-1, int z2=-1, int d3=-1, int z3=-1, int d4=-1, int z4=-1, int d5=-1, int z5=-1, int d6=-1, int z6=-1);
  import void PlacementObjectifsSeulsManuel(int d1, int xtype1, int ytype1, int d2=-1, int xtype2=-1, int ytype2=-1, int d3=-1, int xtype3=-1, int ytype3=-1, int d4=-1, int xtype4=-1, int ytype4=-1);
  import void PionDepartSurvSiege();
  import void EchelleHeliport(int d, int n);
  import void Barbeles(int d1, int x1, int y1, sens s1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1);
  import void VehiculeSpecManuel(TypeVehiculeSpec type, int d, int x, int y, sens s);
  import void VehiculeSpecGarage(TypeVehiculeSpec type, int d, sens s);
  import void VehiculeSpecRue(TypeVehiculeSpec type, int n, sens s);
  import void PionPersonnage(int d, int x, int y);
  import void InterrupteursManuel(couleur c, int d1, int x1, int y1, sens s1, int numerobatiment1=-1, int d2=-1, int x2=-1, int y2=-1, sens s2=-1, int numerobatiment2=-1);
  import void MasquerPions(Button *b1, Button *b2=0, Button *b3=0, Button *b4=0, Button *b5=0, Button *b6=0, Button *b7=0, Button *b8=0, Button *b9=0, Button *b10=0, Button *b11=0, Button *b12=0, Button *b13=0, Button *b14=0);
  import void TirageCarte();
};
#12
Hi there !

I tried to use the resize function on DynamicSprite, but I felt it was not really well working. The image is maybe too complex, and so it's more "pixelized", and not so precise as expected.

Any way to have this function working better in AGS ? Or is there a reason of that ? Or a module that could help ?
#13
Hi there,

Little question : if I create a dynamicsprite and assign it as a graphic of a button for example. If then I write :

Code: ags
int g=mybutton.Graphic;


Which value should be g ?

Because I have in my games a lot of buttons that use the same "template" for their graphics, but as these buttons have very differents heights/widths, I prefer to create dynamicsprite for each of these buttons when the game starts instead of import a lot of images that will make the game heavier.

That's my code :

Code: ags
DynamicSprite* fondshachures[50];

function gamestart()
{
  int h[50], l[50];
  int c;
  for (int i=0 ; i<Game.GUICount ; i++)
  {
    for (int j=0 ; j<gui[i].ControlCount ; j++)
    {
      if (gui[i].Controls[j].AsButton!=null && gui[i].Controls[j].AsButton.Graphic==0)
      {
        bool v=false;
        // Check if the dynamic sprite exists with the same width/height
        for (int k=0 ; k<c ; k++)
        {
          if (gui[i].Controls[j].AsButton.Width==l[k] && gui[i].Controls[j].AsButton.Height==h[k])
          {
            v=true;
            gui[i].Controls[j].AsButton.NormalGraphic=fondshachures[k];
            k=c;
          }
        }
        
        if (v==false) // The dynamic sprite doesn't exist yet
        {
          gui[i].Controls[j].AsButton.CreerFond(c);
          h[c]=gui[i].Controls[j].AsButton.Height;
          l[c]=gui[i].Controls[j].AsButton.Width;
          c++;
        }
      }
    }
  }
}


I know that button.Graphic==0 means no sprite is assigned to that button (so it's the grey button by default). So my goal is to scan all the buttons that are grey when the game starts, and create/assign to them a dynamicsprite.
#14
Hi !

So I come back about problems with the translation file.

My game has been translated in english, but as it  has evolved a lot, I need to update the translation. Many new texts, and many of old texts have been changed (sometimes only 1 letter, but, it changed).

When I update the transcription file in the editor, if a text is different than before, it adds a new line at the end of the transcription file, and the old line is kept.

Because so many lines changed, and it would be too long to tweak it manually, I tried to create a little program with AGS to "update" the transcription file, so that it doesn't stock anymore old texts that re not used anymore.

To do that, I copy the texts of the old transcription file, paste them in a new txt file called "original".

Then I create a new transcription file, copy all the lines (so there are all the texts really used in the game actualized) and paste them in a new txt file called "nouveau".

Then I create a new txt file called "frais" where I write all the lines really used in the game (so those which are in both "nouveau" and "original", with their translation if it has been done in the past).

These txt files are placed in the savegame directory, so the program can access to them easily.

This allow me to have a fresh transcription file, with all the translation of the texts that didn't change from the earlier version, and the new texts that need now a translation. Instead of having a transcription file of thousands of lines, because texts not used are still there since several past versions...

The problem is that I'm french, and it seems to really work nice (the program, I mean), but the functions WriteRawLine support very badly the letters like À É é â etc... Also, the txt file "frais" is written by the program (made with AGS), and is saved as ANSI. It should be UTF-8  I think, because "nouveau" and "original" are both in UTF-8 (and "frais" was also in "UTF-8 before the program writes in it).

Also, it seems that there is a limit, if the text is too long, the WriteRawLine is stopped. The text is cut at the middle (somewhere I presume).

I don't know how to do with that ? It will make me gain a lot of time to get it working.

Here I compiled my program with the 3 txt files needed ("frais" is blank, the others have the needed texts).

https://drive.google.com/file/d/1WfQJnNt_yCGsRK73CyUedJWCkwxPrMbG/view?usp=sharing

Hope someone could help me !
#15
Hi !

I would like to know if there is any way to tweak the space between the lines of a text, for example in a label, or space bewteen the items of a listbox.

My problem is that I use some fonts that sometimes the letters are walking "one on another"...

I don't know if such parameter can be set in AGS ?
#16
Hi again !

I come with this problem that I tried to forget because it was not so important, but at least, I'm looking for a solution, and now it's a good time to find one ! :)

I use a sprite of a clock to show the time in my game, but, I can't understand why, whereas I import my sprite with an alpha channel, in PNG, there is always an ugly "purple" thing around the clock.

Here is the result "in game" :

https://drive.google.com/file/d/1dxyvfgaK_6CG_yLeAWVGRMFprnaKiRk3/view?usp=sharing

Here are two versions of my sprite, I tried with a black "contour", and it doesn't work too.

https://drive.google.com/file/d/10CtmML7eIRf4W7IMhJoXKLR6Uhbc34Kx/view?usp=sharing

https://drive.google.com/file/d/18Eu23YQomVnGP3q4ypZWT6qxwUjgAY-x/view?usp=sharing

Any idea ? The purple is like the "magic pink" used for transparent things in AGS, but I don't why it appears like that. I tried the same sprites on a magic pink background, it didn't work...
#17
Does a Gui's transparency hit the FPS ? I mean, in my game, when a menu is appearing, I place a white 45% transparency GUI under it to have a cleaner view of the menu. When this GUI is here, I have the feeling that the game is laging. The mouse is not moving smoothly. Is it normal ?
#18
Hi all !

I think my problem is weird, but I have to ask the question in case of :)

I use a struct to manage many parameters for the creation of a map for my game (it's a map with many tokens placed into this map, and the struct allows to store the coordinates of all the tokens, so when the map has to be displayed, the script is really simple to place the tokens).

The problem is : I want to store some parameters like that :

- in a map I have 10 buildings

- each building, when it's open (the player click on the door), reveals the tokens that are inside

So in my struct, I can have the buildings like :

struct Map
{
  int nbzonesbuilding[10]; // the number of tokens owned by each building
};

But I want to store the X,Y coordinates of each token of each buildings, so the perfect thing should be : a struct "building" inside the struct "Map"... like I have building[10] and building[0].x[30] to store 30 X-coordinates of the building 0, building[0].y[30] to store the 30 Y-coordinates of the building 0, building[1].x[30] to store the 30 X-coordinates of the building 1... Instead of xbuilding0[30], ybuilding0[30], xbuilding1[30] and so on in the only struct "Map".

Before I used another struct for buildings, because I was creating the maps one at a time when needed (if a map has to be displayed, it's created directly) but now I need to store the parameters of all the maps at the game_start function, so it means : before, my "Map" struct was only for 1 map at a time. Now the "Map" struct is an array of maps stored in memory when the game is launched.

I hope I am clear enough, because english is not my spoken language :)

Many thanks for those who could help me on that !
#19
Hi !

I have a very simple question, I looked for a long time for an answer, but never found any...

I want to use the mouse wheel in a game to allow to scroll a slider up and down (it allows to scroll a label into a GUI to read the whole text that can't be displayed fully in the GUI).

Which functions can I use for that ?

Many thanks !

EDIT : oh sorry, I finally found out the solution... in the tutorial... It's like when I ask for help, help comes by it's own... :D
#20
Hi !

I come with a new brain problem.

I have "stocked" some coordinates of objects (tokens for my game) into 3 arrays of int :

TypeZoneExp : indicates the type of the zone (it's an int, but I'm using an enum to not be lost with numbers...)
XZoneExp : the x-coordinate of the zone "i"
YZoneExp : the y-coordinate of the zone "i"

where i can be a number like 30 or 40 max, it depends of the map (the size of the arrays is changing according to the needs).

I want to sort the zones' coordinates from the top left to the down-right. So the first line of zones (YZoneExp = 0, for example), then the seconde line etc...

Is there any built-in function to do that ? Or useful functions ?

If not, I imagine using loops and loops, but maybe it can be done easier :)

EDIT : I just precise the situation :

In a chosen map, I want some tokens to be placed. I stock their coordinates so I can manipulate them later.
For example, five tokens :
t1(0, 100)
t2(0,250)
t3(100,150)
t4(50, 0)
t5(25, 100)

Each coordinate is stocked in an array, so : XZoneExp[0]=0, XZoneExp[1]=0, XZoneExp[2]=100, XZoneExp[3]=50, XZoneExp[4]=25 and YZoneExp[0]=100, YZoneExp[1]=250, YZoneExp[2]=250, YZoneExp[3]=0 and YZoneExp[4]=100;

What I want is to sort the tokens' coordinates from the top-left to the down-right. It would be : t4, t1, t5, t3, t2

And so their values "match" in the two arrays : XZoneExp[0]=50, YZoneExp[0]=0 ; XZoneExp[1]=0, YZoneExp[1]=100 etc...
SMF spam blocked by CleanTalk