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

[EO] Alatar's Signs


Justn
 Share

Recommended Posts

Some people have asked about adding signs or notices to their games. This is one way of doing it and this might not be for everyone but hopefully it will help a few people out…
The one downside to this tutorial is I believe you will have to delete your maps. As the title says all credits go to Alatar as all I have done was take it from his House Editor and make it usable on the map editor.

**Server**

**modConstants**
Find the ' Tile consants and under TILE_TYPE_SLIDE (or whatever your last tile type is)
Add:
```
Public Const TILE_TYPE_SIGN As Byte = 15
```(or your next number)
(note: your will need to do the same for client side)

**modTypes**
In Private Type TileRec under "DirBlock As Byte" Add:
```
Data4 As String
```(note: you will have to do the same on client side)

**modHandleData**
Find this line of code in HandleMapData:
```
Map(mapnum).Tile(x, y).DirBlock = Buffer.ReadByte
```Under it add this line:
```
Map(mapnum).Tile(x, y).Data4 = Buffer.ReadString 'Sign Editor
```
**modServerTCP**
Find this line in Public Sub MapCache_Create:
```
Buffer.WriteByte .DirBlock
```Under it Add:
```
Buffer.WriteString .Data4 'Sign Editor
```
**modPlayer**
Find in Sub PlayerMove:
```
' Slide
        If .Type = TILE_TYPE_SLIDE Then
            ForcePlayerMove index, MOVING_WALKING, GetPlayerDir(index)
            Moved = YES
        End If
```(Or whatever your next tile type is just make sure its above "End With")
Under it add:
```
If .Type = TILE_TYPE_SIGN Then
            PlayerMsg index, "[Sign Reads]: " & .Data4, Yellow
        End If
```(note: Of course you can change the [Sign Reads]: to whatever you want)

**Client**

**modConstants**
Add this to the bottom of your ' Tile Constants
```
Public Const TILE_TYPE_SIGN As Byte = 15
```(or your next tile type number)

**modTypes**
In Private Type TileRec under "DirBlock As Byte" Add:
```
Data4 As String
```
**modHandleData**
In Sub HandleMapData find this line:
```
Map.Tile(x, Y).DirBlock = Buffer.ReadByte
```Under it add:
```
Map.Tile(x, Y).Data4 = Buffer.ReadString 'Sign Editor
```
**modClientTCP**
In Public Sub SendMap() find:
```
Buffer.WriteByte .DirBlock
```Under it Add:
```
Buffer.WriteString .Data4
```
**modText**
In Public Function BltMapAttributes() under:
```
Case TILE_TYPE_SLIDE
                                DrawText TexthDC, tX, tY, "S", QBColor(BrightCyan)
```(note: or under your next tile type)
Under it Add:
```
Case TILE_TYPE_SIGN
                                DrawText TexthDC, tX, tY, "SN", QBColor(BrightRed)
```(note: Of course you can change the SN or Brightred to whatever suites your needs)

