Jump to content

FrancisPepper

Resident
  • Posts

    7
  • Joined

  • Last visited

Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So, for this line; list parsed = llList2CSV(configNotecardData); I am getting the error "type mismatch"
  2. Hi Wulfie, thanks for your reply. This is the rest of the script, so you can see what I've got so far for it to make sense. processConfiguration(string data) { if (data == "") { llOwnerSay("Reading Notecards. Please wait..."); loadNotecard(configNotecardName); } else if (data == "finished") { // if (llSubStringIndex(data, "#") != 0) // { // integer iz = llSubStringIndex(data, ","); // if (iz != -1) // { // string name = llGetSubString(data, 0, i - 1); // string action = llGetSubString(data, i + 1, -1); // string rot = llGetSubString(data, i + 2, -1); // string pos = llGetSubString(data, i + 3, -1); // string tempList = llParseString2List(name, [" "], []); // tempList = llDumpList2String(action) // } // } llOwnerSay("Done configurating. " + llGetObjectName() + " is now ready to use."); // objects = llList2ListStrided(configNotecardData, 0, -1, 4); // actions = llList2ListStrided(configNotecardData, 1, -1, 4); // positions = llList2ListStrided(configNotecardData, 2, -1, 4); // rotations = llList2ListStrided(configNotecardData, 3, -1, 4); // tempLines = []; // integer length = llGetListLength(objects); // integer i = 0; // for (; i < length; ++i) // llOwnerSay(llList2String(objects, i)); // length = llGetListLength(actions); // for (i = 0; i < length; ++i) // llOwnerSay(llList2String(actions, i)); // length = llGetListLength(positions); // for (i = 0; i < length; ++i) // llOwnerSay(llList2String(positions, i)); // length = llGetListLength(rotations); // for (i = 0; i < length; ++i) // llOwnerSay(llList2String(rotations, i)); } } loadNotecard(string notecard) { tempLines = []; notecardName = notecard; notecardLine = 0; notecardQueryId = llGetNotecardLine(notecardName, notecardLine); } notecardFinished(string notecard) { if (notecard == configNotecardName) { configNotecardData = tempLines; loadNotecard(menuNotecardName); } else if (notecard == menuNotecardName) { menuNotecardData = tempLines; processConfiguration("finished"); } } default { touch_start(integer num_detected) { processConfiguration(""); } changed(integer change) { if (change & CHANGED_INVENTORY) { processConfiguration(""); } if (change & CHANGED_OWNER) { llResetScript(); } } listen(integer channel, string name, key id, string message) { } dataserver(key query_id, string data) { if (query_id == notecardQueryId) { if (data != EOF) { tempLines += data; ++notecardLine; notecardQueryId = llGetNotecardLine(notecardName, notecardLine); } else { notecardFinished(notecardName); } } } } My issue with the llCSV2List is that I'm reading from multiple notecards in this script so that, anyone I give the script to can edit the notecards without being bogged down by LSL jargon. One notecard is for listing Objects with their uses, rotations, and positions, and the other notecard that is configuring menus and submenus with llDialog. So, currently, line 1 for example - "object1, action1, position1, rotation1" - is being read from a notecard, put into a list. I am then trying to separate each object name, use, position, and rotation into separate lists to then call on each one as needed. Regards, Frank Again, I'm sure I'm probably going about it the wrong way, but I just thought I'd elaborate on what I'm trying to accomplish with the script.
  3. Hi, I'm now struggling to work out how to get a list from a notecard where 4 items are on one line, separated by commas and so on. Example below; object1, action1, position1, rotation1 object2, action2, position2, rotation2 object3, action3, position3, rotation3 I'm struggling to then break these down into different lists. Here is what I've been trying so far, to know success; processConfiguration(string data) { if (data == "") { llOwnerSay("Reading Notecards. Please wait..."); loadNotecard(configNotecardName); } else if (data == "finished") { // if (llSubStringIndex(data, "#") != -0) // { // integer iz = llSubStringIndex(data, ","); // if (iz != -1) // { // string name = llGetSubString(data, 0, i - 1); // string action = llGetSubString(data, i + 1, -1); // string rot = llGetSubString(data, i + 2, -1); // string pos = llGetSubString(data, i + 3, -1); // string tempList = llParseString2List(name, [" "], []); // tempList = llDumpList2String(action) // } // } llOwnerSay("Done configurating. " + llGetObjectName() + " is now ready to use."); // objects = llList2ListStrided(configNotecardData, 0, -1, 4); // actions = llList2ListStrided(configNotecardData, 1, -1, 4); // positions = llList2ListStrided(configNotecardData, 2, -1, 4); // rotations = llList2ListStrided(configNotecardData, 3, -1, 4); // tempLines = []; // integer length = llGetListLength(objects); // integer i = 0; // for (; i < length; ++i) // llOwnerSay(llList2String(objects, i)); // length = llGetListLength(actions); // for (i = 0; i < length; ++i) // llOwnerSay(llList2String(actions, i)); // length = llGetListLength(positions); // for (i = 0; i < length; ++i) // llOwnerSay(llList2String(positions, i)); // length = llGetListLength(rotations); // for (i = 0; i < length; ++i) // llOwnerSay(llList2String(rotations, i)); } } I've commented out what hasn't worked, in case something magically came to me and it was just a case of editing what I'd already written out. If anyone is able to point me in the right direction as to what to read, that would be awesome. Thank you in advance, Frank
  4. This is perfect. Thank you so much. I will get testing this out shortly and if it all works out, I'll mark this off as solved (if I can :P). Thank you so much for your quick reply!
  5. Hi. I'm fairly new to LSL but I have previous intermediate coding experience, so I've been falling into it somewhat easily. I am trying to find a way to get one object to talk to another object to make it do something. The object in question is to be rezzed from the root object, then listen for what the root object is telling it to do, and then perform the action. This is what I have so far; Root Object string object; key uuid; default { state_entry() { object = llGetInventoryName(INVENTORY_OBJECT, 0); uuid = llGetInventoryKey(object); llOwnerSay("The UUID of " + object + " is " + (string)uuid + "."); } touch_start(integer num_detected) { llRezObject(object, llGetPos() + <0.0, 1.0, 0.0>, ZERO_VECTOR, <0.0, 0.0, 0.0, 0.0>, 42); llRegionSayTo(uuid, -555555, "Change colour to Green"); } changed(integer change) { if (change & CHANGED_INVENTORY) { llResetScript(); } } } Rezzed Object to perform action integer listenHandle; default { on_rez(integer params) { listenHandle = llListen(-555555, "", "", ""); } listen(integer channel, string name, key id, string message) { if (channel == -555555) llSay(0, name + " said" + message + " to this object"); } } I am trying to get it to say something for now, as opposed to actually changing it's colour to green. For some reason, however, they don't seem to be communicating well. I'm not sure if there is beef between them and they're just not on speaking terms or what, but I'm struggling to work it. If anyone is able to offer some wisdom as to where I may be going, that would be greatly appreciated. Thanks in advance, Frank
×
×
  • Create New...