Space Engineers

Space Engineers

Dispenser - ModAPI example
24 Comments
sssagatt 12 Jan, 2020 @ 2:30am 
Is this still works to somebody? I tried to make it same way as the video showes, but in Visual Studio there is not going to be blue some text which should: "mygamelogiccomponent"; "MyObjectBuilder_EntityBase". And also I can't found "VRage.Common.dll".
TheWorkingMan43 20 Jan, 2016 @ 1:49am 
Ore that you already have or free no mining ore?
Smokie 28 Dec, 2014 @ 2:25pm 
Mod no longer works.
BlazR 10 Nov, 2014 @ 2:11am 
I've made a few modifications and got a working version. For those who just want to use it for the dispenser function, I've published the working version here along with the patches in the changelogs so you can see how I modified the code.
Ferro 4 Nov, 2014 @ 7:05am 
Yeah this thing no longer works with the current version of Space Engineers
DeltaF1 28 Oct, 2014 @ 2:17pm 
@Hugo
Instead of throwing a NullReference, you can slo just do "return null;"
I got caught on that method too, and someone on youtube had to show me XD
Hugo the Dwarf 26 Oct, 2014 @ 11:09am 
Guess I figured it out, kinda.

public override MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false)
{
throw new NullReferenceException();
}

removes the errors and lets my code run now.
Hugo the Dwarf 26 Oct, 2014 @ 11:03am 
As of posting 26/10/2014, The example code in the video does not work, I do however checked my debug menu and found I had a few errors,

AppData\Roaming\SpaceEngineers\Mods\MyFirstMod\Data\Scripts\TestScript\TestScript\EvilSensor.cs(20,18) : error CS0534: 'TestScript.EvilSensor' does not implement inherited abstract member 'Sandbox.Common.Components.MyGameLogicComponent.GetObjectBuilder(bool)'

And when I impliment or override this method I'm not sure what to return for "MyObjectBuilder_EntityBase" I am brand new to this, and would love to start scripting for this game.
Davcrox 18 Oct, 2014 @ 3:02am 
not working in the last version of the game
Raszagal 12 Oct, 2014 @ 10:04am 
@CBFasi: it does still work, you need to move close and back out as the sensor needs to change it's state as shown by the color of it's display
tabpol95 25 Sep, 2014 @ 6:51pm 
could u make one that makes it so that connectors will only collect / dispence a certan item from storage? that is without having to interact with it.
CBFasi 25 Sep, 2014 @ 2:55pm 
No longer working in single player since last update :(
Vi 24 Sep, 2014 @ 11:23pm 
Hello Im The Doctor
Screaming Angels 20 Sep, 2014 @ 8:09pm 
Sadly I've just tested this wonderful example on a clean dedicated server, and it crashes it.
More here on the forums.
http://forums.keenswh.com/post/show_single_post?pid=1284380247&postcount=162
[DKS] Killaim 20 Sep, 2014 @ 5:01pm 
weird on multiplayer it spawns 2 ores one that can be picked up one that cant. the host of the server cannot see it (we are 2 players so some weird client/server issue?)
SRPSKI DOBROVOLJIC 20 Sep, 2014 @ 5:02am 
Stone Iron Nickel Cobalt Magnesium Silicon Silver Gold Platinum Uranium (Ice (mod))
Here's full list of ore's, for those who use other language in game.
RosenRitter 19 Sep, 2014 @ 3:02am 
did it work with components like explosive ?
plaYer2k 18 Sep, 2014 @ 5:05pm 
Small correction for my post below, the resulting path would of course be %appdata%\SpaceEngineers\Mods\315572550.sbm as i did forget the \Mods\ directory there.
plaYer2k 18 Sep, 2014 @ 1:48pm 
Yeah thanks for sharing, that example i was actually missing in the modding example guide over here:
http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=315625486

@ Kilero
It is located in %appdata%\SpaceEngineers\Mods under the name <WorkshopID>.sbm
So in this case, it is %appdata%\SpaceEngineers\315572550.sbm

@ Eigester
But we never have enough monneiz!!
Admiral Dayman 18 Sep, 2014 @ 1:01pm 
Where is the file located after i downloaded it?
TheDevi 18 Sep, 2014 @ 11:39am 
Good you added one for us to test good idea
Eikester 18 Sep, 2014 @ 10:30am 
Now add Money and add a if statement that checks if a user has enough money :D
rocketait 18 Sep, 2014 @ 10:24am 
Can't wait for update
Ondrej Petrzilka  [author] 18 Sep, 2014 @ 10:21am 
This will work after update 1.049