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

#21
Advanced Technical Forum / Label limit ?
Thu 01/04/2021 10:39:28
Hi !

I found other threads about it, but I need to have a confirmation from that year since AGS has been updated. Sorry if I didn't find the answer in an earlier thread, I tried to search, but maybe I didn't see it..?

Well, my question is simple : is there a limit of characters inside a label ? It seems one of my labels is cut just before the end of the text.
#22
Hi !

I encounter a problem : when in windowed mode, if I click outside the game (so outside the window of the game), it results in an event I scripted in on_key_press : "if (keycode==eKeyS)".

Normally, if I put the S key, it shows a message at the screen (it is like a cheat code for play-testing). And when I click outside of the screen of the game, this message appears.

An idea ?
#23
Hi !

In my game, I have 110 characters that have sprites to show their state, like disease, wounds etc. A character is displayed with :

- his face

- a number of transparent sprites that cover his face on differents points

For now, my characters are using views with about 20 sprites per character, each sprite being a possibility, like a combination : 1 wound, 1 wound + 1 disease, 1 wound + 2 diseases, 2 wounds, 2 wounds + 1 disease, 2 wounds + 2 diseases, 3 wounds, etc...

This means that I have plenty of sprites to show their state (about 2500 in total).

But now I have progressed in coding, I am asking myself : is there an easier way to do that ?

My character don't "move" as my game is not an adventure game but an application for a board game (called zombicide, if any knows it :) ). The characters are placed in some places according to the situation, and are moved through different rooms or positions, but they don't move like a character in adventure games (walking, running etc...).

I use a struct of characters for a lot of their proprieties. So character is a good thing for my coding.

My question is so : is there a way to have a sprite like a pile of overlays on their face's sprite, instead of 2500 sprites for each combinations of their state situation ?
#24
Hi all !

I'm sorry, I think this question has been asked a million times before me, but I get confused with all the threads I managed to find about, and they were old dated most of the time...

So I don't know if it is possible to make an AGS game working on a tablet (Android, or even MacOS "iPad" ?) ? And is there a guide to do that ?

I creates my game with AGS 3.5, so I don't know if something is working with that version.
#25
Hi all,

New Topic, new problem.

I am making the translation of my game, and there is the problem I encounter :

Code: ags
String nom = "Cathy";
// Translation : "Cathy"
String bio = "J'ai 21 ans et je suis une ado ennuyeuse.";
// Translation : "I am 21 years old and I am a boring teenager."

Display("%s", nom);
// Displays : "Cathy"

Display("%s", bio);
// Displays : "I am 21 years old and I am a boring teenager"
 
Display("%s[[%s", nom, bio);
//  It Strangely Displays : "Cathy
J'ai 21 ans et je suis une ado ennuyeuse."


Is it an editor problem ? Or I don't use the translation file as intended ?

EDIT : Appologize, I found the GetTranslation function, that is what I need to use. I very sorry to have thought it could be a program error, it was so ambitious  :grin:
#26
Hi everyone !

Is it possible to allow the player to choose which musics he wants to be played in game ? Like he could put his files somewhere and the game choose one of them to play at a moment.

I read something about the File commande or CDAudio command, but it doesn't seem to work with that. (at least the CDAudio could work, but it is too limited for users that don't have any CD player)
#27
Hi everyone,

I am creating a game in 1920*1080 resolution, and I managed to use labels to edit texts on game's events (managed with GUIs), with that method, I don't need to use hundreds of sprites and my Game is not too much heavy.

My question is : why using fonts like "Gorri Sans", the texts are ugly ? I mean I can see the pixels...

How can I get the text quality the same as if it was a sprite with the text written on (with photoshop for example) ? Labels are so useful, but it is sad if the texts get ugly... :)
#28
Hi everybody,

I was working on AGS this morning, I closed it, and when I tried to launch it again, an error occured, and AGS doesn't launch.

I think my game has been effectively saved, and no damage in it. It is at the beginning when AGS is launching that the error occurs.

The beginning of the message :

System.Configuration.ConfigurationErrorsException: Echec de l'initialisation du système de configuration ---> System.Configuration.ConfigurationErrorsException '.', valeur hexadecimale 0x00 est un caractère non valide. Ligne 9, position 1.
(C:\\Users\Guillaume\AppData\Local\AGS\AGSeditor.exe_StrongName_mqpdv5kqypl2dezfmjnjxse4zvfvse2h\3.5.0.24\user.config line 9) ---> System.Xml.XmlException '.',valeur hexadecimale 0x00 est un caractère non valide, Ligne 9, position1.

