0
Fixed

Execute Action Through Code.

Harley Torrisi 1 month ago in Game Creator updated by Marti (Lead Developer) 1 month ago 1

Hey,

Not sure if this is a bug. But I was having issues with combining code and GameCreator.

Creating an RTS module for GameCreator. I have some classes with public Actions lists. The player can put actions there, on certain conditions defined by the RTS module. Those will be invoked.

I am using a combination of  Execute() and ExecuteWithTarget()

Each Actions item has its own bool value asking if the player wants to send the target. I'm not sure what target does, right now I'm only guessing its to do with the invoker.

So, handling a MoveCharacterTo action through GameCreator only works fine. But not with Executing through code.

I got up to switch (this.variable.GetVariableDataType(invoker)) of the GetTarget() function in ActionCharacterMoveTo.cs before it broke on me. Line 133.

GetVariableDataType() fails to process invoker. I don't know how I'm doing this wrong, it seemed like Execute() was a straight forward and easy function to call.


Anyways, In the meantime, I have amended ActionCharacterMoveTo.cs to get me through. But hopefully, someone can tell me if this needs a fix, or how I am meant to execute properly.

I added this to the above-mentioned switch temporarily. 

Unity version:
2018.4.13
Game Creator version:
1.0.7

Answer

Answer
Fixed

Hi Harley!

I forgot to update this topic, as we discussed it via Discord. This error should be fixed in Game Creator version 1.1.2, so I'm closing it. If there's any further issue, feel free to drop a line below and I'll reopen the ticket.

Cheers!

PS: Without getting into details, the problem was that the Invoker game object was being used as the direct target of the Actions, ignoring the settings of the Local Variable (which can be set to Invoker, Game Object, ...). This caused the Variable system to try to access a Local Variable from another object other than the desired target, hence returning a null value.

Answer
Fixed

Hi Harley!

I forgot to update this topic, as we discussed it via Discord. This error should be fixed in Game Creator version 1.1.2, so I'm closing it. If there's any further issue, feel free to drop a line below and I'll reopen the ticket.

Cheers!

PS: Without getting into details, the problem was that the Invoker game object was being used as the direct target of the Actions, ignoring the settings of the Local Variable (which can be set to Invoker, Game Object, ...). This caused the Variable system to try to access a Local Variable from another object other than the desired target, hence returning a null value.