Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
156 stars 51 forks source link

findComponent by class #181

Closed kfpopeye closed 2 years ago

kfpopeye commented 2 years ago

What is the secret to finding components by class? The following code all returns nil.

splitters = component.proxy(component.findComponent(CodeableSplitter_C))
print(splitters[1])

splitters = component.proxy(component.findComponent(CodeableSplitter))
print(splitters[1])

splitters = component.proxy(component.findComponent("CodeableSplitter_C"))
print(splitters[1])

splitters = component.proxy(component.findComponent("CodeableSplitter"))
print(splitters[1])
Panakotta00 commented 2 years ago
splitters = component.proxy(component.findComponent(findClass("CodeableSplitter")))
print(splitters[1]) 

You have to use the internal name shown in the reflection viewer. (The italic name without any spaces)

kfpopeye commented 2 years ago

Thanks. findClass() was what I was missing.