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

[EO 2.0] Chest Attribute with Editor + Data save in Player Array


Joyce
 Share

Recommended Posts

* * *

**Chest Attribute with Editor + Data save in Player Array**

* * *

**Created By:** Yami (Joyce)
**Inspired By:** Kibbelz's horrendously outdated system.
**Date Finished:** 9/1/2012
**Difficulty:** 2/5 - Rated R for Retard Friendly!
**Summary:** A relatively simple chest system that allows you to create and place chests from the in-game editors. The chest can be either one of two types, the first hands out all items in the chest, the second hands out ONE random item from the chest. After the chest has been looted, a flag will appear in the player's array and they will no longer be able to loot this specific Chest ID.
**Credits:**

* Yami for writing pretty much everything.
* Kibblez for the Form mod and the logic that deals with placing down the chests(Why do it yourself if someone did it for you, right?).
* Domino for pointing out some things I changed, but never copied into the tutorial.

**Lisence:** This snippet is offered under the Eclipse Public Lisence V1.1

**Screenshot:**
![](http://www.freemmorpgmaker.com/files/imagehost/pics/46b6bef7acacd5ed7789648d77de572d.png)
A simple shot that shows the editor, with the chest I just picked up open in it. And the messages sent to the chat when it was opened.

* * *

**Step 1: Adding all the Packets, Globals, Types and Constants**

**Server-Side and Client-Side**

In **ModTypes**, add the following code to the bottom:
```
' Chest Addition
Private Type ChestRec
    Name as String * 25
    Type As Byte
    ItemNum(1 To MAX_CHEST_ITEMS) As Long
    ItemVal(1 To MAX_CHEST_ITEMS) As Long
End Type
```
Then at the top, add the following code under the public declarations:
```
' Chest Addition
Public Chest(MAX_CHESTS) As ChestRec
```
Find PlayerRec, and add the following piece of code into it BEFORE 'End Type':
```
' Chest Addition
    ChestState(1 To MAX_CHESTS) As Byte
```
Now head over to **ModConstants** and add the following four lines whereever you see fit:
```
' Chest Addition
Public Const MAX_CHESTS As Long = 100
Public Const MAX_CHEST_ITEMS As Long = 5

Public Const CHEST_TYPE_ALL As Byte = 1
Public Const CHEST_TYPE_RANDOM As Byte = 2
```
and under Public Const TILE_TYPE_SLIDE As Byte = 14 you should add:
```
Public Const TILE_TYPE_CHEST As Byte = 15
```
Now in **modEnumerations**, add the following in ClientPackets, before '' Make sure CMSG_COUNT is below everything else'
```
CRequestEditChest
CRequestChests
CSaveChest
```
Do the same with the following, but this time in the ServerPackets enumeration:
```
SChestEditor
SSendUpdateChest
```
**Client-Side Only**
Add this under Public_ShopChanged… in **modGlobals**
```
Public Chest_Changed(1 To MAX_CHESTS) As Boolean
```
And in modConstants, add the following under EDITOR_ANIMATION:
```
Public Const EDITOR_CHEST as Byte = 7
```
**Step 2: Adding the required Editor Form and Editing the Map Editor.**
Include the files attached in your client project, shouldn't be too hard to do. Replace the original frmEditor_Map with mine, and rejoice! Or look at the differences and manually edit it in if you have existing modifications already in use.

Now that we may applaud you on successfully using a standard IDE function, we continue on to editing the rest!

**Step 3: Adding the routines required.**

**Server Side**
In **ModDatabase** add the following subs at the bottom:
```
Sub ClearChest(ByVal index As Long)
    Call ZeroMemory(ByVal VarPtr(Chest(index)), LenB(Chest(index)))
    Chest(index).Name = vbNullString
End Sub

Sub ClearChests()
    Dim i As Long
    For i = 1 To MAX_CHESTS
        Call ClearChest(i)
    Next
End Sub

Sub SaveChest(ByVal ChestNum As Long)
    Dim filename As String
    Dim F As Long
    filename = App.Path & "\data\chests\chest" & ChestNum & ".dat"
    F = FreeFile
    Open filename For Binary As #F
    Put #F, , Chest(ChestNum)
    Close #F
End Sub

Sub SaveChests()
    Dim i As Long
    Call SetStatus("Saving chests... ")
    For i = 1 To MAX_CHESTS
        Call SaveChest(i)
    Next
End Sub

Sub LoadChests()
    Dim filename As String
    Dim i As Long
    Dim F As Long
    Call CheckChests

    For i = 1 To MAX_CHESTS
        filename = App.Path & "\data\chests\chest" & i & ".dat"
        F = FreeFile
        Open filename For Binary As #F
        Get #F, , Chest(i)
        Close #F
    Next

End Sub

Sub CheckChests()
    Dim i As Long
    For i = 1 To MAX_CHESTS
        If Not FileExist("\Data\chests\chest" & i & ".dat") Then
            Call SaveChest(i)
        End If
    Next
End Sub
```
Then in **ModGeneral** find Sub InitServer() and find this line 'ChkDir App.Path & "\Data\", "spells"', add the following line beneath it:
```
ChkDir App.Path & "\Data\", "chests"
```
then find Sub LoadGameData() and add this to the bottom of it:
```
Call SetStatus("Loading chests...")
Call LoadChests
```
then in Sub ClearGameData() add this at the bottom:
```
Call SetStatus("Clearing chests...")
Call ClearChests
```
In **modHandleData**, find Sub InitMessages and add the following at the bottom:
```
HandleDataSub(CRequestEditChest) = GetAddress(AddressOf HandleRequestEditChest)
HandleDataSub(CRequestChests) = GetAddress(AddressOf HandleRequestChests)
HandleDataSub(CSaveChest) = GetAddress(AddressOf HandleSaveChest)
```
and add the following to the bottom of the file:
```
Sub HandleRequestEditChest(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer

    ' Prevent hacking
    If GetPlayerAccess(index) < ADMIN_DEVELOPER Then
        Exit Sub
    End If

    Set Buffer = New clsBuffer
    Buffer.WriteLong SChestEditor
    SendDataTo index, Buffer.ToArray()
    Set Buffer = Nothing
End Sub

Sub HandleRequestChests(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    SendChests index
End Sub

Private Sub HandleSaveChest(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim ChestNum As Long
    Dim Buffer As clsBuffer
    Dim ChestSize As Long
    Dim ChestData() As Byte

    ' Prevent hacking
    If GetPlayerAccess(index) < ADMIN_DEVELOPER Then
        Exit Sub
    End If

    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()
    ChestNum = Buffer.ReadLong

    ' Prevent hacking
    If ChestNum < 0 Or ChestNum > MAX_CHESTS Then
        Exit Sub
    End If

    ChestSize = LenB(Chest(ChestNum))
    ReDim ChestData(ChestSize - 1)
    ChestData = Buffer.ReadBytes(ChestSize)
    CopyMemory ByVal VarPtr(Chest(ChestNum)), ByVal VarPtr(ChestData(0)), ChestSize
    ' Save it
    Call SaveChest(ChestNum)
    Call AddLog(GetPlayerName(index) & " saved Chest #" & ChestNum & ".", ADMIN_LOG)
End Sub
```
Now in the same file, search for HandleMapGetItem, and replace the entire sub with the following code:
```
Sub HandleMapGetItem(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddR As Long, ByVal ExtraVar As Long)
    Dim a As Long ' For - Next loops
    Dim b As Long ' Inventory slot
    Dim c As Long ' Chest ID
    Dim d As Long
    Dim e As Long ' random number generator
    Dim f As Long ' counter

    If Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Type = TILE_TYPE_CHEST Then
        ' Assign the chest's number to this value.. Easier to read through
        c = Map(GetPlayerMap(index)).Tile(GetPlayerX(index), GetPlayerY(index)).Data1

        ' Check for RTE9
        If c < 0 Or c > MAX_CHESTS Then Exit Sub

        ' See if the chest has a name, if not.. well, ignore it!
        If Len(Chest(c).Name) < 1 Then Exit Sub

        ' See if the user has ever looted this chest before.
        If Player(index).ChestState(c) <> 1 Then
            ' He hasn't! FREE LOOTZ!

            ' What type of chest is it?
            If Chest(c).Type = CHEST_TYPE_ALL Then
                ' Hand the user all the items in the chest, rawr!
                For a = 1 To MAX_CHEST_ITEMS
                    ' Check if the chest has an item in it, and if it's a legal item number.
                    If Chest(c).itemnum(a) > 0 And Chest(c).itemnum(a) <= MAX_ITEMS Then
                        b = FindOpenInvSlot(index, Chest(c).itemnum(a))
                        Call PlayerMsg(index, "You opened the chest and found " & Trim(STR(Chest(c).ItemVal(a))) & " " & Trim(Item(Chest(c).itemnum(a)).Name), White)
                        Call SetPlayerInvItemNum(index, b, Chest(c).itemnum(a))
                        Call SetPlayerInvItemValue(index, b, GetPlayerInvItemValue(index, b) + Chest(c).ItemVal(a))
                        Call SendInventoryUpdate(index, b)
                    End If
                Next
                Player(index).ChestState(c) = 1
            ElseIf Chest(c).Type = CHEST_TYPE_RANDOM Then
                ' Time to be a little tricky, and hand the guy a random item.

                ' Set the counter to zero.
                f = 0
                For a = 1 To MAX_CHEST_ITEMS
                    ' Check if the chest has an item in it, and if it's a legal item number.
                    If Chest(c).itemnum(a) > 0 And Chest(c).itemnum(a) <= MAX_ITEMS Then
                        f = f + 1
                    Else
                        Exit For
                    End If
                Next

                ' if e is too low.. exit to prevent issues.
                If f < 1 Then Exit Sub

                ' Now that we have an indication of how many items there are in the chest, randomize the outcome!
                e = RAND(1, f)

                ' Now we can hand out the item. ;]
                b = FindOpenInvSlot(index, Chest(c).itemnum(e))
                Call PlayerMsg(index, "You opened the chest and found " & Trim(STR(Chest(c).ItemVal(e))) & " " & Trim(Item(Chest(c).itemnum(e)).Name), White)
                Call SetPlayerInvItemNum(index, b, Chest(c).itemnum(e))
                Call SetPlayerInvItemValue(index, b, GetPlayerInvItemValue(index, b) + Chest(c).ItemVal(e))
                Call SendInventoryUpdate(index, b)
                Player(index).ChestState(c) = 1
            Else
                ' A non existant state! RUN FOR YOUR LIVES!
                Exit Sub
            End If
        Else
            ' He has, notify the player.
            Call PlayerMsg(index, "You have already looted this chest!", BrightRed)
        End If
    Else
        Call PlayerMapGetItem(index)
    End If
End Sub
```
In **modServerTCP** add the following code to the bottom:
```
Sub SendChests(ByVal index As Long)
    Dim i As Long
    For i = 1 To MAX_CHESTS
        If LenB(Trim$(Chest(i).Name)) > 0 Then
            Call SendUpdateChestTo(index, i)
        End If
    Next
End Sub

Sub SendUpdateChestTo(ByVal index As Long, ByVal ChestNum As Long)
    Dim packet As String
    Dim Buffer As clsBuffer
    Dim ChestSize As Long
    Dim ChestData() As Byte
    Set Buffer = New clsBuffer
    ChestSize = LenB(Chest(ChestNum))
    ReDim ChestData(ChestSize - 1)
    CopyMemory ChestData(0), ByVal VarPtr(Chest(ChestNum)), ChestSize
    Buffer.WriteLong SSendUpdateChest
    Buffer.WriteLong ChestNum
    Buffer.WriteBytes ChestData
    SendDataTo index, Buffer.ToArray()
    Set Buffer = Nothing
End Sub
```
**Client-Side**
In **ModGameEditors** paste the following at the bottom:
```
Public Sub ChestEditorInit()
    ' Set the global Chest ID properly.
    EditorIndex = frmEditor_Chest.lstChests.ListIndex + 1
    If EditorIndex <= 0 Then EditorIndex = 1

    ' Reset all the data to the selected chest ID, and reset the sliders accordingly.
    frmEditor_Chest.txtChestName.text = Chest(EditorIndex).Name
    frmEditor_Chest.scrlItem1.Max = MAX_CHEST_ITEMS
    frmEditor_Chest.ScrlItem2.Max = MAX_ITEMS
    frmEditor_Chest.scrlItem1.Value = 1
    frmEditor_Chest.lblItemNum.Caption = "Editing " & Trim(Str(frmEditor_Chest.scrlItem1.Value)) & "/" & Trim(Str(MAX_CHEST_ITEMS))
    frmEditor_Chest.ScrlItem2.Value = Chest(EditorIndex).ItemNum(frmEditor_Chest.scrlItem1.Value)
    If frmEditor_Chest.ScrlItem2.Value > 0 Then
        frmEditor_Chest.lblItemName.Caption = "Item: " & Trim(Str(frmEditor_Chest.ScrlItem2.Value)) & ": " & Item(frmEditor_Chest.ScrlItem2.Value).Name
    Else
        frmEditor_Chest.lblItemName.Caption = "None."
    End If
    frmEditor_Chest.txtAmount.text = Str(Chest(EditorIndex).ItemVal(frmEditor_Chest.scrlItem1.Value))
    If Chest(EditorIndex).Type = CHEST_TYPE_ALL Then
        frmEditor_Chest.opGiveAll.Value = True
        frmEditor_Chest.opGiveRandom.Value = False
    Else
        frmEditor_Chest.opGiveAll.Value = False
        frmEditor_Chest.opGiveRandom.Value = True
    End If
End Sub

Public Sub ChestEditorCancel()
    Dim i as Long
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    Editor = 0
    Unload frmEditor_Chest
    ClearChests
    SendRequestChests

    ' Reset the change states.
    For i = 1 To MAX_CHESTS
        Chest_Changed(i) = False
    Next i   

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

Public Sub ChestEditorOk()
Dim i As Long

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

    For i = 1 To MAX_CHESTS
        If Chest_Changed(i) Then
            Call SendSaveChest(i)
            Chest_Changed(i) = False
        End If
    Next

    Unload frmEditor_Chest
    Editor = 0
    ClearChests

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "ChestEditorOk", "modGameEditors", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```
Search for 'frmEditor_Map.fraShop.Visible = False' in ClearAttributeDialogue()and add the following below:
```
frmEditor_Map.fraChest.Visible = False
```
In **modClientTCP** add the following Subs:
```
Public Sub SendRequestEditChest()
Dim Buffer As clsBuffer

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

    Set Buffer = New clsBuffer
    Buffer.WriteLong CRequestEditChest
    SendData Buffer.ToArray()
    Set Buffer = Nothing

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

Public Sub SendRequestChests()
Dim Buffer As clsBuffer

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

    Set Buffer = New clsBuffer
    Buffer.WriteLong CRequestChests
    SendData Buffer.ToArray()
    Set Buffer = Nothing

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

Public Sub SendSaveChest(ByVal ChestNum As Long)
Dim Buffer As clsBuffer
Dim ChestSize As Long
Dim ChestData() As Byte

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

    Set Buffer = New clsBuffer
    ChestSize = LenB(Chest(ChestNum))
    ReDim ChestData(ChestSize - 1)
    CopyMemory ChestData(0), ByVal VarPtr(Chest(ChestNum)), ChestSize
    Buffer.WriteLong CSaveChest
    Buffer.WriteLong ChestNum
    Buffer.WriteBytes ChestData
    SendData Buffer.ToArray()
    Set Buffer = Nothing

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "SendSaveChest", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```
in **modInput** sub HandleKeyPresses, find 'SendRequestEditSpell' and add the following below it:
```
' Editing chest request
                Case "/editchest"
                    If GetPlayerAccess(MyIndex) < ADMIN_DEVELOPER Then GoTo Continue

                    SendRequestChests
                    SendRequestEditChest
```
in **modHandleData** add the following to the bottom of sub InitMessages():
```
HandleDataSub(SChestEditor) = GetAddress(AddressOf HandleChestEditor)
HandleDataSub(SSendUpdateChest) = GetAddress(AddressOf HandleUpdateChest)
```
Then add this to the bottom of the file:
```
Private Sub HandleChestEditor()
Dim i As Long

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

    With frmEditor_Chest
        Editor = EDITOR_CHEST
        .lstChests.Clear

        ' Add the names
        For i = 1 To MAX_CHESTS
            .lstChests.AddItem i & ": " & Trim$(Chest(i).Name)
        Next

        .Show
        .lstChests.ListIndex = 0
        ChestEditorInit
    End With

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

Private Sub HandleUpdateChest(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim n As Long
Dim Buffer As clsBuffer
Dim ChestSize As Long
Dim ChestData() As Byte

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

    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()

    n = Buffer.ReadLong

    ChestSize = LenB(Chest(n))
    ReDim ChestData(ChestSize - 1)
    ChestData = Buffer.ReadBytes(ChestSize)
    CopyMemory ByVal VarPtr(Chest(n)), ByVal VarPtr(ChestData(0)), ChestSize

    Set Buffer = Nothing

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "HandleUpdateChest", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```
And in **modDatabase** add the following to the bottom:
```
Sub ClearChest(ByVal Index As Long)
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    Call ZeroMemory(ByVal VarPtr(Chest(Index)), LenB(Chest(Index)))
    Chest(Index).Name = vbNullString

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

Sub ClearChests()
Dim i As Long

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

    For i = 1 To MAX_CHESTS
        Call ClearChest(i)
    Next

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "ClearChests", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub
```
**Kibblez's guide:**
Then, in modgameeditors Find:
```
' slide
If frmEditor_Map.optSlide.Value Then
    .Type = TILE_TYPE_SLIDE
    .Data1 = MapEditorSlideDir
    .Data2 = 0
    .Data3 = 0
End If
```
And underneath add:

```
'Chest
If frmEditor_Map.OptChest.Value Then
    .Type = TILE_TYPE_CHEST
    .Data1 = ItemEditorNum
    .Data2 = 0
    .Data3 = 0
End If
```
Next, in modtext Find:

```
Case TILE_TYPE_SLIDE
DrawText TexthDC, tX, tY, "S", QBColor(BrightCyan)
```
and then add this underneath:

```
Case TILE_TYPE_CHEST
DrawText TexthDC, tX, tY, "C", QBColor(Brown)
```

* * *

**Remember:** This modification tinkers with PlayerRec, so you will need to delete every Player file present for this to work, or your existing accounts will crash the server.

If all is well, and I didn't forget to copy some changes I made as I was writing and testing this, you should now have your very own chest system! Simply put down this attribute on your map, stand on it and hit whatever key you have assigned to pick up map items and this will do the rest. :] Note that every user can only get ONE try at opening every chest, even the ones that randomly give you one item! There is no do-overs as everything is stored within the player's main data.

If there's any bugs present, leave me a message here with the name of the sub that errors, and I'll correct it.
Link to comment
Share on other sites

Great job! Everything is working great so far, no currency issues or anything. Thanks a lot and it was **very simple to add **EDIT: I tested everything I could test and I have no issues at all. /editchest works and i even added a button on the admin panel.. Im a retard and I got thisadded in 5 mins maybe a difficulty of 2/5****
Link to comment
Share on other sites

@Yami:

> What sub does this originate from though, SendUpdateChestTo or HandleRequestEditChest?

I dunno. xD Also didn workt.

@Justn:

> Great job! Everything is working great so far, no currency issues or anything. Thanks a lot and it was **very simple to add **EDIT: I tested everything I could test and I have no issues at all. /editchest works and i even added a button on the admin panel.. Im a retard and I got thisadded in 5 mins maybe a difficulty of 2/5
>
> Hmm… Ill check what's wrong there in my code... xD
> Maybe smtn with Constants or Enum...****
Link to comment
Share on other sites

Cleaned out the topic a little, could be very confusing to people that never added any of this before yet, especially considering I updated the OP with every fix. ;]

