Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 can you plz see if i did this right?link to photo: http://i767.photobucket.com/albums/xx319/jooshua6/main.jpg Link to comment Share on other sites More sharing options...
DarkMazer Posted June 22, 2009 Share Posted June 22, 2009 Kinda. The way you have it there, it'll say: "Hello, young [class] come forth.", then it'll immediately say "This scripted tile has no apparent use." right after that. You should add a new case, case 1, right before case else, then cut and paste the if/elseif/end if section to case 1. Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 so i leave case 0 empty?can you show me how it should be like a pic or screen shot or something please! Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 22, 2009 Share Posted June 22, 2009 You know, we do havetags, so you can paste those segments into your post; it's alot easier for us to read and work with it to help you :)Can you do this for us? Just paste your entire ScriptedTiles sub in those tags please. Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 ok```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0If GetPlayerClass(Index) = 0 Then Call PlayerMsg(Index, "Hello, young knight come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 2 Then Call PlayerMsg(Index, "HEllo, young archer come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 3 Then Call PlayerMsg(Index, "HEllo, young wizard come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 4 Then Call PlayerMsg(Index, "Hello, young shaman come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 5 Then Call PlayerMsg(Index, "HEllo, young summoner come forth.", YELLOW)End If Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
durama Posted June 22, 2009 Share Posted June 22, 2009 ya all you need to do is remove that last call PlayerMsg() before the end sub :cheesy: Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 really ok thanks so much ima try that and see if it worksso it should be like this?```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0If GetPlayerClass(Index) = 0 Then Call PlayerMsg(Index, "Hello, young knight come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 2 Then Call PlayerMsg(Index, "HEllo, young archer come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 3 Then Call PlayerMsg(Index, "HEllo, young wizard come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 4 Then Call PlayerMsg(Index, "Hello, young shaman come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 5 Then Call PlayerMsg(Index, "HEllo, young summoner come forth.", YELLOW)End If End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 22, 2009 Share Posted June 22, 2009 Of course, this would also work:```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1If GetPlayerClass(Index) = 0 Then Call PlayerMsg(Index, "Hello, young knight come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 2 Then Call PlayerMsg(Index, "HEllo, young archer come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 3 Then Call PlayerMsg(Index, "HEllo, young wizard come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 4 Then Call PlayerMsg(Index, "Hello, young shaman come forth.", YELLOW)ElseIf GetPlayerClass(Index) = 5 Then Call PlayerMsg(Index, "HEllo, young summoner come forth.", YELLOW)End If Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```Now, you'll be using Scripted Tile #1As for the script itself, that's correct. But there are better ways, you can use a Select Case.Watch:```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1 Select Case GetPlayerClass(Index) Case 0 Call PlayerMsg(Index, "Hello, young knight come forth.", YELLOW) Case 2 Call PlayerMsg(Index, "HEllo, young archer come forth.", YELLOW) Case 3 Call PlayerMsg(Index, "HEllo, young wizard come forth.", YELLOW) Case 4 Call PlayerMsg(Index, "Hello, young shaman come forth.", YELLOW) Case 5 Call PlayerMsg(Index, "HEllo, young summoner come forth.", YELLOW) End Select Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```Just as the main Select Case, compares the variable "Script" with 0, 1, etc, your new one is comparing "GetPlayerClass" to whatever the "Case" is. In this case, if it's 0, it will do that one thing, if it's 1, etc.Though, this could probably be refined further, if you just wanted it to display the class name, you could just use the command "GetPlayerClassName", and do this:```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1 Call PlayerMsg(Index, "Hello, young " & GetPlayerClassName(Index) & " come forth.", YELLOW) Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 ok thanks ima use last one thanks :)nvm Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 22, 2009 Share Posted June 22, 2009 @Jooshua6:> ok thanks ima use last one thanks :)Just make sure you read over all the scripts I posted; I posted them as examples, to show you some other structures.Also, read over how the 3rd one works, and why it would be the best method Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 works fine thanks so much :)what the? ![](http://i767.photobucket.com/albums/xx319/jooshua6/chat.jpg) Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 22, 2009 Share Posted June 22, 2009 @Jooshua6:> works fine thanks so much :)> what the? ![](http://i767.photobucket.com/albums/xx319/jooshua6/chat.jpg)Looks like it's inserting a tab afterwards.Try removing the space in the second-half of the string (where it would be "come forth." and not " come forth.") Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 ok ill try thatstill doing same thing? Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 22, 2009 Share Posted June 22, 2009 @Jooshua6:> ok ill try that> still doing same thing?Well, there's always another (and more complicated) way of doing it:```Call PlayerMsg(Index, "Hello, young " & GetVar("Classes\Class" & GetPlayerClass(Index) & ".ini", "CLASS", "Name") & " come forth.", YELLOW)```It's still 1 line, and would still take less computation. Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 so i replace that with:```Call PlayerMsg(Index, "King:Hello, young " & GetPlayerClassName(Index) & "come forth to me.", YELLOW)``` Link to comment Share on other sites More sharing options...
Bobosk Posted June 22, 2009 Share Posted June 22, 2009 Admiral, you can also just use Trim()… Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 22, 2009 Share Posted June 22, 2009 @Bobosk:> Admiral, you can also just use Trim()…Crap, I forgot about Trim!!Joo, just use this as the Call PlayerMsg:```Call PlayerMsg(Index, "Hello, young " & Trim(GetPlayerClassName(Index)) & " come forth.", YELLOW)``` Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 dude it still has that space did i do it wrong?```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1 Call PlayerMsg(Index, "Hello, young " & Trim(GetPlayerClassName(Index)) & " come forth.", YELLOW) Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 22, 2009 Share Posted June 22, 2009 @Jooshua6:> dude it still has that space did i do it wrong?> ```> ' Executes when a player steps onto a scripted tile.> Sub ScriptedTile(Index, Script)> Select Case Script> Case 0> Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE)> Exit Sub> Case 1> Call PlayerMsg(Index, "Hello, young " & Trim(GetPlayerClassName(Index)) & " come forth.", YELLOW)> > Case Else> Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)> Exit Sub> End Select> End Sub> ```Bobosk will probably come back in here and tell me what _I_ did wrong.Anyway, just use this, see if it works:```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1 Call PlayerMsg(Index, "Hello, young " & GetVar("Classes\Class" & GetPlayerClass(Index) & ".ini", "CLASS", "Name") & " come forth.", YELLOW) Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
durama Posted June 22, 2009 Share Posted June 22, 2009 the script works for me i checked it maybe you have a tab on the end of your class name? Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 still space i am missing weird lol Link to comment Share on other sites More sharing options...
Bobosk Posted June 22, 2009 Share Posted June 22, 2009 Then you should definetly double check your class.ini to see if you put spaces in there.. Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 ok thats prbly y cause spaces in classes nopee thats not it none of the classes have spaces?ill post again my main.txt```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1 Call PlayerMsg(Index, "Hello, young " & GetVar("Classes\Class" & GetPlayerClass(Index) & ".ini", "CLASS", "Name") & " come forth.", YELLOW) Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```can you plz check over evrything in there plz cause this is taking to long for a puny script k thanks Link to comment Share on other sites More sharing options...
durama Posted June 22, 2009 Share Posted June 22, 2009 i don't see anything wrong with it but maybe you should just try Admirals second one.```' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE) Exit Sub Case 1 Select Case GetPlayerClass(Index) Case 0 Call PlayerMsg(Index, "Hello, young knight come forth.", YELLOW) Case 2 Call PlayerMsg(Index, "HEllo, young archer come forth.", YELLOW) Case 3 Call PlayerMsg(Index, "HEllo, young wizard come forth.", YELLOW) Case 4 Call PlayerMsg(Index, "Hello, young shaman come forth.", YELLOW) Case 5 Call PlayerMsg(Index, "HEllo, young summoner come forth.", YELLOW) End Select Case Else Call PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub``` Link to comment Share on other sites More sharing options...
Jooshua6 Posted June 22, 2009 Author Share Posted June 22, 2009 still has that rechid space ima try on a different class. yup that space still there! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now