Search found 24 matches

by georgido
Wed Jan 23, 2013 8:38 pm
Forum: Programming
Topic: Abs function
Replies: 8
Views: 659

Re: Abs function

Geoff the Medio wrote:Couple things about the patch:
* Replace tabs with four spaces.
* You could probably use std::abs or similar to simplify the implementation of the actual absolute value calculation.
there you are... tested as well...
again, any code provided is released under GPL 2.0
by georgido
Wed Jan 23, 2013 9:22 am
Forum: Programming
Topic: Abs function
Replies: 8
Views: 659

Re: Abs function

Use it in a content script for an effect on a building, ship, tech, or similar. There are examples of using sin and cos in buildings.txt ook tested it and worked fine... changed the buildcost of the evacuation building in buildings.txt from 10 to abs(50) and then to abs(-50) and both times the cost...
by georgido
Wed Jan 23, 2013 8:59 am
Forum: Programming
Topic: Abs function
Replies: 8
Views: 659

Re: Abs function

Geoff the Medio wrote:Have you tested using the new Abs function in a content script?
should have mentioned it before, not sure how to test it...
by georgido
Wed Jan 23, 2013 8:38 am
Forum: Programming
Topic: Abs function
Replies: 8
Views: 659

Re: Abs function

Geoff the Medio wrote:Please edit your post to note that you release any changes under the GPL 2.0 or later.
done
by georgido
Wed Jan 23, 2013 8:04 am
Forum: Programming
Topic: Abs function
Replies: 8
Views: 659

Abs function

not sure if there are some other files that need changes, seems ok to me and compiled just fine... have a look and tell me if i missed something...

EDIT: any code provided here by me is released under GPL 2.0
by georgido
Wed Jan 23, 2013 6:49 am
Forum: Programming
Topic: question about the abs function needed
Replies: 2
Views: 345

Re: question about the abs function needed

Geoff the Medio wrote:I suspect you need to add (Abs) to the NAMES_SEQ_1 list in Names.h
yes there it is... thing is i was using the search function of visual studio to find where the other tokens (log, cos, sin, etc) were declared, but for some reason VS couldn't find them... thanks
by georgido
Tue Jan 22, 2013 8:22 pm
Forum: Programming
Topic: question about the abs function needed
Replies: 2
Views: 345

question about the abs function needed

so i'm working on the abs function (last thing under Misc in programming work) and i'd like to ask 1 question. for the parsing i want to use an Abs_ token in a similar way Log_ token is used in ValueRefParser.h. more specifically like this: tok.Log_ [ _c = ValueRef::LOGARITHM ] can you point me wher...
by georgido
Tue Jan 15, 2013 8:51 pm
Forum: Compile
Topic: Common build error
Replies: 32
Views: 4588

Re: Common build error

Geoff the Medio wrote:
georgido wrote:...more files appeared (AI_1, AI_2, AI_3, config)...
Do those all have contents?
yes
by georgido
Tue Jan 15, 2013 8:29 pm
Forum: Compile
Topic: Common build error
Replies: 32
Views: 4588

Re: Common build error

ook now everything seems fine... freeorion logfile now has a few lines and also some more files appeared (AI_1, AI_2, AI_3, config)...
by georgido
Tue Jan 15, 2013 11:10 am
Forum: Compile
Topic: Common build error
Replies: 32
Views: 4588

Re: Common build error

Looks like there is a bit of a difference in how the client and server log file pathes are set up. Could you try this patch to see if it gets the client log working with the non-latin username? something's wrong with line 15 from the patch file... std::ofstream : Error:type name not allowed temp: E...
by georgido
Mon Jan 14, 2013 8:41 pm
Forum: Compile
Topic: Common build error
Replies: 32
Views: 4588

Re: Common build error

Does freeoriond.log contain anything? If you felt like looking into the logger initialization and what the path string it gets sent is, that might be helpful. I don't have time at the moment to point you to the right place to look, though. there were two lines: 2013-01-14 22:30:22,028 DEBUG Server ...
by georgido
Mon Jan 14, 2013 8:36 pm
Forum: Compile
Topic: Common build error
Replies: 32
Views: 4588

Re: Common build error

Geoff the Medio wrote:except maybe ogre.log; does that get created?
well aside from the empty freeorion file now there is a freeoriond file but no ogre.log
by georgido
Mon Jan 14, 2013 8:32 pm
Forum: Compile
Topic: Common build error
Replies: 32
Views: 4588

Re: Common build error

Can you modify this function with the cout line and tell me if / what is output on the console before the crash? void FileAppender::_append(const LoggingEvent& event) { std::string message(_getLayout().format(event)); std::cout << "_fd: " << _fd << std::endl; if (!::write(_fd, message...
by georgido
Mon Jan 14, 2013 8:19 pm
Forum: Compile
Topic: Common build error
Replies: 32
Views: 4588

Re: Common build error

Does it help if you modify CategoryStream::flush() in CategoryStream.cpp to be this: void CategoryStream::flush() { try { if (_buffer) { getCategory().log(getPriority(), _buffer->str()); delete _buffer; _buffer = NULL; } } catch (...) { // logging failed... } } Probably a long shot, but maybe worth...
by georgido
Mon Jan 14, 2013 7:45 pm
Forum: Compile
Topic: Common build error
Replies: 32
Views: 4588

Re: Common build error

void FileAppender::_append(const LoggingEvent& event) { std::string message(_getLayout().format(event)); if (!::write(_fd, message.data(), message.length())) { // XXX help! help! } } the game crashes after reaching the if-statement... that's in FileAppender.cpp. had one cout before the if-block...