[FilterScript] Universal Object Editor (attach roads, generate loops)
#21

Really easy to use Here's a little map that I created in less than two days with this editor.

[ame]http://www.youtube.com/watch?v=k0aWLtH8wTc[/ame]
Reply
#22

Perfect +rep.
Reply
#23

Very good for events and such
Reply
#24

Really great!
Reply
#25

Can this be used live on a server, so you can add/edit/remove objects in real-time? and do they save upon server restart?
Reply
#26

Quote:
Originally Posted by Luke_James
Посмотреть сообщение
Can this be used live on a server, so you can add/edit/remove objects in real-time? and do they save upon server restart?
Yeah, you can use it on a live server, but that's not really what it's designed for. Objects don't save on server restart and they are destroyed after their creator leaves the server.
Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
I really wish I could use this, but the object clicking feature just doesn't work on my PC D:

Has anyone else come across this problem?
I've come across this bug, but I didn't really look for a solution because the same script worked perfectly fine on my bro's PC. Alternatively, I could use /esel command anyway, so I just let it be. Now that you also have this stupid bug, there must be a common cause! Maybe numpadless keyboard? Anyway, right now I can't look for a bugfix because I don't have GTASA installed, but if you find the solution, let me know.
Reply
#27

Very nice, and very useful for me
Reply
#28

Quote:
Originally Posted by Patrik356b
Посмотреть сообщение
I'd like to see an import function that can take Create(Dynamic)Object lines and turn it into project files.
That's a great suggestion! In fact, I think it would be an essential addition for the editor. I don't know why I didn't think of that before.
Reply
#29

It just kicks me out of world boundaries every time I attempt to use Fly Mode.

6/10
Reply
#30

Cool work +Rep
Reply
#31

great work
Reply
#32

Regarding the road attachs feature, you are using some matrixes to calculate the right road position, like this:

Код:
			
//18791
{0x4265C7AE, 0x41766E98,-0x40F05532, 0x00000000, 0x00000000, 0x41B40000},
{0x42D88625, 0x4211CDD3, 0x00000000, 0x00000000, 0x00000000, 0x41B40000},
{0x42900A3D, 0x41EEA5E3, 0x00000000, 0x00000000, 0x00000000, 0x42340000},
{0x4297DC29, 0x41B878D5, 0x00000000,-0x3E900000, 0x00000000, 0x41B40000},
{0x4297DC29, 0x41B878D5, 0x00000000, 0x41700000, 0x00000000, 0x41B40000},
{0x4265C7AE, 0x41766E98,-0x40F05532, 0x00000000, 0x00000000, 0x41B40000},
{0x4265C28F, 0x41766666,-0x40F05532, 0x00000000, 0x00000000, 0x41B40000},
{0x4265999A, 0x417620C5,-0x4010D845, 0x00000000, 0x40F00000, 0x41B40000},
{0x4233AE14,-0x417D70A4, 0x41B8F1AA, 0x00000000, 0x00000000, 0x41F00000},
{0x42D88625, 0x4211CDD3, 0x00000000, 0x00000000, 0x00000000, 0x41B40000}
I don't understand exactly what you are doing, but I would like to know if you could give me a similar matrix to use the object 18791 as a right turn, just like in this picture (red):



Thanks!
Reply
#33

Hi, those are just offset values converted to hex.

pawn Код:
//18791
//offset_x   offset_y    offset_z    rot_x       rot_y       rot_z
{0x4265C7AE, 0x41766E98,-0x40F05532, 0x00000000, 0x00000000, 0x41B40000}, //offsets for 18788
{0x42D88625, 0x4211CDD3, 0x00000000, 0x00000000, 0x00000000, 0x41B40000}, //offsets for 18789
{0x42900A3D, 0x41EEA5E3, 0x00000000, 0x00000000, 0x00000000, 0x42340000}, //offsets for 18791
{0x4297DC29, 0x41B878D5, 0x00000000,-0x3E900000, 0x00000000, 0x41B40000}, //offsets for 18792
{0x4297DC29, 0x41B878D5, 0x00000000, 0x41700000, 0x00000000, 0x41B40000}, //offsets for 18793
{0x4265C7AE, 0x41766E98,-0x40F05532, 0x00000000, 0x00000000, 0x41B40000}, //offsets for 18794
{0x4265C28F, 0x41766666,-0x40F05532, 0x00000000, 0x00000000, 0x41B40000}, //offsets for 18795
{0x4265999A, 0x417620C5,-0x4010D845, 0x00000000, 0x40F00000, 0x41B40000}, //offsets for 18796
{0x4233AE14,-0x417D70A4, 0x41B8F1AA, 0x00000000, 0x00000000, 0x41F00000}, //offsets for 18801
{0x42D88625, 0x4211CDD3, 0x00000000, 0x00000000, 0x00000000, 0x41B40000}  //offsets for 18803
If you want more readable values, run the "offset" array through the following code and see server_log.

