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

#281
Well, strangely my function doesn't work anymore... Was it a dream ? Anyway, it doesn't work.

If anybody could help me, I will be grateful ! :)
#282
Hi all,

Sorry for the multipost, but I do that to inform you of the problem.

I managed to fix it, but I think there is a problem in the engine (or something else).

As I said, my code above didn't work after the first time I call the function. The dynamic sprite didn't update.

In fact, I tried to LocViewFrame my character to another frame (a sprite that is the frame 0) just BEFORE I apply the dynamic sprite to the frame 3 and then I lockviewframe my character with the frame 3.

And it worked !

But it seems to be a problem, or I don't understand how a dynamic sprite is working. Because I needed to lock on another sprite, and then lock to the dynamic sprite to have it displayed correctly. Is it an engine problem ?

Also, I found naother problem that should be engine's responsability (but I honnestly don't know how to proof it) : I pause the game with PauseGame(), and sometimes, I need to UnPauseGame() twice to REALLY unpause the game. But I believe only once would be needed...?
#283
Well, I tried to create the new function but I have a problem : when I modify a character's state, it works only 1 time. After that, the image doesn't change anymore. And I don't know why...

There is my function (in my Personnage struct):

Code: ags
DynamicSprite* etatpersos[TOTAL_PERSONNAGES]; // 1 Dynamic sprite per character, TOTAL_PERSONNAGES is a constant value.

void Personnage::Changementetat()
{
  int numero;
  for (int i=1 ; i<TOTAL_PERSONNAGES ; i++)
  {
    if (personnage[i]==this) numero=i; // I find the character that I am changing the state
  }
  
  // I delete the dynamic sprite if it already exists, in case of
  if (etatpersos[numero]!=null) etatpersos[numero].Delete();
  
  // base is for the character's face image. other variables are for attributes : wounds, disease and infection
  int malad, bless, infect, base;
  if (this.mort==true)
  {
    base=1709;
  }
  else
  {
    
    // if the character is a zombivor, the base is not the same that if it is not
    if (this.zombivant==false)
    {
      ViewFrame* i=Game.GetViewFrame(this.CHAR_VIEW, this.CHAR_LOOP, 0);
      base=i.Graphic;
      bless=this.blessure;
      malad=this.maladie;
      infect=this.infecte;
    }
    else if (this.zombivant==true)
    {
      ViewFrame* i=Game.GetViewFrame(this.CHAR_VIEW, this.CHAR_LOOP, 1);
      base=i.Graphic;
      bless=this.blessure;
    }
  }
  
  // now, I "paint" the dynamic sprite according to the character's base image and his attributes
  // and I think the error should be there, as I didn't use so much the dynamic sprites
  etatpersos[numero]=DynamicSprite.CreateFromExistingSprite(base);
  DrawingSurface* s=etatpersos[numero].GetDrawingSurface();
  if (bless>0)
  {
    if (bless==1) s.DrawImage(0, 0, 3338);
    if (bless==2 && this.zombivant==false) s.DrawImage(0, 0, 3337);
    if (bless==2 && this.zombivant==true) s.DrawImage(0, 0, 3344);
    if (bless==3) s.DrawImage(0, 0, 3345);
    if (bless==4) s.DrawImage(0, 0, 3346);
  }
  
  if (malad>0)
  {
    if (malad==1) s.DrawImage(0, 0, 3339);
    if (malad==2) s.DrawImage(0, 0, 3341);
    if (malad==3) s.DrawImage(0, 0, 3343);
  }
  
  if (infect>0) s.DrawImage(0, 0, 3340);
  
  etatpersos[numero]=DynamicSprite.CreateFromDrawingSurface(s, 0, 0, 90, 110);
  s.Release();
  // I put the dynamic sprite in the character's view
  ViewFrame* f=Game.GetViewFrame(this.CHAR_VIEW, this.CHAR_LOOP, 2);
  f.Graphic=etatpersos[numero].Graphic;
  // Then I give this frame to the character
  this.Acteur.LockViewFrame(this.CHAR_VIEW, this.CHAR_LOOP, 2);
}
#284
Yes EriOo :)

Well in fact, I am creating a Survival Mode with AGS (like a campaign mode with lots of features and new gameplay mechannics). If you want to try it or play-test it, it would be with pleasure ! We have a discord channel dedicated to that :)

EDIT :  yeah, I have not posted my game in development in the forum because I don't know if it is legitimate. As it is not a "game", but an app for a board game. I thought it is not the matter here, anyway, if some are interested and that I can release my alpha version here, it will be with pleasure :)