Then it is a lot of stuff I can't write, maybe I could insert an image in a post to show you, but I don't know how to do it ?

Any idea what happenned ? Is it possible to repair ? Or a safe reinstall should be the solution ?
#29
Hello !

I got a question : using and testing my game, I compiled it, test it for a while, and when I quit the game, a warnings.txt appears, and it's written inside :

QuoteScript : (room:1)[G 2788] Dynamic sprite 290 was never deleted
Script : (room:1)[G 2788] Dynamic sprite 291 was never deleted

In Room 1, I don't use any dynamic sprite, but I use some in other rooms, and when I quit the game, it is always in Room 1. That's maybe why it is written "room 1" in the "warnings.txt" file.

But I don't know what is it and what does it mean. Anyone has an idea ?

It is like now it is written "Dynamic Sprite 290", but the previous time I tested the game it was "Dynamic Sprite 288", etc... Maybe I have a hundred of Dynamic Sprites that I have to delete because it takes a lot in the memory of the game ? I don't know anything about that...
#30
Hello again !

I encounter a new problem. I'm trying to simplify my code now that I have learnt a lot since I started AGS a few month ago.

I tried to create a specific function with parameters to simplify the code (and hugely decrease the size of the script !!!). But I encounter problems while using pointers in parameters.

I created Button pointers in my script :

Code: ags
Button *garage[10];
Button *salon[10];


And I want to do something like :

Code: ags
function Objectifs(int obj, Button *type)
{
  int control;
  if (obj==1) control=32;
  if (obj==2) control=45;
  type[obj]=gAffichageexpedition.Controls[control].Asbutton;
}


And I think that when I click the button, it could be like this :

Code: ags
function Button1_Onclick
{
  if (garage[1]==this) Garage(1, 25); // assuming there is a function "Garage" that does something in the case this button is a "garage"
  if (salon[1]==this) Salon(1, 56); // the same if this button is a "salon"
}


Is my code correct ? I don't manage to get it working, so probably I made a mistake or don't understand how it works...
#31
Hi !

I am trying to do something that I can't manage to do, about Audiochannel that I have never used before, and certainly I don't understand well how it works.

My situation is that when I enter the room 1, a song starts playing. Like :

Code: ags
// this code is in room1 script
room before fadein
{
aValses.Play();
}


I have a hotspot that can make the player character to go to room 2. Okay, it works. The aValses is still playing because I didn't write anything to stop it, and that's wonderful.

In the room 2 I have a hotspot that makes the player character to go to room 1. And when I come back in room 1, the aValses is stopping and then restarting from the beginning, so we hear an interruption when the room changes, and the music restarts from the beginning.

What I want is that when I enter the room 1 (from other rooms but NOT from room 2), the music "Valses" starts to play, but if I change from room 2 to room 1, I want the music to continue and NOT to restart. I hope I'm clear, because, I'm not english :S

By reading the manual, I tried some things using Audiochannel *valse.IsPlaying, I correctly used the syntax but it didn't manage to do what I want in the game. I am almost sure that it is something like that, but I don't know how to do it correctly. And maybe it is another thing...

Does someone know how to script that situation correctly ?

Many thanks ! :D
#32
Advanced Technical Forum / Game's Size
Tue 30/06/2020 10:47:12
I created this topic because it was starting in another topic, but it is clearier (and more interessant, I think) (and more fair, I believe !) to put it in a specific topic, maybe it could help someone else :)

I was asking about what can we do to decrease Game's Size. There were the first answers :

Snarky said :

Inefficient scripting makes no significant difference to game size (it could potentially cause it to run slower), but reducing GUIs and buttonsâ€"as long as you also delete the associated spritesâ€"might.

The game size is almost entirely made up of graphics (sprites and room backgrounds) and audio. Importing the same graphics multiple times, or being inefficient when you have small variations (huge sprites that are nearly exactly the same except for a small difference, instead of just having the static part as one sprite and the bit that varies separately) tends to bloat the game size. Also avoid excessive frame-by-frame animations, which should instead be done as videos. If an animation is more than say 100 frames (of individual sprites), you may want to rethink. Many things can be done in-engine instead of being pre-rendered as separate sprites. Similarly, many, large room backgrounds take up a lot of space, and there are ways to store them more efficiently (typically using tile-based drawing or other standard elements that you can reuse in order to create different rooms from the same small set of graphics).

