Unidentified Flying OBJECT! (UFO)
#1

Code:
pawn Код:
new Saucer = CreateObject (16778, 0.0, 0.0, 50.0, 0.0, 0.0, 0.0, 0.0),
            Vehh   = CreateVehicle(501,   0.0, 0.0, 50.0, 0.0, 0,   0,   0  );

        SetObjectMaterial(Saucer, 0, 19475, "signsurf", "sign");
        SetObjectMaterial(Saucer, 1, 19475, "signsurf", "sign");
        SetObjectMaterial(Saucer, 2, 19475, "signsurf", "sign");
        SetObjectMaterial(Saucer, 3, 19475, "signsurf", "sign");

        AttachObjectToVehicle(Saucer, Vehh, 0, 0, -5.125, 0, 0, 0);

        LinkVehicleToInterior(Vehh, 500);
Problem:
I wanted to create a UFO that floats a point, and is then drive-able! My plan was to create a "RC Goblin", create the "Lil Probe Inn" sign, set its materials to nothing, then attach it to the RC...

What Happened:
Ok well, I can create the RC and UFO sign, I can also successfully attach the sign to the rc after setting the materials, and I can link the rc to another interior. All is well until the SetObjectMaterials were not working correctly... Instead of setting the indexes i specified, EVERY MATERIAL ON THE OBJECT GETS SET! What is wrong with it...

Here is the materials for the ufo:
Quote:

Material: 0 split: 0 Tex: Metal3_128
Material: 0 split: 0 Alp: Metal3_128
Material: 1 split: 1 Tex: electricbox256
Material: 1 split: 1 Alp: electricbox256
Material: 2 split: 2 Tex: bonyrd_skin1
Material: 2 split: 2 Alp: bonyrd_skin1
Material: 3 split: 3 Tex: des_probesign
Material: 3 split: 3 Alp: des_probesign
Material: 0 split: 0 Tex: banding3_64HV
Material: 0 split: 0 Alp: banding3_64HV
Material: 1 split: 1 Tex: dam_turbine
Material: 1 split: 1 Alp: dam_turbine

I want to remove the 0 1 2 and 3, but when I set any of them, all of them are affected, also why is there two 0s and 1s? The only materials I wanna keep are the last two, 0 and 1...
Reply
#2

BUMP

























Reply
#3

There are probably two 0's and 1's because it is an animated model. It seems there's one list of textures for the static model (in this case the pole) and one list for the moving part of the model (the ufo itself). Other animated models like the big chicken and the Xoomer gas station sign have this same behavior.

If you don't change the texture of slot 0 and 1, the ufo will probably reappear, but so will the pole. I'm not sure if there is any other solution to this. I really like your idea though.

PS: An easier way to make textures invisible is by setting the last three parameters to 0, "none" and "none", this avoids the need to load another model and texture library.
Код:
SetObjectMaterial(modelid, index, 0, "none", "none"); // Makes the texture invisible as well.
Reply
#4

Thanks, you're the ONLY one who even attempted to help! BTW: even if I only set the material of index 2 or 3, the whole thing is gone!
Reply
#5

It might be that animated objects just aren't compatible with SetObjectMaterial. Not sure though, it would need some more research to confirm that.
Reply
#6

I decided to play with SetPlayerAttachedObject, but it wont attach objects to NPCs?
Reply
#7

Can some one help please
Reply
#8

It might not work because of the same reason: it's an animated model, they work differently.
Reply
#9

I don't know why you would even try to use that object in the first place it is really a horrible choice even though it looks the way you want.
Reply
#10

i didnt try to attach that object, it was two other objects... i cant attach any objects to npcs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)