Jump to content




[MC 1.7.10][CC 1.74] RandomPeripherals, read NBT data from every item and more

peripheral utility turtle

43 replies to this topic

#1 redstoneduck

  • Members
  • 20 posts

Posted 22 October 2014 - 07:40 PM

Random Peripherals


Random Peripherals is an CC addons mod, which adds some random peripherals like a hologram projector, an dispenser Turtle or a computer controlled interface for items, fluids, energy and peripherals to the game(Thats almost everything what the mod adds).

I'm trying to update as quickly as I can, when major bugs apear or CC updates, but I can't warrant for anything

Download links, the license and the wiki

Images(yes, I finally know how I can add spoilers!)
Spoiler

Edited by redstoneduck, 29 September 2015 - 08:57 PM.


#2 redstoneduck

  • Members
  • 20 posts

Posted 11 December 2014 - 10:09 PM

The mod and I aren't dead. In the last 1-2 weeks I updated and improved the mod, so a new version of the mod will available soon with:
-All APIs will be updated, so when the new update will be released in a few, make sure you are using the latest version of CofhCore and all other mods which require CoFHCore
-A new Turtle Upgrade, the Dispenser Turtle will be available, which acts just like a Vanilla Dispenser, so it can dispense all kinds of things that a dispenser can dispense. Because it uses the same code it can even dispense things from other mods.
-Signs as Peripheral, yes that is probably very useless but perhaps somebody can do something with it
-Internal improvements, now it's possible that peripherals can inherit method so e.g. I have to write a function for Getting the amount of Stored energy only once and all peripherals who handle energy have this method available
-All siding informations in function arguments will be relative to the computer/turtle align so instead of writing 0 for bottom you have to write "bottom" like in the standard computercraft functions.

I hope you are like the changes and new things, the update will be available in a few, and don't be so hard about my bad grammar and spelling I'm only a student and English isn't my first language
And please give feedback!



#3 redstoneduck

  • Members
  • 20 posts

Posted 26 December 2014 - 12:50 PM

Version 1.3 available!
Checkout https://github.com/R...eripherals/wiki for the Changelog, Downloads and the API

#4 makromoo

  • Members
  • 8 posts

Posted 28 December 2014 - 09:30 PM

Just the mod I was looking for, my late Christmas present! Huzzah! Thank you, sir! :)

In version 1.3 how would I go about retrieving the NBT data of an item?

#5 redstoneduck

  • Members
  • 20 posts

Posted 29 December 2014 - 01:37 PM

Probably you found already the solution, but if not simply craft an turtle and a pumpkin together(The turtle at the moment the turtle aren't available in the creative inventory or NEI so you have to craft them in creative mode). Put any item into the current selected slot and open the lua shell. Then wrap the peripheral and enter
peripheralVariable.getStackInSlot()
, this will return a table which will be serialized because you are in the lua shell so you can see which variables you need. And don't forget: All peripherals have two functions called
getMethods()
and
help("methodName")
, next time try these and the methods in lua shell where tables get serialized or look in the wiki: https://github.com/R...ripherals/wiki.

Oh and ideas are welcome

#6 makromoo

  • Members
  • 8 posts

Posted 29 December 2014 - 06:05 PM

Ooooooh noob me I forgot to wrap the pumpkin peripheral! :P Thanks for the tip I knew of the openperipherals way of finding methods but not the ComputerCraft way! :)

Edited by makromoo, 30 December 2014 - 10:04 AM.


#7 redstoneduck

  • Members
  • 20 posts

Posted 29 December 2014 - 10:53 PM

1.3b Released
Fixed Server Compatibility, now Random Peripherals should work on a Server

Oh and soon I will add an hologram projector
https://github.com/R...eripherals/wiki

#8 makromoo

  • Members
  • 8 posts

Posted 30 December 2014 - 08:35 AM

Thanks for fix! Anticipated the for projector! :D

Hopefully the inventory turtle gets a recipe soon then can use it on our server :P. I was thinking a pretty expensive recipe since reading NBT is quite a powerful tool.

Edited by makromoo, 30 December 2014 - 06:11 PM.


#9 redstoneduck

  • Members
  • 20 posts

Posted 31 January 2015 - 04:51 PM

For those who are waiting for the hologram projector(probably 0-2 persons) here is an picture:
Posted Image
(The computer is under the projector, you can see some things do not work correctly, like that the bounding box of the glass do not change when rotating)

