Team Spartan Cookies & Milk Forums
ShipCore:getShipSize() returning nil values ! - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: ShipCore:getShipSize() returning nil values ! (/thread-1136.html)



ShipCore:getShipSize() returning nil values ! - Yuri6037 - 25-07-2015

Hello all,

So this time there is a simple question to ask, no explanations needed.

Is it normal that the ShipCore:getShipSize() method returns nil values as min vector and max vector ?

The code I'm using is :
Code:
local mi, ma = Ship.Core:entity():getShipSize() print(mi) --Printing nothing corresponding to nil value print(ma) --Printing nothing corresponding to nil value --local mic = Ship.Shield:entity():LocalToWorld(mi) This is for future integration, desactivated because LocalToWorls does not exist (I'll again need to --recreate the function) --local mac = Ship.Shield:entity():LocalToWorld(ma) This is same for a future integration so don't make attention. ShipSize = {Min = mi, Max = ma} local x = ShipSize.Min.x --Yay crash because ShipSize.Min = nil !!

(25-07-2015, 10:06 AM)Yuri6037 Wrote: Hello all,

So this time there is a simple question to ask, no explanations needed.

Is it normal that the ShipCore:getShipSize() method returns nil values as min vector and max vector ?

The code I'm using is :
Code:
local mi, ma = Ship.Core:entity():getShipSize() print(mi) --Printing nothing corresponding to nil value print(ma) --Printing nothing corresponding to nil value --local mic = Ship.Shield:entity():LocalToWorld(mi) This is for future integration, desactivated because LocalToWorls does not exist (I'll again need to --recreate the function) --local mac = Ship.Shield:entity():LocalToWorld(ma) This is same for a future integration so don't make attention. ShipSize = {Min = mi, Max = ma} local x = ShipSize.Min.x --Yay crash because ShipSize.Min = nil !!

Strange now today, the values prints correctly !
Well yesterday evening it wasn't working, now it works...


RE: ShipCore:getShipSize() returning nil values ! - Person8880 - 25-07-2015

There's no way it can be returning nil values. It creates new vectors every time to populate with the current size values. The only explanation would be GMod's Vector type returning nil on creation, which would be a very weird bug and should break a lot more than one Starfall method.