Kirby4tw Posted August 13, 2009 Author Share Posted August 13, 2009 Hello guys,Im searching for a script what make it possible to see the hp/mp bar above the other online characters. Or maybe anybody can explain how to change the enginge to add this hp/mp bar.thanks, kirby =)) Link to comment Share on other sites More sharing options...
Kirby4tw Posted August 18, 2009 Author Share Posted August 18, 2009 Has nobody an idea how to hardcoded the source for a HP Bar?thxKirby Link to comment Share on other sites More sharing options...
Admiral Refuge Posted August 25, 2009 Share Posted August 25, 2009 I thought you'd just set PlayerBar=1 in the Config.iniOr… Is that just visible to you?I think having PlayerBar=1 and PlayerDamage=1, you see the other player's HP bar when you attack them. Link to comment Share on other sites More sharing options...
Kirby4tw Posted August 25, 2009 Author Share Posted August 25, 2009 no… its not so easy.i only can see my OWN HPBar above the head.But... i cant see the HP of other players. And when i attack an other player theres no HP Bar anywhere^^ Link to comment Share on other sites More sharing options...
Admiral Refuge Posted August 25, 2009 Share Posted August 25, 2009 I see.Well, I'm not much on sourcing, but for whoever is up to it: Couldn't you just copy wherever the code is that displays yours, and display it for the other player, the same way/place it displays it for the NPC? Link to comment Share on other sites More sharing options...
Kirby4tw Posted August 25, 2009 Author Share Posted August 25, 2009 Ok. THis the Code of the NPC-Bars:```Sub BltNpcBars(ByVal Index As Long) Dim X As Long, Y As Long On Error GoTo BltNpcBars_Error If MapNpc(Index).HP = 0 Then Exit Sub End If If MapNpc(Index).Num < 1 Then Exit Sub End If If Npc(MapNpc(Index).Num).Big = 1 Then X = (MapNpc(Index).X * PIC_X + sx - 9 + MapNpc(Index).xOffset) - (NewPlayerX * PIC_X) - NewXOffset Y = (MapNpc(Index).Y * PIC_Y + sx + MapNpc(Index).yOffset) - (NewPlayerY * PIC_Y) - NewYOffset Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0)) Call DD_BackBuffer.DrawBox(X, Y + 32, X + 50, Y + 36) Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) If MapNpc(Index).MaxHp < 1 Then Call DD_BackBuffer.DrawBox(X, Y + 32, X + ((MapNpc(Index).HP / 100) / ((MapNpc(Index).MaxHp + 1) / 100) * 50), Y + 36) Else Call DD_BackBuffer.DrawBox(X, Y + 32, X + ((MapNpc(Index).HP / 100) / (MapNpc(Index).MaxHp / 100) * 50), Y + 36) End If Else X = (MapNpc(Index).X * PIC_X + sx + MapNpc(Index).xOffset) - (NewPlayerX * PIC_X) - NewXOffset Y = (MapNpc(Index).Y * PIC_Y + sx + MapNpc(Index).yOffset) - (NewPlayerY * PIC_Y) - NewYOffset Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0)) Call DD_BackBuffer.DrawBox(X, Y + 32, X + 32, Y + 36) Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) If MapNpc(Index).MaxHp < 1 Then Call DD_BackBuffer.DrawBox(X, Y + 32, X + ((MapNpc(Index).HP / 100) / ((MapNpc(Index).MaxHp + 1) / 100) * 32), Y + 36) Else Call DD_BackBuffer.DrawBox(X, Y + 32, X + ((MapNpc(Index).HP / 100) / (MapNpc(Index).MaxHp / 100) * 32), Y + 36) End If End If On Error GoTo 0 Exit SubBltNpcBars_Error: If Err.Number = DDERR_CANTCREATEDC Then End IfEnd Sub```And this is the Players part:```Sub BltPlayerBars(ByVal Index As Long) Dim X As Long, Y As Long X = (GetPlayerX(Index) * PIC_X + sx + Player(Index).xOffset) - (NewPlayerX * PIC_X) - NewXOffset Y = (GetPlayerY(Index) * PIC_Y + sx + Player(Index).yOffset) - (NewPlayerY * PIC_Y) - NewYOffset If Player(Index).HP = 0 Then Exit Sub End If If SpriteSize = 1 Then ' draws the back bars Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0)) Call DD_BackBuffer.DrawBox(X, Y - 30, X + 32, Y - 34) ' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(X, Y - 30, X + ((Player(Index).HP / 100) / (Player(Index).MaxHp / 100) * 32), Y - 34) Else If SpriteSize = 2 Then ' draws the back bars Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0)) Call DD_BackBuffer.DrawBox(X, Y - 30 - PIC_Y, X + 32, Y - 34 - PIC_Y) ' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(X, Y - 30 - PIC_Y, X + ((Player(Index).HP / 100) / (Player(Index).MaxHp / 100) * 32), Y - 34 - PIC_Y) Else ' draws the back bars Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0)) Call DD_BackBuffer.DrawBox(X, Y + 2, X + 32, Y - 2) ' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(X, Y + 2, X + ((Player(Index).HP / 100) / (Player(Index).MaxHp / 100) * 32), Y - 2) End If End IfEnd Sub```–---------------------------------------------Im attempted deserve ways to get a hpbar for other players, but it backfired...So... i think for an ScriptingPro... its a easy think.help <3 Link to comment Share on other sites More sharing options...
kris_hole Posted August 25, 2009 Share Posted August 25, 2009 i dont think its been coded to view other players hp bars? Link to comment Share on other sites More sharing options...
Kirby4tw Posted August 25, 2009 Author Share Posted August 25, 2009 right… but i want to show the code from NPC and (self) HP-Bar.so maybe anybody can make a operating code for the HPBar of Other players... Link to comment Share on other sites More sharing options...
SawQuart Posted August 27, 2009 Share Posted August 27, 2009 I attempted to do this once, and it didnt work. Idk if there even is a script for this. Im sure Godlord could help. Link to comment Share on other sites More sharing options...
Kimimaru Posted August 27, 2009 Share Posted August 27, 2009 There isn't a script for it, but there's a tutorial here: http://www.touchofdeathforums.com/smf/index.php/topic,50673.0.htmlLook near the middle of the first post. The creator of the tutorial includes many things in one tutorial. Link to comment Share on other sites More sharing options...
Kirby4tw Posted August 27, 2009 Author Share Posted August 27, 2009 i already see this tut.but the bars dont work. My hp bar is just copied above the other players heads.maybe anybody can fix? :/ Link to comment Share on other sites More sharing options...
Kimimaru Posted August 27, 2009 Share Posted August 27, 2009 Try messing around with the Indexes. For example, try this:```' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(X, y + 35, X + ((Player(Index).HP / 100) / (Player(MyIndex).MaxHp / 100) * 32), y + 31)```You can also try this:```' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(X, y + 35, X + ((Player(MyIndex).HP / 100) / (Player(Index).MaxHp / 100) * 32), y + 31)``` Link to comment Share on other sites More sharing options...
kris_hole Posted August 27, 2009 Share Posted August 27, 2009 i dont see a single thing different between those two… Link to comment Share on other sites More sharing options...
Kimimaru Posted August 27, 2009 Share Posted August 27, 2009 Thanks, lol. I forgot to edit part of it, but it's edited now. Also, make sure you're copying and pasting that code and editing the extra one. Don't edit the one you started with. You need to create a new one and then edit it. Link to comment Share on other sites More sharing options...
emblem Posted August 27, 2009 Share Posted August 27, 2009 AUGH. DOES ANYONE KNOW WHAT AN INDEX IS!```' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(X, y + 35, X + ((Player(Index).HP / 100) / (Player(Index).MaxHp / 100) * 32), y + 31)```MyIndex on the client is the index of the player running the client, "index" is a parameter passed to the function that gives the index of the player's hp bar to draw.Why would you compare every players hp with your own, everyone doesn't have your max you know? …*bashes head againsed wall* Link to comment Share on other sites More sharing options...
kris_hole Posted August 27, 2009 Share Posted August 27, 2009 people know what they are but most newbies to eclipse just C&P gawd we've all done it :P Link to comment Share on other sites More sharing options...
Kimimaru Posted August 27, 2009 Share Posted August 27, 2009 I just told him to try out some things, since I don't see why the tutorial wasn't working for him.@[THE-KRIS:> link=topic=50165.msg533082#msg533082 date=1251406054]> people know what they are but most newbies to eclipse just C&P gawd we've all done it :PI don't know if you're directing this to me, but anyway, I'm fully capable of editing the server and client source. I've reformed some of the features that Eclipse comes with, such as the personal messaging system and the trading system. Incase you haven't noticed, I've also fixed up The Oracle's friends list. It now works great. Link to comment Share on other sites More sharing options...
Kirby4tw Posted August 28, 2009 Author Share Posted August 28, 2009 and now? what's the solution? :P Link to comment Share on other sites More sharing options...
Kimimaru Posted August 28, 2009 Share Posted August 28, 2009 I don't know if I'll have time, but I can try to get this done for you. I can't guarantee it, though, sorry. Link to comment Share on other sites More sharing options...
balliztik1 Posted September 1, 2009 Share Posted September 1, 2009 I'm pretty sure this is just a matter of a couple lines tops. All you'd have to do is make sure all players' health is blitted instead of just your own. I'll look into it.What version of Eclipse are you using? I'm looking at Eclipse Stable, and it looks like this is already coded in. Link to comment Share on other sites More sharing options...
Kirby4tw Posted September 1, 2009 Author Share Posted September 1, 2009 i use eclipse stable :/Theres only the own HP BarDemian PLS help <3 Link to comment Share on other sites More sharing options...
balliztik1 Posted September 1, 2009 Share Posted September 1, 2009 ``` ' Blit players bar If frmMirage.chkPlayerBar.Value = Checked Then For I = 1 To MAX_PLAYERS If IsPlaying(I) Then If GetPlayerMap(I) = GetPlayerMap(MyIndex) Then Call BltPlayerBars(I) End If End If Next I End If``````Sub BltPlayerBars(ByVal Index As Long) Dim x As Long, y As Long x = (GetPlayerX(Index) * PIC_X + sx + Player(Index).xOffset) - (NewPlayerX * PIC_X) - NewXOffset y = (GetPlayerY(Index) * PIC_Y + sx + Player(Index).yOffset) - (NewPlayerY * PIC_Y) - NewYOffset If Player(Index).HP = 0 Then Exit Sub End If If SpriteSize = 1 Then ' draws the back bars Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0)) Call DD_BackBuffer.DrawBox(x, y - 30, x + 32, y - 34) ' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(x, y - 30, x + ((Player(Index).HP / 100) / (Player(Index).MaxHp / 100) * 32), y - 34) Else If SpriteSize = 2 Then ' draws the back bars Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0)) Call DD_BackBuffer.DrawBox(x, y - 30 - PIC_Y, x + 32, y - 34 - PIC_Y) ' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(x, y - 30 - PIC_Y, x + ((Player(Index).HP / 100) / (Player(Index).MaxHp / 100) * 32), y - 34 - PIC_Y) Else ' draws the back bars Call DD_BackBuffer.SetFillColor(RGB(255, 0, 0)) Call DD_BackBuffer.DrawBox(x, y + 2, x + 32, y - 2) ' draws HP Call DD_BackBuffer.SetFillColor(RGB(0, 255, 0)) Call DD_BackBuffer.DrawBox(x, y + 2, x + ((Player(Index).HP / 100) / (Player(Index).MaxHp / 100) * 32), y - 2) End If End IfEnd Sub```There's no code in there restricting it to only one player's bar. If they are on the same map and health bars are enabled, you should be seeing their bars. It's set to loop for all indices.I just multilogged, and there's no health bar over other characters…hmm...this is odd. I'll probe a bit deeper into this.Whoa...found the error. Apparently, Eclipse doesn't send HP info from other players. I took out the line about "If Player(index).HP = 0" and it works, except it reads all others' health as 0\. I'll see about making the server send that info to all clients on the same map. Link to comment Share on other sites More sharing options...
damian666 Posted September 1, 2009 Share Posted September 1, 2009 please make sure you are posting the tutorial Ballie ^^Damian666 Link to comment Share on other sites More sharing options...
balliztik1 Posted September 2, 2009 Share Posted September 2, 2009 @[SB:> Damian666 link=topic=50165.msg537430#msg537430 date=1251849588]> please make sure you are posting the tutorial Ballie ^^> > Damian666Sure thing. I'm all over the place tonight. xD How many things have I tackled in the past hour? Link to comment Share on other sites More sharing options...
Kirby4tw Posted September 2, 2009 Author Share Posted September 2, 2009 I test it…you too @ Balliztik1 ?it doesnt work...i see a red bar over the other players... like 0 HP...i already test this without the If Player(index).HP = 0:/ 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