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

Crashing when saving a quest with data in it?


Joyce
 Share

Recommended Posts

Well, I've been fiddling around with it trying to figure out why it crashes.. but I can't seem to make any sense out of it! The darn thing crashes on saving it for some reason.. Here's the sub that saves the quests(works fine when generating empty quest files)
```
Sub SaveQuest(ByVal QuestNum As Long)
    Dim filename As String
    Dim F As Long
    filename = App.Path & "\data\quests\quest" & QuestNum & ".dat"
    F = FreeFile
    Open filename For Binary As #F
    Put #F, , Quest(QuestNum)
    Close #F
End Sub
```
And here's the type(s) I use for it(yes, they are set as a public named Quest())
```
Private Type QuestObjectiveRec
    FlagKillNPC As Boolean
    FlagGather As Boolean
    FlagTalk As Boolean
    KillNPC As Byte
    GatherItem As Byte
    TalkNPC As Byte
    Amount As Byte
End Type

Private Type QuestRewardRec
    ID As Byte
    Amount As Byte
End Type

Public Type QuestRec
    Name As String
    Description As String
    StartText As String
    AwaitText As String
    EndText As String
    ReqQuest As Long
    Objective(1 To QUEST_MAXOBJ) As QuestObjectiveRec
    Reward(1 To QUEST_MAXREW) As QuestRewardRec
    RewardExp As Long
End Type
```
Does anyone know why it does that? It doesn't give any errors, the server just instantly freezes and crashes with the generic "has stopped working" message.
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...