**modGameEditors**
In Public Sub MapEditorMouseDown find:
```
' slide
                If frmEditor_Map.optSlide.Value Then
                    .Type = TILE_TYPE_SLIDE
                    .Data1 = MapEditorSlideDir
                    .Data2 = 0
                    .Data3 = 0
                End If
```Under it (or your under your last tile type) Add:
```
' Sign
                If frmEditor_Map.optSign2.Value Then
                .Type = TILE_TYPE_SIGN
                .Data1 = 0
                .Data2 = 0
                .Data3 = 0
                .Data4 = CStr(HouseSign)
                End If
```
**modGlobals**
Add this to the bottom of the mod:
```
Public HouseSign As String
```
Form Work
Open your frmEditor_Map
Add a new option button(see picture if you don't understand >.>) and name it optSigns2

>! [![](http://www.freemmorpgmaker.com/files/imagehost/pics/880bd1fd04b6de05ac0d5805610225eb.bmp)](http://www.freemmorpgmaker.com/files/imagehost/#880bd1fd04b6de05ac0d5805610225eb.bmp)
Double click it and add this in Private Sub optSign2_Click():
```
' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    ClearAttributeDialogue
    picAttributes.Visible = True
    fraHSign.Visible = True

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "optSign2_Click", "frmEditor_Map", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
```

Then still on your map editor to the right side in the picAttributes make a new frame (see picture below) and add a label, a text box, and a command button.
[![](http://www.freemmorpgmaker.com/files/imagehost/pics/7c65fc2b093b322cc1fb53c00c8b9c01.bmp)](http://www.freemmorpgmaker.com/files/imagehost/#7c65fc2b093b322cc1fb53c00c8b9c01.bmp)
Name the frame : **fraHSign**
Name the text box: **txtSign**
Name the command button : **CmbSigns11**
Be sure to set the frame visible to false (find visible in the properties menu of the frame)

Double click the command button CmbSigns11 and add this code:
```
If fraHSign.Visible = True Then
    HouseSign = CStr(Trim$(txtSign.text))
    picAttributes.Visible = False
    fraHSign.Visible = False
End If
```
That should be it.. When a person walks across a sign attribute it will display the text that you put in.
As I have stated above you will have to delete your map .dat files out of the map folders "data/maps/" I do not see another way around this with this method for signs.
Link to comment
Share on other sites

@Ryoku:

> >.< it is possible to make a version and NOT delete all maps XD

You're adding a new tile type, because the current ones only support long (or is it integer? Can't remember off the top of my head) variables. Try making signs based on that.

Although, the old versions of MS and EE had String1 As String, String2 As String, and so on, so I'm intrigued as to why Robin left it out…was probably left out for a reason.
Link to comment
Share on other sites

=P To avoid deleting all maps, give signs there own rec, mini editor, and save files.

please refer to doors to see how to make these.

this is the way around trashing all maps. Because you just store the number of the sign instead of the string.

Its a little more work, but it's better than deleting all maps if you already have some or all made
Link to comment
Share on other sites

@Ryoku:

> =P To avoid deleting all maps, give signs there own rec, mini editor, and save files.

Why the hell would you make a seperate editor? I'd just make a scripted tile, and just make a new index for each sign, and have it display the message once needed.

@Ryoku:

> please refer to doors to see how to make these.

**_OH MY GOD, WILL YOU PLEASE STOP BANGING ON ABOUT YOUR DOORS/FIXES BEING THE OMNIPOTENT SOLUTION TO EVERYTHING?_**

It seems that everywhere I go, you go on about doors, trade fix, and so on, please, it's irritating. Nobody cares.
Link to comment
Share on other sites

well sorry for trying to come up with a better solution for signs the delete all maps.

and no you wouldn't need an entire editor, you could easily send and save the sign data right from the map editor.

and all I was saying about my doors was that there is all the data for making a new file type and saving data. Its the first one that came to mind.

other things that come to mind for the same purpose: the quest editor, oh wait that one has all the stuff pre-made; ok then the convo editor, wait that has a diffrent way of saving
Link to comment
Share on other sites

There is a much better way of having signs in your game with no source editing or having to delete any maps.

  Just make a friendly NPC say whatever you want your sign to say. Then make a new character sprite that is just a picture of a sign and place your NPC inside of some NPC blocks.

  Works fantastic for me and looks great as well.
Link to comment
Share on other sites

@Surma:

> There is a much better way of having signs in your game with no source editing or having to delete any maps.
>
>   Just make a friendly NPC say whatever you want your sign to say. Then make a new character sprite that is just a picture of a sign and place your NPC inside of some NPC blocks.
>
>   Works fantastic for me and looks great as well.

Umm yea for my game anyway this is not possible due to the fact that I have need for alot of signs and notices and why would I waste 100 npcs .dat files just for a stupid sign and why would I want to limit the amount of npcs on a map just because i wanted to place 5-6 signs… I personally think that is a half ass way of doing it. I will try to look for a way to make a new method like some people have talked about above.. Unless Erwin makes a convertor as I have no idea how to make one... Also I stated in the OP this method might not be for everyone just as yours is not for me.
Link to comment
Share on other sites

1\. New tile type.
2\. Store sign number in tile data for the new tile type.
3\. Cache sign data server-side.
4\. Whenever a person "talks" to a sign send the cached string to the client, which has been accessed using the sign number.

Come on, it isn't that difficult.
Link to comment
Share on other sites

@Lightning:

> 1\. New tile type.
> 2\. Store sign number in tile data for the new tile type.
> 3\. Cache sign data server-side.
> 4\. Whenever a person "talks" to a sign send the cached string to the client, which has been accessed using the sign number.
>
> Come on, it isn't that difficult.

Yep. I've done this long ago and I realise that there are better ways to do it right now. (The entire house editor thingy needs a re-build xD)
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...