For audio, it's mostly about using efficient sound compression, e.g. OGG format (and of course not importing the same sound multiple times, or sound you're not using).

Edit: That's not to say that you shouldn't simplify and clean up your code. Bad code is difficult and tedious to work with, and can drain your energy for working on the game. If you've learned a significantly better way to do it, it's often worth going back and fixing it. (Though at the same time, if it works, you shouldn't put so much work into polishing it that you don't make any other progress.)

Crimson Wizard said :

Right, this is the first reason to simplify the code :) Improving game's perfomance is a reason to optimise it, but that's kind of a different thing (and sometimes you have to write more complex code when doing that).

I said : (my last answer with some questions)

OK, thanks a lot for your replies about decreasing the Game's Size. Effectively I could  decrease that by separating existing sprites in several sprites (one for the part that doesn't change, for example the "background" of a button, and other sprites for the part that changes, for example the "text" of the button.). Maybe also by using "labels" for some texts, but labels are less "flexible" for text alignment, so I have to test before.

About audio's format (OGG you said), I will take a look at that. It won't be difficult to change that quickly since I use a very few audios in my game, and it is still not ready to play.

What's about image's format ? I'm using basically PNG and BMP, but I didn't think a lot about that, and I am not an expert about compressing the image, or choose the right format...
#33
Hi every one,

I post here for a problem I don't understand, really I can't figure out why it doesn't work...

I have defined 10 global variables : zombies1, zombies2, zombies3 etc... until zombies10.

Thanks to that, these variables can be used and verified in any script, aren't they ?

So, in the script of the room 7, I wrote something like :

Code: ags
zombies1=Random(11);
zombies2=Random(11);
zombies3=Random(11);
zombies4=Random(11);
zombies5=Random(11);
zombies6=Random(11);
zombies7=15;
  zombies8=15;
  zombies9=15;
  zombies10=15;


That way, I have some buttons that get visible if I need them : Pionzombie1, Pionzombie2, Pionzombie3 etc... until Pionzombie10 (to explain the whole thing : if Pionzombie1 has to be seen, there is a chance that it become visible, so I make zombie1=Random(11) and if (zombie1 < 3)  Pionzombie1.Visible=true;   Anyway, that doesn't matter, it not the point of my problem).

So after these variables have been assigned to a value (a Random for some of them, and a fixed value of 15 for the others), I have a button that is scripted like that :

Code: ags
if (Pionzombie1.Visible==true && zombies1 < 12) Pionzombie1.Visible=false;
else if (Pionzombie1.Visible==false && zombies1 < 12) Pionzombie1.Visible=true;
if (Pionzombie2.Visible==true && zombies2 < 12) Pionzombie2.Visible=false;
else if (Pionzombie2.Visible==false && zombies2 < 12) Pionzombie2.Visible=true;
if (Pionzombie3.Visible==true && zombies3 < 12) Pionzombie3.Visible=false;
else if (Pionzombie3.Visible==false && zombies3 < 12) Pionzombie3.Visible=true;
if (Pionzombie4.Visible==true && zombies4 < 12) Pionzombie4.Visible=false;
else if (Pionzombie4.Visible==false && zombies4 < 12) Pionzombie4.Visible=true;
if (Pionzombie5.Visible==true && zombies5 < 12) Pionzombie5.Visible=false;
else if (Pionzombie5.Visible==false && zombies5 < 12) Pionzombie5.Visible=true;
if (Pionzombie6.Visible==true && zombies6 < 12) Pionzombie6.Visible=false;
else if (Pionzombie6.Visible==false && zombies6 < 12) Pionzombie6.Visible=true;
if (Pionzombie7.Visible==true && zombies7 < 12) Pionzombie7.Visible=false;
else if (Pionzombie7.Visible==false && zombies7 < 12) Pionzombie7.Visible=true;
if (Pionzombie8.Visible==true && zombies8 < 12) Pionzombie8.Visible=false;
else if (Pionzombie8.Visible==false && zombies8 < 12) Pionzombie8.Visible=true;
if (Pionzombie9.Visible==true && zombies9 < 12) Pionzombie9.Visible=false;
else if (Pionzombie9.Visible==false && zombies9 < 12) Pionzombie9.Visible=true;
if (Pionzombie10.Visible==true && zombies10 < 12) Pionzombie10.Visible=false;
else if (Pionzombie10.Visible==false && zombies10 < 12) Pionzombie10.Visible=true;


Assuming that when zombie1=15, Pionzombie1 isn't Visible, and won't be visible at all because we don't need it. So when I click on the button, all the "Pionzombie" that are visible (with the value of Random(11) ) become Invisible. If I want them to become Visible again, I click again on the button. Normally the "Pionzombie" that we don't need to show in any case won't change Visible or Invisible, because their attached variable is equal to 15 (so >12).

The problem is that when I click the button, ALL the "Pionzombie" that are Visible (those with an attached variable equal to Random(11) ) become invisible, and ALL the "Pionzombie" that are Invisible (those with an attached variable equal to 15) become Visible. When I click again on the button, the exact opposite results. When I check the value of the variables during the game, I can see that the variables have the right value that I want them to be (Random(11) or 15, depending of the case).

So, the problem is that the script of the button is not checking the value of the Global Variable. The condition "zombie10 < 12" is true if zombie10=Random(11), but also if zombie10=15.

Maybe I didn't understand how Global Variables work ? It is like the game don't read the values like I need...

If someone understand my problem and know a way to explain that... That will be helpful !! :)
#34
Hi everybody,

So I decided to create a new topic, to make it clearer and more intelligent than posting again and again in the same topic, because it doen't mean anything with time... :)

My problem is that I want to create a "loop" to make all the buttons of a GUI invisible, in place of coding "button1.Visible=false, button2.Visible=false etc...". Because there is a lot of buttons, it could be terrible to have to write it by hands :)

I tried to use the Controls[] with a loop, but it doesn't work, because of a null pointer reference. I tried like that :

Code: ags

int nombreBoutons = 0;
Button* boutons[9];
Button *Buttonpoint;

for (int n = 0; n < 9; n++){
    GUIControl *control = gAffichageRessourcesColonie.Controls[n];
    if (control.AsButton != null) {
      boutons[nombreBoutons].Buttonpoint.Visible=false;
      nombreBoutons++;
    }
  }


I tried that with and without the Pointer, but it's not working. I'm having an error that I don't understand...

Someone could help me about that ?

Many thanks !
#35
Hi every one, (and apologize for my english, I'm a French Guy, you know how french are good for english)

It has been a few weeks I work on a game on AGS, and I don't manage to do something very important for the game.

In a new game, the player has to choose several characters (6 exactly), and then during the game, maybe he will loose some characters, or find others etc... (characters are like a "team" for the player, and the player character is invisible because it is not useful for my game).

What I want to do is to choose the 6 characters (between 50) and when they have been chosen, they appear in a room, one next to the other, at the bottom of the room.

For that, I Started to make some variable and array at the beginning of Global Script.asc :
Code: ags
int nbpersoscolonie; // counts the number of characters that appear in the room
Character* persoscolonie[]; // the character array


In the game_start function I define the array :

persoscolonie = new Character[nbpersoscolonie];

I choose the 6 characters (in game), then I click on "OK" (a button, no matter), and by clicking in this button it does something like this :

Code: ags
function OK_OnClick(button* OK_button)
{
if [amy has been selected]
{
cAmy.ChangeRoom(6);
persoscolonie[nbpersoscolonie]=cAmy;
nbpersoscolonie++;
}
// and again for each of the 50 characters, so the 6 selected characters are identified and placed in room 6


Then, I create a function to "place" the selected characters in room 6 :

Code: ags
void UpdatePositionsJoueurs()
{
int PosX = 13; // X coord. basic (for the 1st character)
for (int s=0 ; s < nbpersoscolonie ; s++)
{
if (persoscolonie[s].Room == 6) // if this character is in room 6, he will be placed correctly
{
if (s<20) // because if the player has a team with more than 20 characters, they will be placed on two lines. So there is the first line
{
persoscolonie[s].x = PosX;
persoscolonie[s].y = 840;
PosX += 95 ; // Décalage horizontal en pixels pour le prochain
}
if (s>=20) // second line if needed
{
persoscolonie[s].x = PosX;
persoscolonie[s].y = 960;
}
}
}
}


But when I want to test it, the game crashes, saying "array out of bounds". I don't know where the error is, and maybe I didn't make that with the good way...

If Someone could help me for making that working, it will be very cooooooooooooool ! :)

Many thanks !
SMF spam blocked by CleanTalk