@Crimson Wizard : thanks for the advice, I'm going to change my code ! I am always happy when I can sweep some dust in my code (and moreover  : spring is coming, isn't it ? ;) )
#285
So I just tested and managed to do with a dynamic sprite for 1 character, so I have great hopes that I could manage to work for all characters like that !

I saw that arrays of dynamic sprites are possible to use, that's great too.

My question is that :

- should I create as many dynamic sprites as number of states per character (so, about +2500 dynamic sprites to create at the game_start) ?

- or should I only create a dynamic sprite per character, and update it each time the character's state changes ?

If creating thousands of dynamic sprites is not a problem for the game, well I prefer that solution as it won't change all of my scripting I have done yet.

If not, well I will have to work longer and review my scripts to adapt it to a new system.

I have the feeling that it would be better to have few dynamic sprites for the engine because they are stocked into the memory, and if there are too much, it could lag the game. But I don't really know anything about that, so... What will you advice ?
#286
Also : the android launcher must select the windows version of the game, or the "data" is the "data" compiled (when I compile my game, I have 3 folders: windows, linux and data).
#287
Hmm ok sounds great !

So instead to import 2500 sprites in the game, I could have only the "masks" and create the 2500 sprites at game_start with dynamic sprites to fill the views ? (I have several views inside them one character uses one loop, so a loop has about 20 sprites)

It won't get the game lagging to have so many Dynamic sprites at the same time ?

Or I could only create the dynamic sprites for characters that are used by the player ?
#288
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 ?
#289
So if I understand well :

- the player installs Android Launcher

- he places my game at the right path location

- he launches the android launcher and with that he can play my game

Is it ok ?

I created my game with AGS 3.5.0.24 (it is that number that ags shows me when I click "help"). Which Android launcher do I need ?
#290
Thanks Crimson Wizard! I prefer the Android Launcher's method :)

But does it mean that the Android Launcher has to be launched by the player ? Or I can create with it the game version for Android ?

Also, I don't know what is the "External storage device"...?
#291
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.
#292
That's a very good idea ! I didn't figure out that it was possible, but now I understand that modules imitating notepad in AGS work this way, I think. I will try it !
#293
Yes, but... labels do that actually, don't they ? I mean, cutting not at the middle of a word.
#294
In fact, I was talking about a vertical scrolling, and as I can see, your function was about a horizontal scrolling. But I believe that the vertical scrolling function would be pretty the same as yours for horizontal scrolling.

So your scrolling function is about pixel scrolling and not about line or word scrolling ?
#295
Hi !

I wanted to do something like a scrollable label, but I wonder if the text won't be cutted in the middle of a word ?

To have a perfect scrollable label, we would need to "locate" the end of the last word of the last line, and cut the string after it ?

Is it possible to do such thing ?
#296
Yes Monsieur OUXX, the limit of 500 characters is in the editor. You can't write a line of text (string of any kind I presume) over 500 characters. Is there any way to fix it or is it a limit that can't be removed ?

Crimson Wizard : yeah, String.Append is certainly a much better process for what I have to do ! Because it is easier to manipulate, and %s won't appear in the translation file, so it is less confusing... I will have some thought on that, maybe I will change my code. Thanks for the tip :)
#297
Thanks Crimson for the help.

Well, my system locale for non-unicode programs is called "Français (France)", so I don't know if it is "windows 1252" ?

When I use notepad, I simply open the trs file with notepad, add the translations and then save it. And it works perfect. I think tzachs is the man of the situation, since the problem seems to come from his great app ! :)
#298
OK, I have tested a few things, and I have to report a bug.

I restart my translation file from a new one. So I translated the first lines with windows 1252 format. I compile and launch the game.

In game, original texts that were using special characters like àéè etc... weren't translated. Whereas I have translated them in the .trs file.

I tried a new translation file, I openned it with notepad program, translated the same first lines, saved it and launched the game. The texts displayed perfectly, event with such characters as àéè etc...

So I think there is a problem with AGS that don't recognize some format. But windows 1252 probably doesn't work.

I have to say that if I choose windows 1252 format, in tzachs's application, I can see the special characters àéè correctly. But when I save the file, the translation is not working in game.

For the moment, I will go on with notepad until a solution is found. But anyone knows what happens ? tzachs's browser app is very useful, but unfortunately it doesn't work again :(

EDIT : sorry that I insist on this thread, but it took me a long time of research to solve a problem linked with the translation, I thought it was my code but in fact it was the format I presume...
#299
Ah ok, I understand. Windows 1252 works very well for me, so I can save the translation file in Windows 1252 ?
#300
Thanks Crimson Wizard, so I don't know what I should do. Which format should I use ?

It seems that AGS creates translation files in UTF-8, as @tzachs said before about my file. Or I don't understand anything :p
SMF spam blocked by CleanTalk