Murdoc Posted September 18, 2010 Author Share Posted September 18, 2010 This is tested and 100% working. Qazek's [http://www.touchofdeathforums.com/smf/index.php?topic=62859.0](http://www.touchofdeathforums.com/smf/index.php?topic=62859.0) is needed for the code to function properly.It uses the npc editor for this system as well. So you can assign a different text message for each window with ease.Thanks go to DSHWinchester for help with code.First, create a picturebox named "picQuestWindow" (our background), cmd button called "cmdOkQuest" (to click "ok"), and a label "lblQuestMsg" (where text will display).Client Side–---------Under ' Packets sent by server to client add:```SQuestWindow```In modHandleData add:```HandleDataSub(SQuestWindow) = GetAddress(AddressOf HandleQuestWindow)```At bottom of modHandleData create Sub:```Private Sub HandleQuestWindow(ByVal Index As Long, ByRef Data() As Byte, ByVal EditorIndex As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim Buffer As clsBufferDim msg As StringSet Buffer = New clsBufferBuffer.WriteBytes Data()msg = Buffer.ReadStringfrmMainGame.picQuestWindow.Visible = TruefrmMainGame.lblQuestMsg.Caption = "" & msg & ""frmMainGame.lblQuestMsg.Visible = TruefrmMainGame.cmdOkQuest.Visible = TrueEnd Sub```Double click on button "cmdOkQuest" and insert code:```frmMainGame.picQuestWindow.Visible = FalsefrmMainGame.lblQuestMsg.Visible = FalsefrmMainGame.cmdOkQuest.Visible = False```Server Side:Locate the original code to call the quest that starts "If Npc(NpcNum).Behaviour = NPC_BEHAVIOUR_QUEST Then" and replace with:```If Npc(NpcNum).Behaviour = NPC_BEHAVIOUR_QUEST Then If Npc(NpcNum).QuestLevel <= GetPlayerLevel(Attacker) Then If GetVar("data\quest\" & GetPlayerName(Attacker) & ".ini", "QUEST", "Quest" & Npc(NpcNum).QuestNum) = 0 Then Call QuestWindow(Attacker, Npc(NpcNum).QuestMsg1) Call PlayerMsg(Attacker, Npc(NpcNum).QuestMsg1, Yellow) Call PutVar("data\quest\" & GetPlayerName(Attacker) & ".ini", "QUEST", "Quest" & Npc(NpcNum).QuestNum, 1) Exit Function End If If GetVar("data\quest\" & GetPlayerName(Attacker) & ".ini", "QUEST", "Quest" & Npc(NpcNum).QuestNum) = 1 Then If HasItem(Attacker, Npc(NpcNum).QuestReqItem) Then Call QuestWindow(Attacker, Npc(NpcNum).QuestMsg2) Call PlayerMsg(Attacker, Npc(NpcNum).QuestMsg2, Yellow) Call TakeInvItem(Attacker, Npc(NpcNum).QuestReqItem, Npc(NpcNum).QuestReqItemHowMany) Call GiveInvItem(Attacker, Npc(NpcNum).QuestRewItem, Npc(NpcNum).QuestRewItemHowMany) Call PutVar("data\quest\" & GetPlayerName(Attacker) & ".ini", "QUEST", "Quest" & Npc(NpcNum).QuestNum, 2) Exit Function Else Call QuestWindow(Attacker, Npc(NpcNum).QuestMsg3) Call PlayerMsg(Attacker, Npc(NpcNum).QuestMsg3, Yellow) End If End If If GetVar("data\quest\" & GetPlayerName(Attacker) & ".ini", "QUEST", "Quest" & Npc(NpcNum).QuestNum) = 2 Then Call QuestWindow(Attacker, Npc(NpcNum).QuestMsg4) Call PlayerMsg(Attacker, Npc(NpcNum).QuestMsg4, Yellow) Exit Function End If Else Call QuestWindow(Attacker, "Come back when you're stronger!") Call PlayerMsg(Attacker, "You don't have required level!", Yellow) End If End If If Len(Trim$(Npc(NpcNum).AttackSay)) > 0 Then PlayerMsg Attacker, Trim$(Npc(NpcNum).Name) & ": " & Trim$(Npc(NpcNum).AttackSay), White End If End If End If End If End If End IfEnd Function```Add```SQuestWindow```under ' Packets sent by server to clientAdd a Sub at bottom of modGameLogic:```Sub QuestWindow(byval index as long,byval msg as string)Dim Buffer As clsBufferSet Buffer = New clsBufferBuffer.WriteLong SQuestWindowBuffer.WriteString MsgSendDataTo index, Buffer.ToArray() Set Buffer = Nothingend sub```Done.Now you can use Qazek's quest editor to define the messages that will appear in "picQuestWindow".I plant to update this tutorial later to include npc portraits. :)Example Screenshots:![](http://www.freemmorpgmaker.com/files/imagehost/pics/d8869d75b9dba495978b4a62a77d5c4b.jpg)![](http://www.freemmorpgmaker.com/files/imagehost/pics/22d8a800a423d6c82129c8f1d907c2c8.jpg) Link to comment Share on other sites More sharing options...
DshWinchester Posted September 19, 2010 Share Posted September 19, 2010 hoho nice ;Ddid not think you would post this complement Link to comment Share on other sites More sharing options...
Yxxe Posted September 19, 2010 Share Posted September 19, 2010 I guess it makes the overall code a little better - good job. It isn't much more difficult to make a quest log to keep track of your accepted quests, and the ability to Give up quests at any time. It didn't take me long to write a whole quest system with those features.Regards,Lightning Link to comment Share on other sites More sharing options...
DshWinchester Posted September 19, 2010 Share Posted September 19, 2010 @Lightning:> I guess it makes the overall code a little better - good job. It isn't much more difficult to make a quest log to keep track of your accepted quests, and the ability to Give up quests at any time. It didn't take me long to write a whole quest system with those features.> > Regards,> > LightningRobin's Son ;D Link to comment Share on other sites More sharing options...
VitinhooxD Posted September 19, 2010 Share Posted September 19, 2010 Who lighting?If yes , then yes :D Lighting is a great coder.He is doing an amazing work with OTLR Link to comment Share on other sites More sharing options...
Robin Posted September 19, 2010 Share Posted September 19, 2010 @DshWinchester:> Robin's Son ;DNo. Link to comment Share on other sites More sharing options...
Yxxe Posted September 19, 2010 Share Posted September 19, 2010 @[Cake:> Vitin â„¢ link=topic=64737.msg693731#msg693731 date=1284902354]> Who lighting?If yes , then yes :D Lighting is a great coder.He is doing an amazing work with OTLRI'm not Robin's son - and Robin is only 2 years older than me so it wouldn't make sense in the first place ;) Link to comment Share on other sites More sharing options...
Gohan Posted September 19, 2010 Share Posted September 19, 2010 Awesome! Just what I needed ;D Link to comment Share on other sites More sharing options...
Murdoc Posted September 19, 2010 Author Share Posted September 19, 2010 @Lightning:> I guess it makes the overall code a little better - good job. It isn't much more difficult to make a quest log to keep track of your accepted quests, and the ability to Give up quests at any time. It didn't take me long to write a whole quest system with those features.> > Regards,> > LightningWe think much alike. :) Gonna try and update the tutorial with portrait power (lol), and a simple quest log add-on at some point. Link to comment Share on other sites More sharing options...
Yxxe Posted September 20, 2010 Share Posted September 20, 2010 @â•‘Veneranceâ•‘:> @Lightning:> > > I guess it makes the overall code a little better - good job. It isn't much more difficult to make a quest log to keep track of your accepted quests, and the ability to Give up quests at any time. It didn't take me long to write a whole quest system with those features.> > > > Regards,> > > > Lightning> > We think much alike. :) Gonna try and update the tutorial with portrait power (lol), and a simple quest log add-on at some point.Sounds good. I will post a screenshot of my questlog in this thread when I get back home, I guess you could use it as reference.Regards,Lightning Link to comment Share on other sites More sharing options...
Coolguy6318 Posted September 20, 2010 Share Posted September 20, 2010 I did all this but when i push ctrl by npc nothing happens? Link to comment Share on other sites More sharing options...
Murdoc Posted September 20, 2010 Author Share Posted September 20, 2010 @Coolguy6318:> I did all this but when I push ctrl by npc nothing happens?Make sure the npc number and QuestNum are the same. (I believe that's correct) Anyway, if that doesn't work, maybe check the code again? Did you have Qazek's quest system working before you tried this? Let's see if we can narrow it down. :) Link to comment Share on other sites More sharing options...
Coolguy6318 Posted September 20, 2010 Share Posted September 20, 2010 idk :huh: i didn't test it :rolleyes: :icon_crap: Link to comment Share on other sites More sharing options...
Yxxe Posted September 20, 2010 Share Posted September 20, 2010 Old screenie from the ES version of OTLR. Use this image as reference if you like:![](http://i801.photobucket.com/albums/yy294/Adrammelech_2009/questlogupdate.png)Regards,Lightning Link to comment Share on other sites More sharing options...
Murdoc Posted September 20, 2010 Author Share Posted September 20, 2010 @Lightning:> Old screenie from the ES version of OTLR. Use this image as reference if you like:> > ![](http://i801.photobucket.com/albums/yy294/Adrammelech_2009/questlogupdate.png)> > Regards,> > LightningThanks for this Lightning. (nice screenie btw) .. I'm gonna do something like this, but have all game quests listed, and just grey out the ones that arent active. Should be simple enough… I hope :) Link to comment Share on other sites More sharing options...
Coolguy6318 Posted September 29, 2010 Share Posted September 29, 2010 @ѕýα∂Ãă:> @Coolguy6318:> > > I did all this but when I push ctrl by npc nothing happens?> > Make sure the npc number and QuestNum are the same. (I believe that's correct) Anyway, if that doesn't work, maybe check the code again? Did you have Qazek's quest system working before you tried this? Let's see if we can narrow it down. :)Ok i tested Qazeks quest system today no errors but when i talk 2 npc nothing happens :icon_crap: Link to comment Share on other sites More sharing options...
adr990 Posted October 24, 2010 Share Posted October 24, 2010 Hey, nice job on this one.Looks easy to do. (Yet I'm in learning stage.)I should mess with this code some more.I hope to write some nice coding like a Ticket system or so. Just to start with. I will make a Tutorial too.These tutorials are helping me out step by step by applying them and mess around with them.Thanks, keep it up.I wonder how the Cancel or Reset system would work and keeping a Log of all your quests.Probably needs something to do inside the same .Ini. Or eventually another .Ini. ([Quests-Done] Quest1=Done/Busy/-)I'm trying to figure out it my self for now, it sure should be able to be done with just this code already.And I really like the ease of use of this In-Game Quest maker. I'm really gonna use this one.Thanks! Link to comment Share on other sites More sharing options...
NextEraGaming Posted November 24, 2010 Share Posted November 24, 2010 Hrm…for some reason, the picturebox and command button are always visible.Tried setting the 'visibility' option in the properties to false but they still show up. Link to comment Share on other sites More sharing options...
Murdoc Posted November 25, 2010 Author Share Posted November 25, 2010 @[NEG:> Deity link=topic=64737.msg715318#msg715318 date=1290607511]> Hrm…for some reason, the picturebox and command button are always visible.> Tried setting the 'visibility' option in the properties to false but they still show up.Don't create the picturebox inside the game screen. Make it seperate. I think this should fix that problem. If not, let me know. Link to comment Share on other sites More sharing options...
s3th Posted December 27, 2010 Share Posted December 27, 2010 I have a problem installing the quest editor…> Server Side:> > Locate the original code to call the quest that starts "If Npc(NpcNum).Behaviour = NPC_BEHAVIOUR_QUEST Then" and replace with:in my origins server folder i dont have any Npc Behaivour = NPC_BEHAIVOUR_QUEST so where should i add that code?please Help! :sad: Link to comment Share on other sites More sharing options...
Murdoc Posted December 27, 2010 Author Share Posted December 27, 2010 @s3th:> I have a problem installing the quest editor…> > > Server Side:> > > > Locate the original code to call the quest that starts "If Npc(NpcNum).Behaviour = NPC_BEHAVIOUR_QUEST Then" and replace with:> > in my origins server folder I dont have any Npc Behaivour = NPC_BEHAIVOUR_QUEST so where should I add that code?please Help! :sad:You must not have installed the quest system, Qazek made, properly. There's a link to it in my post. I suggest going back and checking it over, because it should be there. :) Link to comment Share on other sites More sharing options...
s3th Posted December 27, 2010 Share Posted December 27, 2010 so should i start again adding the codes from your tutorial? Link to comment Share on other sites More sharing options...
Murdoc Posted January 27, 2011 Author Share Posted January 27, 2011 @s3th:> so should I start again adding the codes from your tutorial?Yes, I would definately suggest that. Link to comment Share on other sites More sharing options...
leopoldobb Posted February 1, 2011 Share Posted February 1, 2011 I adapted this tutorial for my game, using the hardcoded version of quest, this link:http://www.touchofdeathforums.com/smf/index.php/topic,68426.0.htmlWorks perfectly. :) Link to comment Share on other sites More sharing options...
Murdoc Posted February 1, 2011 Author Share Posted February 1, 2011 @leopoldobb:> I adapted this tutorial for my game, using the hardcoded version of quest, this link:> http://www.touchofdeathforums.com/smf/index.php/topic,68426.0.html> > Works perfectly. :)Thanks for letting us know. :-) I was actually gonna test the same to see if it would work. But you beat me to it! 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