Thread: [#181] RS Mod - Let's Do This Together

Page 13 of 13 FirstFirst ... 3111213
Results 121 to 128 of 128
  1. #121  
    Registered Member
    Lysergist's Avatar
    Join Date
    Jul 2012
    Posts
    914
    Thanks given
    370
    Thanks received
    536
    Discord
    View profile
    Rep Power
    138
    180 Update Friend List Snippet. I can't submit a PR to the repo.

    Code:
    - message: gg.rsmod.game.message.impl.LoadFriendListMessage
        type: VARIABLE_SHORT
        opcode: 58
        structure:
          - name: online
            type: BYTE
          - name: username
            type: BYTES
          - name: previousUsername
            type: BYTES
          - name: world
            type: SHORT
    Code:
    package gg.rsmod.game.message.encoder;
    
    import gg.rsmod.game.message.MessageEncoder
    import gg.rsmod.game.message.impl.LoadFriendListMessage
    
    class LoadFriendListEncoder : MessageEncoder<LoadFriendListMessage>() {
        override fun extract(message: LoadFriendListMessage, key: String): Number = when (key) {
            "online" -> message.online
            "world" -> message.world
            else -> throw Exception("Unhandled value key.")
        }
    
        override fun extractBytes(message: LoadFriendListMessage, key: String): ByteArray = when(key) {
            "username" -> {
                if (message.username != null) {
                    val data = ByteArray(message.username.length + 1)
                    System.arraycopy(message.username.toByteArray(), 0, data, 0, data.size - 1)
                    data[data.size - 1] = 0
                    data
                } else {
                    ByteArray(0)
                }
            }
            "previousUsername" -> {
                if (message.previousUsername != null) {
                    val data = ByteArray(message.previousUsername.length + 1)
                    System.arraycopy(message.previousUsername.toByteArray(), 0, data, 0, data.size - 1)
                    data[data.size - 1] = 0
                    data
                } else {
                    ByteArray(0)
                }
            }
            else -> throw Exception("Unhandled value key.")
        }
    
    }
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #122  
    Registered Member
    Join Date
    Mar 2012
    Posts
    35
    Thanks given
    0
    Thanks received
    3
    Rep Power
    13
    Quote Originally Posted by Arravs View Post
    180 Update Friend List Snippet. I can't submit a PR to the repo.

    Code:
    - message: gg.rsmod.game.message.impl.LoadFriendListMessage
        type: VARIABLE_SHORT
        opcode: 58
        structure:
          - name: online
            type: BYTE
          - name: username
            type: BYTES
          - name: previousUsername
            type: BYTES
          - name: world
            type: SHORT
    Code:
    package gg.rsmod.game.message.encoder;
    
    import gg.rsmod.game.message.MessageEncoder
    import gg.rsmod.game.message.impl.LoadFriendListMessage
    
    class LoadFriendListEncoder : MessageEncoder<LoadFriendListMessage>() {
        override fun extract(message: LoadFriendListMessage, key: String): Number = when (key) {
            "online" -> message.online
            "world" -> message.world
            else -> throw Exception("Unhandled value key.")
        }
    
        override fun extractBytes(message: LoadFriendListMessage, key: String): ByteArray = when(key) {
            "username" -> {
                if (message.username != null) {
                    val data = ByteArray(message.username.length + 1)
                    System.arraycopy(message.username.toByteArray(), 0, data, 0, data.size - 1)
                    data[data.size - 1] = 0
                    data
                } else {
                    ByteArray(0)
                }
            }
            "previousUsername" -> {
                if (message.previousUsername != null) {
                    val data = ByteArray(message.previousUsername.length + 1)
                    System.arraycopy(message.previousUsername.toByteArray(), 0, data, 0, data.size - 1)
                    data[data.size - 1] = 0
                    data
                } else {
                    ByteArray(0)
                }
            }
            else -> throw Exception("Unhandled value key.")
        }
    
    }
    were you going to post the actual "LoadFriendListMessage" class or is that for us to figure out?
    Sorry im all new to this Kotlin stuff
    Reply With Quote  
     

  3. #123  
    Registered Member
    Cadillac's Avatar
    Join Date
    Jul 2014
    Age
    6
    Posts
    334
    Thanks given
    0
    Thanks received
    228
    Rep Power
    951
    Very cool project.
    back at it.
    Reply With Quote  
     

  4. #124  
    Donator

    Join Date
    Sep 2019
    Posts
    62
    Thanks given
    48
    Thanks received
    15
    Rep Power
    0
    Very cool project! Keep it up!
    Reply With Quote  
     

  5. #125  
    Registered Member
    Join Date
    Jul 2016
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Amazing contribution, its a shame progress has stopped.
    Reply With Quote  
     

  6. #126  
    Registered Member
    Gallus's Avatar
    Join Date
    Oct 2013
    Age
    28
    Posts
    316
    Thanks given
    14
    Thanks received
    27
    Discord
    View profile
    Rep Power
    91
    I launch the server and get this error.

    Code:
    Caused by: java.lang.IllegalStateException: Option "pickpocket" not found for npc 5298 [options=[]]
    I looked in the class that cause the error, and there is no 5298 id anywhere. Not sure what is causing that.

    I just moved the thieving plugin out of the source and it loads fine.


    Any help is appreciated!
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #127  
    Community Veteran

    Jake_'s Avatar
    Join Date
    Apr 2007
    Age
    28
    Posts
    2,048
    Thanks given
    18
    Thanks received
    80
    Discord
    View profile
    Rep Power
    253
    Quote Originally Posted by Gallus View Post
    I launch the server and get this error.

    Code:
    Caused by: java.lang.IllegalStateException: Option "pickpocket" not found for npc 5298 [options=[]]
    I looked in the class that cause the error, and there is no 5298 id anywhere. Not sure what is causing that.

    I just moved the thieving plugin out of the source and it loads fine.


    Any help is appreciated!
    NPC ids were moved around in some recent revision and the RSMod `on_npc_option` event will throw errors when an npc you've referenced doesn't have the context menu option you've asked to bind.

    The error is telling you that npc id 5298 doesn't have a "pickpocket" context menu option and so binding the pickpocket action to this npc isn't possible. Most likely that npc has a different id now, you need to find it and change the config.

    See here:
    1. The npc 5298 reference `Npcs.YSGAWYN`: [Only registered and activated users can see links. ]
    2. Proof of the npc id: [Only registered and activated users can see links. ]
    3. Where the pickpocket option is being bound to the npc: [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #128  
    Registered Member
    Gallus's Avatar
    Join Date
    Oct 2013
    Age
    28
    Posts
    316
    Thanks given
    14
    Thanks received
    27
    Discord
    View profile
    Rep Power
    91
    Does anyone know which component and setting to use for the quest tab?

    I currently have been playing with this code and have yet to be successful.
    Does anyone know what component and setting to use for the quest tab? I'm trying to add interface events to it so I can properly set it up and I'm not having any luck.

    This is my code so far.

    player.setInterfaceEvents(interfaceId = 399, component = 1, range = 0 until 600, setting = 6)
    I am also curious how I can set up proper animations for npcs. Where is that handled? Or how would I go about handling it.

    I already tried messing with the Npc Combat plugin but not sure if that's the right place.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 13 of 13 FirstFirst ... 3111213

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Would you let your girl do this?
    By Rukin1 in forum Videos
    Replies: 3
    Last Post: 02-20-2012, 04:20 AM
  2. Why/How does RS do this?
    By relex lawl in forum Help
    Replies: 3
    Last Post: 01-19-2012, 06:32 PM
  3. Replies: 1
    Last Post: 01-06-2012, 05:08 PM
  4. Replies: 12
    Last Post: 12-26-2009, 11:28 AM
  5. how can i do this?
    By Joe in forum General
    Replies: 2
    Last Post: 12-30-2007, 02:11 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •