Jump to content




[mc 1.6.x] Openperipheral


1184 replies to this topic

#1141 Gorfel

  • Members
  • 5 posts
  • LocationSwitzerland

Posted 04 March 2014 - 11:17 PM

View Posttheoriginalbit, on 04 March 2014 - 10:24 PM, said:

View PostGorfel, on 04 March 2014 - 02:07 PM, said:

-snip-
Just use the following code
for k,v in pairs( textObj ) do
  print(k, " : ", v)
end
replacing textObj with any object that you wish to see the functions on. it won't tell you the arguments but it tells you the functions — which are all setters anyway so you don't need to know the args.



yaiii... that worked
thanx

Martin

View PostUNOBTANIUM, on 04 March 2014 - 11:17 PM, said:

View Posttheoriginalbit, on 04 March 2014 - 10:24 PM, said:

-snip-
I doubt that it is highly unlikely that you're going to be changing all the values on them at once.
If you don't want screen flicker definitely do not clear. If you want to update the object use the setters, however if you do know that you'll be changing a few at once and want to be a little more efficient on a servers bandwidth usage then consider deleting the element and recreating it; you don't need to clear the screen to remove an object!

Well, i dont have real detection of which values have been changed. Would be an other logistic work to do thought.
How do i delete the elements on screen without clearing it?

As I newly know how to get the List oft the objects Methods... there is a object.delete() function :-)

#1142 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 March 2014 - 12:03 AM

View PostUNOBTANIUM, on 04 March 2014 - 11:17 PM, said:

How do i delete the elements on screen without clearing it?
each element has a method delete. it's definitely the most efficient way (in terms of server network usage) if you think you're going to be updating properties a lot; it uses two packets (deletion and creation), whereas each time you change a property a packet is sent.

#1143 unobtanium

  • Members
  • 505 posts

Posted 05 March 2014 - 12:55 AM

And clearing the screen just calls the delete() method for every object on the screen?

#1144 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 March 2014 - 01:02 AM

yes. but removing all objects just to redraw them can and will cause flicker.

#1145 Gorfel

  • Members
  • 5 posts
  • LocationSwitzerland

Posted 05 March 2014 - 06:45 AM

The way you do things like that in other places is to have a virtual screen-buffer of the same Size as the Screen you paint on.
First you clear your vscreen, draw some things on it and when you're done, you copy the whole screenbuffer to the Display.
Would be cool If something like that would be possible here aswell.

The Only Problem here in Computercraft is: If you use a Glass on a Monitor with a resolution of 1920x1080... To write the whole screen, you need a screen-buffer of approximatly 2MBytes
Thats much Data to write!

The Benefit of this System is to minimize the Time you need to draw all your things on the Screen. You can just clear the memory and draw just the things you need. You dont have to handle drawing and clearing certain pixels.

Perhaps the question to Mikeemoo if something like that could be a feature of a future release. :rolleyes:(and a proper setPixel() Method, so I dont have to abuse the addBox() Method)

#1146 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 March 2014 - 07:51 AM

View PostGorfel, on 05 March 2014 - 06:45 AM, said:

Perhaps the question to Mikeemoo if something like that could be a feature of a future release.
I don't see a buffer as anything we would plan on doing, especially with the way we've designed OpenPeripheral to work (and how Minecraft works).

View PostGorfel, on 05 March 2014 - 06:45 AM, said:

and a proper setPixel() Method, so I dont have to abuse the addBox() Method
abuse of the addBox method would be identical to use of a setPixel method. You may as well just use the former.

#1147 Gorfel

  • Members
  • 5 posts
  • LocationSwitzerland

Posted 05 March 2014 - 08:30 AM

View Posttheoriginalbit, on 05 March 2014 - 07:51 AM, said:

View PostGorfel, on 05 March 2014 - 06:45 AM, said:

Perhaps the question to Mikeemoo if something like that could be a feature of a future release.
I don't see a buffer as anything we would plan on doing, especially with the way we've designed OpenPeripheral to work (and how Minecraft works).

I understand that point.
The way I could see this feature, is in a built-in vscreen-buffer in the Glass.
So you would have the concept of the OpenPeripheral, that you only show the Methods of the attached Block.
One of the Methods would then simply be
glass.Update()

But that's just one way to go. And if its not according to your Philosophy then that's absolutly ok...

View Posttheoriginalbit, on 05 March 2014 - 07:51 AM, said:

View PostGorfel, on 05 March 2014 - 06:45 AM, said:

and a proper setPixel() Method, so I dont have to abuse the addBox() Method
abuse of the addBox method would be identical to use of a setPixel method. You may as well just use the former.

What's the "former"? (heard the first time of it) (missunderstanding due to linguistic disability :) )

Edited by Gorfel, 05 March 2014 - 08:43 AM.


#1148 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 March 2014 - 08:35 AM

View PostGorfel, on 05 March 2014 - 08:30 AM, said:

