Elevator script not working.. (Error message received)
|
Rorrim Wrigglesworth
Registered User
Join date: 6 Apr 2008
Posts: 68
|
12-17-2009 11:20
Hi.. I hope someone here can help out and also see what is wrong with this elevator script. I found it at this link here http://jadendreamer.wordpress.com/2007/06/11/working-elevator/I was hoping to use it for an elevator for an old disused/rundown building I am making. I tried to use it but I got an error message. I have no idea how to resolve the error as scripts are not my thing. I actually have an elevator but it is a fancy one.. I wanted a script I could add to an elevator I made ( a run down one to suit the building I made that has 3 floors. This is the message I left on that web page From: someone This just doesn’t work.. you get a syntax error. It says the following
(16, 15) : ERROR : Syntax error.
Line 16 reads as llSay(0, “Going up!”);
No idea what is wrong.. as I don’t do scripts myself. I copied everything from this page.. (cut/paste) It just doesn’t work. Suggest you check your script to ensure you haven’t left anything out. As this is open source I am posting this on LSLWiki to see if anyone there can resolve the problem
I was going to post it on LSLwiki but I decided to put it here...! This is the script in question... From: someone // lift script, v 1.0 by timeless montreal // edited by jade battery //put it in any object to transform it into an elevator //touch the object to move it up/downinteger liftAmount = 4;//how far to move up integer isUp = FALSE; //current position of the object movePlatform() { //makes you appear to be standing llStartAnimation(“stand”); if(!isUp) { //move the elevator up llSetPos(llGetPos() + <0, 0, liftAmount>  ; llSay(0, “Going up!”); isUp = TRUE; key avataronsittarget = llAvatarOnSitTarget(); llUnSit(avataronsittarget); } else { //move the elevator back down llSetPos(llGetPos() + <0, 0, -1*(liftAmount)>  ; llSay(0, “Going down!”); isUp = FALSE; key avataronsittarget = llAvatarOnSitTarget(); llUnSit(avataronsittarget); } } default { state_entry() { llSitTarget(<0,0,1>,<0,0,0,1>  ; llSetTouchText(“”); llSetSitText(“Move”); } //touch to move the elevator touch_start(integer num) { key avataronsittarget = llAvatarOnSitTarget(); if( avataronsittarget != NULL_KEY ) { if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && llGetPermissionsKey() == avataronsittarget) { llStopAnimation(“sit”); movePlatform(); } else llRequestPermissions(avataronsittarget, PERMISSION_TRIGGER_ANIMATION); } } //end touch changed(integer change) { if(change & CHANGED_LINK) { key avataronsittarget = llAvatarOnSitTarget(); if( avataronsittarget != NULL_KEY ) { if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && llGetPermissionsKey() == avataronsittarget) { llStopAnimation(“sit”); movePlatform(); } else { llRequestPermissions(avataronsittarget, PERMISSION_TRIGGER_ANIMATION); } } } } //request the permissions if need be run_time_permissions(integer perm) { if(perm) { llStopAnimation(“sit”); movePlatform(); } } //end runtime permission } //end default I have no idea what any of this script means/does/says... So if you have any ideas.. please feel free to amend/correct the above etc and let me know what to do.. lol Thanks in advance for your help. Ro
|
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
|
12-17-2009 11:44
Maybe it's the use of typographer's quotes that's the issue: From: someone llSay(0, “Going up!”); In LSL string literals should be eclosed in the boring old double-quotes found above the "2" key. Some text editors automatically subsitute typographer's quotes for the ordinay ones. From: someone llSay(0, "Going up!"  ;
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-17-2009 11:52
From: Pete Olihenge Maybe it's the use of typographer's quotes that's the issue... /me bets you're right. The OP should make sure to not edit scripts in a word processor type thing - plain text editors only! Also, "liftAmount" isn't defined. I think this is a copy/paste error. Change this at line 4.. //touch the object to move it up/downinteger liftAmount = 4;//how far to move up ...to be this.. //touch the object to move it up/down integer liftAmount = 4;//how far to move up
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Rorrim Wrigglesworth
Registered User
Join date: 6 Apr 2008
Posts: 68
|
12-17-2009 12:24
From: Pete Olihenge Maybe it's the use of typographer's quotes that's the issue:
In LSL string literals should be eclosed in the boring old double-quotes found above the "2" key. Some text editors automatically subsitute typographer's quotes for the ordinay ones. thanks for your response but also in response to your reply... This is what the 'author' said in response to someone else who had a problem as well, taken from this web page.. if you care to look http://jadendreamer.wordpress.com/2007/06/11/working-elevator/From: someone
3. Jade | August 24, 2008 at 9:04 pm
Did you forget a end curly brace? Make sure you copied everything from the blue section, this is exactly what I had in my elevator object.
This implies, to me anyway, that jade battery states that this works, as he seems to imply in his response (above) to someone else leaving a comment. As I said this means nothing to me at all.. I copied this script as is and therefore, according to jade battery, it should work as I copied all of the script from 'blue section' of that page. Also that would then mean that all of the quote marks would have to be replaced then as they all look the same to me... or are some meant to be different? Once again, as I have said, all of this means nothing to me. All I wanted to do was to copy an elevator script and place it in one I have made to enable it to be useable. I neither have the time or the inclination to write scripts, as I have no idea on what to do at all, hence me placing this 'script' here for you to look at, and hopefully resolve the issue.
|
Pete Olihenge
Registered User
Join date: 9 Nov 2009
Posts: 315
|
12-17-2009 12:32
From: Rorrim Wrigglesworth I neither have the time or the inclination to write scripts, as I have no idea on what to do at all, hence me placing this 'script' here for you to look at, and hopefully resolve the issue. You have come to the wrong forum; Scripting Tips is for people who want to make scripts. Perhaps you'd be better off asking for a finished or custom product in the Products Wanted forum.
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-17-2009 12:36
From: Rorrim Wrigglesworth I neither have the time or the inclination to write scripts, as I have no idea on what to do at all, hence me placing this 'script' here for you to look at, and hopefully resolve the issue.  Need to work a bit more on your "asking people for help" skillz there, Rorrim... Just edit the damn script inside SL and re-type all the " symbols. That and fix line 4 like I said above. You should also yell at whoever published this script and have them fix their examples to use " symbols instead of the fancy ones that don't work. Feel free to just point them at this here thread.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Rorrim Wrigglesworth
Registered User
Join date: 6 Apr 2008
Posts: 68
|
12-17-2009 12:42
From: Meade Paravane /me bets you're right. The OP should make sure to not edit scripts in a word processor type thing - plain text editors only!
Also, "liftAmount" isn't defined. I think this is a copy/paste error. Change this at line 4..
//touch the object to move it up/downinteger liftAmount = 4;//how far to move up
...to be this..
//touch the object to move it up/down
integer liftAmount = 4;//how far to move up Thanks for your response... but as I said in the post above... all of this means nothing to me. Altering a line to make it do something else is beyond me, as I have no idea at all what that means... apart from copyingwhat you said for that line and making the elevator go up that is. Scripting is not my thing.. but if you can make this work then great. I only wanted an elevator script that I could use when placed in one I have made so it seems to me then that I may as well put ac all out for someone to make one for me then as I am not going to go and alter this one by changing the quote marks, assuming that they need to be altered that is, and if so do I alter them all or alter certain ones and leave others alone? Scripting, as I keep saying is not my thing. So it seems to me I will delete this script from my pc then and not bother with it at all, as I don't want to be messing around with something that should, to all intents and purposes, be working but yet it doesn't appear to be, according to the webpage it is posted on. Despite jade batterys reply that implies it does for him.. he seems to think that the curly braces may have been missing... I copied everything that was there and it doesn't work.. it gives an error message about line 16 and not line 4, which seems to you to be at fault as well.. so does this imply that if line 16 was resolved that line 4 would then be listed as an error as well? As they say... "If it aint broke... don't fix it!"but if it is broke then it should be fixed... but I can't... or rather won't.
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-17-2009 12:43
From: Rorrim Wrigglesworth but if it is broke then it should be fixed... but I can't... or rather won't. Ok. Good luck with that then. edit: /me tries once more.. Look closely, if you can find the time, at these two lines below. The first one is what you have, the second will work: From: someone llSay(0, “Going up!”); From: someone llSay(0, "Going up!"  ; Yours is using quotes that are like \\Going up!// and the ones we're saying to use are more like ||Going up!|| .
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Rorrim Wrigglesworth
Registered User
Join date: 6 Apr 2008
Posts: 68
|
12-17-2009 13:15
From: Pete Olihenge You have come to the wrong forum; Scripting Tips is for people who want to make scripts. Perhaps you'd be better off asking for a finished or custom product in the Products Wanted forum. Correct me if I am wrong but if you care to take a look at the forum heading.. it is called Scripting Tips So far I have been given tips on what to do... so therefore I would assume I am correct in placing it in this forum. As I posted this script in here and asked for assistance, of which Meade has provided some pointers as to what is wrong with this script, ergo.. the forum has provided what it says it does.. Also the script is a 'finished product' as well. It was placed here for that very purpose.. as it is open source. As an ad here in the UK states.. "It does what it says on the tin"
Did I use the correct parenthisis there Meade?
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
12-17-2009 13:26
From: Rorrim Wrigglesworth ...of which Meade has provided some pointers as to what is wrong with this script Actually, it was Pete that spotted the immediate problem you're having. I spotted the one that you'll find *after* you fix what Pete originally spotted. From: Rorrim Wrigglesworth Did I use the correct parenthisis there Meade? Quotes, not parentheses. Yes, you used the right quote symbol.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
12-18-2009 05:13
From: Rorrim Wrigglesworth Correct me if I am wrong but if you care to take a look at the forum heading.. it is called Scripting Tips
Yes, you're wrong. Pete and Meade had it right. This is not a forum to come to if you want someone else to do your scripting for you. This is for people who want to learn to do it for themselves. The "tips" we share are to help each other learn or to share interesting new ways of doing things. If you don't care to learn or or just interested in getting free help to fix a script you didn't create, you're in the wrong place. Try Products Wanted or continue your conversation with the scripter who wrote the program you're trying to use.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
|
12-18-2009 08:54
// lift script, v 1.0 by timeless montreal // edited by jade battery // transcription error fixes, and indentation, by Pale Spectre :D // put it in any object to transform it into an elevator // touch the object to move it up/down
integer liftAmount = 4;//how far to move up integer isUp = FALSE; //current position of the object
movePlatform() { //makes you appear to be standing llStartAnimation("stand"); if(!isUp) { //move the elevator up llSetPos(llGetPos() + <0, 0, liftAmount>); llSay(0, "Going up!"); isUp = TRUE; key avataronsittarget = llAvatarOnSitTarget(); llUnSit(avataronsittarget); } else { //move the elevator back down llSetPos(llGetPos() + <0, 0, -1*(liftAmount)>); llSay(0, "Going down!"); isUp = FALSE; key avataronsittarget = llAvatarOnSitTarget(); llUnSit(avataronsittarget); } }
default { state_entry() { llSitTarget(<0,0,1>,<0,0,0,1>); llSetTouchText(""); llSetSitText("Move"); } //touch to move the elevator touch_start(integer num) { key avataronsittarget = llAvatarOnSitTarget(); if( avataronsittarget != NULL_KEY ) { if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && llGetPermissionsKey() == avataronsittarget) { llStopAnimation("sit"); movePlatform(); } else llRequestPermissions(avataronsittarget, PERMISSION_TRIGGER_ANIMATION); } } //end touch changed(integer change) { if(change & CHANGED_LINK) { key avataronsittarget = llAvatarOnSitTarget(); if( avataronsittarget != NULL_KEY ) { if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && llGetPermissionsKey() == avataronsittarget) { llStopAnimation("sit"); movePlatform(); } else { llRequestPermissions(avataronsittarget, PERMISSION_TRIGGER_ANIMATION); } } } } //request the permissions if need be run_time_permissions(integer perm) { if(perm) { llStopAnimation("sit"); movePlatform(); } } //end runtime permission } //end default
...seems to work too.
|