Page 1 of 1

showing tag in RoMBot output

Posted: Tue Jun 02, 2015 9:31 am
by Celesteria
hi rock5,

I hope this is the correct forum for this...
It would be nice to see the tag (if there is one) within the 'moving to waypoint...'-message. I changed the following line within my personal copy, but it should be a better way to use and update the language-files to fit these little changes

Code: Select all

-- bot.lua --
line: 950
from
cprintf(cli.green, language[13], wpnum, wp.X, wp.Z);	-- Moving to returnpath waypoint
to
cprintf(cli.green, language[13]..(wp.Tag~='' and ' tag: '..wp.Tag or ''), wpnum, wp.X, wp.Z);	-- Moving to returnpath waypoint

line: 954
from
cprintf(cli.green, language[6], wpnum, wp.X, wp.Z, wptag);	-- Moving to waypoint
to
cprintf(cli.green, language[6]..(wp.Tag~='' and ' tag: '..wp.Tag or ''), wpnum, wp.X, wp.Z);	-- Moving to waypoint


greetings
Celesteria

Re: showing tag in RoMBot output

Posted: Thu Jun 04, 2015 3:45 am
by rock5
That looks ok. I'll add it to my next commit.

I'm not sure what you meant by "but it should be a better way to use and update the language-files to fit these little changes".

Note: if you make changes to your personal copy, when you do an SVN Update usually you can do the update without affecting your changes and without causing any problems. The only time you have conflicts is when the part of the file you changed is also being changed by the update.

If you want changes added to the bot you have to let us know on the forum so a developer like me can add it. If anyone ever contributes a lot and it looks like they want to contribute for the long term and Administrator is happy with their work he might invite them to become a developer like me and Lisa.

Re: showing tag in RoMBot output

Posted: Thu Jun 04, 2015 2:05 pm
by Celesteria
using the language-files means that there ist a carriage return in the language[6] and language[13] and the output of my solution doesnt look nice. the correct way to implement it could be this:

Code: Select all

-- language/deutsch.lua (and in all other language-files) --
language = {
...
  [6] = "Wir gehen zum Wegpunkt #%d, (%d, %d) %s\n",
...
  [13] = "Wir gehen zum R\129ckkehrpfad-Wegpunkt #%d, (%d, %d) %s\n",
...
}
and

Code: Select all

-- bot.lua --
-- change line 947 to 955 to --
if( player.Returning ) then
  wp = __RPL:getNextWaypoint();
  wpnum = __RPL.CurrentWaypoint;
  wptag = (wp.Tag~='' and ' tag: '..wp.Tag or '')
  cprintf(cli.green, language[13], wpnum, wp.X, wp.Z, wptag);	-- Moving to returnpath waypoint
else
  wp = __WPL:getNextWaypoint();
  wpnum = __WPL.CurrentWaypoint;
  wptag = (wp.Tag~='' and ' tag: '..wp.Tag or '')
  cprintf(cli.green, language[6], wpnum, wp.X, wp.Z, wptag);	-- Moving to waypoint
end
if I use update to get a new version of your files then it merges your changes with my changes correctly? I never used SVN before together with other developers this way, so I wasn't sure :)

Re: showing tag in RoMBot output

Posted: Fri Jun 05, 2015 1:11 am
by rock5
I see what you mean. It just has to be added to each language file. It can't be helped. I've change it to reflect these changes.
Celesteria wrote:if I use update to get a new version of your files then it merges your changes with my changes correctly? I never used SVN before together with other developers this way, so I wasn't sure
That's the way TortoiseSVN works, it doesn't download and install the new version, it downloads the changes and merges the changes with your copy. Therefore if you have done some personal changes then they remain. If you ever want to see what changes you made in the past then you can right click the file or folder and select "TortoiseDVN/Check for modifications".