And Domino, do you have any existing modifications installed?
Link to comment
Share on other sites

Just try it again bro I have a heavily modified source and this really didn't affect any other mods I have had done. Not sure if this makes a difference but i deleted my old accounts after adding this I tend to do that when I get some new feature added =)

@Yami you said you updated the OP does that mean you changed something in the code or just changed the tutorial part?
Link to comment
Share on other sites

Well, the accounts needing to be deleted are a given, considering you're messing with PlayerRec ;] But I'll add this to the post.

Anyhow, I updated the OP with all the small tidbits and fixes as we were discussing them. If you just installed it, you have them all aside from the CleanGameData mod.
Link to comment
Share on other sites

@Yami:

> Cleaned out the topic a little, could be very confusing to people that never added any of this before yet, especially considering I updated the OP with every fix. ;]
>
> And Domino, do you have any existing modifications installed?

I have a bit moded project but I uninstalled other eo chest source and didnt check if I did it all right, maybe I didn do all and afther that when added your edit there was a mistake from last chest system.. Tomorrow ill redo this all. :)
Link to comment
Share on other sites

The old one isn't designed by me, I merely fixed it in that topic.. This one is completely separate aside from the fact it uses some parts on the map editor from Kibblez, the rest is written from scratch. I wouldn't recommend pasting over it, it may cause some issues.
Link to comment
Share on other sites

