Jump to content

Exylos

Resident
  • Posts

    22
  • Joined

  • Last visited

Reputation

1 Neutral

Recent Profile Visitors

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

  1. Thank you my god, I was thinking about it backwards, which is why i couldnt figure it out..lol.. Thank you very much
  2. OK so i am working on an HP meter, I want it to get the start amount of HP from the meters description. So i have that done, and it works. When you are say shot, you lose HP just fine. Now i am trying to do the heartbeat regen timer. This is where i have my issue. I have tried every thing i can think of to get this to work. I want the timer to stop add + to health, when it matches the Object desc. here is the first Part. llListen(HUNTCHAN,"","",""); //llSetTimerEvent(1.0); //one second heartbeat string health = llGetObjectDesc(); // This works just fine but now the timer. timer() { health += 1; llSay(-15238," HEALTH="+(string)health); if (health>?????) health=????; llSay(-15238," HEALTH="+(string)health); } } I know normally that Expression would be for if you have a hardcoded number for the health. BUT my Health starts from the Object description. So what would I put in the timer. So it knows look at the object description, and if Health is greater than the object decription, then you set it to the object description. The stupid part is i feel like I know, but its like trying to think of a word, and no matter how deep in your brain pan you reach your not finding it.
  3. That is part of what I ended up doing. I had intended to make the Notecard control script and the Message Control script two different scripts for the purpose of ease, With them as two scripts it would be easier to add in commands for other Scripts and other parts when i get to them with out fear of putting in the wrong script and messing it all up. But i decided to hell with it, put the Message script and the Notecard control in the same script and now it works fine. If you take the and just rez it out it doesn't change or lose the exp setting, and now it adds that amount to the display print out easily, and you can just add it back to worn and it will hold the exp that was last on it, the issue only comes in when you fully reset the scripts, and anyone who knows anything about people will no even if you put a big disclaimer on it that says, never reset your scripts or you will lose all EXP, someone is gonna do it anyway. Thats why I want the Notecard so they can save the info in it and even if they do lose some exp it wont be all of it. But anyway its working fine now thank you all.
  4. I am aware of that, Hence it being one you saved the info in as the player yourself, and the counter just starting with that Info., But thats ok I have decided to try and go a different route with it anyway
  5. The note card is used because, it the player has to be able to save certain details, at the end of each of the sessions, so they progress is not lost by accident, and some parts rely on other parts from that CT sheet notecard to do their job. for instance, If you choose race whatever lest say human, in the Character creation aid tool i am building, you will be allowed a different number of points to put into your stats, than if someone chose dragonette, Because of that the First exp points that you start with will be slightly different. Same with Health points. If i hard code the info in the script then the player can't change that info, nor can they save that info for later use... Lets say you go and play the game i am working on, and kill two dragons for 1000 exp each. You cant save it, its saved only in the hard coding of the script, then something goes wrong and you have to reset the huds scripts, you just lost that exp. This way if you saved it in the notecard, when you reset the script the HUD starts from the last save point.
  6. The rest of the script works, but because its a simple llSay(0, "expddten"); and the script then Adds 10 points to whatever the last count was. But for that first notecard amount i am sending a string to channel because it could be a random number between 0 and 5250, and accept for the way above. Which is the first time i ever tried that. I don't know anyway to tag a message post with a command and String of numbers, if that makes sense since i am brain fried..lol..
  7. Pretty much yeah, its an exp counter like you would find in an rpg, but basically yes it is. But i cant get the listner to accept the first amount from the note card as the first number. to add and subtract from.
  8. Ok so the listener Changes a counter based on a incoming command, well several actually.. The global for the counter is 0, It has to be 0 because the script wont save if it isn't The commands that it listens to comes from items that are made by me and in my region. So lets say the the counter starts at 0 and i send the command to add 10 the counter goes from 0 to 10 the next time i send the message to add it 10 it goes to 20. Works great. Now the part I am stuck at, the HUD uses a Character sheet, in the form of a notecard, that the player can save the last amount exp earned themselves. BUT i need the counter to start with that number. instead of 0, I have the Notecard handler done, it reads the notecard, it sends the message of the EXP that is saved in the notecard. So now I just need a way to make the listen reconise the sent message number as the first change to the counter. So it would work the same way that this command would XP = XP + 10; in the rest of the if statements of if the listener. The scirpt piece that i used above, if you read it should do what i want. It should Divide the message into two parts, the Tag that Identifies the if(msg == " so that it knows that is the command to work with, and it then it should do the next part . It is not hearing the message, and I dont know if the flaw is in the listner or the message.. This is the message that should tell the listen to set the counter to the number saved in the notecard. llSay(0,llList2CSV( [ "expdd ",(string)amount ])); it is working it does send the message, but the listner does not hear it so doesn't change the counter at all, and I have two debug messages, for it to print the output in two places and its not doing either of those things. I have found in the script if I get the counter to accept the command to add in any amount then after that any new amount added starts at the last amount entered. XP = XP + llList2Integer(tMsg,1);
  9. ok So i tried this, because It looks like it would do what i want, What i have noticed while writing the script is that once the listener recieves the first message that updates the EXP counter, the amount doesn't matter, it will always update from last count. So the above looked like it should work. So i have the message being sent from the Notecard handler script, Showing the amount saved using this command llSay(0,llList2CSV( [ "expdd " , (string)amount ])); Yes i am aware that using channel 0 is bad, I was using it to debug while I checked if i could get this to work. But anyway, so the Note handler script is reading the proper line for the XP amount, and it is saying it on the chat channel so the read out looks like this. [05:29] HUD: expdd , 140 So far as I can tell that is correct that is what I want to see, and I have checked no matter what I set in the EXP line of the Notecard it posts the proper changed number. Now we come to the listener. I put this listener in, and I have tried it two ways. The first was exactly the way you posted it above. It did not react at all, and the two debug message options The say to -15231 to a Display panel and to the Objects description. Saw no change So I can only conclude that the listener is not hearing the message, I am not sure why So i tried it a bit differently. listen(integer channel, string name, key granterid, string msg){ if(channel==chan1){ //Split the incoming message up everytime we find a comma into individual elements in a list key objectowner = llList2Key(llGetObjectDetails(granterid,[OBJECT_CREATOR]),0); key regionowner = llList2Key(llGetParcelDetails(<0,0,0>,[PARCEL_DETAILS_OWNER]),0); if(objectowner==regionowner){ } list tMsg=llCSV2List(message); //Check if the first entry in the tMsg list is 'expdd' if(llList2String(tMsg,0)=="expdd"){ //If so then add the second entry which is our xp amount to the XP variable XP = XP + llList2Integer(tMsg,1); text = (string)XP; llSay(-15231, text); } The reason for the attempt was I thought maybe as was the issue with one other comment that maybe just moving the spot a bit might fix the problem as it was the expression was just slightly off. But still the listener is doing nothing, like it is not hearing the message at all. So any ideas.
  10. ok Update link_message(integer sender_num, integer XP, string message, key id) { if (id == "256481") { llSay(0, message ); XP = (integer) message; llSay(0, (string)XP); }} So the above script now works, It turns out the first line of the below was if ((string)((integer)message) == XP ) one issue, It was comparing the incoming random amount to global 0 and then reverting it back to 0 when it did not match. BUT t hats ok I took it out and it now works, when you tell it to print out String XP after the conversion it gives the correct out put. NOw the issue is making the Listen event accept that Number as the replacement for the Global event, because the global is still 0 according to the listen event which doesn't make any sense. YET
  11. } link_message(integer sender_num, integer XP, string message, key id) { if (id == "256481") { llSay(0, message ); if ((string)((integer)message) == XP ) // That is, if the message is a potential integer XP = (integer) message; llSay(0, (string)XP); } I thought i put this in but i am not seeing it. This is the actual code.
  12. [14:40] Hud: 200 //this is the Message that is being recieved before the script parts I just added [14:40] HUD: 0 //This is the output of the required XP string after the Link message code. So somewhere in this (string)XP; Which is what the counter part needs, is not getting the message, I think he is drunk and not willing to listen to direction There you go.
  13. Yes i have but I am not ready for that yet, right now I need to see the text so i can read it for sure right now, I will eventually get to lists and stuff, but I don't want to start abbreviation so to speak until I can get it correct when its written out completely first.
  14. Right the Sender script is sending it, I know that because I did a normal say message in 0 in the chat into it to test that it was sending it and it was receiving the message i told it to send. But i think i will walk away from it for a bit, because my eyes are starting to hurt from staring holes at it and rereading it over and over again..laughs, thanks again for the help guys.
  15. ok this will be a long one integer chan1 = 100; integer chan2 = -1; integer upturn = 0; key owner; integer handel ; vector color = <1.0, 1.0, 1.0>; string default_text = "0"; string text; string message; integer XP = 0; integer MAXXP = 5450; // max experience points integer MIN_XPLEVEL = 1; integer MAX_XPLEVEL = 30; integer lvl1 = 10; integer lvl2 = 30; integer lvl3 = 50; integer lvl4 = 75; integer lvl5 = 105; integer lvl6 = 140; integer lvl7 = 180; integer lvl8 = 225; integer lvl9 = 280; integer lvl10 = 335; integer lvl11 = 395; integer lvl12 = 475; integer lvl13 = 550; integer lvl14 = 650; integer lvl15 = 800; integer lvl16 = 950; integer lvl17 = 1100; integer lvl18 = 1250; integer lvl19 = 1450; integer lvl20 = 1650; integer lvl21 = 1850; integer lvl22 = 2150; integer lvl23 = 2450; integer lvl24 = 2750; integer lvl25 = 3050; integer lvl26 = 3450; integer lvl27 = 3850; integer lvl28 = 4250; integer lvl29 = 4650; integer lvl30 = 5450; key id; Message_Control(integer l, integer n) // Message_Total_Lack_Of_Control { integer r = (++n); // Increment the value of n. llMessageLinked( l, r, "", ""); // Send the result to l } default { state_entry() { owner = llGetOwner(); handel = llListen(chan1,"","",""); handel = llListen(chan2,"","",""); } link_message(integer sender_num, integer XP, string message, key id) { if (id == "256481") { if ((string)((integer)message) == XP ) // That is, if the message is a potential integer { XP = (integer) message; }}} listen(integer channel, string name, key granterid, string msg) { if (channel == chan2){ } else if (channel == chan1) { // do stuff key objectowner = llList2Key(llGetObjectDetails(granterid,[OBJECT_CREATOR]),0); key regionowner = llList2Key(llGetParcelDetails(<0,0,0>,[PARCEL_DETAILS_OWNER]),0); if(objectowner == regionowner) //llSay(0,msg); // llSay(0,(string)upturn); // llSay(0, (string)upturn); if(msg == "expdds") { XP = XP + 1; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if(msg == "expddten") {// llWhisper(0, "1up recieved"); XP = XP + 10; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if(msg == "expdd20") {// llWhisper(0, "1up recieved"); XP = XP + 20; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if(msg == "expdd50") {// llWhisper(0, "1up recieved"); XP = XP + 50; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if(msg == "expdd-1") {// llWhisper(0, "1up recieved"); XP = XP - 1; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if(msg == "expdd-10") {// llWhisper(0, "1up recieved"); XP = XP - 10; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if(msg == "expdd-20") {// llWhisper(0, "1up recieved"); XP = XP - 20; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if(msg == "expdd-50") {// llWhisper(0, "1up recieved"); XP = XP - 50; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if(msg == "expdd-100") {// llWhisper(0, "1up recieved"); XP = XP - 100; text = (string)XP; llSay(-15231, text); llSetObjectDesc(text); } if ( XP >= MAXXP ) { llOwnerSay("You have reach the Max HP possible!! Congrats you have won, for now.((Insert Creepy ass laugh)))"+(string)XP); } } }} This is the whole counter and message control.. So Rollig thank you what you gave me compiled, But the listen is still ignoring the incoming Link message, and I know this is probally sloppy compared to a lot of what you guys do, but i don't feel i am up to Abbreviation of code yet, But I dont get what i am missing. It is supposed to get the link message when the Script is reset the first time, and set that number from the message as the starting number, so any changes that come in after should start the count from that, But for some reason the listen is still starting with the global 0. so is there now something that should go between the listen and the link message or am i just an idiot and not getting this..lol..
×
×
  • Create New...