These things are also already implemented:
  • An command which returns the unlocalized name, the metadata(damage), and the NBT-data of the items which you hold in your hand
  • Random Peripherals got finally an creative tab
These things will be implemented soon:
  • An 3D-Scanner to scan "real" world block structures which can be displayed with the hologram
If you have any suggestions, please write it below

Edited by redstoneduck, 31 January 2015 - 05:02 PM.


#10 makromoo

  • Members
  • 8 posts

Posted 25 March 2015 - 03:52 PM

Wow that is epic!

#11 vargaszm

  • Members
  • 38 posts

Posted 27 April 2015 - 04:59 PM

3 people waiting on the hologram projector now. How does it work? i should probably read earlier posts. awesome potential for stuff tho, especially the limited interface. Will it offer any touch events or similar?

#12 BizzySleepin

  • Members
  • 4 posts
  • LocationSouthern Ontario

Posted 10 May 2015 - 01:23 PM

Is this mod still active? I installed it but don't see the the dispenser turtle in game. Btw the projector looks awesome!

#13 redstoneduck

  • Members
  • 20 posts

Posted 18 May 2015 - 04:47 PM

Hi there,
surprised that theres such an interest in newer versions of random peripherals(Btw, I haven't planned to implement an input possibility to interact with the hologram, but it is an brillant idea!).


To clarify it, the mod development is currently paused, but once the summer holidays begins it will be continued!

I'm back and a new version of Random Peripherals will probably released next week, which will include the hologram projector and some other new feature.

Sorry for the long waiting time, but something will probably won't happen again. The problem was simply the result of trying to combine my hobby(programming) and a school project with any topic, it ends up with having no time for anything.

Edited by redstoneduck, 19 July 2015 - 01:49 PM.


#14 redstoneduck

  • Members
  • 20 posts

Posted 07 August 2015 - 11:09 PM

Random Peripherals Version 1.4 "Falco" is out!
After long waiting time the Version of Random Peripherals with the hologram projector, countless bug fixes and other stuff I'm to lazy to list them is there.

The wiki will be updated in the next days.
Posted Image

So here is a little program for the Hologram Projector, just place an Computer nearby one and start it. Just try it out, it makes use of the touchscreen feature of the hologram projector and demonstrates what the hologram projector can do:
p = peripheral.find("hologram_projector")
--Clear with air
p.clear("minecraft:air",0)
for x=0,7 do
  for z=0,7 do
	p.setBlock(x,0,z,"minecraft:grass")
  end
end
while true do
  local event,button,x,y,z,side,item =
	 os.pullEvent("hologramTouch")
  if item ~= nil and button == 1 then
	if side == "top" then
	  y = y + 1  
	elseif side == "bottom" then
	  y = y -1
	elseif side == "west" then
	  x = x -1
	elseif side == "east" then
	  x = x +1
	elseif side == "north" then
	  z = z - 1
	elseif side == "south" then
	  z = z + 1
	end
  
	p.setBlock(x,y,z,item.internalName)
  elseif button == 0 then
	p.setBlock(x,y,z,"minecraft:air")
  end
end

You can download it here:
https://github.com/R...herals/releases

Oh and don't forget it depends on CoFHCore so it needs to be installed to use Random Peripherals.

Before this question comes I answer to it:
Q: Why is the ComputerCraft computer correctly displayed in the previous screenshot and here not?
A: I switched to an alternative hacky rendering system that allows to display more block types as there would be displayed in the world(So I'm render the blocks as there would render in the world). Unfortunate the system don't works with Blocks that have to TileEnities which are so implemented that if there is no tile entity, no block will be rendered.

I hope you enjoy this new version of Random Peripherals!

Oh and before I forget about it, big thanks to everyone who waited that long for the update, every Person who gave me feedback and suggestions and ChickenBones, I took the code that a block can have multiple selection boxes from him(The code is licends under MIT License)

And the last thing backup your worlds, the mod is almost completely untested!

Please give feedback, thanks!

EDIT: added screenshot
EDIT 2: I updated the changelog, you can find it here: https://github.com/R.../wiki/Changelog

Edited by redstoneduck, 07 August 2015 - 11:26 PM.


#15 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,095 posts
  • LocationTasmania (AU)

Posted 08 August 2015 - 01:08 PM

Oh, I got me some plans for this... B)

They're not terribly imaginative, but still, should be fun to mess with.

... any chance that the hologram can be made to rotate? Like, so you can have it slowly spinning in circles?

#16 redstoneduck

  • Members
  • 20 posts

Posted 08 August 2015 - 02:19 PM

Rotating the drawn blocks is easy and I can manage to implement that until the small bug fix update which comes soon.

But rotating the bounding box isn't possible (as far I know), so the touchscreen feature will only be available if the rotation is a number that is dividable through 90(or if it's 0)