-snip-
I understand what you're saying, but I don't really see it working, plus it breaks everything again — especially if we implemented you needing to invoke an update method — and people are starting to complain about the changes.

View PostGorfel, on 05 March 2014 - 08:30 AM, said:

What's the "former"? (heard the first time of it)
Definition #2

#1149 Azhdev

  • New Members
  • 1 posts

Posted 05 March 2014 - 08:43 PM

hey mikee,
i can remeber that you could put the terminal glasses in a powersuit helmet but now I cant see it.
is this removed or am i missing something?

#1150 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 March 2014 - 11:27 PM

View PostAzhdev, on 05 March 2014 - 08:43 PM, said:

hey mikee,
i can remeber that you could put the terminal glasses in a powersuit helmet but now I cant see it.
is this removed or am i missing something?
Yes MPS support was removed a long time ago. MPS was too buggy.

#1151 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 06 March 2014 - 01:04 AM

Or more accurately I believe, they didn't have a consistent API, they kept changing it. So we decided that if they wanted Terminal Glasses, THEY could add it. Not us.
That's my understanding anyway.

#1152 blunty666

  • Members
  • 79 posts

Posted 06 March 2014 - 05:54 PM

I've been playing around with the glasses and I keep encountering an issue where setting the alpha on text becomes a bit temperamental. It will stay at full opacity for all values of alpha between 0.1 and 1, then for any value less than 0.1 it just disappears completely, i.e. has full transparency. Like I said it doesn't always happen so I can't give a reliable way to replicate it. This might just be down to me using setAlpha() incorrectly, am I right that it works the same way setOpacity() works (values 0 <= alpha <= 1), your documentation on it is a little thin on the ground.

Thanks in advance.

#1153 SkyWeapons

  • New Members
  • 1 posts

Posted 07 March 2014 - 10:06 PM

Hi !
I would like to pass parameters on terminal glasse's command. Is there away to do it so ?

#1154 CometWolf

  • Members
  • 1,283 posts

Posted 08 March 2014 - 11:23 AM

Yes there is, but it has nothing to do with openP, that's all CC side. What you need is to convert what the glasses send(strings) into whatever variables it is you need using the string librairy.
http://lua-users.org...LibraryTutorial
Go to ask a pro if you need more help

#1155 CreeperGoBoom

  • Members
  • 91 posts

Posted 13 March 2014 - 08:49 AM

hi me and a friend are using a 1.5.2 server

where exactly do i put the methods script?

does it go into Scripts.txt or do i need to make a file in /lua then put in the script name?

#1156 MechE_

  • Members
  • 8 posts
  • LocationCalifornia

Posted 16 March 2014 - 01:01 AM

Hi so i have run into an issue with the latest update for open peripherals.

If i use the method getAllStacks() it returns a table of tables for items in each slot, and for a double chest it returns up to slot 54. This works as normal

However, when I attempt to use the method getStackInSlot(54) it returns the error, slot id(53) must be less than size (27)....
So while I can create a table for all the slots, if i want information on just one slot and the slot happens to be greater than 27, it will throw me that error. It does not matter which side the computer is on slots(1)-(27) are always the top 27 slots within the chest.Posted ImagePosted Image

Posted Image Posted Image

#1157 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 16 March 2014 - 02:38 AM

View PostMechE_, on 16 March 2014 - 01:01 AM, said:

-snip-
Please do this!

#1158 MechE_

  • Members
  • 8 posts
  • LocationCalifornia

Posted 16 March 2014 - 11:05 AM

View Posttheoriginalbit, on 16 March 2014 - 02:38 AM, said:

View PostMechE_, on 16 March 2014 - 01:01 AM, said:

-snip-
Please do this!

Got it for the future, and here as well. Thanks.
  • Forge: forge-1.6.4-9.11.1.965
  • OpenModsLib: OpenModsLib-0.3.jar
  • OpenPeripheralCore: OpenPeripheralCore-0.3.2.jar
  • OpenPeripheral-Addons: OpenPeripheralAddons-0.1.2.jar


#1159 Pharap

  • Members
  • 816 posts
  • LocationEngland

Posted 19 March 2014 - 03:57 AM

Looks like a useful mod, it's a shame the documentation isn't better though.

#1160 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 19 March 2014 - 04:57 AM

View PostMechE_, on 16 March 2014 - 11:05 AM, said:

-snip-
I can't seem to confirm this in our code, I'll have to try and test this later in my environment, can you please also test it for any other mod that adds an inventory that's larger than a single chest, just to see if its a problem unique with a double chest or not.

View PostPharap, on 19 March 2014 - 03:57 AM, said:

Looks like a useful mod, it's a shame the documentation isn't better though.
The problem with documentation is that even we don't know everything our mod does, so its impossible to write an extensive, accurate, and up-to-date online documentation; what we've got is the only way to be able to do this.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users