Warning - while you were typing a new reply has been posted. You may wish to review your post.

Is that just an edited photo to show you got ur items or does your eo edit display items being picked up like that all the time? :P
Link to comment
Share on other sites

Partially, the item icons are real. The text I added isn't, still writing the procedure for it. ;] I want it to respond appropriately, e.g.:

Picked up 500 Gold!
Picked up 40 Gold!
Picked up a Health Potion!

And of course, make them disappear if they're displayed for a longer amount of time. Which is smoother in D3D8, but I'll settle for them poofing off of the screen with this. I thought this up while working on the chest system, I mean a bit of silly chat text is actually kind of sad when you pick items up, isn't it?

I'll finish it whenever though, maybe tomorrow.. maybe the day after, who knows?
Link to comment
Share on other sites

Oh! Fairly important, I forgot to add the following piece of code in the client, modGameEditors:

Search for 'frmEditor_Map.fraShop.Visible = False' in ClearAttributeDialogue()and add the following below:
```
frmEditor_Map.fraChest.Visible = False
```
All your other attributes will bug up with the chest addition blocking them if you don't add this! Updated the OP with this fix as well.
Link to comment
Share on other sites

Thanks, everything works great, I had a mistake when I added you'r code. ^^
Also suggestion make random how mutch items will give not who from all 5.. ;)
Like you have 1 of 5 item to give, but make like 1-5 of 5 to randomly give items.
example: you have items a,b,c,d,e make and on random he will give you only b,c,d, or a or d,c. item togeather..
Link to comment
Share on other sites

  • 2 months later...
Put the chest attribute around the chest, and not on the chest.

What I did was restrict opening chests to the front of it, and caused it to play an animation of my choice 1 tile above the chest attribute. To which I made an animation of 1 frame, an open chest. Gave it a bit of frame time, and bam.

But like I said, you don't have to change anything to put the attribute NOT on a chest. It's not like it recognizes the tile image as a chest.
Link to comment
Share on other sites

  • 4 weeks later...
  • 7 months later...

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...