I'm really sorry, and thanks a lot for helping !
OK, so as for ever, it's always the last thing you look at that hides the mistake
So, this function is crashing the game :
Code: ags
Here, I get the data "nomobjectif" and "texteobjectif" of the map, I look at it if there is some standard text into it (events_txtstandards.txthaut), if yes, I replace it by a "mark" (events_txtstandards.txthautcode), then I look at the next one.
Perhaps multiple loops with IndexOf functions (where the string looked for is a large string, more than 100 characters sometimes) gets the engine crashing ?
Example of the struct events_txtstandards :
Code: ags
It's to save some place into .txt files, so texts that are redundant (like for rules that could be similar in many maps) are replaced by what I call "marks" (don't know the exact word in english).
I'm really sorry, because I thought I had fully debugged the function, but I forgot something... And just now I saw that it crashes at this place and not another one. Perhaps these maps have many rules, and the loops are crashing the game because too many things in one function ..?
Also I'm sorry if now, it's not the good thread to discuss about it... Because it doesn't seem an AGS bug anymore.
OK, so as for ever, it's always the last thing you look at that hides the mistake

So, this function is crashing the game :
for (int i=0 ; i<NB_REGLES ; i++)
{
if (String.IsNullOrEmpty(this.nomobjectif[i])==false || String.IsNullOrEmpty(this.texteobjectif[i])==false)
{
String temp=this.nomobjectif[i];
for (int j=0 ; j<TOTAL_EVENTS_TXTSTANDARDS ; j++)
{
if (events_txtstandards[j].txthaut!=null && temp.IndexOf(events_txtstandards[j].txthaut)>=0) temp=temp.Replace(events_txtstandards[j].txthaut, events_txtstandards[j].txthautcode, eCaseSensitive);
if (events_txtstandards[j].txtbas!=null && temp.IndexOf(events_txtstandards[j].txtbas)>=0) temp=temp.Replace(events_txtstandards[j].txtbas, events_txtstandards[j].txtbascode, eCaseSensitive);
}
regleobj=regleobj.Append(e);
regleobj=regleobj.Append(balise_trad[0]);
regleobj=regleobj.Append(temp);
regleobj=regleobj.Append(balise_trad[0]);
temp=this.texteobjectif[i];
for (int j=0 ; j<TOTAL_EVENTS_TXTSTANDARDS ; j++)
{
if (events_txtstandards[j].txthaut!=null && temp.IndexOf(events_txtstandards[j].txthaut)>=0) temp=temp.Replace(events_txtstandards[j].txthaut, events_txtstandards[j].txthautcode, eCaseSensitive);
if (events_txtstandards[j].txtbas!=null && temp.IndexOf(events_txtstandards[j].txtbas)>=0) temp=temp.Replace(events_txtstandards[j].txtbas, events_txtstandards[j].txtbascode, eCaseSensitive);
}
regleobj=regleobj.Append(e);
regleobj=regleobj.Append(balise_trad[0]);
regleobj=regleobj.Append(TranscriptionLineBreak(temp, true));
regleobj=regleobj.Append(balise_trad[0]);
}
}
Here, I get the data "nomobjectif" and "texteobjectif" of the map, I look at it if there is some standard text into it (events_txtstandards.txthaut), if yes, I replace it by a "mark" (events_txtstandards.txthautcode), then I look at the next one.
Perhaps multiple loops with IndexOf functions (where the string looked for is a large string, more than 100 characters sometimes) gets the engine crashing ?
Example of the struct events_txtstandards :
void Events_TxtStandards::CreerTxtStandards(int ID)
{
// OBJ COULEUR
if (ID==0) // bleu
{
this.txthaut=GetTranslation("Vous venez de trouver la clé bleue !");
this.txtbas=GetTranslation("Placez l'Objectif Bleu sur la Fiche du Survivant qui a pris cet Objectif. Il ne prend pas de place dans l'Inventaire, et peut être échangé de la même manière qu'une carte Équipement.[[Un Survivant qui possède l'Objectif Bleu peut dépenser 1 Action pour ouvrir la Porte Bleue silencieusement et sans autre équipement requis.");
this.txthautcode="[STANDARD_TXTOBJBLEU_HAUT]";
this.txtbascode="[STANDARD_TXTOBJBLEU_BAS]";
}
}
It's to save some place into .txt files, so texts that are redundant (like for rules that could be similar in many maps) are replaced by what I call "marks" (don't know the exact word in english).
I'm really sorry, because I thought I had fully debugged the function, but I forgot something... And just now I saw that it crashes at this place and not another one. Perhaps these maps have many rules, and the loops are crashing the game because too many things in one function ..?
Also I'm sorry if now, it's not the good thread to discuss about it... Because it doesn't seem an AGS bug anymore.
