Gravity Hull Designator problem

Hello,
I downloaded the GHD today, and I have been searching for a solution to my problem:
When I spawn a spaceship (I have SB3) and try to use the GHD, i start getting this error message all the time:

gravityhull/cl_main.lua:253: attempt to call method ‘GetBoneCount’ (a nil value)
gravityhull/cl_main.lua:253: attempt to call method ‘GetBoneCount’ (a nil value)
gravityhull/cl_main.lua:253: attempt to call method ‘GetBoneCount’ (a nil value)
gravityhull/cl_main.lua:253: attempt to call method ‘GetBoneCount’ (a nil value)
gravityhull/cl_main.lua:253: attempt to call method ‘GetBoneCount’ (a nil value)

And if I step into the spaceship I get teleported somewhere into space and if I don’t delete the spaceship with GHD, the game crashes.

Pls somebody help me, It’s a great mod and I’d like to use it on my server!

Thanks!

GetBoneCount is a method of the Entity class. Whatever object on line 253 that is calling that function is probably not an entity which is why it says it is a nil value. I don’t have the script to be able to tell why that is happening. If you want to pastebin that script and post a link I’ll look at it.

Thanks a lot for your reply!
Here’s the link to the cl_main.lua file:

Your welcome!

Bad news though, this is a complicated issue. I will need to look at the data that is running through the SLShipContents function to determine what needs to be done to fix this. Do you have this on a server already? If so, I can figure this out on there. I need the same environment you were in when you experienced the error to get the data I need.

I have somewhere I have to go now so I can’t do this right now. I’ll be back on in a few hours, if your still online we can look at this then.

Sorry, no i don’t have this on an online server, but the thing is that it doesn’t matter if im playing sp or mp (I’ve tried playing on many different maps too, including gm and sb maps, no difference…always the same error), i’ve tried to play on a lan server with my friend, but we both get the error…

You will always get the error no matter where its played, whether its a map, in singleplayer, or on a multiplayer server. That’s not relevant to the problem.

The function SLShipContents takes in a table of entities and loops through it, doing many checks on each one. One or more of the values in that table are not valid entities or they are some other type of object that doesn’t support the GetBoneCount method. The only way for me to figure out what value is causing it is for me to replicate the problem myself, so I can get those values. Do you catch my drift?

O I see, yes I do understand now, but now I have made some progress: I decided to reinstall gmod (once again…), and after that I have been able to use the GHD on some small props, but It still doesn’t work on big props or entities… And now I’m not receiving that 253 error, now it’s

addons\gravityhull\lua\gravityhull\sv_main.lua:470:attempt to call method ‘GetGravity’ (a nil value)

This error pops up right away when I step on a big prop or entitie, and I get teleported somewhere into space (in sb maps). But this error message is blue and it only comes once.
This problem is really frustrating…

Here’s the link to the file:

Thanks!

Go to line 470 and insert a new line before it. Add in


print(p)

Do whatever you did to produce the error then go to your console and tell me what it says above the error line.


print (p)  p.OldGravity = p:GetGravity()

Is that what you mean? After all I’m a noob with all this :rolleyes:
If it is, I still just got this in the console


 addons\gravityhull\lua\gravityhull\sv_main.lua:470: attempt to call method 'GetGravity' (a nil value)]

What is it suppose to say above the error?

You should have a message above that error. It should be your player entity object, but in your case it wont. I need to know what it says.

Also I wanted you to insert a new line before it.



print(p)
p.OldGravoty = p:GetGravity()


No need for that one anymore.
One of my friends came by and he fixed the error! I have no clue what he did, but the GHD is now working :dance: But I do really appreciate your help! Thanks!