pawn Код:
// convert to float
    printf("static const");
    printf("\toffset[][][] =");
    printf("{");
    for (new i = 0; i < sizeof(offset); ++i)
    {
        printf("\t{");
        for (new x = 0; x < sizeof(offset[]); +x)
        {
            printf("\t\t{%5.06f, %5.06f, %5.06f, %5.06f, %5.06f, %5.06f},", offset[i][x][0], offset[i][x][1], offset[i][x][2], offset[i][x][3], offset[i][x][4], offset[i][x][5]);
        }
        printf("\t},");
    }
    printf("}");
Anyways, for exmaple, to make 18791 turn right when attached to 18788 (straight road), you would need to manipulate 18788's 18791 offset values a bit. Right now I can't tell how exactly they need to be manipulated. Basically, in most cases, changing certain position offsets to the opposite sign (positive to negative and vice versa) will do the trick, but it might not always work. I'm not sure about the Z rotation. You either need to change its sign or add 180 degrees to its current rotation. Example:

Код:
//18788 (ROAD TO LEFT)
{offset_x, offset_y, offset_z, rot_x, rot_y, rot_z}, //offsets for 18788
{offset_x, offset_y, offset_z, rot_x, rot_y, rot_z}, //offsets for 18789
{offset_x, offset_y, offset_z, rot_x, rot_y, rot_z}, //offsets for 18791
Код:
//18788 (ROAD TO RIGHT)
{offset_x, offset_y, offset_z, rot_x, rot_y, rot_z}, //offsets for 18788
{offset_x, offset_y, offset_z, rot_x, rot_y, rot_z}, //offsets for 18789
{offset_x,-offset_y, offset_z, rot_x, rot_y, rot_z + 180.0}, //offsets for 18791
That's just a random guess. You may need to change other offsets aswell.

Make sense?
Reply
#34

Yes, it does! Thanks
Actually, I think with some math it's possible to calculate those values via some "reversed" use of the EDIT_FloatGetPosAndRot function. I mean, if we manually positionate two objects, we can calculate the offsets given their current positions and rotations. But it does not seem easy at all :/
Reply
#35

There's no need to reverse engineer anything. To get the offsets, you need to set object A's position and rotation to 0, and then place object B whereever you want it to be in relation to object A. Object B's position and rotation are the offsets (if that makes any sense).

