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

[EO] Alatar's Quest System v1.2


Alatar
 Share

Recommended Posts

**Error:** "Method or data member not found"

**in ".PlayerQuest", of function:**

```
Public Function QuestInProgress(ByVal index As Long, ByVal QuestNum As Long) As Boolean
    QuestInProgress = False
    If QuestNum < 1 Or QuestNum > MAX_QUESTS Then Exit Function

    If Player(index)[.PlayerQuest(QuestNum).Status = QUEST_STARTED Then 'Status=1 means started
        QuestInProgress = True
    End If
    End Function
```
Anyone helpme???
I declared all Types, and yet add modules…
Link to comment
Share on other sites

  • Replies 703
  • Created
  • Last Reply

Top Posters In This Topic

@mkldoido:

> **Error:** "Method or data member not found"
>
> **in ".PlayerQuest", of function:**
>
> ```
> Public Function QuestInProgress(ByVal index As Long, ByVal QuestNum As Long) As Boolean
>     QuestInProgress = False
>     If QuestNum < 1 Or QuestNum > MAX_QUESTS Then Exit Function
>
>     If Player(index)[.PlayerQuest(QuestNum).Status = QUEST_STARTED Then 'Status=1 means started
>         QuestInProgress = True
>     End If
>     End Function
> ```
> Anyone helpme???
> I declared all Types, and yet add modules…

Replace it with this :
```
Public Function QuestInProgress(ByVal index As Long, ByVal QuestNum As Long) As Boolean
    QuestInProgress = False
    If QuestNum < 1 Or QuestNum > MAX_QUESTS Then Exit Function

    If Player(index).PlayerQuest(QuestNum).Status = QUEST_STARTED Then 'Status=1 means started
        QuestInProgress = True
    End If
    End Function
```

* * *

Also, I've made a fix for taking/giving items on the start of a quest :
In **modHandleData** replace **HandlePlayerHandleQuest** with this :
```
Sub HandlePlayerHandleQuest(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer
Dim QuestNum As Long, Order As Long

Set Buffer = New clsBuffer
Buffer.WriteBytes Data()
QuestNum = Buffer.ReadLong
Order = Buffer.ReadLong '1 = accept, 2 = cancel
If Order = 1 Then
Player(index).PlayerQuest(QuestNum).Status = QUEST_STARTED '1
Player(index).PlayerQuest(QuestNum).ActualTask = 1
Player(index).PlayerQuest(QuestNum).CurrentCount = 0
PlayerMsg index, "New quest accepted: " & Trim$(Quest(QuestNum).Name) & "!", BrightGreen
    If Quest(QuestNum).StartItem > 0 And Quest(QuestNum).StartItemValue > 0 Then
    GiveInvItem index, Quest(QuestNum).StartItem, Quest(QuestNum).StartItemValue
    End If
    If HasItem(index, Quest(QuestNum).StartRemoveItem) And Quest(QuestNum).StartRemoveItem > 0 And Quest(QuestNum).StartRemoveItemValue > 0 Then
    TakeInvItem index, Quest(QuestNum).StartRemoveItem, Quest(QuestNum).StartRemoveItemValue
    End If
ElseIf Order = 2 Then
Player(index).PlayerQuest(QuestNum).Status = QUEST_NOT_STARTED '2
End If
SavePlayer index
SendPlayerData index
SendPlayerQuest index, QuestNum
Set Buffer = Nothing
End Sub
```
Link to comment
Share on other sites

just tried it out, seems its backwards on when it gives takes, but it at least is better than it was.  i made a few quests to test it out.  instead of giving on start and taking on end it will either

a.  give on start, not take on end. 
or
b. take on start, give on end.

this was tried with combinations of multiple tasks, single tasks, talk to, get from, give to, take on start, give on start. 

and lastly it will give items in stack form, so its not good to give more than 1 item, you drop stack on ground, its instantly just 1 item again. 

again tho still better than before.
Link to comment
Share on other sites

@sotvotkong:

> just tried it out, seems its backwards on when it gives takes, but it at least is better than it was.  i made a few quests to test it out.  instead of giving on start and taking on end it will either
>
> a.  give on start, not take on end. 
> or
> b. take on start, give on end.
>
> this was tried with combinations of multiple tasks, single tasks, talk to, get from, give to, take on start, give on start. 
>
> and lastly it will give items in stack form, so its not good to give more than 1 item, you drop stack on ground, its instantly just 1 item again. 
>
> again tho still better than before.

I know it isn't perfect, I'm still improving it. ;)
Also, this fixes only take/give item **at start**
Link to comment
Share on other sites

@Erwin:

> I know it isn't perfect, I'm still improving it. ;)
> Also, this fixes only take/give item **at start**

yea i was thinking that. during my testing it seems as tho that was the case.  as for the on starts, if used seperatly they work as intended, if used in same quest on multi task, it works backwards lol.
Link to comment
Share on other sites

@askumi:

> im getting some runtime error..
>
> "Run-time error '9':
> Subscript out of range"
>
> it happens when i hit end to open up my questlog

Run it in the IDE and click Debug ehen error comes up, and tell us what line he's selecting.
Link to comment
Share on other sites

~~Im getting a RTE 9 when i try to open quest log. The error sends me to the line In clsBuffer Public Sub WriteBytes
Im using EO 2.0~~

Nvm i fixed it, i was just missing some lines from the tutorial, Sorry. Great Quest System.  :P
Link to comment
Share on other sites

@shadowdeath:

> Works Great.
> Simple Question though,
> How about adding a button to view the quest log?
> Anyone give me a hand?
> I'd appreciate it. :)

I'll make a tutorial for that tomorrow and ill post it in this thread.
I also gonna add a 'Train resource' fix ;)
Link to comment
Share on other sites

**Quest Log Button Tutorial**

**Client Side**

Alright, first **make a button somewere in picMain**, make sure Visible = True.

Double click on the button and **add this in the button_click sub** :
```
UpdateQuestLog
            If picQuestLog.Visible Then
                ShowQuestLogPage 1
            Else
                picQuestLog.Visible = True
                picInventory.Visible = False
                picCharacter.Visible = False
                picSpells.Visible = False
                picOptions.Visible = False
                picParty.Visible = False
          End If
```
And there we have our Quest Log Button ;)

* * *

**Fix for 'Train Resource' quest type**

**Server Side**

In **modPlayer** in **Sub CheckResource** under :
```
' carry on
GiveInvItem index, Resource(Resource_index).ItemReward(FinalReward), 1
SendAnimation GetPlayerMap(index), Resource(Resource_index).Animation, rX, rY
```
Add :
```
Call CheckTasks(index, QUEST_TYPE_GOTRAIN, Resource_index)
```
And now the Train Resource quest type works. ;)
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...