YimMenuV2 icon indicating copy to clipboard operation
YimMenuV2 copied to clipboard

[Request]: Add a paste code to the outfit section

Open ApoRaven opened this issue 6 months ago • 11 comments

Problem

the modify outfit or clothes or whatever it says could be improved. I found a website (https://www.bbfas.com/cc/suit/m/) in this website you can find outfit codes to place to your mod menu but yimmenu v2 doesn't have that

Solution

please add this feature

Reason

it would help a lot to making outfits

Additional context

No response

ApoRaven avatar Jun 08 '25 14:06 ApoRaven

You mean an export / import from a clipboard or json file right ?

L7NEG avatar Jun 08 '25 15:06 L7NEG

You mean an export / import from a clipboard or json file right ?

As i read it : import/export code.

But this can clearly be done with both code and json.

alzhetv avatar Jun 08 '25 17:06 alzhetv

You mean an export / import from a clipboard or json file right ?

I'm not sure, here's a code for example from the website: SXRlbQpESQpwQ0kwCi0xCnBDSTEKMTEwCnBDSTIKLTEKcENJMwoxMTAKcENJNAo4NwpwQ0k1CjgyCnBDSTYKOTMKcENJNwoxMjgKcENJOAoyMDQKcENJOQo1NgpwQ0kxMAoyNDgKcENJMTEKMjA3Ci9ESQpEVApwQ1QwCi0xCnBDVDEKMjQKcENUMgotMQpwQ1QzCjEwCnBDVDQKMjIKcENUNQo2CnBDVDYKMwpwQ1Q3CjAKcENUOAozCnBDVDkKMwpwQ1QxMAoyCnBDVDExCjIyCi9EVApQaQpwUGkwCjEyMQpwUGkxCjQ1CnBQaTIKLTEKcFBpMwotMQpwUGk0Ci0xCnBQaTUKLTEKcFBpNgotMQpwUGk3Ci0xCi9QaQpQdApwUHQwCjAKcFB0MQoxOApwUHQyCi0xCnBQdDMKLTEKcFB0NAotMQpwUHQ1Ci0xCnBQdDYKLTEKcFB0NwotMQovUHQKL0l0ZW0K you can also check out the site yourself

ApoRaven avatar Jun 08 '25 18:06 ApoRaven

I need to know how the format works if you want me to implement it

Item
DI
pCI0
0
pCI1
0
pCI2
77
pCI3
14
pCI4
130
pCI5
0
pCI6
27
pCI7
84
pCI8
129
pCI9
0
pCI10
0
pCI11
76
/DI
DT
pCT0
0
pCT1
0
pCT2
0
pCT3
0
pCT4
5
pCT5
0
pCT6
0
pCT7
1
pCT8
0
pCT9
0
pCT10
0
pCT11
4
/DT
Pi
pPi0
89
pPi1
8
pPi2
5
pPi3
-1
pPi4
-1
pPi5
-1
pPi6
-1
pPi7
-1
/Pi
Pt
pPt0
0
pPt1
0
pPt2
0
pPt3
-1
pPt4
-1
pPt5
-1
pPt6
-1
pPt7
-1
/Pt
/Item

maybegreat48 avatar Jun 08 '25 22:06 maybegreat48

It appears that this syntax is more or less as follows:

Each "block" is represented in a similar way to XML (with an opening tag (e.g. DI) and a closing tag (e.g. /DI)).

The blocks would look something like this:

  • Item: Represents the whole outfit
  • DI: Drawable indexes?
  • DT: Drawable textures?
  • Pi: Prop indexes?
  • Pt: Prop textures?

While items starting with p would mean something similar to this:

  • pCIx: Component Index X
  • pCTx: Component Texture X
  • pPix: Prop index X
  • pPtx: Prop Texture X

So the example you sent should be equal to something like this:

SetPedComponentVariation(ped, 0, 0, 0, 0);
SetPedComponentVariation(ped, 1, 0, 0, 0);
SetPedComponentVariation(ped, 2, 77, 0, 0);
SetPedComponentVariation(ped, 3, 14, 0, 0);
SetPedComponentVariation(ped, 4, 130, 5, 0);
SetPedComponentVariation(ped, 5, 0, 0, 0);
SetPedComponentVariation(ped, 6, 27, 0, 0);
SetPedComponentVariation(ped, 7, 84, 1, 0);
SetPedComponentVariation(ped, 8, 129, 0, 0);
SetPedComponentVariation(ped, 9, 0, 0, 0);
SetPedComponentVariation(ped, 10, 0, 0, 0);
SetPedComponentVariation(ped, 11, 76, 4, 0);

SetPedPropIndex(ped, 0, 89, 0, true, 0);
SetPedPropIndex(ped, 1, 8, 0, true, 0);
SetPedPropIndex(ped, 2, 5, 0, true, 0);
SetPedPropIndex(ped, 3, -1, -1, true, 0);
SetPedPropIndex(ped, 4, -1, -1, true, 0);
SetPedPropIndex(ped, 5, -1, -1, true, 0);
SetPedPropIndex(ped, 6, -1, -1, true, 0);
SetPedPropIndex(ped, 7, -1, -1, true, 0);

snowyyd avatar Jun 08 '25 23:06 snowyyd

It appears that this syntax is more or less as follows:...

That's what I thought too. I have no idea who could come up with such a format when you can just use... idk, JSON?

maybegreat48 avatar Jun 09 '25 03:06 maybegreat48

That's what I thought too. I have no idea who could come up with such a format when you can just use... idk, JSON?

Yeah, it really doesn't make much sense. JSON would be more appropriate, but apparently the tools mentioned on the web page do not use JSON.

The syntax itself is absurd, because the whole idea of the "blocks" makes no sense, since each type of element has a unique tag "pXY" (where X can be CI for component's drawableId, CT for component's textureId, etc.) and can be easily parsed with regex.

snowyyd avatar Jun 09 '25 04:06 snowyyd

The syntax itself is absurd, because the whole idea of the "blocks" makes no sense, since each type of element has a unique tag "pXY" (where X can be CI for component's drawableId, CT for component's textureId, etc.) and can be easily parsed with regex.

Yep (though I admit regex is probably a bad idea for low-level C++ projects, particularly ones that wish to stay lightweight.) You can just iterate through the lines and compare the first three characters to see which op you have to perform

maybegreat48 avatar Jun 09 '25 04:06 maybegreat48

Yep (though I admit regex is probably a bad idea for low-level C++ projects, particularly ones that wish to stay lightweight.) You can just iterate through the lines and compare the first three characters to see which op you have to perform

Indeed. I mentioned RegEx since it is what I used to make a simple parser in TypeScript.

static parse(b64Data: string)
{
    const lines = Buffer.from(b64Data, 'base64').toString().trim().split('\n')
        .map((line) => line.trim());
    const components = new Map<number, IComponent>();
    const props = new Map<number, IComponent>();

    const setValue = (
        map: Map<number, IComponent>,
        id: number,
        part: 'drawableId' | 'textureId',
        value: number,
    ) =>
    {
        const current = map.get(id) ?? { drawableId: undefined, textureId: undefined };
        current[part] = value;
        map.set(id, current);
    };

    for (let i = 0; i < lines.length - 1; i += 2)
    {
        const key = lines[i];
        const value = Number(lines[i + 1]);
        const match = key?.match(/^p(?<type>CI|CT|Pi|Pt)(?<id>\d+)$/)?.groups;

        if (!match) continue;

        const id = Number(match.id);
        switch (match.type)
        {
            case 'CI': setValue(components, id, 'drawableId', value); break;
            case 'CT': setValue(components, id, 'textureId', value); break;
            case 'Pi': setValue(props, id, 'drawableId', value); break;
            case 'Pt': setValue(props, id, 'textureId', value); break;
            default: break;
        }
    }

    return { components, props };
}

snowyyd avatar Jun 09 '25 04:06 snowyyd

The well known outfit codes generally come from BincoHax.

StheCat avatar Jun 09 '25 04:06 StheCat

revive this thread

ApoRaven avatar Jun 10 '25 10:06 ApoRaven