Anyways, I managed to get some offsets correct, but I didn't calculate all of them.
pawn Код:
static const
        Float:offset[][][] =
    {
        {
            // 18788
            {   39.994998,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000},
            {   94.995002,     0.000000,     0.561200,     0.000000,     0.000000,     0.000000},
            {   58.970001,    -7.752999,     0.561200,     0.000000,     0.000000,   157.500000}, // 18791
            {   59.994998,     0.000000,     0.561200,   -15.000000,     0.000000,     0.000000},
            {   59.994998,     0.000000,     0.561200,    15.000000,     0.000000,     0.000000},
            {   39.994998,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000},
            {   39.994998,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000},
            {   39.930000,     0.000000,    -1.307000,     0.000000,     7.500000,     0.000000},
            {   22.320999,    -9.671600,    23.679500,     0.000000,     0.000000,     7.500000},
            {   94.995002,     0.000000,     0.561200,     0.000000,     0.000000,     0.000000}
        },
        {
            // 18789
            {   94.995002,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {  149.994995,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000},
            {  113.970001,    -7.752999,     0.000000,     0.000000,     0.000000,   157.500000}, // 18791
            {  114.995002,     0.000000,     0.000000,   -15.000000,     0.000000,     0.000000},
            {  114.995002,     0.000000,     0.000000,    15.000000,     0.000000,     0.000000},
            {   94.995002,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {   94.995002,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {   94.934997,     0.000000,    -1.868399,     0.000000,     7.500000,     0.000000},
            {   77.400001,    -9.689000,    23.118999,     0.000000,     0.000000,     7.099999},
            {  149.994995,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000}
        },
        {
            // 18791
            {  -57.444999,    15.402000,    -0.561200,     0.000000,     0.000000,   157.500000},
            { -108.262001,    36.451000,     0.000000,     0.000000,     0.000000,   157.500000},
            // 18791 right from itself (-72.019996,    29.830999,     0.000000,     0.000000,     0.000000,   315.000000)
            // 18791 left from itself  (-77.953445,    15.504273,     0.000000,     0.000000,     0.000000,   180.000000)
            {  -72.019996,    29.830999,     0.000000,     0.000000,     0.000000,   315.000000}, // right from itself
            {  -75.930000,    23.059000,     0.000000,   -15.000000,     0.000000,   157.500000},
            {  -75.930000,    23.059000,     0.000000,    15.000000,     0.000000,   157.500000},
            {  -57.444999,    15.402000,    -0.561200,     0.000000,     0.000000,   157.500000},
            {  -57.439998,    15.399999,    -0.561200,     0.000000,     0.000000,   157.500000},
            {  -57.400001,    15.383000,    -1.868399,     0.000000,     7.500000,   157.500000},
            {  -44.919998,    -0.254999,    23.118000,     0.000000,     0.000000,   165.000000},
            { -108.262001,    36.451000,     0.000000,     0.000000,     0.000000,   157.500000}
        },
        {
            // 18792
            {   59.994998,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {  114.995002,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000},
            {   78.970001,    -7.752999,     0.000000,     0.000000,     0.000000,   157.500000}, // 18791
            {   79.995002,     0.000000,     0.000000,   -15.000000,     0.000000,     0.000000},
            {   79.995002,     0.000000,     0.000000,    15.000000,     0.000000,     0.000000},
            {   59.994998,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {   59.994998,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {   59.935001,     0.000000,    -1.868399,     0.000000,     7.500000,     0.000000},
            {   42.439998,    -9.671999,    23.118999,     0.000000,     0.000000,     7.500000},
            {  114.995002,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000}
        },
        {
            // 18793
            {   59.994998,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {  114.995002,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000},
            {   78.970001,    -7.752999,     0.000000,     0.000000,     0.000000,   157.500000}, // 18791
            {   79.995002,     0.000000,     0.000000,   -15.000000,     0.000000,     0.000000},
            {   79.995002,     0.000000,     0.000000,    15.000000,     0.000000,     0.000000},
            {   59.994998,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {   59.994998,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {   59.935001,     0.000000,    -1.868399,     0.000000,     7.500000,     0.000000},
            {   42.439998,    -9.671999,    23.118999,     0.000000,     0.000000,     7.500000},
            {  114.995002,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000}
        },
        {
            // 18794 (18791 right turn not supported)
            {   39.194999,     0.000000,    10.411000,     0.000000,   -15.000000,     0.000000},
            {   92.180000,     0.000000,    25.188999,     0.000000,   -15.000000,     0.000000},
            {   57.388000,     7.739999,    15.862000,    -5.677000,   -13.899999,    21.785999},
            {   58.387001,    -0.029999,    16.050500,   -14.477000,   -15.383999,    -3.979000},
            {   58.387001,     0.029999,    16.051000,    14.477000,   -15.383999,     3.979000},
            {   39.194999,     0.000000,    10.411000,     0.000000,   -15.000000,     0.000000},
            {   39.194999,     0.000000,    10.411000,     0.000000,   -15.000000,     0.000000},
            {   39.479999,     0.000000,     9.133999,     0.000000,    -7.500000,     0.000000},
            {   16.059999,    -9.673000,    28.732999,    -1.924999,   -15.000000,     7.099999},
            {   92.180000,     0.000000,    25.188999,     0.000000,   -15.000000,     0.000000}
        },
        {
            // 18795 (18791 right turn not supported)
            {   38.861999,   -10.366499,     0.000000,     0.000000,     0.000000,   -15.000000},
            {   91.992599,   -24.603000,     0.561200,     0.000000,     0.000000,   -15.000000},
            {   59.204601,    -7.790400,     0.561200,     0.000000,     0.000000,     7.500000},
            {   58.181999,   -15.543499,     0.561200,   -15.000000,     0.000000,   -15.000000},
            {   58.181999,   -15.543499,     0.561200,    15.000000,     0.000000,   -15.000000},
            {   38.861999,   -10.366499,     0.000000,     0.000000,     0.000000,   -15.000000},
            {   38.865398,   -10.367500,     0.000000,     0.000000,     0.000000,   -15.000000},
            {   38.807998,   -10.352199,    -1.307000,     0.000000,     7.500000,   -15.000000},
            {   19.407199,   -15.166999,    23.680000,     0.000000,     0.000000,    -7.400000},
            {   91.992599,   -24.603000,     0.561200,     0.000000,     0.000000,   -15.000000}
        },
        {
            // 18796 (18791 right turn not supported)
            {   39.759998,     0.000000,    -3.915999,     0.000000,     7.500000,     0.000000},
            {   94.370002,     0.000000,   -10.539999,     0.000000,     7.500000,     0.000000},
            {   58.590999,     7.751999,    -6.248000,     3.098999,     7.500000,    22.291999},
            {   59.646999,     0.017000,    -5.966000,   -14.862999,     7.760000,     2.026999},
            {   59.646999,    -0.017000,    -5.967000,    14.862999,     7.760000,    -2.026999},
            {   39.759998,     0.000000,    -3.915999,     0.000000,     7.500000,     0.000000},
            {   39.759998,     0.000000,    -3.915999,     0.000000,     7.500000,     0.000000},
            {   39.540000,     0.000000,    -5.205500,     0.000000,    15.000000,     0.000000},
            {   25.450000,    -9.684000,    21.850000,     0.934000,     7.500000,     7.099999},
            {   94.370002,     0.000000,   -10.539999,     0.000000,     7.500000,     0.000000}
        },
        {
            // 18801 (18791 right turn not supported)
            {   21.000000,   -12.380000,   -23.680000,     0.000000,     0.000000,    -7.099999},
            {   75.500000,   -19.167999,   -23.118000,     0.000000,     0.000000,    -7.099999},
            {   40.813999,    -7.308000,   -23.118000,     0.000000,     0.000000,    15.000000},
            {   40.813999,   -15.128000,   -23.118000,   -15.010000,     0.000000,    -7.500000},
            {   40.813999,   -15.128999,   -23.117000,    14.989999,     0.000000,    -7.500000},
            {   20.979999,   -12.517999,   -23.680000,     0.000000,     0.000000,    -7.500000},
            {   21.000000,   -12.380000,   -23.680000,     0.000000,     0.000000,    -7.099999},
            {   20.920000,   -12.510000,   -24.985000,    -0.009999,     7.500000,    -7.500000},
            {    2.390000,   -19.812000,     0.000000,     0.000000,     0.000000,     0.000000},
            {   75.500000,   -19.167999,   -23.118000,     0.000000,     0.000000,    -7.099999}
        },
        {
            // 18803 (18791 right turn not supported)
            {   94.995002,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {  149.994995,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000},
            {  113.970001,     7.752999,     0.000000,     0.000000,     0.000000,    22.500000},
            {  114.995002,     0.000000,     0.000000,   -15.000000,     0.000000,     0.000000},
            {  114.995002,     0.000000,     0.000000,    15.000000,     0.000000,     0.000000},
            {   94.995002,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {   94.995002,     0.000000,    -0.561200,     0.000000,     0.000000,     0.000000},
            {   94.934997,     0.000000,    -1.868399,     0.000000,     7.500000,     0.000000},
            {   77.400001,    -9.689000,    23.118999,     0.000000,     0.000000,     7.099999},
            {  149.994995,     0.000000,     0.000000,     0.000000,     0.000000,     0.000000}
        }
    };
With those offsets road 18791 turns to the right. Though only roads 18788, 18789 18791, 18792 and 18793 are supported.
Reply
#36

You are right man, thanks a lot!
I will try it soon.
Reply
#37

NICEEEEE
Reply
#38

Yes, I also tested it and basically is {offset_x,-offset_y, offset_z, rot_x, rot_y, 180.0 - rot_z} :P
Now it's time to create a bunch of matrixes with many objects
Thanks!
Reply
#39

Awesome.
Reply
#40

Quote:
Originally Posted by richardcor91
Посмотреть сообщение
Yes, I also tested it and basically is {offset_x,-offset_y, offset_z, rot_x, rot_y, 180.0 - rot_z} :P
Now it's time to create a bunch of matrixes with many objects
Thanks!
If you wish, you can get the offsets of tube objects (18808...). That's a bit time consuming, but it's just a suggestion.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)