Actions

Configs/LocType

From RuneWiki

Revision as of 11:14, 9 February 2024 by Pazaz (talk | contribs) (→‎186)

RS2

Changes based on decompiling available clients. If a revision is off by a couple, it's because we were missing those clients or they were not auto-decompilable (yet) to narrow the revision down further. I'll refine this again later.

Names are an attempt to be authentic and correct, if you have any more information definitely reach out.

TODO: opcodes up to rev 742

TODO: add history when opcodes change - for example moving to gSmart2or4, or the models array stored as [shape][index] = model. At one point models were loaded differently based on the world type...

TODO: add opcode data structure underneath

Property Opcode History Notes
model 1 Added 186 (2003-12-02)

Changed 581 (2010-01-29)

name 2 Added 186 (2003-12-02)
desc 3 Added 186 (2003-12-02)

Removed 410 (2006-05-25)

Examine text. Later transmitted from the server.
model 5 Added 249 (2004-08-09)

Changed 581 (2010-01-29)

This opcode is used to save bytes in the list of models.
width 14 Added 186 (2003-12-02)
length 15 Added 186 (2003-12-02)
blockwalk=no 17 Added 186 (2003-12-02)
blockrange=no 18 Added 186 (2003-12-02)
active 19 Added 186 (2003-12-02)
hillskew=yes 21 Added 186 (2003-12-02) hillskew mode 1
sharelight=yes 22 Added 186 (2003-12-02)
occlude=yes 23 Added 186 (2003-12-02)
anim 24 Added 186 (2003-12-02)
- 25 Added 186 (2003-12-02)

Removed 249 (2004-08-09)

This opcode was used internally for disposing of alpha data between animation frames.

It was not manually defined and comes from a linked anim.

blockwalk=yes 27 Added 454 (2007-03-26)
wallwidth 28 Added 186 (2003-12-02)
ambient 29 Added 186 (2003-12-02)
contrast 39 Added 186 (2003-12-02)
op 30-35 Added 186 (2003-12-02) Originally this reserved opcodes >= 30 & < 39 (likely copy-pasted).
recol 40 Added 186 (2003-12-02)
retex 41 Added 465 (2007-07-19)
recoldpalette 42 Added 494 (2008-04-15)
mapfunction 60 Added 186 (2003-12-02)
mirror=yes 62 Added 186 (2003-12-02)
shadow=no 64 Added 186 (2003-12-02)
resizex 65 Added 186 (2003-12-02)
resizey 66 Added 186 (2003-12-02)
resizez 67 Added 186 (2003-12-02)
mapscene 68 Added 186 (2003-12-02)

Removed 530 (2009-01-28)

forceapproach 69 Added 186 (2003-12-02) This is a bitmask, one bit will be set - the direction.
offsetx 70 Added 194 (2004-01-07)
offsety 71 Added 194 (2004-01-07)
offsetz 72 Added 194 (2004-01-07)
forcedecor=yes 73 Added 194 (2004-01-07)
breakroutefinding=yes 74 Added 245 (2004-07-13)
raiseobject 75 Added 249 (2004-08-09)
multiloc 77 Added 289 (2005-01-17)
bgsound 78 Added 417 (2006-06-27)
randomsound 79 Added 417 (2006-06-27)
treeskew* 81 Added 465 (2007-07-19) hillskew mode 2
82 Added 487 (2008-02-12) Related to whether it should render?
hardshadow=no* 88 Added 487 (2008-02-12) If this isn't hardshadow, it's something like sceneshadow?
randseq=no* 89 Added 487 (2008-02-12) Disable randomizing the initial seq frame.
90 Added 487 (2008-02-12)
members=yes 91 Added 494 (2008-04-15)
multiloc 92 Added 498 (2008-05-09) multiloc with a default value.
rotateskew* 93 Added 498 (2008-05-09) hillskew mode 3 - Same as previous but reads 2-bytes.
ceilingskew=yes* 94 Added 498 (2008-05-09) hillskew mode 4
skewtofit=yes* 95 Added 498 (2008-05-09) hillskew mode 5
96 Added 501 (2008-07-01) Related to having an animation?
mapscenerotates=yes 97 Added 506 (2008-07-28) Map scene icon rotates with the loc.
98 Added 530 (2009-01-28)
cursor1 99 Added 530 (2009-01-28)
cursor2 100 Added 530 (2009-01-28)
mapsceneangle* 101 Added 530 (2009-01-28) Map scene icon angle offset.
mapscene 102 Added 530 (2009-01-28) Replaces the earlier mapscene.
occlude=no 103 Added 535 (2009-03-16)
bgsoundvol 104 Added 535 (2009-03-16)
mapsceneflipy* 105 Added 535 (2009-03-16) Map scene icon flipped vertically.
anims 106 Added 542 (2009-04-02) Animation weights?
mel 107 Added 548 (2009-05-27) Map element.
memberop* 150-155 Added 548 (2009-05-27) Members-only ops.
quests* 160 Added 555 (2009-09-02)
rotateskew* 162 Added 581 (2010-01-29) Same as previous but reads 4-bytes.
tint 163 Added 581 (2010-01-29) Hue, saturation, luminance, weight values
postoffsetx 164 Added 593 (2010-03-02)
postoffsety 165 Added 593 (2010-03-02)
postoffsetz 166 Added 593 (2010-03-02)
decorheight* 167 Added 595 (2010-03-12)
168 Added 611 (2010-06-08)
169 Added 611 (2010-06-08)
occludewidth 170 Added 618 (2010-09-14)
occludeheight 171 Added 618 (2010-09-14)
bgsoundrate 173 Added 623 (2010-10-11)
177 Added 637 (2011-02-07)
bgsounddistance 178 Added 637 (2011-02-07)
189 667+ (todo)
param 249 Added 500 (2008-06-05) Map of params key -> value.

hillskew Types

enum HillSkewType {
    none = 0,
    floor_skew = 1,
    tree_skew = 2,
    rotate = 3,
    ceiling_skew = 4,
    skew_to_fit = 5
}

shape Names

enum LocShape {
    wall_straight = 0,
    wall_diagonalcorner = 1,
    wall_l = 2,
    wall_squarecorner = 3,
    wall_diagonal = 9,
    walldecor_straight_nooffset = 4,
    walldecor_straight_offset = 5,
    walldecor_diagonal_nooffset = 6,
    walldecor_diagonal_offset = 7,
    walldecor_diagonal_both = 8,
    centrepiece_straight = 10,
    centrepiece_diagonal = 11,
    grounddecor = 22,
    roof_straight = 12,
    roof_diagonal_with_roofedge = 13,
    roof_diagonal = 14,
    roof_l_concave = 15,
    roof_l_convex = 16,
    roof_flat = 17,
    roofedge_straight = 18,
    roofedge_diagonalcorner = 19,
    roofedge_l = 20,
    roofedge_squarecorner = 21,
}

shape Map Editor Hotkeys

// hotkeys in jagex's map editor are used as the extension for loc models so they know which shape to inherit
enum LocShapeHotkey {
    _1 = 0, // 'wall_straight',
    _2 = 1, // 'wall_diagonalcorner',
    _3 = 2, // 'wall_l',
    _4 = 3, // 'wall_squarecorner',
    _5 = 9, // 'wall_diagonal',
    //
    _q = 4, // 'walldecor_straight_nooffset',
    _w = 5, // 'walldecor_straight_offset',
    _e = 6, // 'walldecor_diagonal_nooffset',
    _r = 7, // 'walldecor_diagonal_offset',
    _t = 8, // 'walldecor_diagonal_both',
    //
    _8 = 10, // 'centrepiece_straight',
    _9 = 11, // 'centrepiece_diagonal',
    _0 = 22, // 'grounddecor',
    //
    _a = 12, // 'roof_straight',
    _s = 13, // 'roof_diagonal_with_roofedge',
    _d = 14, // 'roof_diagonal',
    _f = 15, // 'roof_l_concave',
    _g = 16, // 'roof_l_convex',
    _h = 17, // 'roof_flat',
    //
    _z = 18, // 'roofedge_straight',
    _x = 19, // 'roofedge_diagonalcorner',
    _c = 20, // 'roofedge_l',
    _v = 21, // 'roofedge_squarecorner',
}

model Property

This property is used to render a specific model based on the shape. The shape to use comes from the map data and zone protocol.

Config

They only need to define this as a single model=name, the shape is derived by looking for suffixes on file names in their src/models/ directory. The suffixes are not the shape numbers here but rather their map editor's hotkeys!

Example 1: a model example_8.ob3 and they have model=example in their loc config. It sees _8 and then knows to add shape=10.

Example 2: two models, example_8.ob3 and example_0.ob3 and they have model=example in their loc config. It sees both suffixes and knows to add shape=10 and shape=22 with those model IDs.

Example 3: two models, example_8.ob3 and example_0.ob3 again, but this time they have model=example_0 in their loc config. It sees that it's a specific suffix and adds that grounddecor model using shape=10 instead. This is a very particular feature used to override the appearance of the standard centrepiece_straight shape.

186
if (opcode == 1) {
    int count = buf.g1();

    if (count > 0) {
        if (this.models == null || lowmem) {
            this.shapes = new int[count];
            this.models = new int[count];

            for (int i = 0; i < count; i++) {
                this.models[i] = buf.g2();
                this.shapes[i] = buf.g1();
            }
        } else {
            buf.pos += count * 3;
        }
    }
}
249
if (opcode == 5) {
    int count = buf.g1();

    if (count > 0) {
        if (this.models == null || lowmem) {
            this.shapes = null;
            this.models = new int[count];

            for (int i = 0; i < count; i++) {
                this.models[i] = buf.g2();
            }
        } else {
            buf.pos += count * 2;
        }
    }
}
581

Models is now a 2d array so multiple models can be merged when rendering a loc shape.

if (opcode == 1 || opcode == 5) {
    if (opcode == 5 && LocTypeList.lowmem) {
        this.skipModels(buf);
    }

    int shapeCount = buf.g1();
    this.shapes = new byte[shapeCount];
    this.models = new int[shapeCount][];

    for (int i = 0; i < shapeCount; i++) {
        this.shapes[i] = buf.g1();

        int modelCount = buf.g1();
        this.models[i] = new int[modelCount];

        for (int j = 0; j < modelCount; j++) {
            this.models[i][j] = buf.g2();
        }
    }

    if (opcode == 5 && !LocTypeList.lowmem) {
        this.skipModels(buf);
    }
}

void skipModels(Buffer buf) {
    int shapeCount = buf.g1();
    for (int i = 0; i < shapeCount; i++) {
        buf.pos++;

        int modelCount = buf.g1();
        buf.pos += modelCount * 2;
    }
}

RS3

Very little time spent on RS3 (little-to-no tools). Here's some ones that existed in 2016.

Property Opcode History Notes
44
45
179
186
188
196
197
198
199
200
201
250
251
252
253
254
255

OSRS

OSRS is pretty similar, it forked from 468 but they can also backport stuff - here's the known additions

Property Opcode History Notes
category 61 Added 197 (2021-06-16) Originally only server-sided.

External Credits

* Walied for reviewing the list afterwards and advising on some properties