#17 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,095 posts
  • LocationTasmania (AU)

Posted 09 August 2015 - 01:37 PM

Here we go:

pastebin get rkgbqcUk holobuild

The above is a quick'n'dirty edit of WorldPorter, rigged to display a "scan" file generated by the original version via a hologram projector. Since it doesn't use any MineCraft commands it doesn't need a Command Computer.

Some pre-made scan files can be downloaded with:

pastebin run cUYTGbpb get SKDhmxC7

... but for the most part they're way too large for the projector to display. Still, the original version of the script can always be used to make more.

Spoiler

It'd be really nice to have a peripheral which was able to return the world-locations of other peripherals on the same network... or at least get their locations relative to each other. But still, even with an array of projectors, I don't see how a structure taller than eight blocks would be displayed...

I assume the bug you intend to fix is the crash I'm getting every time I click a block in the hologram? Here's the crash report, if you haven't run into it yourself.

Once that's figured out I should be able to go the other way - let the user build a hologram with eg your example script, then save that to a WorldPorter file that can actually be generated full-size within the world.

In regards to rotating, disabling the touch-screen ability whenever the angle didn't have a factor of 90 would be fine by me.

Edited by Bomb Bloke, 10 February 2016 - 11:18 PM.


#18 redstoneduck

  • Members
  • 20 posts

Posted 10 August 2015 - 06:50 PM

1.4b released!
This version fixes all known issues(including the crash when clicking with an empty hand the hologram) and adds the possiblity to rotate the hologram

Also I updated the wiki to the newest version

You can find the wiki and the downloads here: https://github.com/R...eripherals/wiki

#19 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,095 posts
  • LocationTasmania (AU)

Posted 11 August 2015 - 11:26 AM

Well that rotation feature's really pretty cool. Exactly what I wanted - thank you! :)/>

But, I'm still having some stability issues, sorry. For some reason, continuous operation eventually causes the projectors to "stall": they still return true on setBlock/draw/clear calls, but they stop updating the hologram display.

It's still possible to change the metadata of the blocks that were set when the projectors froze, but they otherwise can't be visibly changed. Even shutting down Minecraft and restarting it doesn't resolve this, nor does destroying/replacing the projectors: instead, you have to stop attempting to update the holograms for a minute or so (while the game is still running), then they should eventually "snap to" to whatever state they're supposed to be in, and resume operation from there (until they freeze again, or the game crashes).

If it helps, you should be able to reproduce this issues by running this script for about a minute. The number of projectors connected, and whether they're using universal interfaces, doesn't seem to matter. When the projector freezes, try a projector.clear("minecraft:air",0) call on it: the blocks should go white (as the metadata updates correctly), then a minute or three later the blocks should disappear (as the projector decides to fix itself), then you can re-run the script and it should resume animating for another minute or so before freezing again.

I'm also having some trouble using the universal interface for remote peripheral wrapping, come to mention it: ui.wrapPeripheral() doesn't detect blocks next to the interface after a world reload (until they're broken / replaced).

It'd be nice to be able to call setBlock with an optional metadata parameter, and it'd likewise be nice to be able to connect wired modems to the base of the hologram projectors. I understand these tasks aren't as simple as they sound - as BIT had to do some tinkering to get these sort of features working with the peripherals in his mod - but I gather it can be done.

Edit:

I ran into another crash when disconnecting a bunch of wired modems from a bunch of universal interfaces (with projectors on top of them).

Speaking of using multiple projectors, the hologramTouch event doesn't include any information about the identity of the projector that triggered it.

Edited by Bomb Bloke, 11 August 2015 - 02:11 PM.


#20 redstoneduck

  • Members
  • 20 posts

Posted 29 August 2015 - 11:31 PM

1.4c released
This update includes bug fixes for pretty much every known bug(including the startup crash on servers, that Universal Interface don't recognise neightbor peripherals after world reload etc.)
Also hologram projectors do now include in touch events where the projector is located and there is a method(setBlockMeta) to set both the block and meta data for one block.

Get it here: https://github.com/R...herals/releases





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users