Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Adding Mini HP Bars for Npcs


Kimimaru
 Share

Recommended Posts

  • Replies 81
  • Created
  • Last Reply

Top Posters In This Topic

@Ertzel:

> Dunno wtf u just tried to say but..
>
> You NEED vb6 to edit anything in the source for any version of Eclipse.

Actually, you don't. You can edit everything, even forms, in notepad++ or whatever, but you can't compile or run it, that's all. :) If he want's to edit his code and then compile it, he can use VB6 for compiling and notepad for programming, not saying it's a good way to do it, just that you can.
Link to comment
Share on other sites

@Marcus:

> Actually, you don't. You can edit everything, even forms, in notepad++ or whatever, but you can't compile or run it, that's all. :) If he want's to edit his code and then compile it, he can use VB6 for compiling and notepad for programming, not saying it's a good way to do it, just that you can.

You're not going to get anywhere without being able to edit the forums, controls or project.
Link to comment
Share on other sites

  • 3 weeks later...
If you have factions, and they fight eachother, their HP bars will not update, this is how to fix:

Find this:
```
' Can the npc attack the npc?
                                If CanNpcAttackNpc(MapNum, x, Target) Then
                                        Damage = CLng(Npc(NpcNum).Stat(Stats.strength)) - CLng(Npc(Target).Stat(Stats.endurance))
                                        If Damage < 1 Then Damage = 1
                                        Call NpcAttackNpc(MapNum, x, Target, Damage)
```
Right after:
```
Call NpcAttackNpc(MapNum, x, Target, Damage)
```
Add this:
```
SendMapNpcVitals MapNum, Target
```

===

Please add this to the main post.
Link to comment
Share on other sites

  • 1 month later...
I'm a little bit stuck on this step.

Here is the error I am getting:

