Tuesday, September 13, 2011

Message log

When I tried to do those language screenshots I noticed a bug in the message log. I got it fixed and I even improved it a bit, it can be now minimized and maximized and on maximized mode it can be scrolled so that player can go back to earlier messages. I also made some visual improvements. Ill put a screenshots on media page when I get home from work :)

On a side note, I also noticed a weird bug on my monster talking. The talk generator and "word-confusor" works perfectly but for some reason the output is a little off.. The way it works is that I send a string of what monster is saying to function which converts it depending how well player understands that languag. After the conversion it returns the converted string. Now in the function I make new char talk2[ str.size() ] which means that talk2 should be as big as str itself.. then i just copy the str content into talk2 ( and convert it if thats nessecery ). However when i print the talk2 which comes from the function it sometimes ( not everytime ) has some odd numbers and stuff after the actual string..

for examaple, str = "what is this stuff" and after conversion when i call PRINT( str ) it contains "what is this stuff\234%#\d" or something like that. I checked that sizes do match and the generator don't add those extra marks there.. im kinda puzzled..


Right, I fixed it.. There seems to be some sort of overflow in std::string class, it got fixed when I changed std::string into QString..

3 comments:

  1. heh, until you do code me map with otional sorting I am forced to you std.. ;)

    ReplyDelete
  2. Yeah libtcod definitely lacks a good hashmap.it's been on the todo list for years...

    ReplyDelete