Jump to content

Kai Sirenz

Resident
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Kai Sirenz

  • Rank
    Member
  1. Alright so I changed it to what I posted, it worked once, but after pressing it again nothing rezzes. No break links errors though
  2. If I do that surely it will end up as an infinite loop since CountC is reset at the start of every statement? I'm not sure what you mean by projectile, there is no projectile script, the movement is set with velocity inside that script, if you mean the object it contains no scripts If !spear is the message then CountC = 0, get pos etc and then the script is told to do the rez + increments, I'm unsure what the while does here. Hypothetically wouldn't something like this work just as well? string object = "Nier: Automata Pod Program Spear"; // Name of object in inventory vector relativePosOffset = <0.0, 0.0, 0.25>; // "Forward" and a little "above" this prim vector relativeVel = <0.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/s rotation relativeRot = <10.0, 5.0, 10.0, 10.0>; // Rotated 90 degrees on the x-axis compared to this prim integer countC = 0; integer startParam = 10; default { link_message(integer sender_number, integer number, string message, key id) { while (message == "!spear" && countC < 15) { countC++; vector myPos = llGetPos(); rotation myRot = llGetRot(); vector rezPos = myPos+relativePosOffset*myRot; vector rezVel = relativeVel*myRot; rotation rezRot = relativeRot*myRot; relativePosOffset.x++; relativeRot.y++; llRezObject(object, rezPos, rezVel, rezRot, startParam); } CountC = 0; } }
  3. string object = "Nier: Automata Pod Program Spear"; // Name of object in inventory vector relativePosOffset = <0.0, 0.0, 0.25>; // "Forward" and a little "above" this prim vector relativeVel = <0.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/s rotation relativeRot = <10.0, 5.0, 10.0, 10.0>; // Rotated 90 degrees on the x-axis compared to this prim integer countC = 0; integer startParam = 10; default { link_message(integer sender_number, integer number, string message, key id) { while (message == "!spear" && countC < 15) { countC++; vector myPos = llGetPos(); rotation myRot = llGetRot(); vector rezPos = myPos+relativePosOffset*myRot; vector rezVel = relativeVel*myRot; rotation rezRot = relativeRot*myRot; relativePosOffset.x++; relativeRot.y++; llRezObject(object, rezPos, rezVel, rezRot, startParam); } } }
  4. Hey so just on the back of this if (message == "R000") { llSetTimerEvent(0.0); llListenRemove(listenHandle); llSay(0,"Activating turret."); // llSay(0,"Pod Program R:000 is currently undergoing maintenance."); llSay(1,"!shoot"); llMessageLinked(LINK_THIS, 1, "!shoot", NULL_KEY); } else if (message == "R050") { llSetTimerEvent(0.0); llListenRemove(listenHandle); llSay(0, "Activating Pod Program: R050."); // llSay(0,"Pod Program R:000 is currently undergoing maintenance."); llSay(1,"!spear"); llMessageLinked(LINK_THIS, 1, "!spear", NULL_KEY); } The script usually runs if I refresh the spear script object name, but other than that it doesn't and is currently flooding me with Script trying to break links but PERMISSION_CHANGE_LINKS permission not set! I'm very confused
  5. ah oops, it works now! thank you all so much for your help these past few days! ❤️
  6. Alright so I tried this in the shooting script state_entry() { llMessageLinked(LINK_THIS, 0, llGetScriptName(), ""); } link_message(integer sender_number, integer number, string message, key id) { if (message == "!shoot") { vector myPos = llGetPos(); rotation myRot = llGetRot(); vector rezPos = myPos+relativePosOffset*myRot; vector rezVel = relativeVel*myRot; rotation rezRot = relativeRot*myRot; llRezObject(object, rezPos, rezVel, rezRot, startParam); And this in the Dialog if (message == "R:000") { //stop the timer llSetTimerEvent(0.0); //remove listen llListenRemove(listenHandle); //this can be removed if you actually do not need this in open chat llSay(0,"!shoot"); //call to other Script llMessageLinked(LINK_THIS, 0, "!shoot!", NULL_KEY); } With no luck (shooting script works on it's own without the linking if "!shoot" is typed into public chat)
  7. Yes the other script is in the prim as well! Would I still need the listen function when doing this? Because I removed the listen part and replaced it with link_message and ultimately did nothing, I presume it would need both but I'm unsure how to do that. This is the shoot script, I can understand the code in the dialog is telling it to link "!shoot" into the shooting script on channel 0, where the script is listening, it prints "!shoot" into chat but does not rez. default { state_entry() { llListen(0,"", NULL_KEY, ""); } listen(integer channel, string name, key id, string message) { if (message == "!shoot") { vector myPos = llGetPos(); rotation myRot = llGetRot(); vector rezPos = myPos+relativePosOffset*myRot; vector rezVel = relativeVel*myRot; rotation rezRot = relativeRot*myRot;
  8. Then the other script is checking that it's only the avatar speaking and nothing else. That's right, I don't understand the second line though
  9. Thank you all for your help! My next question is that the object is obviously saying this, from what I can see on the Wiki and posts about it they can't listen to themselves, is there a way I can get round this? i.e making my avatar say it on 1 or something? The other script is triggered by saying !shoot n I figured it wouldn't be more complicated than that lol
  10. I think I do too, but if that's the case I can't work out why the above code won't open another menu.
  11. So using this @Wandering Soulstar where the second dialog box is called, it does nothing once "Weapons" is pressed, no new box is opened! And @Innula Zenovka I understand that snippet to make a second menu box appear I would just call llDialog and set up the listener and timer in one of the if statements with a new list and string? list buttons = ["Weapons", "Music", "Return"]; string dialogInfo = "\nHow can I help you?."; key ToucherID; integer dialogChannel; integer listenHandle; default { state_entry() { dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); } touch_start(integer num_detected) { ToucherID = llDetectedKey(0); listenHandle = llListen(dialogChannel, "", ToucherID, ""); llDialog(ToucherID, dialogInfo, buttons, dialogChannel); llSetTimerEvent(60.0); // Here we set a time limit for responses } listen(integer channel, string name, key id, string message) { //stop the timer llSetTimerEvent(0.0); //remove listen llListenRemove(listenHandle); //first level menu responses if (message == "Programs") { string dialogInfo = "\nWhich function should I perform?"; list buttons = ["R000", "R030", "R050"]; //call second level menu listenHandle = llListen(dialogChannel, "", ToucherID, ""); llDialog(ToucherID, dialogInfo, buttons, dialogChannel); llSetTimerEvent(60.0); // Here we re set a time limit for responses if (message = "R000") { //stop the timer llSetTimerEvent(0.0); //remove listen llListenRemove(listenHandle); llSay(0,"!shoot"); } else if (message == "R030") { llSay(0,"This function is not operable yet."); } else if (message == "R050") { llSay(0,"This function is not operable yet."); } } else if (message == "Music") { llSay(0,"This function is not Operable yet."); } else if (message == "Return") { llSay(0,"Until next time."); } } timer() { // stop timer llSetTimerEvent(0); llListenRemove(listenHandle); llWhisper(0, "Sorry. You snooze; you lose."); } }
  12. so I need to call llDialog for each new menu I want to work? I'm still a bit confused, I tried adding llDialog before if r000 and it didnt work!
  13. Hi, I'm new to LSL and I'm trying to work on a Dialog box, that opens another dialog box when an option is clicked, I'm looking at the Wiki examples, the "primitive" one I can understand and follow quite well but the more advanced one I can't, but even with the basic one I can't work out how to call a second Dialog box when an option is pressed! My biggest issue is that I can't understand where in the script it actually *tells* the box what to do with each button? When I close the first if statement every option just prints "!shoot" - been trying to solve it for hours and it's giving me a headache now, any help would be appreciated! list buttons = ["Weapons", "Music", "Return"]; string dialogInfo = "\nHow can I help you?."; key ToucherID; integer dialogChannel; integer listenHandle; default { state_entry() { dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); } touch_start(integer num_detected) { ToucherID = llDetectedKey(0); llListenRemove(listenHandle); listenHandle = llListen(dialogChannel, "", ToucherID, ""); llDialog(ToucherID, dialogInfo, buttons, dialogChannel); llSetTimerEvent(60.0); // Here we set a time limit for responses } listen(integer channel, string name, key id, string message) { if (message == "Programs") { //string dialogInfo = "\nWhich function should I perform?"); //list buttons = ["R000", "R030", "R050"]; //llSay(dialogChannel,"Programs Selected)" } if (message = "R000") { llSay(0,"!shoot"); } else if (message == "R030") { llSay(0,"This function is not operable yet."); } else if (message == "R050") { llSay(0,"This function is not operable yet."); } else if (message == "Music") { llSay(0,"This function is not Operable yet."); } else if (message == "Return") { llSay(0,"Until next time."); } } timer() { // stop timer llSetTimerEvent(0); llListenRemove(listenHandle); llWhisper(0, "Sorry. You snooze; you lose."); } }
  14. got close enough with a simple rez script telling it where to rez, not always accurate but works fine enough
  15. Is there anyway I can get the position of the object I want it to shoot from? So it's not coming out of my center? control(key id, integer held, integer change) { rotation Rot = llGetCameraRot(); if ( held & change & CONTROL_ML_LBUTTON) { if (llGetInventoryType(gShootSound) == INVENTORY_SOUND) llPlaySound(gShootSound, 1.0); llRezObject(gBullet, llGetLocalPos() + <1.5, 0.0, 0.0>*Rot, gVelocity*llRot2Fwd(Rot), Rot, 10); llSleep(gReloadTime); } I tried swapping rezatroot and getcamera pos for those but now it doesn't shoot at all. I'm trying to get it to shoot from an attachment!
×
×
  • Create New...