>! ![](http://i116.photobucket.com/albums/o10/masterofmoo/DangerWillRobinson.png)

My Gut says that the error "Expected End Sub" means that it wants me to place and End Sub for that specific line?

However I don't want to do anything without clarification until I become confident in VB6 :)
Link to comment
Share on other sites

@Chuchoide:

> u have a sub in a sub. u replaced BltNpc with BltNpcHP. U needa go to the End Sub command of BltNpc, press enter, and then paste the BltNpcHP sub.
>
> Like:
>
> Public Sub BltNpc
> -Code-
> End Sub
>
> Public Sub BltNpcHP
> -Code-
> End Sub

I got it working, thank you for the extra help! MUCH appreciated.
Link to comment
Share on other sites

~~Thats because u followed the tutorial wrong…

when it says

Add this under Public Sub BltNpc in modDirectDraw7:

it means add it under that whole sub, not just add it below that one line in the sub like u did.~~

Nvm, you just edited ur post.
Link to comment
Share on other sites

@Valek:

> @Chuchoide:
>
> > u have a sub in a sub. u replaced BltNpc with BltNpcHP. U needa go to the End Sub command of BltNpc, press enter, and then paste the BltNpcHP sub.
> >
> > Like:
> >
> > Public Sub BltNpc
> > -Code-
> > End Sub
> >
> > Public Sub BltNpcHP
> > -Code-
> > End Sub
>
> I got it working, thank you for the extra help! MUCH appreciated.

Yeah, Np
Link to comment
Share on other sites

**I am having a bit of trouble changing the position of the health bar on my NPC's..

this is what the HP bar looks like on the NPC.**

>! ![](http://i116.photobucket.com/albums/o10/masterofmoo/HPBAR.png)

**This is what my code looks like.**

>! ```
' Calculate the X coordinate to place the name
    X = MapNpc(Index).X * PIC_X + MapNpc(Index).XOffset

    If Sprite < 1 Or Sprite > NumCharacters Then
        y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - 50
    Else
        y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - (DDSD_Character(Sprite).lHeight) + 50
    End If
```

**It says in the tutorial that I can move the placement by changing the coordinates displaced in these lines of code, however I am have changing them and haven't really had any luck moving it at all.

Any help would be great!**
Link to comment
Share on other sites

@Athagekin:

> The positions are based on pixel units.  Your offsets are probably too high or too low.  Did you modify any of the code that was shown in the tutorial?

No I didn't modify any of it. I just followed it step by step. The health bar is displaying, however when I change the coordinates and recompile, it doesn't move at all. Not even a pixel in either direction. So its confusing to me. Even if my offsets were too high or too low I should be able to compensate by modifying the coords.
Link to comment
Share on other sites

I used this:

'Position bar - 225 = Below Char, 154 = Above Name, 172 Between Name and Char

And worked fine for me.. All thought, ofcourse, a name between the Sprite and Name doesn't look good haha IMO.

Just try it out to check. (Unless you changed your window size, this should work in EO CE(1.2.0) )
Link to comment
Share on other sites

@adr990:

> I used this:
>
> 'Position bar - 225 = Below Char, 154 = Above Name, 172 Between Name and Char
>
> And worked fine for me.. All thought, ofcourse, a name between the Sprite and Name doesn't look good haha IMO.
>
> Just try it out to check. (Unless you changed your window size, this should work in EO CE(1.2.0) )

You'll have to be more specific with me.
My code looks like this, what does yours look like?

>! ```
' Calculate the X coordinate to place the name
    X = MapNpc(Index).X * PIC_X + MapNpc(Index).XOffset

    If Sprite < 1 Or Sprite > NumCharacters Then
        y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - 50
    Else
        y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - (DDSD_Character(Sprite).lHeight) + 50
    End If
```
Link to comment
Share on other sites

@Valek:

> @adr990:
>
> > I used this:
> >
> > 'Position bar - 225 = Below Char, 154 = Above Name, 172 Between Name and Char
> >
> > And worked fine for me.. All thought, ofcourse, a name between the Sprite and Name doesn't look good haha IMO.
> >
> > Just try it out to check. (Unless you changed your window size, this should work in EO CE(1.2.0) )
>
> You'll have to be more specific with me.
> My code looks like this, what does yours look like?
>
> >! ```
> ' Calculate the X coordinate to place the name
>     X = MapNpc(Index).X * PIC_X + MapNpc(Index).XOffset
>  
>     If Sprite < 1 Or Sprite > NumCharacters Then
>         y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - 50
>     Else
>         y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - (DDSD_Character(Sprite).lHeight) + 50
>     End If
> ```

Mine does look like this at the moment:
```
' Calculate the X coordinate to place the name
    X = MapNpc(Index).X * PIC_X + MapNpc(Index).XOffset

    If Sprite < 1 Or Sprite > NumCharacters Then
        y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - 225 'Position bar - 225 = Below Char, 154 = Above Name, 172 Between Name and Char
    Else
        y = MapNpc(Index).y * PIC_Y + MapNpc(Index).YOffset - (DDSD_Character(Sprite).lHeight) + 255 'Position bar - 225 = Below Char, 154 = Above Name, 172 Between Name and Char
    End If
```
I only tried the normal npc yet. The DDSD Char I'm not sure of what it is as of yet, actually..
Link to comment
Share on other sites

  • 3 weeks later...
I just try on 1.3 but there's a strange problem with the npc hp bar
it is too large

the piece is here but I cant find what is the problem

>! Call DDS_BackBuffer.DrawBox(ConvertMapX(X), ConvertMapY(Y), ConvertMapX(X + Int(((MapNpc(Index).Vital(Vitals.HP) / 32) / (Npc(NpcNum).HP / 32)) * 32)), ConvertMapY(Y + 4))

here is what looks like ![](http://img411.imageshack.us/img411/500/screenhunter02jan210202.png)

the back bar(black) works perfectly.Anyone can help?'='

edit: /450000
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×
×
  • Create New...