Page 1 of 1

DOL under linux solving various error

PostPosted: Sun Mar 09, 2014 3:30 pm
by destiny71
Hi Dol comunity. Im new user and this is my first post. Sorry in advanced for my poor english. I suppose this is a correct section.

During compiling DOL (the last svn release) under linux (ubuntu 13.04) i found this error and solving whit implicit cast but not sure this fix is a best solution.

Error 1
ai/brain/StandardMobBrain.cs(992,70): error CS0172: Type of conditional expression cannot be determined as `int' and `byte' convert implicitly to each other

change line 992 from
Code: Select all
int numAttackers = (attackerGroup == null) ? 1 : attackerGroup.MemberCount;
to
Code: Select all
int numAttackers = (attackerGroup == null) ? 1 : (int)attackerGroup.MemberCount;
Error 2
gameobjects/GameLiving.cs(2939,93): error CS0172: Type of conditional expression cannot be determined as `byte' and `int' convert implicitly to each other
gameobjects/GameLiving.cs(2939,52): error CS1502: The best overloaded method match for `System.Math.Ceiling(decimal)' has some invalid arguments
gameobjects/GameLiving.cs(2939,52): error CS1503: Argument `#1' cannot convert `object' expression to type `decimal'


change line 2939 from
Code: Select all
int procChance = (int)Math.Ceiling(((weapon.ProcChance > 0 ? weapon.ProcChance : 10) * (weapon.SPD_ABS / 35.0)));
Code: Select all
int procChance = (int)Math.Ceiling((((int)weapon.ProcChance > 0 ? (int)weapon.ProcChance : 10) * (weapon.SPD_ABS / 35.0)));
Error 3
gameobjects/GamePlayer.cs(7065,121): error CS0172: Type of conditional expression cannot be determined as `byte' and `int' convert implicitly to each other

change line 7065 from
Code: Select all
int chance = reactiveItem.ProcChance > 0 ? reactiveItem.ProcChance : 10;
to
Code: Select all
int chance = (int)reactiveItem.ProcChance > 0 ? (int)reactiveItem.ProcChance : 10;
Error 4
gameobjects/GamePlayer.cs(7084,121): error CS0172: Type of conditional expression cannot be determined as `byte' and `int' convert implicitly to each other

change line 7084 from
Code: Select all
int chance = reactiveItem.ProcChance > 0 ? reactiveItem.ProcChance : 10;
to
Code: Select all
int chance = (int)reactiveItem.ProcChance > 0 ? (int)reactiveItem.ProcChance : 10;
Now DOL compile and work very well.

-----
Destiny

Re: DOL under linux solving various error

PostPosted: Sun Mar 09, 2014 4:42 pm
by Graveen
Thank you. Can you give the version of mono you are using ?

Re: DOL under linux solving various error

PostPosted: Sun Mar 09, 2014 4:47 pm
by destiny71
Im using monodevelop 3.0.3.2 and Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-5ubuntu1) on x86_64

Re: DOL under linux solving various error

PostPosted: Mon Mar 10, 2014 8:57 am
by Leodagan
It's weird, I didn't run accross these while compiling with Mono 3.2

Re: DOL under linux solving various error

PostPosted: Mon Mar 10, 2014 10:32 am
by destiny71
It's weird, I didn't run accross these while compiling with Mono 3.2
I do not think the mono version of Ubuntu is changed from 13:04 to 13:10. (Now in my Ubuntu 13:10: Mono JIT compiler version 2.10.8.1 (2.10.8.1-5ubuntu2 Debian) Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. http://www.mono-project.com) and the version of MonoDevelop is always 3.0.3.2

I tried to update with additional Launchpad repository but nothing changed.

----------
Destiny

Re: DOL under linux solving various error

PostPosted: Mon Mar 10, 2014 11:20 am
by Tolakram
Could it be the warning or error level used? Strict type checking turned on? Something like that?

Re: DOL under linux solving various error

PostPosted: Mon Mar 10, 2014 12:05 pm
by destiny71
Could it be the warning or error level used? Strict type checking turned on? Something like that?
Hi Tolakram thanks for reply.

My skill in .net not very high because normaly i programing in other language like Java or C++ but logically do not think depends on the level of error display. Generally the warnings message, not knowing .net very well and might be completely wrong, showing alert message but allow you to complete the compilation process. In my case it gave me a failure of the compilation (stop compilation whitout creating binary file) with a most Warning (19 yellow messages on console) and 6 Errors (messages in red).

If necessary reproduce the error and post a screen for more details.

Edit: Attach screen: http://www.websources.it/wp-content/upl ... 03/dol.png

Original line (992) in StandardMobBrain.cs whitout implicit cast, error message in console and debug/release folder empty
---------------
Destiny

Re: DOL under linux solving various error

PostPosted: Mon Mar 10, 2014 1:49 pm
by Leodagan
It's weird, I didn't run accross these while compiling with Mono 3.2
I do not think the mono version of Ubuntu is changed from 13:04 to 13:10. (Now in my Ubuntu 13:10: Mono JIT compiler version 2.10.8.1 (2.10.8.1-5ubuntu2 Debian) Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. http://www.mono-project.com) and the version of MonoDevelop is always 3.0.3.2

I tried to update with additional Launchpad repository but nothing changed.

----------
Destiny
I'm running Freyad under Mono 3.2 x86_64 on Ubuntu (I don't remember exactly the Ubuntu Release...)

https://launchpad.net/~directhex/+archive/monoxide

My testing server is a Gentoo Linux with self-compiled Mono 3.2, but I admit that I still compile my ByteCode using SharpDevelop under Windows... (.NET 4.5)

Re: DOL under linux solving various error

PostPosted: Tue Mar 11, 2014 10:39 am
by destiny71
It's weird, I didn't run accross these while compiling with Mono 3.2
I do not think the mono version of Ubuntu is changed from 13:04 to 13:10. (Now in my Ubuntu 13:10: Mono JIT compiler version 2.10.8.1 (2.10.8.1-5ubuntu2 Debian) Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. http://www.mono-project.com) and the version of MonoDevelop is always 3.0.3.2

I tried to update with additional Launchpad repository but nothing changed.

----------
Destiny
I'm running Freyad under Mono 3.2 x86_64 on Ubuntu (I don't remember exactly the Ubuntu Release...)

https://launchpad.net/~directhex/+archive/monoxide

My testing server is a Gentoo Linux with self-compiled Mono 3.2, but I admit that I still compile my ByteCode using SharpDevelop under Windows... (.NET 4.5)
Updating Ubuntu at development branch (14.04 Trusty) and now compile whitout problem whit monodevelop 4.0.12 and Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

Re: DOL under linux solving various error

PostPosted: Wed Mar 12, 2014 8:45 am
by Graveen
thank you for the feedback guys !