Jump to content

Mister Webwyre

Resident
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Mister Webwyre

  1. Helium Loon wrote: I would say a single prim per gate (or element, for those composed of multiple gates), with particle emitters for the various connections to other prims. Particle emitters for "virtual" wires sounds cool ! I haven't used particles before, but I just tried this script from the wiki, and got a "local" (around the prim) "burp" I created another prim and put this in it : //// nodeRegister//key uuid;default { state_entry() { uuid = llGetKey(); llSay(0,"(node1) state_entry uuid-key: " + (string) uuid );// llRegionSay(800,(string)uuid); } touch_start(integer num) { llSay(0,"(node1) touch_start : sending uuid on channel 800 " + (string) uuid ); llRegionSay(800,(string)uuid); }} I added this to the "example" script : state_entry(){ llOwnerSay("(particles1) state_entry : listening on channel 800"); llListen(800, "", NULL_KEY, ""); updateParticles(); } listen(integer channel, string name, key id, string msg) { llOwnerSay("(particles1:listen) Received msg: " + msg); llOwnerSay("(particles1:listen) channel = " + (string) channel); if(channel == 800){ llOwnerSay("channel = 800, setting target to : " + msg); target = (key) msg; } } But the particles are not going to the target prim. I'm looking for "laser beam" scripts, (wire scripts ?) now. Mike
  2. Rolig Loon wrote: Visit the fourth floor at the College of Scripting, Music & Science at http://maps.secondlife.com/secondlife/Horsa/52/221/113 to run through their panels on representation of logic in LSL. Thanks, I've been to that site before. Someone spent a lot of effort making those panels. Too bad, they're not interactive. Would be nice if you could touch a panel, and it would create a prim(s) with an example script. Mike
  3. Freya Mokusei wrote: As research for this, you may want to look at Minecraft's 'RedPower2' mod, which includes a lot of interesting graphics for circuitry already. Chat is definitely how it's going to be done. Take a look at the commands for llListen and llRegionSayTo. One strong method of accomplishing 'pairing' or connection is to generate this small sequence within 2 unlinked prims:- 1. User touches PRIM1, PRIM1 sets to 'awaiting connection'. 2. User touches PRIM2, PRIM2 broadcasts 'I need a connection'. 3. PRIM1 listens to PRIM2, and assigns it as a 'paired' prim with it. From this point on, you can use llRegionSayTo to make sure chat commands pass explicitly between PRIM1 and PRIM2, without creating confusing 'noise' for other prims in the same circuit. I've actually used Redpower quite a bit. I found something even better (for my purposes) for Minecraft : http://eisental.github.com/RedstoneChips/ Thanks for the tip about "llRegionSayTo". Looks like another useful function. For all who've commented on the link strategy ... thanks ... I'm a novice at LLscript .. though I've programmed in many other languages. I guess it's not the best way to proceed with this. With all the suggestions of chat / transmitting etc, I'm thinking now of a central prim, that when gate prims get rezzed, will transmit to the "center / master", and will then receive their pin frequencies, etc. As well, when a gate is connected into the network, there will be a way of the connecting / receiving nodes to send their status / receive frequencies from the master prim. I'm lookin at the on_rez and object_rez events now which look handy for triggering initialization code, when items will be dragged from inventory (rezzed ?) Mike
  4. Freya Mokusei wrote: These are the specific parts of LSL code that may interest you. LSL supports 'basic' boolean logic (which combined with AND and OR mostly expands this range) and also bit-wise/hex-based comparison. http://wiki.secondlife.com/wiki/LSL_Operators http://wiki.secondlife.com/wiki/Category:LSL_Flow_Control It would be fun to see how 'modular' you could make a logic gates system, as well as how expandable. For the most part however, LSL deals with logical comparisons and other operations within a single script. e.g.:- if(inputA == TRUE && inputB == TRUE) { llOwnerSay("AND pass"); } else { llOwnerSay("AND fail"); } Freya, Thanks, yes I've already read those parts of the wiki, and have written code similar to yours. What I'm trying to figure out now, is how to "graphically" illustrate it with (linked?) prims, e.g three prims for an AND gate, the two inputs and the output, and how to show gates connected and their states. I'm wondering if an entire CPU / or circuit would have to be one linkset (is there a limit to how many prims in a linkset ?), or if I can make each logic gate a linkset, and then use chat to communicate between the linksets ? Mike
  5. Madelaine McMasters wrote: Do you intend to offer a demonstration of a pre-wired system, as in the Fetch Decode Cycle demo? Or do you intend for people to wire the gates themselves? Ideally, I'd like to do both. Prewired examples, using scripted "building blocks" (logic gates), as well as maybe using the Sloodle / Moodle framework or maybe just LSL scripting to create interactive / testing / learning / game / quiz like situations. Heh, but first I need to build some basic logic gates, or even a "lever" / switch. It's too bad that apparently links cannot have child links, as that would possibly simplify things, from the little I've read about LSL scripting so far. Mike
  6. >If you want to apply it to the problem of creating electronic circuits, that's fine. It's certainly been done enough times, but there's always room for a fresh approach Done enough times in SL ? (As I haven't been able to find any examples) Or with programming languages in general ? In that case, yes I know there are dedicated languages like Verilog and VHDL, but I thought an interactive"walk through a CPU" might be educational and interesting. Mike
  7. After searching for logic gates, electronics / cpu scripting etc, it seem no one is doing this in SecondLife ? The one example I've found is the "Fetch Decode cycle" / Sloodle app for the University of Ulster : http://www.youtube.com/watch?v=N5wjrRkh57Y http://vrlcom.com/tutorials So, maybe I won't be "re-inventing the wheel", but rather will have to invent it ? :) I found the timer() / llSetTimerEvent scripting elements, which is a start for a cpu / clocked circuit. Now I'm trying to figure out how to construct logic gates. It would seem that linked prims might be something I should be looking at ? llMessageLinked also looks like it might be useful I'm looking at the example TicTacToe game on the wiki, to try to get up to speed on the elements I mentioned above, as it seems to have most of them. Any ideas / tips / suggestions are appreciated. Mike
  8. Thanks ! ' llDetectedLinkNumber seems to be the function to use for the touch_start event. Now, I added a llSetColor(..... to the touch_start event, but when I click on any of the cubes only cube "#1" is changing color. I want which ever cube was clicked to change color. Mike
  9. Hi guys and gals, As a scripting newbie, I was working through this example: http://wiki.secondlife.com/wiki/Tic_Tac_Toe I seem to be missing something on how to link the cubes together. (I click the first one, then shift click the next 8, then click the link button ... is there another (corrrect ?) way to do it ?) When I link them, the llGetLinkNumber() function returns the same number, on any cube I touch. I was expecting (for 9 cubes), nine distinct link numbers / id's Mike Here's a test script I was trying to use : // // ShowLinkNum - use with two or more linked objects // integer lnum = 0; default { state_entry() { lnum = llGetLinkNumber(); llOwnerSay("(ShowLinkNum) state_entry) lnum : " + (string) lnum); llOwnerSay("llGetNumberOfPrims: " + (string) llGetNumberOfPrims()); } touch_start(integer touching_agents) { llOwnerSay("(ShowLinkNum) touch_start) lnum : " + (string) lnum); } }
×
×
  • Create New...