Growlith1223 Posted June 17, 2012 Author Share Posted June 17, 2012 Hi i am making a Convo/quest option so it gives you a quest but…When i do, in server, it erros and highlights```QuestMessage index, Conv(convNum).Conv(curChat).Data1, Quest(Conv(convNum).Conv(curChat).Data1).Speech(1), Quest(Conv(convNum).Conv(curChat).Data1).Speech(1)```In SendChat Sub…Here is the full code of that sub.``` Dim convNum As Long Dim curChat As Long Dim mainText As String Dim optText(1 To 4) As String Dim P_GENDER As String Dim P_NAME As String Dim P_CLASS As String Dim i As Long If TempPlayer(index).inChatWith > 0 Then convNum = NPC(TempPlayer(index).inChatWith).Conv curChat = TempPlayer(index).curChat ' check for unique events and trigger them early If Conv(convNum).Conv(curChat).Event > 0 Then Select Case Conv(convNum).Conv(curChat).Event Case 1 ' Open Shop If Conv(convNum).Conv(curChat).Data1 > 0 Then ' shop exists? SendOpenShop index, Conv(convNum).Conv(curChat).Data1 TempPlayer(index).InShop = Conv(convNum).Conv(curChat).Data1 ' stops movement and the like End If ' exit the chat TempPlayer(index).inChatWith = 0 TempPlayer(index).curChat = 0 ' send chat update sendChat index ' send npc dir With MapNpc(TempPlayer(index).c_mapNum).NPC(TempPlayer(index).c_mapNpcNum) If .c_inChatWith = index Then .c_inChatWith = 0 .Dir = .c_lastDir NpcDir TempPlayer(index).c_mapNum, TempPlayer(index).c_mapNpcNum, .Dir End If End With ' clear last of data TempPlayer(index).c_mapNpcNum = 0 TempPlayer(index).c_mapNum = 0 ' exit out early so we don't send chat update twice Exit Sub Case 2 ' Open Bank SendBank index Case 3 ' Give Item Dim b As Long b = FindOpenInvSlot(index, Conv(convNum).Conv(curChat).Data1) Call SetPlayerInvItemNum(index, b, Conv(convNum).Conv(curChat).Data1) Call SetPlayerInvItemValue(index, b, Conv(convNum).Conv(curChat).Data2) SendInventory index Case 4 ' Give Quest 'QuestMessage index, Conv(convNum).Conv(curChat).Data1, Quest(Conv(convNum).Conv(curChat).Data1).Speech(1), Quest(Conv(convNum).Conv(curChat).Data1).Speech(1) End Select End Ifcontinue: ' cache player's details If Player(index).Sex = SEX_MALE Then P_GENDER = "man" Else P_GENDER = "woman" End If P_NAME = Trim$(Player(index).Name) P_CLASS = Trim$(Class(Player(index).Class).Name) mainText = Conv(convNum).Conv(curChat).Conv For i = 1 To 4 optText(i) = Conv(convNum).Conv(curChat).rText(i) Next End If SendChatUpdate index, TempPlayer(index).inChatWith, mainText, optText(1), optText(2), optText(3), optText(4)```Help will be greatly appreciated! :D Link to comment Share on other sites More sharing options...
tslusny Posted June 17, 2012 Share Posted June 17, 2012 why u used data from conversation to be used as data for questmessage?This is data for questmessage, you must add them as byvals to top of sub and send them when sending sendchat. You must send Questnum ande NpcNum i thinkQuestMessage attacker, NPC(NPCNum).QuestNum, Trim$(Quest(NPC(NPCNum).QuestNum).Speech(1)), NPC(NPCNum).QuestNum Link to comment Share on other sites More sharing options...
Ariel Posted June 17, 2012 Share Posted June 17, 2012 Thanks that helped me too Link to comment Share on other sites More sharing options...
abhi2011 Posted June 17, 2012 Share Posted June 17, 2012 @ZeroX8:> Hi i am making a Convo/quest option so it gives you a quest but…@DeathbeamI think he is trying to combine the conv with quest so that quest can be initated with a conv.You will have to edit something most likely with the choices of the conv system. Something like intiate chat when the choice marked with a quest intiate. Link to comment Share on other sites More sharing options...
zerosavior115 Posted June 19, 2012 Share Posted June 19, 2012 well ive tried this method(edit some part in the convo tut)follow this stepfor example like thisfind the send chat subadd another index ( the case for events )and add this line of code on that case ( replace the attacker and npcnum below ) Call CheckTasks(attacker, QUEST_TYPE_GOTALK, npcNum) Call CheckTasks(attacker, QUEST_TYPE_GOGIVE, npcNum) Call CheckTasks(attacker, QUEST_TYPE_GOGET, npcNum) If NPC(npcNum).Quest = YES Then If Player(attacker).PlayerQuest(NPC(npcNum).Quest).Status = QUEST_COMPLETED Then If Quest(NPC(npcNum).Quest).Repeat = YES Then Player(attacker).PlayerQuest(NPC(npcNum).Quest).Status = QUEST_COMPLETED_BUT Exit Function End If End If If CanStartQuest(attacker, NPC(npcNum).QuestNum) Then 'if can start show the request message (speech1) QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Speech(1)), NPC(npcNum).QuestNum Exit Function End If If QuestInProgress(attacker, NPC(npcNum).QuestNum) Then 'if the quest is in progress show the meanwhile message (speech2) QuestMessage attacker, NPC(npcNum).QuestNum, Trim$(Quest(NPC(npcNum).QuestNum).Speech(2)), 0 Exit Function End If End If End Ifafter that on clientjust add another name on the event list ( on the conv editor )PS you will need quest and conv system here Link to comment Share on other sites More sharing options...
Guest Posted June 19, 2012 Share Posted June 19, 2012 What engine are you using 0_o Link to comment Share on other sites More sharing options...
Growlith1223 Posted June 19, 2012 Author Share Posted June 19, 2012 that gave me an error and highlighting```If Conv(convNum).Conv(curChat).rTarget(chatOption) = 0 Then```:/I works until i click on the buttonEDIT: NVM i got it fixed xD 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