Jump to content




[MC 1.7.10 | CC 1.65] OpenCCSensors

lua

  • You cannot reply to this topic
1334 replies to this topic

#821 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 29 March 2013 - 06:37 AM

View PostLemonyLime, on 29 March 2013 - 06:13 AM, said:

Are there any more detailed tutorials than what's on the wiki?

I get a "attempt to return ? (a nil value)" error whenever I use any of the mod's built in functions to set a variable. For example, if I copied the redstone lamp example in the wiki directly, I get that error at line 25.

Which version are you using?

#822 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 29 March 2013 - 06:39 AM

View PostLemonyLime, on 29 March 2013 - 06:13 AM, said:

Are there any more detailed tutorials than what's on the wiki?

I get a "attempt to return ? (a nil value)" error whenever I use any of the mod's built in functions to set a variable. For example, if I copied the redstone lamp example in the wiki directly, I get that error at line 25.

Also, please try putting a sensor card in, then running this program:

ocs/programs/sensorview

navigate (using the arrow keys) to the side that the sensor is attached to, and check that the sensor returns information

#823 iAmMe

  • Members
  • 10 posts

Posted 29 March 2013 - 06:44 AM

Would there be any way to create a sensor to detect what's in a player's inventory or to detect what's in a player's hand? It'd be pretty cool to have the ability to find out if a player is "hostile" based off of items in their inventory/hand.

#824 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 29 March 2013 - 06:45 AM

View PostiAmMe, on 29 March 2013 - 06:44 AM, said:

Would there be any way to create a sensor to detect what's in a player's inventory or to detect what's in a player's hand? It'd be pretty cool to have the ability to find out if a player is "hostile" based off of items in their inventory/hand.

The proximity sensor does that.

#825 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 29 March 2013 - 06:49 AM

View PostiAmMe, on 29 March 2013 - 06:44 AM, said:

Would there be any way to create a sensor to detect what's in a player's inventory or to detect what's in a player's hand? It'd be pretty cool to have the ability to find out if a player is "hostile" based off of items in their inventory/hand.

I'm not at all certain about detecting what's in the hand, but the proximity sensor will give you the contents of a player's inventory. Try using a proximity card in a sensor and running `ocs/programs/sensorview`. Use the arrow keys to navigate sides/targets until you get to your player, then use PageUp/PageDown to scroll through the detailed info (requires disabling NEI; hit O in inventory screen by default). You should be able to see their whole inventory, and you can check to see if it will tell you what is currently selected.

#826 LemonyLime

  • Members
  • 11 posts
  • LocationOregon

Posted 29 March 2013 - 06:57 AM

View PostMikeemoo, on 29 March 2013 - 06:39 AM, said:

View PostLemonyLime, on 29 March 2013 - 06:13 AM, said:

Are there any more detailed tutorials than what's on the wiki?

I get a "attempt to return ? (a nil value)" error whenever I use any of the mod's built in functions to set a variable. For example, if I copied the redstone lamp example in the wiki directly, I get that error at line 25.

Also, please try putting a sensor card in, then running this program:

ocs/programs/sensorview

navigate (using the arrow keys) to the side that the sensor is attached to, and check that the sensor returns information
I'm using 0.1.4.

I have a proximity mk2 in the sensor turtle, and sensorview is working properly.

#827 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 29 March 2013 - 07:35 AM

Well, it would be odd if this worked, but try changing the `proximity.getTargets()` on that line to `sensor.call("left", "getTargets")` and be sure there are targets in range. That's the only significant difference I can think of between that program and sensorview.

#828 iAmMe

  • Members
  • 10 posts

Posted 29 March 2013 - 08:33 AM

View PostLyqyd, on 29 March 2013 - 06:49 AM, said:

I'm not at all certain about detecting what's in the hand, but the proximity sensor will give you the contents of a player's inventory. Try using a proximity card in a sensor and running `ocs/programs/sensorview`. Use the arrow keys to navigate sides/targets until you get to your player, then use PageUp/PageDown to scroll through the detailed info (requires disabling NEI; hit O in inventory screen by default). You should be able to see their whole inventory, and you can check to see if it will tell you what is currently selected.

View PostMikeemoo, on 29 March 2013 - 06:45 AM, said:

The proximity sensor does that.

Bah, I thought I looked for that and saw nothing..my bad xP I never scrolled down..deeeeerp

#829 luaanon

  • Members
  • 7 posts

Posted 29 March 2013 - 11:31 AM

View PostMikeemoo, on 28 March 2013 - 11:10 PM, said:

Good spot. Yeah, the sonic sensor seems to have its own range settings. I didn't make this particular sensor. Not sure if I should reduce the range on these to make it inline with the other block/tile sensors, or just update the wiki...

Hrmm.

