Not a Bug

State machine loses custom behaviours

Christian Koch 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 2

I have a state machine that handles a simple turnbased combat system. This state machine uses scripts like: a Turnorder, an actionHandler, my participants in the battle etc. From time to time (recently more often) it loses the capability to reference those on the start of unity. "Failed to define InvokeMember #...". It also loses types on macros for input flow, output flow and there input values. This leads to a huge mess in my macros. This is not too bad yet, but it takes up a lot of time.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

It happened again. I built my game, closed unity and then reopened it.

I attached the warnings. It seems most of them are just a result of the earlier errors. Log.txt

I hope this is my mistake and easy to fix

Not a Bug

Hi Christian,

Sorry you're experiencing this issue.

From what I can see in the log, it seems like you're using methods on a custom Turnorder class, like Playercount. However, Bolt fails to find it and therefore that unit fails to define. This causes a bunch of errors afterwards, because everything that was connected to that unit fails to find a compatible port.

Usually, that happens when you change the signature of a member (like renaming a field/property/method, renaming a class, changing the parameters of a method, or turning a field into a method or vice versa). If that is the case, there is nothing Bolt can do to catch up with your changes automatically: you have to tell it that the renaming happened. There is information about this Refactoring process in the manual here: https://ludiq.io/bolt/manual/scripting/refactoring

If your signature did not change at all and you're getting this issue, then the only probability, I think, is that this part of your code failed to compile. This could happen if you put it inside an assembly definition or a special editor folder. In that case, fix the compilation errors and the error should go away.

Let me know if that helps!