EveronLife
EveronLife copied to clipboard
Vehicle Locking & Inventory Locking
I have completed the code to allow vehicles to be locked with a key, as well as access control for storage.
Vehicle inventories are locked via this inventory access control. Vehicle inventories are the exact same as any other item that has storage.
Vehicle Setup:
- Create a variant of the vehicle for everon life
- Add the component EL_VehicleLockComponent to the vehicle as shown in this image:
- Remove any text inside the "Debug Identifier" on the EL_VehicleLockComponent component. This is purely for making keys without the use of code.
- Add EL_VehicleInventoryStorageAccessControl the same way EL_VehicleLockComponent was added.
- Add the "Lock/Unlock" action to the vehicle. Position does not matter, but for this example i will be using the door handle.
- Add the "vehicle_lock" context to additional actions.
- Replace the default open storage action with EL_OpenVehicleStorageAction as shown below: https://gyazo.com/5992f8e8bf45f37929b4ad6bec9fc22e
- Done!
Key Setup:
- Create your inventory item
- Add EL_VehicleKeyComponent to the key entity.
- Done!
@Arkensor when persistence is added, the persistence id should be used instead of the ID currently used in the lock script.
@njbrown09 just confirming I've done this correctly for you? Not familiar with forking branches in Github https://github.com/SaxW/EveronLife-adding-car-key-model/tree/adding-vehicle-key-component
@SaxW I think this could generally work yes. You would file a pull request for @njbrown09's repository into the branch he is working on called Vehicle-Locking-Clean and with that, the change would arrive here as well.
Just some minor comments on the model:
- Did you use .tiff for the texture source files before importing them into the Workbench? if not try that, they might reduce the file size.
- The name
EL_VehicleKeyComponent
was primarily for the script. You would want to call the model itself only something likeVehicleKey
. Please include the.fbx
and.tiff
texture maps inassets/model/VehicleKey
. Thexob
+ data go intosrc/Assets/Items/Vehicles/VehicleKey
and the prefab for it could be saved assrc/Prefabs/Items/Vehicles/VehicleKey.et
@Arkensor done. It was 394kb for the base color texture and 184kb for the RGB_ALPHA so I've lowered the texture size to 128x128, but it looks like mario 64 - what file sizes should we be working with?
@SaxW yeah 128 might be too low. Have you tried 256 and chosen LZW compression on the tiff export? We are still figuring out good guideline values for low file size objects. So we need to experiment around :)
@Arkensor I believe so. I'm exporting 8bit tiff from substance painter. 128x128 was <150kb, the same process at 256x256 was 500 kb, not sure how that math even works haha
@njbrown09 Check out the license plate system that got merged. We modified the base prefab for vehicles to add something like the lock component by default to all prefabs. I think this would be a good solution for your system as well. Let me know when you had time to look into that and the other PR notes that are still open.
Key Item has been added.
@njbrown09 Hey just wanted to wake this up and wanted to see if you would be able to reflect Arks changes and then get this upto date with main?