The purpose of SkookumScriptClassData


#1

I am not sure I understand (or partially understand) the purpose of SkookumScriptClassData.

In the Wombat (twin stick shooter) example, if I remove SookumScriptClassData, nothing bad happens. However, if I give it the name of another class in the Script > Script Actor Class Name then that particular class (i.e. not PlayerOnePawn) is initialized (i.e. the constructor called) and an error:

Class ‘PlayerOnePawn’ has data but UObject has no embedded instance

which makes sense, that :sk: is not able to connect the UObject with its :sk: counterpart. So my guess is that:

  • the SkookumScriptClassData is needed as a mechanism for :sk: to initialize/de-initialize through the :ue4: components interface.
  • if Script > Script Actor Class Name is left blank, the :sk: class picked will be the same as the :ue4: BP name

If all that is correct:

  • why would I ever specify a different script class in the SkookumScriptClassData component?
  • how come removing the SkookumScriptClassData component has no effect (I expect PlayerOnePawn to stop working completely but that’s not the case)?

#2

This is a good question, I was wondering if basically the SkookumScriptClassData component is mainly to get the SkInstance of the actor as follows?

get_sk_actor_instance

Does that make sense?


#3

That’s what I thought as well. However, if you remove the component from the Wombat example, everything still works.


#4

That is because since the SkookumScriptClassData component was introduced we changed how the SkInstance is stored which is now stored inside the UObject, so the SkookumScriptClassData component is no longer necessary.