Jump to content

Surssin

Resident
  • Posts

    40
  • Joined

  • Last visited

Everything posted by Surssin

  1. That was the missing bit. I feel silly because I knew I needed the "GetOwner" part, but I couldn't add it without getting an error. Now I see what I was missing. It works as desired now. Thank you!
  2. I can't seem to get it to work. I can get it to detect if I'm sitting when I attach it, but I can't get a timer to recheck the status of sitting/not. My best effort. integer gSitting; integer sit; key ID; default { state_entry() { llSetTimerEvent(5.0); } attach(key ID) { sit = llGetAgentInfo(ID); if (sit & AGENT_SITTING) { llOwnerSay("Is sitting"); } else { llOwnerSay("Has stood up"); } } timer() { key ID; integer sitting = llGetAgentInfo(ID)&(AGENT_SITTING|AGENT_ON_OBJECT); if(sitting!=gSitting) { gSitting=sitting; if(gSitting) { llOwnerSay("Is sitting"); } else { llOwnerSay("Has stood up"); } llOwnerSay((string)sitting); } } }
  3. hm, when I try it, I don't get the responses when I sit on something. I'll try the adjustments you mentioned after work. Unless someone has a different way to do it.
  4. I don't care what I'm sitting on. It's all about "am I sitting?" I managed to man-handle the example into accurately detecting sit on attach. So that's one part down. Thanks for that. Now I just need help with the timer part, or whatever I need, to have it detect when I stand up.
  5. I swear I've tried to find ways to do it, so I'm probably looking right past some simple example. I want to have an attachment react to the wearer sitting vs not sitting. Both when it's attached, or just "oh hey, you're sitting now. We're going to do X. Oh you stood up? Okay. We'll do Y." I'm confident I can get it to do what I want it too when those states are detected, but I can't figure out how to get it to detect sitting vs not. I saw about the llGetAgentInfo, but I'm at a loss as to how to use that to do what I'm looking for. P.S. Noob scriptor. Forgive me missing anything simple.
  6. For someone better than me, I have absolutely no doubt. But this is a system I understand and can adapt to fit my end goals (such as easily adding or removing options). So if I can get it to operate with the main menu, that'll do. I'm not good enough to condense it. And I plan to eventually sell these scripts so people can build their own gags like I did. Getting someone to do all of that work for free or a price I can afford with that understanding is highly unlikely.
  7. well that's progress. I FINALLY had it save without any error messages! ...Now I just gotta get the link stuff part to ACTUALLY work (it doesn't right now). But still, thank you!
  8. Sheesh. How does anyone stay sane doing this? It's like pulling weeds. Got that fixed (I think), but now on the line listed below, it's giving me a "name not defined within scope" error. if(option == "RLV 1...")
  9. I don't think that's it. With out that line, I get a "Dead code found beyond return statement" error, and STILL get the other error as well. I added that in as an attempt at a cheat to get around that. Edit: The "Not all code paths return a value" error jumps to the end of the script, if that helps.
  10. So with a little help I DID finally clear the syntax error. Had to cheat a little to get around a "dead code" error, but now I get a different one; "Not all code paths return a value" I think it's time I just posted the whole second script (the first one is behaving, though no idea if the linking works yet), and see if I can get schooled on what I'm missing and how to make what I want to happen, happen. For reference, "RLV 1..." is the first page of this second script's menu, and the one the main menu would call up when someone chooses "RLV" on the main meny. I'll also need to tune things so that when "Main Menu" is chosen, you get the main menu. integer RLVFlags=65533; list pList; key tkey; RLVRefresh() { if(RLVFlags & 4) trestrict += ",showinv=y"; else trestrict += ",showinv=n"; if(RLVFlags & 32) trestrict += ",addoutfit=y,addattach=y"; else trestrict += ",addoutfit=n,addattach=n"; if(RLVFlags & 64) trestrict += ",remoutfit=y,remattach=y"; else trestrict += ",remoutfit=n,remattach=n"; if(RLVFlags & 128) trestrict += ",touchattachother=y"; else trestrict += ",touchattachother=n"; if(RLVFlags & 256) trestrict += ",touchattachself=y"; else trestrict += ",touchattachself=n"; if(RLVFlags & 512) trestrict += ",touchworld=y"; else trestrict += ",touchworld=n"; if(RLVFlags & 1024) trestrict += ",edit=y"; else trestrict += ",edit=n"; if(RLVFlags & 2048) trestrict += ",rez=y"; else trestrict += ",rez=n"; if(RLVFlags & 4096) trestrict += ",touchfar=y"; else trestrict += ",touchfar=n"; if(RLVFlags & 8192) trestrict += ",sittp=y"; else trestrict += ",sittp=n"; if(RLVFlags & 16384) trestrict += ",showworldmap=y,showminimap=y"; else trestrict += ",showworldmap=n,showminimap=n"; if(RLVFlags & 24) trestrict += ",shownearby=y,shownametags=y"; else trestrict += ",shownearby=n,shownametags=n"; if(RLVFlags & 32768) trestrict += ",startim=y"; else trestrict += ",startim=n"; llOwnerSay(trestrict); } string IsOffOn(integer value) { if(value) return "off"; return "on"; } string IsBlockedAllowed(integer value) { if(value) return "allowed"; return "BLOCKED"; } string At() { { } if(option == "RLV 1...") { tstring = "Configure the current RLV options (1/2).\nRLV is currently "; if(RLVFlags & 1) tstring += "ACTIVE\n\n"; else tstring += "DISABLED\n\n"; tstring += "Current Restrictions:"+"\nInventory - "+ IsBlockedAllowed(RLVFlags & 4) +"\nWear clothing - "+ IsBlockedAllowed(RLVFlags & 32) +"\nUnwear clothing - "+ IsBlockedAllowed(RLVFlags & 64) +"\nTouch attach (other) - "+ IsBlockedAllowed(RLVFlags & 128) +"\nTouch attach (self) - "+ IsBlockedAllowed(RLVFlags & 256) +"\nTouch world - "+ IsBlockedAllowed(RLVFlags & 512) +"\n(More on page 2)"; tlist = ["Disable All RLV", "Unwear "+ IsOffOn(RLVFlags & 64), "Touch Wld "+ IsOffOn(RLVFlags & 512), "Enable Most RLV", "Wear "+ IsOffOn(RLVFlags & 32), "Touch Sel "+ IsOffOn(RLVFlags & 256), "Enable All RLV", "Inv. "+ IsOffOn(RLVFlags & 4), "Touch Oth "+ IsOffOn(RLVFlags & 128), "Main Menu", "RLV 2..."]; } else if(option == "RLV 2...") { tstring = "Configure the current RLV options (2/2).\nRLV is currently "; if(RLVFlags & 1) tstring += "ACTIVE\n\n"; else tstring += "DISABLED\n\n"; tstring += "Current restrictions:\nEdit - "+ IsBlockedAllowed(RLVFlags & 1024) +"\nRez - "+ IsBlockedAllowed(RLVFlags & 2048) +"\nMaps & Location "+ IsBlockedAllowed(RLVFlags & 16384) +"\nFar touch - "+ IsBlockedAllowed(RLVFlags & 4096) +"\nFar sit - "+ IsBlockedAllowed(RLVFlags & 8192) +"\nStartIM - "+ IsBlockedAllowed(RLVFlags & 32768) +"\nNametags & Radar - "+ IsBlockedAllowed(RLVFlags & 24) +"\n(More on page 1)"; tlist = ["Disable All RLV", "Maps "+ IsOffOn(RLVFlags & 16384), "Nametags "+ IsOffOn(RLVFlags & 24), "Enable Most RLV", "Rez "+ IsOffOn(RLVFlags & 2048), "StartIM "+ IsOffOn(RLVFlags & 32768), "Enable All RLV", "Edit "+ IsOffOn(RLVFlags & 1024), "Farsit "+ IsOffOn(RLVFlags & 8192), "Main Menu", "RLV 1...", "Fartouch "+ IsOffOn(RLVFlags & 4096)]; } else if(llSubStringIndex(message, "Inv. ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 4) ^ 4); else RLVFlags = RLVFlags | 4; remenu = "RLV..."; } else if(llSubStringIndex(message, "Wear ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 32) ^ 32); else RLVFlags = RLVFlags | 32; remenu = "RLV..."; } else if(llSubStringIndex(message, "Unwear ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 64) ^ 64); else RLVFlags = RLVFlags | 64; remenu = "RLV..."; } else if(llSubStringIndex(message, "Touch Oth ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 128) ^ 128); else RLVFlags = RLVFlags | 128; remenu = "RLV..."; } else if(llSubStringIndex(message, "Touch Sel ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 256) ^ 256); else RLVFlags = RLVFlags | 256; remenu = "RLV..."; } else if(llSubStringIndex(message, "Touch Wld ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 512) ^ 512); else RLVFlags = RLVFlags | 512; remenu = "RLV..."; } else if(llSubStringIndex(message, "Edit ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 1024) ^ 1024); else RLVFlags = RLVFlags | 1024; remenu = "RLV 2..."; } else if(llSubStringIndex(message, "Rez ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 2048) ^ 2048); else RLVFlags = RLVFlags | 2048; remenu = "RLV 2..."; } else if(llSubStringIndex(message, "Fartouch ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 4096) ^ 4096); else RLVFlags = RLVFlags | 4096; remenu = "RLV 2..."; } else if(llSubStringIndex(message, "Farsit ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 8192) ^ 8192); else RLVFlags = RLVFlags | 8192; remenu = "RLV 2..."; } else if(llSubStringIndex(message, "StartIM ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 32768) ^ 32768); else RLVFlags = RLVFlags | 32768; remenu = "RLV 2..."; } else if(llSubStringIndex(message, "Maps ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 16384) ^ 16384); else RLVFlags = RLVFlags | 16384; remenu = "RLV 2..."; } else if(llSubStringIndex(message, "Nametags ") == 0) { if(llGetSubString(message, -3, -1) == "off") RLVFlags = ((RLVFlags | 24) ^ 24); else RLVFlags = RLVFlags | 24; remenu = "RLV 2..."; } else if(message == "Enable Most RLV") { RLVFlags = ((RLVFlags | 4) ^ 4); RLVFlags = ((RLVFlags | 32) ^ 32); RLVFlags = ((RLVFlags | 64) ^ 64); RLVFlags = ((RLVFlags | 128) ^ 128); RLVFlags = ((RLVFlags | 256) ^ 256); RLVFlags = ((RLVFlags | 1024) ^ 1024); RLVFlags = ((RLVFlags | 2048) ^ 2048); RLVFlags = ((RLVFlags | 16384) ^ 16384); remenu = "RLV..."; } else if(message == "Enable All RLV") { RLVFlags = ((RLVFlags | 4) ^ 4); RLVFlags = ((RLVFlags | 32) ^ 32); RLVFlags = ((RLVFlags | 64) ^ 64); RLVFlags = ((RLVFlags | 128) ^ 128); RLVFlags = ((RLVFlags | 256) ^ 256); RLVFlags = ((RLVFlags | 512) ^ 512); RLVFlags = ((RLVFlags | 1024) ^ 1024); RLVFlags = ((RLVFlags | 2048) ^ 2048); RLVFlags = ((RLVFlags | 4096) ^ 4096); RLVFlags = ((RLVFlags | 8192) ^ 8192); RLVFlags = ((RLVFlags | 16384) ^ 16384); remenu = "RLV..."; } else if(message == "Unsit") { llOwnerSay("@unsit=force"); remenu = "RLV..."; } else if(message == "Disable All RLV") { RLVFlags = RLVFlags | 65533; remenu = "RLV..."; } else if(message == "Main Menu") { llMessageLinked(LINK_THIS,0,"Main Menu",""); } else if(message == "Clear") { RLVFlags = RLVFlags | 65533; } } default { state_entry() { } }
  11. Like I said, just way above my head. Thank you for trying, but really I'm pretty much just giving up. It's more complex than I can manage right now.
  12. Well one script it's saying the error is the very last bracket at the end. not sure how to post that one. The other is this section, with a little bit above and below for some context. (I haven't added MY options/commands to it yet)
  13. Nope, my brain is fried. Thank you all for trying, but I think this is beyond me. I'm gonna need to find someone to make these changes for me.
  14. It's telling me the error is at the very very end. The final bracket. I've tried to match them up but I can't seem to.
  15. I've tried and tried, and to me it seems like it should be fine and match up, but I still get the same syntax error.
  16. *sighs* I think I'll need to find direct help with this one. I keep getting "syntax errors". I know it has to do with the brackets ( { } ), but I can't figure out why. I've never been able to understand exactly when you need which and how many. So I can't even figure out if I'm doing the linked parts right.
  17. So much for simple. lol. I think I'll get it, but it's gonna take some serious mental gymnastics. Thankfully, I'm getting better at that. Thank you for the insight. Don't be afraid to offer more if someone has some. You might cover something that wasn't.
  18. Okay. Following so far. So for those other commands I mentioned, I'll need to add a messagelink too, right? (Button on main menu is pressed, setting X on this separate script needs to be applied.)
  19. I'm still learning SO much about scripting so a lot of that went over my head. lol. In my case, at least as far as I can think, just about all of the elements of the menu section I want to separate out would be self contained in its own script. Though there are a couple of commands in the primary that the secondary would need to listen for. One being an end of timer event (timer hits zero, set setting X).
  20. I swear I looked for it but my search wording SUCKS, so I apologize if I looked right over it. I'm trying to figure out how to do something. So I have one script that is just too full. I've seen many things have an entire section of their menu on a different script, but it's all one menu system. I was wondering how I would do that. If I could split this one, long part of my menu into it's own script, it would give me all of the memory space I need to do the things I want to do. As an example of what I mean; say you have a tank. It's controlled through one menu you can navigate, but the code for the "main gun" option is on a separate script than where the rest of the menu is. How would I make that happen?
  21. huh, thought I added an updated reply. Sorry. Before I had added a section that looked like this; if(openMouth) // attempt to keep mouth open. animateMouth(); if(MuzzleMouth) // attempt to keep mouth open. animateMouth(); Now it looks like this, and seems to be working properly now; if(openMouth || MuzzleMouth) // attempt to keep mouth open. animateMouth(); Not sure why the second version works but the other had the bug I mentioned. I only know that as far as I can tell it's working now. But I never would have thought of it without the help I got here, so thank you. Next rabbit hole: smoother walking while leashed.
  22. Well, my fix works, but now I got a different bug going with it. It's like both are competing so when I use my JOMO hud to open my mouth (with gag attached, but no gag set), it cycles so my mouth is constantly opening and closing. So that's not gonna do it. Any additional ideas?
  23. Actually... I think you got it backwards, but still found the right hole in the code. The problem is there's no entry for "MuzzleMouth" (the closed mouth state) in that section and there needs to be. I've added a copy of that bit of code but with "MuzzleMouth" instead of "openMouth". So far my testing seems to show it fixed, but please, if anyone else thinks my problem lies elsewhere do chime in. I'll let you know moving forward if I continue to see it fixed. Thank you greatly for taking the time to look it over.
  24. Hello there. I have a nice OLD script that I adapted for a muzzle. I had to have it trigger a looped animation to keep my mouth closed when muzzled. That works well enough, except sometimes when I stand from things, the animation seems to have been stopped. Not overridden, stopped completely. I don't see it listed among the playing animations when I bring up the list. Is there some little thing I can add to make the script, I don't know, restart the animation periodically? What's weird is as far as I can tell, the animation to keep my mouth open (for things like a ball gag) DOESN'T get canceled in this manner. So I'm not sure why one does, but not the other. Both are the same priority. I'm gonna add a comment with the full script pasted. It's a bit long, so fair warning. Otherwise, I'm open to ideas.
×
×
  • Create New...