Medieval Engineers

Medieval Engineers

55 ratings
Remote Rope Control Component
   
Award
Favorite
Favorited
Unfavorite
Type: Mod
Mod category: script
Version: 0.7
File Size
Posted
Updated
23.711 KB
Nov 19, 2018 @ 4:01pm
Feb 17, 2024 @ 7:35am
34 Change Notes ( view )

Subscribe to download
Remote Rope Control Component

Description
This is for modders. It adds an easy to use component that allows you to recieve keybinding controls when the user is connected.

You can look at an example block that uses it in the Balloons mod. Search for the LockingPin.sbc and PAX_LockPin script

How to use:

Your block needs the following for this to work: UseObjectsComponent, ModelAttachmentComponent, EntityRopeComponent, RemoteRopeControlComponent.
And also your Control definitions

UseObjectsComponent:
Add <UseObject Dummy="detector_remoterope" Name="Generic" />
your model also needs the detector

ModelAttachmentComponent:
Add attachment with name: RemoteRopeControlComponent_sub
The model you can use is: Models\RemoteRopeControlComponent_sub.mwm
You can also use your own dummy rope model. The visual rope connection is optional

EntityRopeComponent:
This sets the visual rope connection, you can use any number of ropes. example:
<Connection From="RemoteRopeControlComponent_sub:detector_fakerope" To="detector_fakerope">
<RopeDefinition Type="RopeDefinition" Subtype="BasicRope" />
</Connection>
You can use your own detector names, added to the subpart model and the main model

Now the importart part, the RemoteRopeControlComponent

the channels:

<Channels>
<KeybindingChannel>
<ControlDefinitions>
<ControlDefinition>
<ControlDefinitionName>ControlDefinitionName</ControlDefinitionName>
<InputState>Pressed</InputState>
</ControlDefinition>
</ControlDefinitions>
</KeybindingChannel>
</Channels>

You can add any number of channels, and each channel can have any number of keys. You enter the name of the control definition and the input state (Pressed, Down, Up, Released, Any)

variants:

<VariantsSubTypeId>
<Variant>BlockB</Variant>
<Variant>BlockC</Variant>
</VariantsSubTypeId>

If you have one or more block variants that you want able to be connected, put them here. This is optional

<MaxRange>50</MaxRange> -> this is the distance at which the connection will be disconnected
<Inverted>false</Inverted> -> this will invert the first 2 keys added to a channel

Control definition example:

<Definition xsi:type="MyObjectBuilder_ControlDefinition">
<Id Type="MyObjectBuilder_ControlDefinition" Subtype="TheNameYouEnterInTheComponent" />
<DisplayName>Channel X - DoStuffOnKeyPress</DisplayName>
<Category>RemoteRopeCategory</Category>
<Primary Key="Y" />
</Definition>

the RemoteRopeCategory has been added to this mod. You can use it if you don't want your own category or don't want to use vanilla ones


YOUR SCRIPT:

The component will send events of the pressed keys.
To subscribe to these you must find the MyRemoteRopeControlComponent in your block container and subscribe to the OnControlRecieved event. The event will send a short variable containing the key number that was pressed and a short variable containing the current channel.

the MyRemoteRopeControlComponent is found in the Pax.RemoteRope namespace

If you need any custom behaviour, feel free to copy the code to your own mod, or ask me to add it to the component.
17 Comments
Mr.Rick Mar 1 @ 12:44am 
thank you very much
peaceman  [author] Feb 28 @ 3:12pm 
The camera block? Press F6 to return to your normal view
Mr.Rick Feb 28 @ 2:34pm 
im stuck in the cannon scope
peaceman  [author] Feb 11 @ 12:27pm 
When you get in a chair the ropes go invisible. The ropes are really just a way to see what your connected to. The original idea behind it was for the control drums where you had 2 ropes in your hand to rotate the drum. But for a lot of other blocks it doesn't really make a lot of sense
cascarrabias Feb 10 @ 5:54pm 
has anyone tried to make a mod to hook up these control ropes to a block, which you can interact with to trigger/toggle/throttle whatever is attached to the rope? It just feels weird to have the player juggle like 15 ropes to drive a vehicle LMAO :p
garyp156 May 9, 2020 @ 7:57am 
Hey @peaceman. Thank you so much for this link!!! It's working awesome!
It's finding and downloading the mods excellently!!!
garyp156 May 6, 2020 @ 11:40am 
Cool! I'll try these. Thank you.
peaceman  [author] May 6, 2020 @ 10:48am 
get these fixes: http://deepflame.nl/medieval/medieval_fixes.html
it has fixes for the download problem and some other minor fixes. Just download those files and overwrite the files in this folder: steamapps\common\MedievalEngineers\Bin64
Kill3rCat [1st FORECON] May 6, 2020 @ 9:57am 
Just keep trying. :)
garyp156 May 6, 2020 @ 9:56am 
Sorry, @peaceman, not on mine PC. When I add the mod to the save, then go back, exit the game, then wait a few, run the game again, Windows 10 says app running. I have to go into the task manager and remove it before it will restart the game.
After that, when I restart the game, then go to Load then choose the game save, it sits on Downloading mod x of x again. :(
Any help would be awesome.