thomasfn / ecolawextensionsmod Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Read y coordinate from input location and return it as float, maybe option for relative (to surface) vs absolute?
As expected beta 0.4.1 doesn't work on version 10 of the server. The following error is thrown on startup.
[23:14:09.507] [24] [Error] [Eco] Failed to start the server. Exception was Exception: ReflectionTypeLoadException
Message:Unable to load one or more of the requested types.
Source:System.Private.CoreLib
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Eco.Shared.Utils.ReflectionCache.<>c.<GetTypesCached>b__10_0(Assembly a)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Eco.Shared.Utils.ReflectionCache.GetTypesCached(Assembly assembly)
at Eco.Shared.Utils.ReflectionCache.<>c.<GetGameAssembliesTypes>b__21_0(Assembly assembly)
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
at Eco.Core.Serialization.SimpleSerializer.InitializeSerializableTypes()
at Eco.Core.Serialization.SimpleSerializer..cctor()
System.TypeLoadException
Outer Exceptions:
One or more errors occurred. (Exception has been thrown by the target of an invocation.)
Exception has been thrown by the target of an invocation.
One or more errors occurred. (The type initializer for 'Eco.Core.Serialization.SimpleSerializer' threw an exception.)
The type initializer for 'Eco.Core.Serialization.SimpleSerializer' threw an exception.
[23:14:14.512] [24] [ Info] [Eco] Shutdown finished
[23:14:14.512] [24] [Error] [Eco] Errors report:
Failed to get derived types for 'Eco.World.Blocks.Block' in assembly 'EcoLawExtensionsMod, Version=0.4.1.0, Culture=neutral, PublicKeyToken=null' (usually safe to ignore for third party assembly). Error message: Unable to load one or more of the requested types.
: 1
Failed to start the server. Exception was Exception: ReflectionTypeLoadException
Message:Unable to load one or more of the requested types.
Source:System.Private.CoreLib
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Eco.Shared.Utils.ReflectionCache.<>c.<GetTypesCached>b__10_0(Assembly a)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Eco.Shared.Utils.ReflectionCache.GetTypesCached(Assembly assembly)
at Eco.Shared.Utils.ReflectionCache.<>c.<GetGameAssembliesTypes>b__21_0(Assembly assembly)
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
at Eco.Core.Serialization.SimpleSerializer.InitializeSerializableTypes()
at Eco.Core.Serialization.SimpleSerializer..cctor()
System.TypeLoadException
Outer Exceptions:
One or more errors occurred. (Exception has been thrown by the target of an invocation.)
Exception has been thrown by the target of an invocation.
One or more errors occurred. (The type initializer for 'Eco.Core.Serialization.SimpleSerializer' threw an exception.)
The type initializer for 'Eco.Core.Serialization.SimpleSerializer' threw an exception.
: 1
Interested to know if possible to build a law to tax for power used and pay for power generated.
It would be nice if you could limit gathering of crops on public land via a law stating only X % grown plants could be gathered from when using the On Harvests/Hunt action.
Not sure if it's possible to have a picker for biome, and fairly sure biome is fractional not binary (e.g a little bit desert vs alot desert), so some investigation required to determine feasibility for this.
e.g. before balanced, tastiness etc modifiers applied
On WT, we have a law that should automatically transfer all income from a person to their company.
It goes like this:
On transfer money -> if receiver is employed by a company -> transfer the amount that just got transferred from the target bank account to the personal account of the company of the receiver
This also happens if the receiver is in a government office and the transaction is for government business e.g. someone buys something at a government store. In that case, the government income is rerouted to the owners company.
It would be awesome to be able to filter where the money is going in a "transfer money" trigger by having a check "is government account" for a bank account. Then we could change our law like this:
On transfer money -> if receiver is employed by a company and target bank account is not a government account -> transfer the amount to the company
e.g. EP law could turn on all machines after reallocation (but only ones that got turned off legally, not ones the player turned off themselves!)
[15:47:37.829] [12] [Error] [Eco] System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.)
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Eco.Gameplay.Civics.Laws.LegalActions.Money.TaxPayBase_LegalAction.GovernmentTransferUsers(LocString description, Single amount, Currency currency, BankAccount governmentAccount, GameValue`1 aliasGameValue, IContextObject context, Settlement jurisdictionSettlement, Boolean canTransferNonCitizens, Boolean taxing, Boolean preventIfUnableToPay, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LegalActions.Money.Pay_LegalAction.DoTransfer(LocString description, IContextObject context, Settlement jurisdictionSettlement, Single amount, Currency currency, Boolean preventIfUnableToPay, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LegalActions.Money.MoneyTransferBase_LegalAction.Do(LocString description, IContextObject context, Settlement jurisdictionSettlement, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LegalActions.Money.MoneyTransferBase_LegalAction.Perform(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.LegalAction.PerformAndProcessResult(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.IfThenBlock.TryPerform(Law law, GameAction action, AccountChangeSet acc, LawSection section, Int32 index, LocStringBuilder sbDebug)
at Eco.Gameplay.Civics.Laws.LawSection.CheckConditionsAndApplyEffects(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LawSection.InternalPerform(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LawSection.Perform(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.Law.TryPerform(GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LawManager.Perform(GameAction action, AccountChangeSet acc)
at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(PackFlags flags, List`1 actions, IEnumerable`1 preTests, IEnumerable`1 postEffects, AccountChangeSet acc)
at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(User userToNotify, GameActionPack actionPack)
at Eco.Mods.LawExtensions.PowerGridLawManager.DoLawTick(Single deltaTime)
at Eco.Core.Utils.Threading.PeriodicWorkerFactory.<>c__DisplayClass0_0.<Create>b__0(CancellationToken token)
at Eco.Core.Utils.Threading.RepeatableWorkerBase.DoWork(CancellationToken token)
--- End of inner exception stack trace --- System.NullReferenceException: Object reference not set to an instance of an object.
at Eco.Gameplay.Civics.Laws.LegalActions.Money.TaxPayBase_LegalAction.GovernmentTransferUsers(LocString description, Single amount, Currency currency, BankAccount governmentAccount, GameValue`1 aliasGameValue, IContextObject context, Settlement jurisdictionSettlement, Boolean canTransferNonCitizens, Boolean taxing, Boolean preventIfUnableToPay, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LegalActions.Money.Pay_LegalAction.DoTransfer(LocString description, IContextObject context, Settlement jurisdictionSettlement, Single amount, Currency currency, Boolean preventIfUnableToPay, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LegalActions.Money.MoneyTransferBase_LegalAction.Do(LocString description, IContextObject context, Settlement jurisdictionSettlement, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LegalActions.Money.MoneyTransferBase_LegalAction.Perform(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.LegalAction.PerformAndProcessResult(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.IfThenBlock.TryPerform(Law law, GameAction action, AccountChangeSet acc, LawSection section, Int32 index, LocStringBuilder sbDebug)
at Eco.Gameplay.Civics.Laws.LawSection.CheckConditionsAndApplyEffects(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LawSection.InternalPerform(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LawSection.Perform(Law law, GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.Law.TryPerform(GameAction action, AccountChangeSet acc)
at Eco.Gameplay.Civics.Laws.LawManager.Perform(GameAction action, AccountChangeSet acc)
at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(PackFlags flags, List`1 actions, IEnumerable`1 preTests, IEnumerable`1 postEffects, AccountChangeSet acc)
at Eco.Gameplay.GameActions.GameActionManager.TryPerformActions(User userToNotify, GameActionPack actionPack)
at Eco.Mods.LawExtensions.PowerGridLawManager.DoLawTick(Single deltaTime)
at Eco.Core.Utils.Threading.PeriodicWorkerFactory.<>c__DisplayClass0_0.<Create>b__0(CancellationToken token)
at Eco.Core.Utils.Threading.RepeatableWorkerBase.DoWork(CancellationToken token)
The same way we can check the bonus from each nutriments included in the food bonus, it would be interesting to also check the xp bonus provided by each type of room in the residency.
Can choose settlement population to do math against a settlement for funding but cannot have the left number as Demographic or seemingly only pick on active citizens.
Idea for law would be every 24 hours Pay from X account to X account Active Settlement population ABC Town Multiplied by X, if the game has a better way to do this I have not found it.
Ie
Every 24 hours pay from Global Govt to Country Govt 15 * 200 due to them having 15 citizens
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.