Craselin Posted April 16, 2011 Author Share Posted April 16, 2011 Blood On/Off Button Tutorial by CraselinHey everyone,before i start the tutorial I want say "MASSIVE" credit to Sweek who pretty much taught me how to do this and without him this tutorial would not exisit. Also please bear in mind this is my first tutorial.**What does this tutorial do?**This tutorial will guide you on create a checkbox in the options menu which allows players to turn blood on or off.**Are there any known bugs?**Yes, sadly there is a pretty big bug which causes blood not to appear on login until unchecking the box then re-checking it. There are no other known bugs.**Is it hard?**Not very hard it all, that is, if you follow the instructions.>! **_ALL EDITS DONE IN CLIENT_****1\.** Open up client.vbp using visual basic professional or enterprise edition.**2\.** In the project explorer click "Modules" then "modConstants"![](http://www.freemmorpgmaker.com/files/imagehost/pics/5358ee6f37e3711433a65233dcab8208.bmp)**3\.** At the end of modConstants add this:```'blood on or offPublic bloodvisi As Boolean```then close modConstants**4\.** Once again in the modules section but this time open "modDirectDraw7"![](http://www.freemmorpgmaker.com/files/imagehost/pics/685dccd4bbe3723c90b1e4d5a2e3f38e.bmp)**5\.** Find this code using Ctrl+F```Public Sub BltBlood(ByVal Index As Long)Dim rec As DxVBLib.RECT```Underneath it add this:``` If bloodvisi = False Then Exit Sub```then close modDirectDraw7**6\.** Under the Forms section open frmMain![](http://www.freemmorpgmaker.com/files/imagehost/pics/4e217d0472040d82e54edd011be78574.bmp)**7\.** Now for the more graphical part, in the corner you will see a big picture box (refer to picture below) right click it and select send to back, do this again until you see the music and sound options![](http://www.freemmorpgmaker.com/files/imagehost/pics/c52be8a282c1fa7941f21582827239e9.bmp)**8\.** Now make a small label by clicking on the label button and place it below the other options, then click in the caption section at the side and name it "Blood" make the backstyle "0 - transparent" change the font to "georgia (bold)" and make the font colour "white (highlighted text)"Then you need to make a checkbox next to the blood label, name it "bloodchk", make the backcolour "black (button text)" and change the value to "1 - Checked"![](http://www.freemmorpgmaker.com/files/imagehost/pics/7e7c1574b8aacd25e045f08c438f3fc7.bmp)**9\.** Double click on the checkbox and a window should pop up, you should see a code like this:```Private Sub bloodchk_Click()>! End Sub```In the middle of that code, in the blank space, type (or copy) this:``` If Check1.Value = 0 Then BloodSwitch = True Else: BloodSwitch = False End If```**10\.** Close that window and select File > Make Eclipse Origins.exe. A window should pop up so click ok then yes, now wait until the compile bar at the top is done. Now close VB6 (it will ask if you want to save, click yes)**DONE!**>! Oh and, sorry for the werid flashing at the start, Camstudio is werid like that sometimes.http://www.youtube.com/watch?v=4RoK29wV_VU**GOOD LUCK! And enjoy!**kind regards,Craselin Link to comment Share on other sites More sharing options...
Carim123 Posted April 16, 2011 Share Posted April 16, 2011 Perfectly written. I wish all the tutorials were in this format. Link to comment Share on other sites More sharing options...
Craselin Posted April 16, 2011 Author Share Posted April 16, 2011 @QWERTYUIoP:> Perfectly written. I wish all the tutorials were in this format.Thank you. Actually i might add a poll to see what more people think Link to comment Share on other sites More sharing options...
Carim123 Posted April 16, 2011 Share Posted April 16, 2011 @Craselin:> Thank you. Actually i might add a poll to see what more people thinkThere's no need, as long as you're happy with it yourself. Link to comment Share on other sites More sharing options...
Craselin Posted April 16, 2011 Author Share Posted April 16, 2011 Meh, i did it anyway XD Link to comment Share on other sites More sharing options...
Conra Posted April 16, 2011 Share Posted April 16, 2011 Nice tut! Anyway why will you turn blood off? Link to comment Share on other sites More sharing options...
Craselin Posted April 16, 2011 Author Share Posted April 16, 2011 I dunno, edgy parents? XD. I've just played some games where people have commented on not wanting blood. And thanks :D Link to comment Share on other sites More sharing options...
Conra Posted April 16, 2011 Share Posted April 16, 2011 Oh right! Awesome and no prob. Link to comment Share on other sites More sharing options...
Helladen Posted April 16, 2011 Share Posted April 16, 2011 You should use radio buttons and add a blood option to the OptionsRec and have it save this so it won't cause the bug you described above. Link to comment Share on other sites More sharing options...
Craselin Posted April 16, 2011 Author Share Posted April 16, 2011 Only one problem, i've got no idea how!? :/ Link to comment Share on other sites More sharing options...
Helladen Posted April 16, 2011 Share Posted April 16, 2011 Can't really explain it well, try Ctrl + F OptionsRec, add Blood as Byte at the bottom of that. Then look for SaveOptions and LoadOptions, copy a line and rename the things to Blood.After that copy a set of radio buttons and rename them, then set it and save options when it is modified.You should know the basics of programming enough to figure this out on your own with this help though, don't feel like going through this in extreme detail.You should also add the exit out where its called, because it would stop from calling the sub in the first place. So if the blood count is greater than 1 it would have to exit out as many times as what the blood count equaled. Link to comment Share on other sites More sharing options...
Craselin Posted April 16, 2011 Author Share Posted April 16, 2011 hmm, thanks. I'll look into that Link to comment Share on other sites More sharing options...
Conra Posted April 16, 2011 Share Posted April 16, 2011 DOnt you think it will slow your engine down a bit? Every time a player is supposed to "bleed" it checks whether "bleeding" is on or off. And it might be a little bit but it does affect the final speed of your client. Link to comment Share on other sites More sharing options...
Helladen Posted April 16, 2011 Share Posted April 16, 2011 No. The values are cached it takes like a millisecond to check. Link to comment Share on other sites More sharing options...
ToshiroHayate Posted April 16, 2011 Share Posted April 16, 2011 Ironically, Craselin has a bloody signature. XDAs for the tutorial, very nice. Should help quite a few people. Link to comment Share on other sites More sharing options...
Carim123 Posted April 16, 2011 Share Posted April 16, 2011 An Option Button is simple.Get rid of``` If Check1.Value = 0 Then BloodSwitch = True Else: BloodSwitch = False End If```And make two buttons, in one picture.On the On button, simply put```Private Sub optBOn_Click()Â Â Â Â bloodvisi = TrueEnd Sub```And on the Off, simply put```Private Sub optBOff_Click()bloodvisi = FalseEnd Sub```It's so simple even I got it, and I'm a programming wreck. It actually works.EDIT: Although, this doesn't save it. Need to save it to the .ini. Link to comment Share on other sites More sharing options...
Conra Posted April 16, 2011 Share Posted April 16, 2011 @Helladen:> No. The values are cached it takes like a millisecond to check.oh. Someone told me differently today. :) Link to comment Share on other sites More sharing options...
Helladen Posted April 17, 2011 Share Posted April 17, 2011 @Conra:> oh. Someone told me differently today. :)I am not sure how fast it is to get the cached value, but I was trying to say that it is nothing to notice. Link to comment Share on other sites More sharing options...
Craselin Posted April 17, 2011 Author Share Posted April 17, 2011 @QWERTYUIoP:> An Option Button is simple.> > Get rid of> ```> If Check1.Value = 0 Then> BloodSwitch = True> Else: BloodSwitch = False> End If> ```> And make two buttons, in one picture.> > On the On button, simply put> ```> Private Sub optBOn_Click()> Â Â Â Â bloodvisi = True> End Sub> ```> And on the Off, simply put> ```> Private Sub optBOff_Click()> bloodvisi = False> End Sub> ```> It's so simple even I got it, and I'm a programming wreck. It actually works.> > EDIT: Although, this doesn't save it. Need to save it to the .ini.Thank you, i will test it and see if i can add a saved option Link to comment Share on other sites More sharing options...
gdog12356 Posted April 17, 2011 Share Posted April 17, 2011 haha this is awesome. I love ur accent :D. It is really cool, you should add a tut to hide player names/levels lol. Link to comment Share on other sites More sharing options...
Craselin Posted April 17, 2011 Author Share Posted April 17, 2011 Hmmm, i just might do that :)Thanks (and also, your like the 8th person to mention something about me accent to me XD) Link to comment Share on other sites More sharing options...
Conra Posted April 17, 2011 Share Posted April 17, 2011 @Helladen:> I am not sure how fast it is to get the cached value, but I was trying to say that it is nothing to notice.i think if you add a few things that need checking it starts getting noticeable. Link to comment Share on other sites More sharing options...
Craselin Posted April 17, 2011 Author Share Posted April 17, 2011 @Conra:> i think if you add a few things that need checking it starts getting noticeable.Not really, think of it like this. How many lines of code does it take to say, you an item in EO or fight an NPC? The answer: quite a few, yet it still loads pretty fast. Link to comment Share on other sites More sharing options...
Vus Posted April 24, 2011 Share Posted April 24, 2011 nice tutorial, thanks :) 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