Space Engineers

Space Engineers

评价数不足
[Dawese] Roleplay Lockpicking
   
奖励
收藏
已收藏
取消收藏
Type: Mod
Mod category: Block, Script
标签: ServerScripts
文件大小
发表于
更新日期
1.874 MB
3 月 21 日 上午 5:37
10 月 21 日 上午 5:51
7 项改动说明 ( 查看 )

订阅以下载
[Dawese] Roleplay Lockpicking

描述
!!! BETA-VERSION (STABLE) !!!

!!! CONTAINS API FOR INTEGRATION IN OWN MODS !!!

Description
This mod allows you to place or find special freight containers, which can be locked or unlocked by lockpicking them!

The lockpicking is done by solving a little role-playing minigame.

Tired of going to space for platin and uranium? Find it in little chunks in loot boxes anywhere (if you embed it into your mod)!

Loot can contain: Platin, gold, silver, uranium, space credits.

Primarily made for my roleplay mission mod: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=3458555164

Features
  • A new block "Lockpickable Freight" which can be placed by the player on large grids or can be spawned by the API in your own mod.
  • Custom terminal actions embedded into the original system of SE.
  • Random generated loot if the block is created by the API and not by the player.
  • Help dialog containing a guide how to lockpick the lock.

How to use
  1. Open the terminal of any "Lockpickable Freight" block.
  2. Access the terminal of the block to lock or unlock its inventory.
  3. Close and reopen the terminal/inventory after lockpicking the freight to get access to the inventory.


Future features
  • No more reopening the terminal for accessing the loot.

API class for integrating the spawning in your mod

