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 !
If anybody could help me, I will be grateful !

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 MenuDynamicSprite* 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);
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.071 seconds with 14 queries.