My personal opinion would be to bring it in line with the other sensors...consistency is a good thing. There is also a performance cost to consider...scanning 2,197 blocks when all you want is short range data is rather wasteful, but scanning 117,649 blocks is kinda insane (especially since it isn't a simple lookup per block, but rather a raycast per block to simulate echo-location).

If the sonic sensor does keep its custom range(s), then I'd like you to consider adding either a method to check a single xyz coordinate (relative to the turtle) within the range of the sensor card or a method that lets you specify a range shorter than the range of the sensor card.

One way to implement the former would be to change getTargetDetails in PeripheralSensor.java. Currently, it calls getTargets every time getTargetDetails is invoked (which works, but is a smidgeon wasteful with a 49x49x49 range). If that were changed to only check the provided target, it would be quite useful. This would involve refactoring all of the existing sensors, but it should mostly be a matter of cut/paste:
  • Add a new method to each sensor:
    getTarget(...)
  • Move the single-target code from each sensor's getTargets loop to getTarget
  • Have getTargets call getTarget for each potential target
  • Have getTargetDetails call getTarget instead of getTargets
Every sensor would benefit from this change, and it wouldn't change the existing API. The change should be completely transparent to the end-user's scripts.

Another way would be to use custom method, but is less graceful imho.

Implementing the latter would require a custom method, but doesn't involve any refactoring. It would also only affect the sonic sensor. It also doesn't break the API, but end-users would have to rewrite their scripts to take advantage of it (which happens with any new feature, so isn't really a consideration).

#830 kruex

  • New Members
  • 1 posts

Posted 01 April 2013 - 04:08 AM

Hi,
my reactor is about 4 blocks away, i want to show the information about heat, Output etc. on my Monitor. How do I define the reactor as a target and set this in a term.write.

#831 fuzzzie

  • Members
  • 3 posts
  • LocationCanada

Posted 05 April 2013 - 09:43 AM

Did the Jenkins site get removed or is it just down?

#832 Foone

  • Members
  • 25 posts

Posted 05 April 2013 - 09:59 AM

What's needed to get this ready for a 1.5.1 compatible release? Is it just compatibility issues or are there new features being worked on?

I ask because I'm not upgrading my personal server off vanila until OpenCCSensors is updated, and I'm a java programmer who has done a few minor mods. I can gladly help if it just needs someone to sit down and fix anything that broke in the 1.4.7->1.5.1 migration.

#833 tabs

  • Members
  • 21 posts

Posted 06 April 2013 - 04:37 AM

<edited out help request>

turns out I'm a noob. <_<

#834 elfin8er

  • Members
  • 133 posts

Posted 06 April 2013 - 04:11 PM

I'm not getting how to use these. Do you program with them just like the original ccsensors? Is there somewhere I can go for like an in-depth tutorial?

#835 SimpleMajority

  • Members
  • 26 posts

Posted 06 April 2013 - 08:42 PM

I didn't see a suggestion for this, so here it goes.
I would love to see a sensor card get added in for Universal Electricity. It would make life a ton easier in managing a power network.

#836 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 07 April 2013 - 07:41 AM

View PostSimpleMajority, on 06 April 2013 - 08:42 PM, said:

I didn't see a suggestion for this, so here it goes.
I would love to see a sensor card get added in for Universal Electricity. It would make life a ton easier in managing a power network.

This is already in the new 1.5.1 version :)

#837 kaj

  • Members
  • 43 posts

Posted 07 April 2013 - 11:42 PM

hi. Any chance of a mirror for the current/dev (1.5.x) version? am having no luck with the Jenkins link from a page or so back - thanks

#838 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 08 April 2013 - 03:01 AM

Sorry, Jenkins is temporarily taken down while I try work out why it's sitting on 40% CPU when idle!

I'm adding ic2 support back into OCS today, so I'm likely to do a proper release for minecraft 1.5.1 tonight. :)

#839 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 08 April 2013 - 05:54 AM

Guys and gals,


https://dl.dropbox.c...nsors-0.1.5.jar

Here's OpenCCSensors 0.1.5, for minecraft 1.5.1.

I've tried it myself and it all seems to work fine, however, if someone could help me out a bit and give it a bit of a test, i'd really appreciate it.

Thanks to those who've been involved in the latest updates to it.


Changes:

Removed the mod-specific sensor cards. The functionality of these will be merged into other cards.
Applied energistics is supported by the inventory sensor
Industrialcraft 2 is supported by the power and machine sensor
Universal Electricity is supported by the power sensor card
Tooltips have been added into the inventory sensor card
Buildcraft not currently supported, Thaumcraft not currently supported.


Note that the bleeding edge ic2 builds still seem to be pretty buggy (for example, nuclear reactor appears to crash the moment you turn it on), this is nothing to do with OpenCCSensors, but also means I haven't fully tested these sensors are working yet.

#840 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 08 April 2013 - 09:52 AM

Thanks for the wiki edit, Foone!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users