fordhamflash Posted July 22, 2019 Share Posted July 22, 2019 Just when I thought I was making a ton of progress - whammy! I keep getting the "command is uncallable from remote" error even though I have added callable(namespace."blah blah") command. Even when I try to make the function callable, I am still getting the uncallable error message and broken function. Any ideas? Link to comment Share on other sites More sharing options...
fordhamflash Posted July 22, 2019 Author Share Posted July 22, 2019 Also, when it seems that I get past the "callable" error, I am then getting a "nil value" in the function error. Basically, using the "debug" menu as a template, I've created a window with two combo boxes - one for torpedo type and the other for warhead type. torpedoBodyCombo = tab:createComboBox(Rect(vec2(100, 100), vec2(350, 125)), "onTorpedoBodySelect") torpedoWarheadCombo = tab:createComboBox(Rect(vec2(450, 100), vec2(700, 125)), "onTorpedoWarheadSelect") function AdvancedCommands.onTorpedoBodySelect() local torpedoBodyType = torpedoBodyCombo.selectedIndex + 1 print(torpedoBodyType) end function AdvancedCommands.onTorpedoWarheadSelect() local torpedoWarheadType = torpedoWarheadCombo.selectedIndex + 1 print(torpedoWarheadType) end function AdvancedCommands.onTorpedoBuildPressed() invokeServerFunction("onTorpedoBodySelect", "onTorpedoWarheadSelect") local torpedoBodyType = torpedoBodyCombo.selectedIndex + 1 local torpedoWarheadType = torpedoWarheadCombo.selectedIndex + 1 print(torpedoWarheadType) print(torpedoBodyType) local ship = Entity() local launcher = TorpedoLauncher(ship.index) if launcher == nil then return end local x, y = Sector():getCoordinates() local torpedo = AdvancedTorpedoGenerator.generate(x, y, nil, nil, torpedoWarheadType, torpedoBodyType) --for i = 1, 10 do launcher:addTorpedo(torpedo) --end end callable(AdvancedCommands, "onTorpedoBodySelect") callable(AdvancedCommands, "onTorpedoWarheadSelect") Link to comment Share on other sites More sharing options...
fordhamflash Posted July 23, 2019 Author Share Posted July 23, 2019 For the life of me, I cannot figure this out. Once I even get close to working, then the torpedo launcher stops working properly. So frustrating. Link to comment Share on other sites More sharing options...
Hammelpilaw Posted July 23, 2019 Share Posted July 23, 2019 Please add client and server logs to make other people able to help you. Without logs and only code snippets that is very hard. Link to comment Share on other sites More sharing options...
fordhamflash Posted July 24, 2019 Author Share Posted July 24, 2019 Of course. Just a frustrating few days. So I went back and started reading about entity component systems basics. Clearly the source of my problems. I have figured out how to generate torpedoes and load up my ship no problem. I have made "custom torpedoes" which are a heck of a lot of fun. But I can only generate "pre-determined" combinations of torpedo types and warheads. So I am trying to create an interface where the player can select a torpedo type and warhead type and then build torpedoes. I think my struggles relate to the very nature of the entity component systems itself. (1) My lua file contains a function for a UI with combo boxes and build button. (2) My lua file contains a function for generating the torpedoes. Is each function a separate script which are attached to different objects? Is the entire lua file a single script that is attached to an object? To which object(s) are they attached and how the heck is that done? How do I get variables from one function to another? Anyway, I am going to continue to read on to try to get a better grasp on this. Link to comment Share on other sites More sharing options...
fordhamflash Posted July 24, 2019 Author Share Posted July 24, 2019 So I have attached my two most recent client logs and server logs from tonight. Reading up on ECS was VERY helpful. At this point, I stil have the problem of the torpedo launcher not loading. In looking over the logs, it looks like "MY" torpedo generator is creating some type of object error while the ENTITYDBG generator does not. I suspect this explains the problem but is over my head at this time. Any help would be greatly appreciated. I think I'm on hour 184 on this little project of mine! clientlog_2019-07-24_02-43-53.txt clientlog_2019-07-24_00-06-58.txt serverlog_2019-07-24_02-44-11.txt serverlog_2019-07-24_02-40-08.txt Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now