Jump to content

Wandering Soulstar

Resident
  • Content Count

    421
  • Joined

  • Last visited

Everything posted by Wandering Soulstar

  1. Having just got home and being able to take another look at the code I discovered the problem. Though it is interesting what the result on the processed code was. At the beginning of my include file I had a #define, which I had accidentally placed a semi-colon after. The 'interesting' part is that the #define variable was 'replaced' correctly, and that the semi-colon was dumped at the end of the included functions. Back to the path, I see that it works if I put the path to the file, i.e. the sub-folder trail from the root. This though is not, at least to me, what I read on the Firestorm page: Reading this it seems to say that the preprocessor will check the subfolders on it's own, without me having to specify ...
  2. @Wulfie Reanimator As to the file itself, each function is defined as it would be in a normal Script, i.e. function (params) { code } (sorry for not putting in a code window, but am on my phone) And for the path, have seen that, and not clear (at least for me). Question is, if folder ‘x’ is designated as the location for includes, and the file is in x\a, do I need to write: #include “\a\name.lsl” in other words, it will not automatically look in subfolders?
  3. Hi All .. this is going out to anyone that uses the Firestorm Preprocesor functionality ... I have just started to use this, and seem to be having some problems that I could use some help with. The first comes from the preprocessor, correctly inserting used functions from my 'common_funtions' file. But it is inserting a semi-colon ( ; ) after the bracket of the last function. Any ideas of what I am not doing in my function file that would cause this? Second question is actually finding the file. On the Firestorm page is says it can check sub-folders of the designated #include directory, my qustion is do I have to actually specify the sub-folder path in the #include directive line? Thanks in advance!!!!
  4. I cannot imagine how difficult it must be going through life being the only one who knows what is right
  5. Actually Steph, as it states above, it does reduce the the memory used, i.e. smaller byte code. In the Wiki as well, under the definition of Float: What's more ... when the script is 'run' as you state, it has already been compiled and the 'conversion' completed, at run time just executing the byte code. Finally .. would be interested in understanding what issues you are referring to .. have not seen any reference to this before.
  6. While having my morning coffee I was browsing around the Wiki, as one does, and came across THIS PAGE from @Omei Qunhua that I had not seen before. The really interesting section for me came at the bottom: Counter intuitive, but good to know and something to take into account I would think. Also was intrigued by the last statement: Since the wiki page has not been updated since May of 2014 .. would be very interested in seeing what came of this ... Omei, @Strife Onizuka, Pedro .... are you there?
  7. Not the same, but similar to your issue @Melkanea I have seen, on occasion, when I copy code from the forum and paste into LSL Editor that some of the words change to a different font, and the line acts weird (hard to explain) in the editor .. and definitely won't compile. Only way to clean it up has been delete and re-write. I'm using Firstorm & FireFox (on Win10). Next time it happens will try to investigate more, for curiosities sake.
  8. Since the time has past for me to be able to edit it, please ignore the above post. I had tested this out, but only briefly and must have hit the one scenario/time it was right. I have just these past days been finally in full testing of the system where this code was .. and found out that it did not work at all. After struggling with it for much longer than I should have (being stubborn) .. I went back to @animats code .. and wouldn't you know it .. worked perfectly. For my scenario though there was one problem ... llGetBoundingBox returns for the whole linkset, whilst I need it for the specific prim ... but actually calculating the prim's bounding box is fairly simple .. at least I believe so .. basically it is just the prim scale vector with each xyz divided by 2 (max) and -2 (min) ... if this is not always correct please let me know ... My final version is as follows .. mainly animat's code .. with formating changes based on how I like it (to each their own style) , the bounding box change, passing in the values as I do need this code to get these values for other prims as well and llGetObjectDetails does not bring back scale, and as well I have scenarios where I need to call this passing a scale that the prim does not have ... and then finally removing the pathMax, pathMin functions (again personal preference). vector div_vector_num(vector dividend, float divisor) { dividend.x = dividend.x/divisor; dividend.y = dividend.y/divisor; dividend.z = dividend.z/divisor; return dividend; } //find the global positions of the max and min corners of a prim //developed by animats //minor modifications by Wanda Soulstar list get_corners(vector pos, rotation rot, vector size) { // bounds in local dist from center, min & max list bound = [div_vector_num(size, -2), div_vector_num(size, 2)]; //resulting corner positions vector minCorner; vector maxCorner; //loop through the x,y,z vertices //ctrs integer ix; integer iy; integer iz; //vertices vector vx; vector vy; vector vz; //calculations vector pt; vector ptWorld; for (ix = 0; ix < 2; ix++) { vx = llList2Vector(bound, ix); for (iy = 0; iy < 2; iy++) { vy = llList2Vector(bound, iy); for (iz = 0; iz < 2; iz++) { vz = llList2Vector(bound, iz); //now get the corner ... in obj coords pt = <vx.x, vy.y, vz.z>; //translate to world coords ptWorld = pt * rot + pos; //first time through set base if ((ix + iy + iz) == 0) { minCorner = ptWorld; maxCorner = ptWorld; } else { //calc min corner if (ptWorld.x < minCorner.x){minCorner.x = ptWorld.x;} if (ptWorld.y < minCorner.y){minCorner.y = ptWorld.y;} if (ptWorld.z < minCorner.z){minCorner.z = ptWorld.z;} //and then max corner if (ptWorld.x > maxCorner.x){maxCorner.x = ptWorld.x;} if (ptWorld.y > maxCorner.y){maxCorner.y = ptWorld.y;} if (ptWorld.z > maxCorner.z){maxCorner.z = ptWorld.z;} } } } } return([minCorner, maxCorner]); }
  9. I think your question was more along the lines of pre-rental of the skybox .. no? I don't have a specific answer for you, mainly as I do not tend to use security orbs. I would think though from my experience with them in the wild, that you can set the amount of time before the orb ejects someone. So you could set this to a reasonable period for potential renters .. but finding that right period could be hard and you'll certainly end up ejecting real customers .. and personally I'd be turned off by a place that ejected me. To be honest I really do not think you have much to worry about, no one is going to squat. There are tonnes of rental places all over SL, none of which have security orbs to eject squaters.
  10. @steph Arnott I think you are missing the point here. Independent of how the scripts get into the prim .. the fact is Scenario A - Scripts are already loaded, the prim is a copy made using viewer build tools. The name has been checked using llGetInventoryType, so it 'exists' in the Prim's inventory, yet throws an error (occasionally .. not all the time) when setting the state Scenario B - The name of the script is retrieved using llGetInventoryName, so again it 'exists', and again throws an occasional error.
  11. Have done that, multiple times .. this is not occuring in a single script, and has occured in other scripts I have in the past that do something similar. I raised this on the forum some years ago, and at the time was told that there is some delay between what the Inventory 'contents list' has and the items actually being fully loaded to inventory. Putting in the llSleeps where I have reduces the occurrences of this, but still can occur.
  12. @steph Arnott In Scenario B I am not passing them from one object to another, I am dropping them on the prim, manually. In any case the point is that for some reason the code is raising an error even though it is working ...
  13. @steph Arnott Just to be clear, Scenario B occurs when dropping scripts into a prim. Scenario A is the one when copying prims. And whilst my HUD as well contains primswith the scripts, when building you more often than not want to make a copy of an existing prims, that has already been made to a size, textured, etc.
  14. Even stranger, in the Scenario B) above, I just was doing some testing, and though it threw up the error '[10:26] Could not find script 'X', Script X was set to not running
  15. Hi All, I have a re-occuring error, though not one that happens constantly. I believe I know the reason, and have a clunky work around, but was hoping someone might have a better solution. What happens is on two scenarios I have either of the following Code Snippets that at times shout an error on Debug that file 'x' was not found A) listen(integer channel, string name, key id, string message) { list params = llParseString2List(message, [FUNC_SEP], [EMPTY_STR]); string function = llList2String(params, 0); if (function == F_SCR_DATA) { gScripts = llParseString2List(llList2String(params, 1), [DATA_SEP], [EMPTY_STR]); //disable them integer num = llGetListLength(gScripts); string script; //need to wait a moment to allow inventory lists to catch up <sigh> llSleep(2.0); while (num-- > 0) { script = llList2String(gScripts, num); if (llGetInventoryType(script) != INVENTORY_NONE){llSetScriptState(script, FALSE);} } } } This one gives the error occasionally when I make a copy of the object this code is in. The start of the script makes a call to another object (HUD) to get the list of scripts, so you would think that the prim has loaded everything .. but no. Even dropping an llSleep before the While does not avoid this error 100%. B) changed(integer change) { if (change & CHANGED_INVENTORY) { //need to wait a moment to allow inventory lists to catch up <sigh> llSleep(2.0); //check if a change in the scripts integer curNum = llGetInventoryNumber(INVENTORY_SCRIPT); integer scrNum = llGetListLength(gScripts); string name; //if added if (curNum > scrNum) { gScripts = []; //get the name(s) and add to the list, stopping them while (curNum-- > 0) { name = llGetInventoryName(INVENTORY_SCRIPT, curNum); if (name != ME){gScripts += [name]; llSetScriptState(name, FALSE);} } } //or removed else if (curNum < scrNum) { while (scrNum-- > 0) { if (llGetInventoryType(llList2String(gScripts, scrNum)) == INVENTORY_NONE){gScripts = llDeleteSubList(gScripts, scrNum, scrNum);} } } } } Here it comes, as you can see, when scripts are dropped into the object. Again, not continually happening, but just once in a while. In summary, although using LLGetInventoryType to check, or actually pulling the name from llGetInventoryName, calling the LLSetScriptState on occasion fails. I do not want to be putting the script to sleep for ages .. and so was hoping someone had a solution. Thanks! Wanda
  16. @steph Arnott No what I am doing is setting a prim to mirror the angle of another prim, as in the two sides of a roof for example. The previous code snippets helped, and what I was missing was the formula to get the 'mirror' value .. which KT kindly pointed out to me .. so all good now!
  17. @steph Arnott I know you gave me exactly what I asked for .. I had just not described my problem fully or properly, so all my fault.
  18. Spot on (and staring me right in the face) @KT Kingsley Thanks!!!!
  19. All .. just was finally debugging inworld an realised I had, by the example given, not fully explained what I am trying to do. The previous answers around EulertoRot and back helped .. but I realised that I need to calculate the actual value I need to add .. it is not 180 as I gave in the example. What I want to do is mirror an angle ... this means if base x is 300 .. mirror x is 60; if base x is 330 .. mirror x is 30.; etc .... Does anyone know of a formula to be able to calculate this? I only want to change the selected axis rotation ...
  20. Thanks @Wulfie Reanimator ... had missed that line in the Wiki .. and @steph Arnottyou were correct as well .. see the solution they provide in the wiki ..
  21. Hi all, After all these years of using notecards in scripts I have just come across a small issue and was wondering if someone had an answer. What is happening is, after checking that the notecard actually exists, and I call llGetNotecardLine (or llGetNumberOfNotecardLines same result). I was then getting a debug error that the Notecard did not exist, whilst it actually did exist in the inven. After a bit I was able to isolate the problem: the notecard had not been initialised. What I mean by this is that I had created a new notecard in inven, and as there is a scenario where the notecard could exist, but be empty, I left it as that without opening. Apparently the system does not like this. If you open the note card make changes, but leave it with no lines and save .. you are fine. My question is, does anyone know of a way to protect against this, i.e. avoid code breaking? Thanks ... Wanda
  22. @Fenix Eldritch Thanks! @Wulfie Reanimator I am creating a texture for a display panel that shows the name of a script 🙂
×
×
  • Create New...