Terrakion Posted July 4, 2011 Author Share Posted July 4, 2011 This tutorial will teach you how to make an option for this tutorial: http://www.touchofdeathforums.com/smf/index.php/topic,72388.0.htmlso, the credit goes to him for the feature, and the credit goes to me for the option.ok, let's start.Go to frmMain, search for picOptions and add:1 label with caption of - Names. Make sure to change its font to 'Georgia' and make it bold. Then, make 2 options. Put them below your 'Names' label. name one optS and another optH. optS is for showing names, and optS is for not showing them. Then, put in their captions: Show and Hide, depending the option.Now, to the code: (the following code is from Xlithlan's tutorial, just edited to fit this tutorial)Go to modDirectDraw7, search for **' Draw player names**, and replace the following code:```' draw player names For i = 1 To Player_HighIndex If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then Call DrawPlayerName(i) End If Next ' draw npc names For i = 1 To Npc_HighIndex If MapNpc(i).num > 0 Then Call DrawNpcName(i) End If Next```with:``` ' draw player names If frmMain.optH.Value = True Then For i = 1 To Player_HighIndex If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then If CurX = Player(i).X And CurY = Player(i).Y Then Call DrawPlayerName(i) End If End If NextElse For i = 1 To Player_HighIndex If IsPlaying(i) And GetPlayerMap(i) = GetPlayerMap(MyIndex) Then Call DrawPlayerName(i) End If Next End If ' draw npc names If frmMain.optH.Value = True Then For i = 1 To Npc_HighIndex If MapNpc(i).num > 0 Then If CurX = MapNpc(i).X And CurY = MapNpc(i).Y Then Call DrawNpcName(i) End If End If NextElse For i = 1 To Npc_HighIndex If MapNpc(i).num > 0 Then Call DrawNpcName(i) End If Next End If```Now, go to modTypes, search for **Private Type OptionsRec**, and at the end (after debug As byte), add:```ShowNames As Byte```Now go to modDatabse, search for **Public Sub SaveOptions()** and before:```'error handler```Add:```Call PutVar(fileName, "Options", "ShowNames", Str(Options.Debug))```Then, below that Sub, you will find **Public Sub LoadOptions()** and just before where it says **SaveOptions**, add:```Options.ShowNames = 0```in that same Sub, just before the FIRST **End If**, add:```Options.ShowNames = GetVar(fileName, "Options", "ShowNames")```Then, in that sub, before it says **'error handler**, add:``` If Options.ShowNames = 0 Then frmMain.optS.Value = True Else frmMain.optH.Value = True End If```and finally, add this at the bottom of frmMain's code:```Private Sub opts_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Options.ShowNames = 0 SaveOptions ' Error handler Exit Suberrorhandler: HandleError "optW_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd SubPrivate Sub opth_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Options.ShowNames = 1 SaveOptions ' Error handler Exit Suberrorhandler: HandleError "optR_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```and lastly, go to config.ini and at the bottom (after debug= 0 or w/e), add:```ShowNames= 0```If you don't add this to your config.ini, you will receive a RTE.Hope this helps you all, i felt like contributing to the community for the first time…. may post more tutorials. Link to comment Share on other sites More sharing options...
EclipseCommunity Posted July 6, 2011 Share Posted July 6, 2011 Thanks Terrakion :) Link to comment Share on other sites More sharing options...
Medleyy Posted July 26, 2011 Share Posted July 26, 2011 Love this edit, thanks. Link to comment Share on other sites More sharing options...
Darth Tyllo Posted July 26, 2011 Share Posted July 26, 2011 This is my code except worded differently, and a lot longer, for no reason -.- I fail to see how interchanging my "HoverNames" and your "ShowNames" constitutes as a tutorial. In addition, you need to follow the extra steps that I detailed to complete the option feature. That was the first time I figured out how to code a feature(be it something small) all by myself, so I am very…_touchy_…about this.For future reference, I advise you to read [this](http://www.plagiarism.org/plag_article_what_is_plagiarism.html), Terrakion, it could keep you out of a lot of trouble in the future. Link to comment Share on other sites More sharing options...
Darth Tyllo Posted July 27, 2011 Share Posted July 27, 2011 @Terrakion:> This tutorial will teach you how to make an option for this tutorial: http://www.touchofdeathforums.com/smf/index.php/topic,72388.0.htmlKinda like how I did…except ten days earlier than you did...with your topic LINKED to the topic where I posted mine...@terrakion:> Hope this helps you all, i felt like contributing to the community for the first time….Your probablly feeling how I felt. 10 days before you posted this. I seriously suggest you read [this](http://www.plagiarism.org/plag_article_what_is_plagiarism.html), before you attempt to 'contribute' again. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted July 27, 2011 Share Posted July 27, 2011 @Darth:> -snip-You're flogging a dead horse my friend. Link to comment Share on other sites More sharing options...
Darth Tyllo Posted July 27, 2011 Share Posted July 27, 2011 I know, I know, but I truely have nothing better to do atm. Link to comment Share on other sites More sharing options...
Craselin Posted August 4, 2011 Share Posted August 4, 2011 @뱄â€rÃÂ:> Love this edit, thanks.Second this Link to comment Share on other sites More sharing options...
Mr.LLoyd Posted November 13, 2011 Share Posted November 13, 2011 I have a problem.Everything worked great but when i attack i cant see the damage i deal or doge or when you put a stat like will power that shows above your head and stuff like that. 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