Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quest help
#1
Ok I found this tutorial for programming a quest system on a MS based forum, can't remember the name and it went out of buisness so anyway. This is server side.

Code:
' :::::::::::::::::::::::::::::::
    ' :: Request a quest packet ::
    ' :::::::::::::::::::::::::::::::
    If Left(LCase(Parse(0)), 12) = "requestquest" Then
        If Player(index).Char(Player(index).CharNum).CurrentQuest > 0 Then
        Select Case Player(index).Char(Player(index).CharNum).QuestStatus
            Case Is = 1
                Call SendDataTo(index, "questmsg" & SEP_CHAR & procQuestMsg(index, Quests(Player(index).Char(Player(index).CharNum).CurrentQuest).StartQuestMsg) & END_CHAR)
            Case Is = 2
            Debug.Print Quests(Player(index).Char(Player(index).CharNum).CurrentQuest).GetItemQuestMsg
                Call SendDataTo(index, "questmsg" & SEP_CHAR & procQuestMsg(index, Quests(Player(index).Char(Player(index).CharNum).CurrentQuest).GetItemQuestMsg) & END_CHAR)
            Case Is = 3
                Call SendDataTo(index, "questmsg" & SEP_CHAR & procQuestMsg(index, Quests(Player(index).Char(Player(index).CharNum).CurrentQuest).FinishQuestMessage) & END_CHAR)
            Case Else
                Call PlayerMsg(index, "You have no quest", White)
            
        End Select
        Else
            Call SendDataTo(index, "questmsg" & SEP_CHAR & "You currently have no quest" & END_CHAR)
        End If
    End If

It highlights the Quests of
Code:
(index, Quests(Player(index).Char(Player
this part and says sub or function not defined, no matter what I do, including creating another quest sub with all the needed info in it; any idea's?
Reply
#2
Did you make a QuestRec?

Is procQuestMsg defined? Like, is there a Sub procQuestMsg or Function procQuestMsg?
Reply
#3
Ya I think your missing the QuestRec.
Reply
#4
Nah I have it on both sides, I figured out what the error was.

Code:
Public Quests(1 To MAX_QUESTS) As QuestRec
This was what was wrong, I typed in
Code:
public Quest(1 to MAX_QUEST) as QuestRec
on the server side.
Reply
#5
Alright cool Smile
Reply
#6
It's always the small problems that are hard to find.
Reply
#7
Ya like 1 small letter can ruin all. I always think that the reason its not super fast is because of a mis-spell :p. Like if 1 letter was missing and you added it, it would be like a super mirage and run super fast xD.
Reply
#8
Yeah missspelling screwed up my Vis inv several times, and the npc, and the PickP system(though that's still not working correctly.) It's really annoying, the tut doesn't explain any way to use the npc's to give the quests so I'm in the middle of figuring that out.
Reply
#9
Sorry about double posting but I have another issue

Code:
' Make sure they are on the same map
    If IsPlaying(Attacker) Then
        If NpcNum > 0 And GetTickCount > Player(Attacker).AttackTimer + 950 Then
            ' Check if at same coordinates
            Select Case GetPlayerDir(Attacker)
                Case DIR_UP
                    If (MapNpc(MapNum, MapNpcNum).y + 1 = GetPlayerY(Attacker)) And (MapNpc(MapNum, MapNpcNum).x = GetPlayerX(Attacker)) Then
                    If Npc(NpcNum).Behavior  NPC_BEHAVIOR_FRIENDLY And Npc(NpcNum).Behavior  NPC_BEHAVIOR_SHOPKEEPER Then
                        CanAttackNpc = True
                    Else
                    If chkQuest.Value = True Then
                        Call SetCurrentQuest
                        Call StartQuestMsg
                    Else
                        Call PlayerMsg(Attacker, Trim(Npc(NpcNum).Name) & " says: '" & Trim(Npc(NpcNum).AttackSay) & "'", BrightBlue)
                        End If
                    End If
                    End If
it highlights if Chkquest.value and says variable not defined and I've tried about everything I know and still no luck any clues?
Reply
#10
Where is this code located? If in a mod you have to state the form.

Code:
frmBlah.Chkquest.Value

If it it's in the form... you never made the Chkquest.


And isn't it supposed to be
Code:
Chkquest.checked
or something like that?
Reply
#11
The check box is on the npcform and I think I set a quest code on the npcform; but all the quest codes like start finish and checkquestprogression are all in modQuests. So make 'em all like

Code:
If frmNpcEditor.chkQuest.Checked = True Then
                        Call SetCurrentQuest
                        Call StartQuestMsg
Is that what your talking about?
Reply
#12
Yes.
Reply
#13
there is a tutorial for making a quest editor an stuff on elysium it works once you fix the errors.
Reply
#14
Necro posting. xD

Anything at ES is useless.
Reply
#15
I still can't get this stupid thing to let players aquire a quest from a npc, I am actually getting very annoyed with it.
Reply
#16
Necro-post again, but if you haven't fixed it by now there's always the option of hard-coding in the quests. Takes a lot work and isn't as efficient, but at least it gets the job done. Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)