using System.Collections.Generic; using Sandbox.ModAPI; using VRageMath; namespace Dawese_Roleplay_Lockpicking { public class DaweseRoleplayLockpickingModApi { /// <summary> /// Spawns a lockpickable freight containing generated loot.<br/><br/> /// Example with loot table content string "pgssuc":<br/><br/> /// The used characters in the loot table string describe the possible items of the loot. <br/> /// 'p'= 1 Platinum ingot<br/> /// 'g'= 1 Gold ingot<br/> /// 's'= 2 Silver ingot<br/> /// 'u'= 1 Uranium ingot<br/> /// 'c'= 5000-7000 Space credits<br/> /// <br/> /// The amount of the used characters describe the chance that the item is generated.<br/> /// Examples: "pgsuc" puts everything equally into a bucket - 20% chance for each item. "pppuu" puts 60% platinum and 40% gold into a bucket.<br/><br/> /// /// The variables minLootStacks and maxLootStacks determine how often the system is grabbing into the bucket for getting loot items.<br/><br/> /// </summary> /// <param name="spawnPosition">Describes the spawn position.</param> /// <param name="minLootStacks">Minimum amount of generated stacks for loot.</param> /// <param name="maxLootStacks">Maximum amount of generated stacks for loot.</param> /// <param name="lootTable">Describes the loot table as string.</param> /// <param name="appendedToBattery">Appends the block to a battery block so it doesn't get removed by the games trash removal.</param> /// <param name="factionOwnerTagKey">The tag of the owner faction.</param> public static void spawnLockpickableFreight( Vector3D spawnPosition, int minLootStacks, int maxLootStacks, string lootTable, bool appendedToBattery = false, string factionOwnerTag = null) { Dictionary<string, object> payload = new Dictionary<string, object> { { spawnPositionKey, spawnPosition }, { minLootStacksKey, minLootStacks }, { maxLootStacksKey, maxLootStacks }, { lootTableKey, lootTable }, { appendedToBatteryBlockKey, appendedToBattery }, { factionOwnerTagKey, factionOwnerTag } }; MyAPIGateway.Utilities.SendModMessage(modIdForMessageApi, payload); } public static void spawnLockpickableFreight(Vector3D spawnPosition) { spawnLockpickableFreight(spawnPosition, 3, 6, "ppggssuucccc", false, null); } public static void spawnLockpickableFreightWithBattery(Vector3D spawnPosition, string factionOwnerTag) { spawnLockpickableFreight(spawnPosition, 3, 6, "ppggssuucccc", true, factionOwnerTag); } //=========================================== // Don't touch. ;) //=========================================== public const long modIdForMessageApi = 3448904606; public const string spawnPositionKey = "spawnPositionKey"; public const string minLootStacksKey = "minLootStacksKey"; public const string maxLootStacksKey = "maxLootStacksKey"; public const string lootTableKey = "lootTableKey"; public const string appendedToBatteryBlockKey = "appendedToBatteryBlockKey"; public const string factionOwnerTagKey = "factionOwnerTagKey"; } }


Discord server
https://discord.gg/2vtAxgdmQ2


Mod License

License Terms

1. Usage Rights
- The use of this mod is permitted under the conditions of this license.

2. Restrictions
- **No Reupload**: It is not allowed to reupload this mod, neither in its original nor in a modified form.
- **No False Authorship**: This mod may not be claimed as your own work.
- **Integration into Other Mods**: If this mod is integrated into or used as part of another mod, the original creator must be clearly credited and linked.
- **Intellectual Property**: The entire content of this mod is and remains the intellectual property of the original creator.
- **No Commercial Use**: It is not allowed to make money in any way using this mod.
- **Content Utilization**: Any utilization of the contents of this mod is only permitted if explicitly acknowledged. The original creator remains the intellectual property owner of this API as well.

3. Disclaimer
- This mod is provided without any warranties. The creator is not liable for any damages that may arise from its use.

---
© [2025] [Dawese / not4you403 / clickbait_virus]
9 条留言
not4you403  [作者] 10 月 21 日 上午 5:52 
Version 2.1.4 is released.
- Fixed new audio error.
not4you403  [作者] 9 月 21 日 上午 3:32 
Version 2.1.3 is released.
- Converted audios to mono.
- Game doesn't crash anymore.
TheRanker 9 月 20 日 上午 10:56 
this audio error thats been reported... crashes single player on load.. and crashes on DS.

unable to use this mod and its dependants as it currently stands.
not4you403  [作者] 9 月 20 日 上午 1:19 
@Trixey:
Thank you for your feedback!
This error occurs, because the audio files are in stereo and not in mono. It shouldn't affect the game because the error is in reality a warning.
Going to fix this tomorrow!
Kind regards
Trixey 9 月 14 日 下午 6:30 
Appreciate the time and efforts you and all Modder's add to the games we play.
Noticed this morning a couple of server errors.

MOD_ERROR: [Dawese] Roleplay Lockpicking
MyAudio.LoadData - START
MyAudio.CreateX3DAudio - Device: default - Channels #: 8 - Sample rate: 44100
- in file: \3448904606\Data\Audio.sbc
3D sound 'Dawese_Sound_unlocked_pin' \3448904606\Audio\unlocked_pin.wav' must be in mono, got 2 channels

- in file: \3448904606\Data\Audio.sbc
3D sound 'Dawese_Sound_unlocked_lock', 3448904606\Audio\unlocked_lock.wav' must be in mono, got 2 channels
MyAudio.LoadData - END
not4you403  [作者] 9 月 7 日 上午 5:22 
Version 2.1.2 is released.
- Fixed chat commands.
- Fixed a null error when spawning via API.
not4you403  [作者] 7 月 19 日 上午 2:36 
@S Boogy:
Thank you, glad to hear that!
Good idea to implement it as small grid.
The battery is necessary because the original game thinks, "oh that block has no logic and is to far away, it must be trash so I'm gonna delete it".
It's a separate grid so it can spawn on top or in a prefab at a random point.

I'm going to think about that. Small grid version is very good, because it's harder to find then! The drop pod idea is great too.

Kind regards!
S Boogy 7 月 18 日 下午 6:57 
Thanks for tweaking this, glad these are spawning with your mission mod.

an observation/feedback: when the lootboxes spawn its literally just a non-static large grid battery and a crate(unless another mod i'm using is interfereing, haven't tested that yet). It works but it can look silly sometimes. have you thought about small grid implementation?

You could probably re-skin lockable crates to use barrels or other small grid containers then the mod could implement drop pods that deploy once the mission is completed with the mission rewards and a little bonus? just a thought if that fits in to the vision of your mod, could be more immersive vs spawning rewards in inventory. Otherwise, great work on the mod and glad it works with the missions :)
not4you403  [作者] 7 月 13 日 上午 9:02 
New release out there. The API changed a little bit.