EveronLife icon indicating copy to clipboard operation
EveronLife copied to clipboard

Vehicle Locking & Inventory Locking

Open njbrown09 opened this issue 2 years ago • 10 comments

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:

  1. Create a variant of the vehicle for everon life
  2. Add the component EL_VehicleLockComponent to the vehicle as shown in this image: image
  3. Remove any text inside the "Debug Identifier" on the EL_VehicleLockComponent component. This is purely for making keys without the use of code.
  4. Add EL_VehicleInventoryStorageAccessControl the same way EL_VehicleLockComponent was added.
  5. Add the "Lock/Unlock" action to the vehicle. Position does not matter, but for this example i will be using the door handle. image
  6. Add the "vehicle_lock" context to additional actions. image
  7. Replace the default open storage action with EL_OpenVehicleStorageAction as shown below: https://gyazo.com/5992f8e8bf45f37929b4ad6bec9fc22e
  8. Done!

Key Setup:

  1. Create your inventory item
  2. Add EL_VehicleKeyComponent to the key entity.
  3. Done!

njbrown09 avatar Jun 01 '22 21:06 njbrown09

@Arkensor when persistence is added, the persistence id should be used instead of the ID currently used in the lock script.

njbrown09 avatar Jun 01 '22 21:06 njbrown09

@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 avatar Jun 02 '22 09:06 SaxW

@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:

  1. 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.
  2. The name EL_VehicleKeyComponent was primarily for the script. You would want to call the model itself only something like VehicleKey. Please include the .fbx and .tiff texture maps in assets/model/VehicleKey. The xob + data go into src/Assets/Items/Vehicles/VehicleKey and the prefab for it could be saved as src/Prefabs/Items/Vehicles/VehicleKey.et

Arkensor avatar Jun 02 '22 09:06 Arkensor

@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 avatar Jun 02 '22 10:06 SaxW

@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 avatar Jun 02 '22 11:06 Arkensor

@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

SaxW avatar Jun 02 '22 11:06 SaxW

@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.

Arkensor avatar Jun 03 '22 15:06 Arkensor

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 05 '22 18:06 CLAassistant

Key Item has been added.

njbrown09 avatar Jun 05 '22 18:06 njbrown09

@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?

jasper-one avatar Jul 06 '24 13:07 jasper-one