Garry's Mod

Garry's Mod

Star Wars Vehicles: EU Pack
NeonTheCoder 30 Mar, 2019 @ 5:38am
Speeders having major issues, (Invisible, LUA barf in console.)
Since this was more recently updated than the original Star Wars Vehicles and their "offical" content I will repost this here because it applies to these vehicles too.

I don't know if you are currently actively developing for Garry's Mod considering the last update was almost a year ago, however I have discovered an issue that seems to be persistent in all of the vehicles that are "speeders"

What prompted me investigating was two bugs.
1. Some vehicles would be Invisible however their shadow still existed, and the vehicle still "worked"
2.The game warned of LUA errors from the mod, and the errors were saying "attempt to index field 'BaseClass' (a nil value)"

I extracted an addon speeder that has this issue, the SWTOR Executive Speeder.

I examined the LUA and the error was in the ENT:Think section under the if CLIENT section

It was self.BaseClass.Think(self) erroring

I looked side by side with a fighter vehicle and the if CLIENT section, it appeared that the function ENT:Initialize() was missing.

I tried writing in the client section
"
function ENT:Initialize()
self.BaseClass.Initialize(self);
end
"
However this did not solve either issues.

I looked further and discovered that the Draw function was also missing

so I took and added this function in the client section
"function ENT:Draw() self:DrawModel() end"
This fixed the invisibility issue, however it was throwing even more LUA errors, but it was still drivable despite the only audio being the boost audio, driving it also made ULIB throw errors as well.

Hopefully you would be able to fix this issue as it is for EVERY vehicle that is using the base_speeder LUA class, (I tried singling this out as a conflict issue but it persisted when I made a copy of the class in the extracted folder and renamed it in the lua and the file itself.)

Not sure if you would be able to fix this, but I can't find anything about this anywhere else and I am not very famiilar with LUA/Gmod coding.