MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 432 forks source link

OpenComputers-dev75 #109

Closed TheRealKANi closed 10 years ago

TheRealKANi commented 10 years ago

Hi fnuecke.. I noticed a little bug in component.modem.getStrength() and component.modem.setStrength()

getStrength() and setStrength() returns nothing, not even and error. setStrength() does set the signal strength.

2014-01-30_18 51 07

Not the biggest bug, but does complicate scripting.. a bit.. ;-) Thanks for the coolest and refreshing Computer mod i a LOOOOONG time.. ComputerCraft is history when you get more peripherals and adds more components to the adaptor API. HINT Mekanism (EnergyCubes) HINT

ghost commented 10 years ago

1+1 also don't return 2

That cause by change lua program. Use = prefix for get result.

=m.getStrength()

TheRealKANi commented 10 years ago

Okay.. Why the change in lua program..? I cant remember when I last ran a function with a return variable, that didn't output the return variable.

ghost commented 10 years ago

lua.lua now behaves closer to vanilla Lua's interpreter, meaning ente…

ghost commented 10 years ago

https://github.com/MightyPirates/OpenComputers/commit/fa6dae03eb2bd7a93f19573b13d6766da149c5f8

TheRealKANi commented 10 years ago

Makes sense.. thanks for clearing it up EcmaXp..

fnuecke commented 10 years ago

The main cause for the change was that results are now automatically serialized. This makes working with tables a lot easier, since one doesn't has to manually iterate them. However, to avoid tables spamming the screen, the interpreter now requires you to prefix expressions with an equality sign. The nice side effect is that this is indeed closer to standard Lua's standalone interpreter now :-) There is a big fat message when starting the interpreter saying so, which I was hoping would be clear enough (if there isn't you're not using the latest devbuild).

TheRealKANi commented 10 years ago

I kind of noticed it, but only after I ran one of my scripts, that didn't output what i wanted.. My bad, RTFM for me.. Habits are a nasty thing in a dev world.. :-D

But again.. Thanks for the coolest and refreshing Computer mod i a LOOOOONG time.. ComputerCraft is history when you get more peripherals and adds more components to the adaptor API. HINT Mekanism (EnergyCubes) HINT

fnuecke commented 10 years ago

Hehe, thanks for the vote of confidence. Personally I think/hope there'll be happy co-existence, with the people who'd prefer a more "realistic"-ish playstyle tending to OC and the rest to CC. Or both! As for peripherals/components, we may have a look into extending/forking OpenPeripherals to get a good batch of compatibility going. At least that's somewhat the plan :-P

ghost commented 10 years ago

Move Item Inventory to other inventory, and read item id and damage value, etc stuff can Overpowered. Must require some extra energy are required if do operate

fnuecke commented 10 years ago

Finding a generic way to determine how much power peripherals should consume will probably impossible. This would have to be handled on a peripheral by peripheral basis... which kinda encourages a fork instead of a change in OP proper. Will have to think about it.

TheRealKANi commented 10 years ago

Just an idea.. Base the required power demand of the adaptor block on the number of lines it can read from the ie, energy block. The more info, the more required power.

fnuecke commented 10 years ago

You mean the number of methods a peripheral provides? Interesting idea. Would that be a continuous energy drain or on a per-call basis, though? Hmm. Since each callback would have to cost the same in the latter, even if one logically may do a very different amount of work, I'd vote for the prior - i.e. the continuous drain.

TheRealKANi commented 10 years ago

Agreed, continuous.. Imagine OpenComputers acting as a giant status panel over an entire factory..! Thats exactly why I'm using a computer mod in the first place.. We are planning to build an entire society, complete with daily shopping centers, public buildings, public transportation (railcraft) and jobs for everyone.. Daunting task indeed..

Anyway.. Keep up the fantastic work. :+1: