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

[EVB/DX7] Quest Images


SkywardRiver
 Share

Recommended Posts

In this tutorial I'm going to walk you through how to have an image render above NPC's with quests.

Like so:

![](http://snag.gy/fEOqV.jpg)

Now, I'll attach the image I made for this (ugly as it is) if you want to use it, that's fine.

Now, this is all client-side and SO easy it's not even funny.

modDirectDraw7

Find:

```
Public DDSD_Bars As DDSURFACEDESC2
```

And below it put:

```
Public DDSD_Quest As DDSURFACEDESC2
```

Now find:

```
Public DDS_Bars As DirectDrawSurface7
```

and below that put:

```
Public DDS_Quest As DirectDrawSurface7
```

Now find this:

```
If FileExist(App.Path & "\data files\graphics\bars.bmp") Then Call InitDDSurf("bars", DDSD_Bars, DDS_Bars)
```

and below that put:

```
If FileExist(App.Path & "\data files\graphics\quest.bmp") Then Call InitDDSurf("quest", DDSD_Quest, DDS_Quest)
```

Now find this:

```
Set DDS_Target = Nothing ZeroMemory ByVal VarPtr(DDSD_Target), LenB(DDSD_Target)
```

and below that put:

```
Set DDS_Quest = Nothing ZeroMemory ByVal VarPtr(DDSD_Quest), LenB(DDSD_Quest)
```

Now find this in BltNpc:

```
Call BltSprite(Sprite, X, Y, rec)
```

And below that put this:

```
If Npc(MapNpc(MapNpcNum).num).questGiver = 1 Then Call BltQuest(X, Y) End If
```

Now add this at the bottom of the module:

```
Public Sub BltQuest(ByVal X As Long, ByVal Y As Long)Dim rec As DXVBLib.RECT ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler With rec .top = 0 .Bottom = 0 .Left = 0 .Right = 0 End With Engine_BltFast X + 33, Y - 32, DDS_Quest, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY ' Error handler Exit Suberrorhandler: HandleError "BltQuest", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub
```

Depending on the sprite youre using or the image, you'll want to edit this part of the code.

Engine_BltFast _**X + 33, Y - 32**_, DDS_Quest, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY

Now: download the attachment and put it into your graphics folder.

That should be it! Report any bugs and I'll fix em, like always.

~SkywardRiver
Link to comment
Share on other sites

> How would you add a ? mark one showing the quest returner?

It's in the latest version of [EVB](http://www.eclipseorigins.com/community/index.php?/topic/136376-evb/?p=932963). Here's how to do it:

Repeat Sky's tutorial but instead of "_Quest" for your surfaces add two surfaces named "_Quest_Available" and "_Quest_Handin"

Change:

```
If Npc(MapNpc(MapNpcNum).num).questGiver = 1 Then
Call BltQuest(X, Y)
End If

```
To:

```
If Npc(MapNpc(MapNpcNum).num).questGiver = 1 Then
        Call BltQuest(X, Y, MapNpcNum)
    End

```
Replace your BltQuest with this one:

```
Public Sub BltQuest(ByVal X As Long, ByVal Y As Long, ByVal MapNpcNum As Long)
Dim rec As DXVBLib.RECT
Dim questNum As Long, i As Long
Dim questInProgress As Boolean

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    With rec
        .top = 0
        .Bottom = 0
        .Left = 0
        .Right = 0
    End With

    questNum = Npc(MapNpc(MapNpcNum).num).questIndex
    For i = 1 To MAX_QUESTS
        If Player(MyIndex).Quest(i).QuestStatus = 1 And i = questNum Then
            questInProgress = True
        End If
    Next

    If questInProgress Then
        Engine_BltFast X + 32, Y - 10, DDS_Quest_Handin, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY
    Else
        Engine_BltFast X + 32, Y - 10, DDS_Quest_Available, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY
    End If

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "BltQuest", "modDirectDraw7", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub

```
There's no flag for if the quest is ready to hand in (i.e. all the objectives are complete) so it shows if the player is currently on that NPC's quest.
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...