Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
It's easy to disallow the toolgun for it however - just check for vehicle_jeep which have a .ZAPC property I believe and then use GMod's vanilla hooks.
This is exactly what CPPI is for
http://facepunch.com/showthread.php?488410-Common-Prop-Protection-Interface-(CPPI)-v1.1
Every prop protection has it, here is its implementation in FPP:
https://github.com/FPtje/Falcos-Prop-protection/blob/master/lua/fpp/sh_cppi.lua
You are to use the ENTITY:CPPISetOwner(ply) function.
Now about it being "my responsibility": The APC is a standalone product. It doesn't require third party modules, never did, and I'm not going to start. Not every server uses prop protection (and in those two and a half years, nobody ever mentioned these issues you're currently having), so I would either need to add a check (which adds another point of failure/maintenance) to see if CPPI is available and if it is do stuff, or I require CPPI/equivalent to be installed.
It's "No" to both answers. I'm not going to create dependencies and I'm not going to start adding third party APIs unless 1) there's a very good reason, 2) there's a popular demand and 3) it's not possible to implement it outside the APC (as hook/patching) easily.
In this case, your solution likley has five lines of lua for the hook, a check if it's an APC and the call to CPPISetOwner.
There is still a problem though: your APC creates passenger seats in the ENT:Initialize method. You cannot expect FPP to hack into your entity to see if you're creating any extra entities. You also can't expect me to check for variables like ent.DriverSeat, ent.Turret and ent.GunnerSeat. That would only work for YOUR vehicle.
There's a standard for this, and it's called CPPI. All respectable prop protection mods support it. Making your APC compatible with all prop protections and none is as easy as:
Have some properties:
Now, on your worries:
There is. Your mod creates subentities that any prop protection cannot possible deal with unless specifically checking whether your addon is installed.
I am popular and I demand it, hahaha!
Yes it is, see code above. It's literally a copy paste job.
However, my stance remains. It's a design decision: The APC, for all intents and purposes, is supposed to work with vanilla content, containing vanilla content. My reasoning:
Your code is missing the passenger pods (the property Passengers, a table, each value being a passenger pod) but regardless, it's not about the effort to do it, it's about the code design.
I do see the issue however, namely that the APC currently has no interface for "What belongs to me", and could offer you a function on the SENT that returns a table containing all entities owned by the APC (and maybe another one for shot rockets if required). That would make wriitng the hook code a lot easier and robust because there would be a proper interface. But I won't mess around with CPPI myself. If CPPI for the APC is direly required, it should probably be done properly (up to the point where multiple functions in the APC's own hook system are wired to CPPI) and therefore in an own addon/workshop entry/autorun file.
You're also contradicting yourself:
You DON'T want to adhere to a recognised standard, but you DO expect me and every other prop protection author to hook to a function that you are "willing to provide" us because you don't want to implement 10 lines of harmless code? And you call that a "proper interface"!?
The code literally has 0 impact. The pseudo dependency is bulIsh¡t, the people who made the CPPI standard are actually competent people with university background. They wouldn't fu©k you over and break backwards compatibility. CPPI has updated several times, the latest update actually made that hook available. Each update was documented and did not break backwards compatibility.
If anyone ever complains to me that they can't pick up the APC, but can pick it up by the gun or by one of the passenger seats, I can now honestly say that it's not my damn responsibility. You refuse to make your crappy vehicle compatible with prop protections, giving weak xenophobic "not-invented-here" excuses about why you don't want any references to other people's work in your code. All while you expect me to specifically tailor FPP for your addon.
I'm not contradicting myself, I'm offering a compromise. I thought I've explained myself properly, but it's possible that my English is a bit rusty.
Honestly, I think it's kind of funny how you express my thoughts from the opposite point of view. The same way you don't think that FPP should have a special implementation for my APC, I think the APC shouldn't have a special implementation for CPPI/FPP. The cleanest and in my opinion only clean solution is to have a third, independent addon/script/whatever that ties the two things together. Because it's not my responsibility to deal with prop protection issues and it isn't CPPI's/yours to deal with APC problems.
It's the server's issues if I'm bloody honest. If you wish to use X and Y, you are to make sure that X and Y are compatible - if necessary with some glue in-between. It's unreasonable to expect all addons to work nicely together (as I've sadly found out with just this SENT alone).
I couldn't care less that CPPI is supposed to be a "standard" made by people with "university background" and a fancy PDF. I'm not going to implement specific, completely unrelated interfaces (unless the three points I've mentioned above are fulfilled - so far we're at two people, which I don't see as "popular demand", although they're quite loud). I'm offering an independent, stable interface that can be used for whoever needs access to APC resources for whatever reason. This can be CPPI, this can be someone who wants to color every entity on the server fuchsia. It's a more generic interface than "dude owns this entity". Basically, it's a promise I make: I offer you this interface, and I won't change it. So you can depend on it, no matter what update will come in the future.
You can't force people to adhere to "standards" (relevant xkcd[xkcd.com]). The world isn't a happy place where every addon in existance plays nicely with each other. There's bound to be conflicts and there's bound to be missing or incomplete support of things. This is one of these things.
So, I don't expect you to support the APC the same way I ask you to not expect me to support CPPI. Because quite frankly, that's none of our business. Unless you truly want to go around and force every addon in existance to implement CPPI, you're never going to get a fully working prop protection with every addon.
However, I think your paragraph raises some good ideas. I'll probably push an update later on to fix these issues. It's something that was overlooked on my part, I believe, but you really shouldn't be able to interact with any seat/pod nor the turret. Cheers.
http://facepunch.com/showthread.php?488410-Common-Prop-Protection-Interface-(CPPI)-v1.1
Oh yes, put the responsibility on the end user, because they should know how mods are implemented and modify that to make them work together because the author refuses to take responsibility.
Any API you can offer is NOT independent. It's just a ♥♥♥♥♥♥♥♥ API for your addon. All my addons already have APIs and I'm not asking you to use them. I'm asking you to comply with a ♥♥♥♥♥♥♥♥ standard. The only standard by the way, so that smug xkcd link is irrelevant.
Also, CPPI really is a standard. Look at big players like wire using it:
https://github.com/wiremod/wire/blob/082a58dd176e7e51c8a7a2f0a079e48917ffb132/lua/entities/gmod_wire_expression2/core/e2lib.lua#L697
This makes Wire E2 compatible with ALL admin mods. DarkRP uses it too, so you can replace FPP with any other CPPI compliant pp.
Either way. I guess I can live with your solution. It works.
As my final statement to this whole prop protection/tooling issue, I won't add third party interfaces (unless there's a dire need and so forth, see above) if the same thing can be achieved with tools already here.
It's not my responsibility, it's the user's (not end user, which I would consider people joining the server). If you want to combine mods, you can't expect them to work together flawlessly. In this case, I'm not publishing information that another service requires, hence said service doesn't work as you expect. I'm not doing that because I'm an evil person or a lazy bastard, I'm doing it because GMod itself doesn't have a concept of "ownership".
Your argumentation is flawed. If I buy a player (VCR, DVD, BluRay, - feel free to pick one or more) and a telly, it's neither the player nor the TV manufacturer's responsibility to connect them. They merely offer interfaces that you, as end user, are to connect yourself. I see the same here for a simple reason: It just can't be expected that something that was created completely independently suddenly needs to be compatible with something else.
I don't care how big CPPI is, or who uses it, or how exactly it can cure cancer, end hunger and achieve world peace. You can use my APC with CPPPI just fine, as you've shown yourself. The whole thing can be broken down to half a dozen lua lines, without any modification to the APC.
With that being said, I'll leave the thread open for comments, but in all likelihood won't post unless there's some grave change that justifies it. I'll repeat what I've said at the beginning:
If you wish to use prop protection with the APC, you ought to tell your prop protection what an APC is. Use the .DriverSeat/.APC properties to deal with it. If you have specific needs, the APC's custom ZAPC_CheckAccess hook allows fine-tuning of what tools are allowed even in environments without a prop protection addon.