Error Meassage, need a hint
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Error Meassage, need a hint
What may be the cause this error, just in general.
The best bet is your own, good Taste.
Re: Error Meassage, need a hint
Something about string and number conversion. For better debugging I would add logging in one of the lines mentioned in stacktrace.
- Pentarctagon
- Project Manager
- Posts: 5592
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Error Meassage, need a hint
It's a pretty terrible error message, but
stoi
is the name of a c++ function for converting a string to an int. So it tried to convert a string value to an int value and that conversion failed.99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Error Meassage, need a hint
ok, thanks, will see if something like that happens when the message is displayed
The best bet is your own, good Taste.
Re: Error Meassage, need a hint
btw, is there any way to suppress these messages from popping up that can be controlled via the scn?Pentarctagon wrote: ↑July 5th, 2023, 4:13 am It's a pretty terrible error message, butstoi
is the name of a c++ function for converting a string to an int. So it tried to convert a string value to an int value and that conversion failed.
the message pops up when the last leader of a group of leaders get killed, and among these leaders "canrecruit" ability is switched each turn via store_unit and storing these informations in variables, i guess when the last leader get killed there is some unclean code which causes this.
but may its als something else, there are also other events involed when these leaders are killed,
however everything works fine (beside he message pops up), its just that the meassage clutter up the whole screen and last a very long time whch is pretty annoying
The best bet is your own, good Taste.
- Spannerbag
- Posts: 553
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Error Meassage, need a hint
FWIW if you haven't looked at the logs yet, there's sometimes something in there that helps?
Just a thought
Cheers!
-- Spannerbag
- Pentarctagon
- Project Manager
- Posts: 5592
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Error Meassage, need a hint
There's the ctrl+x hotkey as well as the number of chat lines preference, but nothing that can be done via code.Mabuse wrote: ↑July 6th, 2023, 1:19 pmbtw, is there any way to suppress these messages from popping up that can be controlled via the scn?Pentarctagon wrote: ↑July 5th, 2023, 4:13 am It's a pretty terrible error message, butstoi
is the name of a c++ function for converting a string to an int. So it tried to convert a string value to an int value and that conversion failed.
the message pops up when the last leader of a group of leaders get killed, and among these leaders "canrecruit" ability is switched each turn via store_unit and storing these informations in variables, i guess when the last leader get killed there is some unclean code which causes this.
but may its als something else, there are also other events involed when these leaders are killed,
however everything works fine (beside he message pops up), its just that the meassage clutter up the whole screen and last a very long time whch is pretty annoying
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- beetlenaut
- Developer
- Posts: 2829
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Error Meassage, need a hint
There is an exception being thrown, so you probably shouldn't be attempting to leave it like that even if your code does what you want at the moment. This should be fixable in your code. There is a place where the engine expects a number, but you are giving it an empty string. Maybe one of your tags is missing a required key. (Technically, you could also be giving the engine a string that starts with text, but that seems unlikely.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: Error Meassage, need a hint
yes. you are right about that the exeptions shouldnt be ignored.beetlenaut wrote: ↑July 6th, 2023, 6:32 pmThere is an exception being thrown, so you probably shouldn't be attempting to leave it like that even if your code does what you want at the moment. This should be fixable in your code. There is a place where the engine expects a number, but you are giving it an empty string. Maybe one of your tags is missing a required key. (Technically, you could also be giving the engine a string that starts with text, but that seems unlikely.)
i tracked down the error and it was as ususal a trivial typo. that would have still ofc caused things not to work like intended.
the mechanism (switching leaders) was not the cause, instead it was a spawned unit and one of its attributes wasnt declared as a string.
thank you all for your help
The best bet is your own, good Taste.