lollicat Posted April 20, 2010 Author Share Posted April 20, 2010 Hi. Sure, call me retarded, but I made a quest with Wolf00's questmaker and…. I have no idea of how to put it in.Can someone give me an easy, VERY detailed guide on how to put it in? xD Link to comment Share on other sites More sharing options...
chiccora Posted April 20, 2010 Share Posted April 20, 2010 First off all go to the script folder in the server folder. Create a folder called Quests.When you make the quest click to get the code. Now you will see a ton of code. Copy this code…..now go to the server folder....go to scripts...events...then go to scriptednpc.ess......after that paste it after the case you see there but before case else. A case is the script number so make sure you never have duplicate cases.Now in the editor you chiose the case number, keep q track of this. If the quest is case 1 then you need to create a npc. Set its stats to 1\. Click it to be scripted and set it to script 1\. The scripted npc corresponds to the case number.I am writing this on my phone so its kinda annoying but if you need more help let me know and I will jump on my computer Link to comment Share on other sites More sharing options...
lollicat Posted April 21, 2010 Author Share Posted April 21, 2010 @chiccora:> First off all go to the script folder in the server folder. Create a folder called Quests.> > When you make the quest click to get the code. Now you will see a ton of code. Copy this code…..now go to the server folder....go to scripts...events...then go to scriptednpc.ess......after that paste it after the case you see there but before case else. A case is the script number so make sure you never have duplicate cases.> > Now in the editor you chiose the case number, keep q track of this. If the quest is case 1 then you need to create a npc. Set its stats to 1\. Click it to be scripted and set it to script 1\. The scripted npc corresponds to the case number.> > I am writing this on my phone so its kinda annoying but if you need more help let me know and I will jump on my computerActually, I did exactly that as you instructed, and got an error when trying to talk to the NPC:"TYPE: Type mismatch: 'ScriptedNPC'LINE: 1COLUMN: 0CODE: (this was blank)" Link to comment Share on other sites More sharing options...
chiccora Posted April 21, 2010 Share Posted April 21, 2010 Hmm..Could you please copy and paste your entire Scripted Npc ess file here..I would like to take a look at it.Here is a sample code:```Sub ScriptedNPC(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted NPC has no apparent use.", WHITE) Exit SubCase 1 'If the player has not started the quest, start the quest for them. This also prevents errors occuring in the script later on If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest5" ) = vbNullString Then 'Start the quest for the player by setting their status to 0 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest5", "0") End If 'If the player level is greater than or equal to the needed player level If GetPlayerLevel(Index) >= 0 Then 'If the player is not the right class - tell them and then exit If GetPlayerClass(Index) <> 7 Then Call PlayerMsg(Index, "Mercachio: You are not the right class to begin this quest!",GREEN) Exit Sub End If 'If the player has not started the quest yet If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest5" ) = "0" Then 'The player has now started the quest and can go onto the next part Call PlayerMsg(Index, "Mercachio: I am in need of your assistance Paladin. I used to be part of the Holy Union of Paladins but I was recently banished. I was framed in the murder of my wife by a dark knight. I have been exiled from the Sacred City. There is hope though, the Dark Knight resides currently in a cave by the Great Forest. The Dark Knight has an emblem that belongs to the royal family. The emblem has the ability to record events so I am sure it recorded my wife's dead and can prove my innocence..Please help me..", GREEN) 'The player started the quest, set their status to 1 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest5", "1") 'If the player has started the quest and needs to attempt to finish it ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest5" ) = "1" Then 'If the player has the needed item If CanTake(Index, 66, 1) = True Then 'If the player does not have enough free slots for items given as rewards If Not GetFreeSlots(Index) >= 1 Then 'If they can't take the rewards - tell them and exit Call PlayerMsg(Index, "Mercachio: You don't have enough free slots to take my reward, you need 1 slot(s)!", GREEN) Exit Sub End If 'Take the needed item Call TakeItem(Index, 66, 1) Call PlayerMsg(Index, "Mercachio: Thank you for getting this " & GetItemName(66) & " for me!", GREEN) 'Give the player the non-stackable reward item Call GiveItem(Index, 67, 1) Call PlayerMsg(Index, "Mercachio: Please take this " & GetItemName(67) & "!", GREEN) 'Give the player exp Call SetPlayerExp(Index, GetPlayerExp(Index) + 185) Call SendStats(Index) Call PlayerMsg(Index, "Mercachio: Please take 185 experience for helping me!", GREEN) 'The player has completed the quest Call PlayerMsg(Index, "Mercachio: Thank you.", GREEN) 'The player has completed the quest, set their status to 2 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest5", "2") Else 'The player does not have the item Call PlayerMsg(Index, "Mercachio: We must make haste. I will stock up on supplies, I suggest you do the same. We will meet in a bit by the cave outside the Great Forest.", GREEN) End If 'If the player has completed the quest and claimed their reward ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest5" ) = "2" Then 'Tell them they have completed the quest Call PlayerMsg(Index, "Mercachio: Your heart is pure. You are a great Paladin...Cyrus would have been proud to have you as one of his own. ", GREEN) End If End If Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```Make sure you dont delete Case Else at the end there, and just start at Case 1\. Exit sub after each Case is needed too..again let me see your code…make sure there is a "Quest" folder and remember the word is case sensitive..also make sure everything you wrote n the quest editor is correct :) Link to comment Share on other sites More sharing options...
lollicat Posted April 21, 2010 Author Share Posted April 21, 2010 ```'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Module: ScriptedNPC.ess '' Author: Stephan J.R. van Schaik '' Date: August 30th, 2009. '' Version: 1.0.0 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function: ScriptedNPC '' Brief: executes when somebody talks to a NPC. '' Parameters: '' Index: the index of the player. '' Script: the script to execute. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'Quest script created using cloudwolf00s Quest Maker (cloudwolf00s Quest Maker is © cloudwolf00 2010) 'You may not remove this or the above credit! Case 1 'If the player has not started the quest, start the quest for them. This also prevents errors occuring in the script later on If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = vbNullString Then 'Start the quest for the player by setting their status to 0 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0") End If 'If the player level is greater than or equal to the needed player level and less than or equal to the maximum level If (GetPlayerLevel(Index) >= 0) And (GetPlayerLevel(Index) <= 10) Then 'If the player has not started the quest yet If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "0" Then 'The player has now started the quest and can go onto the next part Call PlayerMsg(Index, "Mimi: I am going to help you do an easy quest. I lost an important treasure chest, and I need you to go around and look for it. To pick it up, you can press ENTER on your keyboard.", BLACK) 'The player started the quest, set their status to 1 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "1") 'If the player has started the quest and needs to attempt to finish it ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "1" Then 'If the player has the needed item If CanTake(Index, 8, 1) = True Then 'If the player does not have enough free slots for items given as rewards If Not GetFreeSlots(Index) >= 1 Then 'If they can't take the rewards - tell them and exit Call PlayerMsg(Index, "Mimi: You don't have a free slot to take my reward, you need one more inventory slot!", BLACK) Exit Sub End If 'Take the needed item Call TakeItem(Index, 8, 1) Call PlayerMsg(Index, "Mimi: Thank you for getting this " & GetItemName(8) & " for me!", BLACK) 'Give the player the stackable reward item Call GiveCurrency(Index, 3, 5) Call PlayerMsg(Index, "Mimi: Please take this " & GetItemName(3) & "!", BLACK) 'Give the player exp Call SetPlayerExp(Index, GetPlayerExp(Index) + 15) Call SendStats(Index) Call PlayerMsg(Index, "Mimi: For helping me, you get 15 experience!", BLACK) 'The player has completed the quest Call PlayerMsg(Index, "Mimi: Thank goodness! I was just about to panic, as it had my lunch in here...it would be terrible if I had to starve!", BLACK) 'The player has completed the quest, set their status to 2 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "2") Else 'The player does not have the item Call PlayerMsg(Index, "Mimi: Please get me " & GetItemName(8) & "!", BLACK) End If 'If the player has completed the quest and claimed their reward ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "2" Then 'Tell them they have completed the quest but can do it again Call PlayerMsg(Index, "Mimi: Now, where did I put that chest...?", BLACK) 'Set the player status back to 0 so that they can do the quest again Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0") End If End If Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub Exit Sub ``` Link to comment Share on other sites More sharing options...
lollicat Posted April 21, 2010 Author Share Posted April 21, 2010 Also, do I have a Case 0? Link to comment Share on other sites More sharing options...
balliztik1 Posted April 21, 2010 Share Posted April 21, 2010 You pasted over the sub name, looks like. Give this a try:>! ```'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Module: ScriptedNPC.ess '' Author: Stephan J.R. van Schaik '' Date: August 30th, 2009. '' Version: 1.0.0 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''>! '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function: ScriptedNPC '' Brief: executes when somebody talks to a NPC. '' Parameters: '' Index: the index of the player. '' Script: the script to execute. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Sub ScriptedNPC(index, script) 'Quest script created using cloudwolf00s Quest Maker (cloudwolf00s Quest Maker is © cloudwolf00 2010) 'You may not remove this or the above credit! Case 1>! 'If the player has not started the quest, start the quest for them. This also prevents errors occuring in the script later on If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = vbNullString Then>! 'Start the quest for the player by setting their status to 0 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0")>! End If>! 'If the player level is greater than or equal to the needed player level and less than or equal to the maximum level If (GetPlayerLevel(Index) >= 0) And (GetPlayerLevel(Index) <= 10) Then>! 'If the player has not started the quest yet If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "0" Then>! 'The player has now started the quest and can go onto the next part Call PlayerMsg(Index, "Mimi: I am going to help you do an easy quest. I lost an important treasure chest, and I need you to go around and look for it. To pick it up, you can press ENTER on your keyboard.", BLACK)>! 'The player started the quest, set their status to 1 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "1")>! 'If the player has started the quest and needs to attempt to finish it ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "1" Then>! 'If the player has the needed item If CanTake(Index, 8, 1) = True Then>! 'If the player does not have enough free slots for items given as rewards If Not GetFreeSlots(Index) >= 1 Then>! 'If they can't take the rewards - tell them and exit Call PlayerMsg(Index, "Mimi: You don't have a free slot to take my reward, you need one more inventory slot!", BLACK) Exit Sub>! End If>! 'Take the needed item Call TakeItem(Index, 8, 1) Call PlayerMsg(Index, "Mimi: Thank you for getting this " & GetItemName(8) & " for me!", BLACK)>! 'Give the player the stackable reward item Call GiveCurrency(Index, 3, 5) Call PlayerMsg(Index, "Mimi: Please take this " & GetItemName(3) & "!", BLACK)>! 'Give the player exp Call SetPlayerExp(Index, GetPlayerExp(Index) + 15) Call SendStats(Index) Call PlayerMsg(Index, "Mimi: For helping me, you get 15 experience!", BLACK)>! 'The player has completed the quest Call PlayerMsg(Index, "Mimi: Thank goodness! I was just about to panic, as it had my lunch in here...it would be terrible if I had to starve!", BLACK)>! 'The player has completed the quest, set their status to 2 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "2")>! Else>! 'The player does not have the item Call PlayerMsg(Index, "Mimi: Please get me " & GetItemName(8) & "!", BLACK)>! End If>! 'If the player has completed the quest and claimed their reward ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "2" Then>! 'Tell them they have completed the quest but can do it again Call PlayerMsg(Index, "Mimi: Now, where did I put that chest...?", BLACK)>! 'Set the player status back to 0 so that they can do the quest again Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0") End If>! End If>! Exit Sub>! Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)>! Exit Sub End SelectEnd Sub>! Exit Sub``` Link to comment Share on other sites More sharing options...
lollicat Posted April 21, 2010 Author Share Posted April 21, 2010 @Ballie:> You pasted over the sub name, looks like. Give this a try:> > >! ```> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> ' Module: ScriptedNPC.ess '> ' Author: Stephan J.R. van Schaik '> ' Date: August 30th, 2009. '> ' Version: 1.0.0 '> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> >! '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> ' Function: ScriptedNPC '> ' Brief: executes when somebody talks to a NPC. '> ' Parameters: '> ' Index: the index of the player. '> ' Script: the script to execute. '> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> Sub ScriptedNPC(index, script)> 'Quest script created using cloudwolf00s Quest Maker (cloudwolf00s Quest Maker is © cloudwolf00 2010) > 'You may not remove this or the above credit!> Case 1> >! 'If the player has not started the quest, start the quest for them. This also prevents errors occuring in the script later on> If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = vbNullString Then> >! 'Start the quest for the player by setting their status to 0> Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0")> >! End If> >! 'If the player level is greater than or equal to the needed player level and less than or equal to the maximum level> If (GetPlayerLevel(Index) >= 0) And (GetPlayerLevel(Index) <= 10) Then> >! 'If the player has not started the quest yet> If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "0" Then> >! 'The player has now started the quest and can go onto the next part> Call PlayerMsg(Index, "Mimi: I am going to help you do an easy quest. I lost an important treasure chest, and I need you to go around and look for it. To pick it up, you can press ENTER on your keyboard.", BLACK)> >! 'The player started the quest, set their status to 1> Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "1")> >! 'If the player has started the quest and needs to attempt to finish it> ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "1" Then> >! 'If the player has the needed item> If CanTake(Index, 8, 1) = True Then> >! 'If the player does not have enough free slots for items given as rewards> If Not GetFreeSlots(Index) >= 1 Then> >! 'If they can't take the rewards - tell them and exit> Call PlayerMsg(Index, "Mimi: You don't have a free slot to take my reward, you need one more inventory slot!", BLACK)> Exit Sub> >! End If> >! 'Take the needed item> Call TakeItem(Index, 8, 1)> Call PlayerMsg(Index, "Mimi: Thank you for getting this " & GetItemName(8) & " for me!", BLACK)> >! 'Give the player the stackable reward item> Call GiveCurrency(Index, 3, 5)> Call PlayerMsg(Index, "Mimi: Please take this " & GetItemName(3) & "!", BLACK)> >! 'Give the player exp> Call SetPlayerExp(Index, GetPlayerExp(Index) + 15)> Call SendStats(Index)> Call PlayerMsg(Index, "Mimi: For helping me, you get 15 experience!", BLACK)> >! 'The player has completed the quest> Call PlayerMsg(Index, "Mimi: Thank goodness! I was just about to panic, as it had my lunch in here...it would be terrible if I had to starve!", BLACK)> >! 'The player has completed the quest, set their status to 2> Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "2")> >! Else> >! 'The player does not have the item> Call PlayerMsg(Index, "Mimi: Please get me " & GetItemName(8) & "!", BLACK)> >! End If> >! 'If the player has completed the quest and claimed their reward> ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "2" Then> >! 'Tell them they have completed the quest but can do it again> Call PlayerMsg(Index, "Mimi: Now, where did I put that chest...?", BLACK)> >! 'Set the player status back to 0 so that they can do the quest again> Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0")> End If> >! End If> >! Exit Sub> >! Case Else> Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)> >! Exit Sub> End Select> End Sub> >! Exit Sub> ```I got the same error, unfortunately. Link to comment Share on other sites More sharing options...
balliztik1 Posted April 21, 2010 Share Posted April 21, 2010 Add this under the "Sub ScriptedNPC(index, script)":```Select Case script```I'm getting rusty in my old age.Also, note to self. Code tags inside spoilers look awful. Link to comment Share on other sites More sharing options...
lollicat Posted April 21, 2010 Author Share Posted April 21, 2010 @Ballie:> Add this under the "Sub ScriptedNPC(index, script)":> > ```> Select Case script> ```> I'm getting rusty in my old age.> > Also, note to self. Code tags inside spoilers look awful.Is that in my main? xD [/notgoodatscripting] Link to comment Share on other sites More sharing options...
balliztik1 Posted April 21, 2010 Share Posted April 21, 2010 Your scriptedNPC.ess should look like this.```'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Module: ScriptedNPC.ess '' Author: Stephan J.R. van Schaik '' Date: August 30th, 2009. '' Version: 1.0.0 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function: ScriptedNPC '' Brief: executes when somebody talks to a NPC. '' Parameters: '' Index: the index of the player. '' Script: the script to execute. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Sub ScriptedNPC(index, script) 'Quest script created using cloudwolf00s Quest Maker (cloudwolf00s Quest Maker is © cloudwolf00 2010) 'You may not remove this or the above credit! Select Case script Case 1 'If the player has not started the quest, start the quest for them. This also prevents errors occuring in the script later on If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = vbNullString Then 'Start the quest for the player by setting their status to 0 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0") End If 'If the player level is greater than or equal to the needed player level and less than or equal to the maximum level If (GetPlayerLevel(Index) >= 0) And (GetPlayerLevel(Index) <= 10) Then 'If the player has not started the quest yet If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "0" Then 'The player has now started the quest and can go onto the next part Call PlayerMsg(Index, "Mimi: I am going to help you do an easy quest. I lost an important treasure chest, and I need you to go around and look for it. To pick it up, you can press ENTER on your keyboard.", BLACK) 'The player started the quest, set their status to 1 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "1") 'If the player has started the quest and needs to attempt to finish it ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "1" Then 'If the player has the needed item If CanTake(Index, 8, 1) = True Then 'If the player does not have enough free slots for items given as rewards If Not GetFreeSlots(Index) >= 1 Then 'If they can't take the rewards - tell them and exit Call PlayerMsg(Index, "Mimi: You don't have a free slot to take my reward, you need one more inventory slot!", BLACK) Exit Sub End If 'Take the needed item Call TakeItem(Index, 8, 1) Call PlayerMsg(Index, "Mimi: Thank you for getting this " & GetItemName(8) & " for me!", BLACK) 'Give the player the stackable reward item Call GiveCurrency(Index, 3, 5) Call PlayerMsg(Index, "Mimi: Please take this " & GetItemName(3) & "!", BLACK) 'Give the player exp Call SetPlayerExp(Index, GetPlayerExp(Index) + 15) Call SendStats(Index) Call PlayerMsg(Index, "Mimi: For helping me, you get 15 experience!", BLACK) 'The player has completed the quest Call PlayerMsg(Index, "Mimi: Thank goodness! I was just about to panic, as it had my lunch in here...it would be terrible if I had to starve!", BLACK) 'The player has completed the quest, set their status to 2 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "2") Else 'The player does not have the item Call PlayerMsg(Index, "Mimi: Please get me " & GetItemName(8) & "!", BLACK) End If 'If the player has completed the quest and claimed their reward ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "2" Then 'Tell them they have completed the quest but can do it again Call PlayerMsg(Index, "Mimi: Now, where did I put that chest...?", BLACK) 'Set the player status back to 0 so that they can do the quest again Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0") End If End If Exit Sub Case Else Call PlayerMsg(Index, "No NPC 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...
lollicat Posted April 21, 2010 Author Share Posted April 21, 2010 That's what it looks like and I still got the error. Link to comment Share on other sites More sharing options...
balliztik1 Posted April 21, 2010 Share Posted April 21, 2010 Unbridled rage ensues! >=(I broke your server, BTW, trying to see what happens. It was only afterwards that I realized that I won't be able to do shit because of the server error. Oops.There's nothing wrong with the script, though, from what I can see, so it's puzzling. Link to comment Share on other sites More sharing options...
chiccora Posted April 21, 2010 Share Posted April 21, 2010 I am not sure if Case 0 is an issue, but I did have a problem similar because I did not include that case so just try this, its worth a shot:```'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Module: ScriptedNPC.ess '' Author: Stephan J.R. van Schaik '' Date: August 30th, 2009. '' Version: 1.0.0 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Function: ScriptedNPC '' Brief: executes when somebody talks to a NPC. '' Parameters: '' Index: the index of the player. '' Script: the script to execute. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Select Case Script Case 0 Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE) Exit Sub Case 1 'If the player has not started the quest, start the quest for them. This also prevents errors occuring in the script later on If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = vbNullString Then 'Start the quest for the player by setting their status to 0 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0") End If 'If the player level is greater than or equal to the needed player level and less than or equal to the maximum level If (GetPlayerLevel(Index) >= 0) And (GetPlayerLevel(Index) <= 10) Then 'If the player has not started the quest yet If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "0" Then 'The player has now started the quest and can go onto the next part Call PlayerMsg(Index, "Mimi: I am going to help you do an easy quest. I lost an important treasure chest, and I need you to go around and look for it. To pick it up, you can press ENTER on your keyboard.", BLACK) 'The player started the quest, set their status to 1 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "1") 'If the player has started the quest and needs to attempt to finish it ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "1" Then 'If the player has the needed item If CanTake(Index, 8, 1) = True Then 'If the player does not have enough free slots for items given as rewards If Not GetFreeSlots(Index) >= 1 Then 'If they can't take the rewards - tell them and exit Call PlayerMsg(Index, "Mimi: You don't have a free slot to take my reward, you need one more inventory slot!", BLACK) Exit Sub End If 'Take the needed item Call TakeItem(Index, 8, 1) Call PlayerMsg(Index, "Mimi: Thank you for getting this " & GetItemName(8) & " for me!", BLACK) 'Give the player the stackable reward item Call GiveCurrency(Index, 3, 5) Call PlayerMsg(Index, "Mimi: Please take this " & GetItemName(3) & "!", BLACK) 'Give the player exp Call SetPlayerExp(Index, GetPlayerExp(Index) + 15) Call SendStats(Index) Call PlayerMsg(Index, "Mimi: For helping me, you get 15 experience!", BLACK) 'The player has completed the quest Call PlayerMsg(Index, "Mimi: Thank goodness! I was just about to panic, as it had my lunch in here...it would be terrible if I had to starve!", BLACK) 'The player has completed the quest, set their status to 2 Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "2") Else 'The player does not have the item Call PlayerMsg(Index, "Mimi: Please get me " & GetItemName(8) & "!", BLACK) End If 'If the player has completed the quest and claimed their reward ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "2" Then 'Tell them they have completed the quest but can do it again Call PlayerMsg(Index, "Mimi: Now, where did I put that chest...?", BLACK) 'Set the player status back to 0 so that they can do the quest again Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0") End If End If Exit Sub Case Else Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End SelectEnd Sub```Add this, hit reload of the scripts in the server and try it with the NPC who is scripted to 1\. Link to comment Share on other sites More sharing options...
lollicat Posted April 21, 2010 Author Share Posted April 21, 2010 @chiccora:> I am not sure if Case 0 is an issue, but I did have a problem similar because I did not include that case so just try this, its worth a shot:> > ```> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> ' Module: ScriptedNPC.ess '> ' Author: Stephan J.R. van Schaik '> ' Date: August 30th, 2009. '> ' Version: 1.0.0 '> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> > '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> ' Function: ScriptedNPC '> ' Brief: executes when somebody talks to a NPC. '> ' Parameters: '> ' Index: the index of the player. '> ' Script: the script to execute. '> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''> Select Case Script> Case 0> Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE)> Exit Sub> Case 1> > 'If the player has not started the quest, start the quest for them. This also prevents errors occuring in the script later on> If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = vbNullString Then> > 'Start the quest for the player by setting their status to 0> Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0")> > End If> > 'If the player level is greater than or equal to the needed player level and less than or equal to the maximum level> If (GetPlayerLevel(Index) >= 0) And (GetPlayerLevel(Index) <= 10) Then> > 'If the player has not started the quest yet> If GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "0" Then> > 'The player has now started the quest and can go onto the next part> Call PlayerMsg(Index, "Mimi: I am going to help you do an easy quest. I lost an important treasure chest, and I need you to go around and look for it. To pick it up, you can press ENTER on your keyboard.", BLACK)> > 'The player started the quest, set their status to 1> Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "1")> > 'If the player has started the quest and needs to attempt to finish it> ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "1" Then> > 'If the player has the needed item> If CanTake(Index, 8, 1) = True Then> > 'If the player does not have enough free slots for items given as rewards> If Not GetFreeSlots(Index) >= 1 Then> > 'If they can't take the rewards - tell them and exit> Call PlayerMsg(Index, "Mimi: You don't have a free slot to take my reward, you need one more inventory slot!", BLACK)> Exit Sub> > End If> > 'Take the needed item> Call TakeItem(Index, 8, 1)> Call PlayerMsg(Index, "Mimi: Thank you for getting this " & GetItemName(8) & " for me!", BLACK)> > 'Give the player the stackable reward item> Call GiveCurrency(Index, 3, 5)> Call PlayerMsg(Index, "Mimi: Please take this " & GetItemName(3) & "!", BLACK)> > 'Give the player exp> Call SetPlayerExp(Index, GetPlayerExp(Index) + 15)> Call SendStats(Index)> Call PlayerMsg(Index, "Mimi: For helping me, you get 15 experience!", BLACK)> > 'The player has completed the quest> Call PlayerMsg(Index, "Mimi: Thank goodness! I was just about to panic, as it had my lunch in here...it would be terrible if I had to starve!", BLACK)> > 'The player has completed the quest, set their status to 2> Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "2")> > Else> > 'The player does not have the item> Call PlayerMsg(Index, "Mimi: Please get me " & GetItemName(8) & "!", BLACK)> > End If> > 'If the player has completed the quest and claimed their reward> ElseIf GetVar( "Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1" ) = "2" Then> > 'Tell them they have completed the quest but can do it again> Call PlayerMsg(Index, "Mimi: Now, where did I put that chest...?", BLACK)> > 'Set the player status back to 0 so that they can do the quest again> Call PutVar("Scripts\Quests\" & GetPlayerName(Index) & ".ini", "Quests", "Quest1", "0")> End If> > End If> > Exit Sub> > Case Else> Call PlayerMsg(Index, "No NPC script found. Please contact an admin to solve this problem.", WHITE)> > Exit Sub> End Select> End Sub> ```> Add this, hit reload of the scripts in the server and try it with the NPC who is scripted to 1.Still getting the error. >:U Link to comment Share on other sites More sharing options...
ewielang Posted October 7, 2010 Share Posted October 7, 2010 I am having this exact same issue. It is a mismatch type error whenever I try to interact with a scripted NPC. I finally just removed all my quest text and set it to the exact original ScriptedNPC.ess, still getting the error. I can't use a scripted NPC no matter what the code looks. I'm using SE, and I'm starting to think that is where the problem lies. Anyone know what the problem could be any maybe how to fix it? Link to comment Share on other sites More sharing options...
lollicat Posted October 7, 2010 Author Share Posted October 7, 2010 @ewielang:> I am having this exact same issue. It is a mismatch type error whenever I try to interact with a scripted NPC. I finally just removed all my quest text and set it to the exact original ScriptedNPC.ess, still getting the error. I can't use a scripted NPC no matter what the code looks. I'm using SE, and I'm starting to think that is where the problem lies. Anyone know what the problem could be any maybe how to fix it?This post is extremely old. Your best bet would be to try a new topic. 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