-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Vehicle Inputs To Cam Controllers And EGP Huds #3263
Conversation
Adds a "Vehicle" input to Cam Controllers and EGP Huds, inline with Pod Controllers. I understand this is somewhat redundant for Cam Controllers but I feel it's relevant. I am working on some addon stuff where a seat may not exist on spawn (generated by another entity). In this case, wire I/O is a reliable way to persist linkages through dupes.
Can 'Vehicles' entity array input be used instead? You can add that to the egp hud. |
Could I do this:
If absolutely need be I can avoid adding that "redundant" input to pod controllers but I believe it would be more accessible if they all could use the same 'Vehicles' input. |
Instead of adding 'Vehichle' to Cam Controllers and EGP
fa30bf4
to
96eb533
Compare
There is no real reason to add Vehicle input to hud/cam, as you already can set a single vehicle manually, and when you want to set a vehicle programmatically or via gates - you always have access to arrays |
The reason I want to add a vehicle input is for accessibility reasons. I have an entity that creates a seat on spawn that's intentionally meant to be invisible to the player, but intended to be used in contraptions. Because the seat is generated by another entity on spawn and is not duplicateable, it also cannot be linked to via the normal wire link system. I can output the seat from the entity as a wire output, which would be more accessible than forcing everyone using the addon to need to use a chip for this. |
looks good I think. I can fully review tomorrow |
lua/entities/gmod_wire_pod.lua
Outdated
@@ -471,6 +472,12 @@ function ENT:TriggerInput(name, value) | |||
if value:IsNPC() then return end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update this to use the TypeID and IsValid check, instead of IsPlayer IsNPC? All the rest of the code looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should work now. Apologies for the delay.
lua/entities/gmod_wire_pod.lua
Outdated
@@ -468,8 +468,8 @@ function ENT:TriggerInput(name, value) | |||
self:SetShowCursor(value) | |||
elseif name == "Vehicle" then | |||
if not IsValid(value) then return end -- Only link if the input is valid. That way, it won't be unlinked if the wire is disconnected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which line are you referring to? I am having a skill issue. Line 470?
Adds a "Vehicle" input to Cam Controllers and EGP Huds, inline with Pod Controllers.
I understand this is somewhat redundant for Cam Controllers but I feel it's relevant.
I am working on some addon stuff where a seat may not exist on spawn (generated by another entity). In this case, wire I/O is a reliable way to persist linkages through dupes.