thezeus Posted January 28, 2011 Author Share Posted January 28, 2011 I was brainstorming is helping teach people how hard monsters are.. it is obviously an option I'd like to convert eventually to be within the options to turn off and on; however, I think this is a good start.If anyone knows why the # is lower than the text let me know and provide a bug fix.Search within Client```Public Sub DrawNpcName(ByVal Index As Long)```Change the code to```Public Sub DrawNpcName(ByVal Index As Long)Dim TextX As LongDim TextY As LongDim color As LongDim Name As StringDim NpcNum As LongDim TextA As LongDim TextB As LongDim Strength As String NpcNum = MapNpc(Index).num Select Case Npc(NpcNum).Behaviour Case NPC_BEHAVIOUR_ATTACKONSIGHT color = QBColor(BrightRed) Case NPC_BEHAVIOUR_ATTACKWHENATTACKED color = QBColor(Yellow) Case NPC_BEHAVIOUR_GUARD color = QBColor(Grey) Case Else color = QBColor(BrightGreen) End Select Name = Trim$(Npc(NpcNum).Name) Strength = Trim$("STR: " & Npc(NpcNum).Stat(Stats.Strength)) TextX = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) If Npc(NpcNum).Sprite < 1 Or Npc(NpcNum).Sprite > NumCharacters Then TextA = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("STR: " & Npc(NpcNum).Stat(Stats.Strength)))) TextB = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 32 TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 16 Else ' Determine location for text TextA = ConvertMapX(MapNpc(Index).x * PIC_X) + MapNpc(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$("STR: " & Npc(NpcNum).Stat(Stats.Strength)))) TextB = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - 32 TextY = ConvertMapY(MapNpc(Index).y * PIC_Y) + MapNpc(Index).YOffset - (DDSD_Character(Npc(NpcNum).Sprite).lHeight / 4) + 16 End If ' Draw name Call DrawText(TexthDC, TextA, TextB, Strength, QBColor(White)) Call DrawText(TexthDC, TextX, TextY, Name, color)End Sub```![](http://i747.photobucket.com/albums/xx117/richconner/display.jpg) Link to comment Share on other sites More sharing options...
shado360 Posted January 28, 2011 Share Posted January 28, 2011 Interesting idea, I like it. I'll try it out later, when I have the time :P Link to comment Share on other sites More sharing options...
Irhymer Posted January 28, 2011 Share Posted January 28, 2011 Thanks man, will mess around with this code for sure. :cheesy: Link to comment Share on other sites More sharing options...
Guest Posted January 28, 2011 Share Posted January 28, 2011 Works!Thank you.But can you make it also to show the hp.I tryd changing STR to HP and Strength to Health but it dident work it just gived me an error.Edit: I found a bug.It says the str only to the npc's you awredy had in the game.But if you make a new one the str and name are on same high line. Link to comment Share on other sites More sharing options...
Guest Posted January 29, 2011 Share Posted January 29, 2011 sorry for the doble post but can someone help please?Edit:Nvm i fixd it myself. Link to comment Share on other sites More sharing options...
thezeus Posted January 29, 2011 Author Share Posted January 29, 2011 Please share your information with the class Link to comment Share on other sites More sharing options...
chuchoide Posted February 1, 2011 Share Posted February 1, 2011 Very nice, won't use but very nice feature. Link to comment Share on other sites More sharing options...
thezeus Posted February 1, 2011 Author Share Posted February 1, 2011 I've actually modifying it to change the npc name color instead of displaying the level. It goes yellow for monsters easily killable, white for average, and red for difficult. If that is something people would like me to release let me know. Link to comment Share on other sites More sharing options...
saruish Posted February 10, 2011 Share Posted February 10, 2011 @thezeus:> I've actually modifying it to change the npc name color instead of displaying the level. It goes yellow for monsters easily killable, white for average, and red for difficult. If that is something people would like me to release let me know.i would like it Link to comment Share on other sites More sharing options...
dream1204 Posted February 17, 2011 Share Posted February 17, 2011 I got a little problem. I just copy all your code and follow the step. However, the name of NPC and Strength overlap. I've checked the code several times. I am sure the X,Y,A,B coordinates are correct. plz help me with this:) 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