How to define multiple Objects at once
#1

Hey guys... I am basically new to scripting(I have no intentions of learning pwn), so I am basically a mapper, But when you come to 'SetObjectMaterial' you need to script that, so I was wondering if we can define multiple objects at once for example:

new object;

object = CreateObject(7497, 1066.41406, 2110.75781, 14.41406, 356.85840, 0.00000, 3.14159);
CreateObject(7497, 1066.41406, 2110.75781, 14.41406, 356.85840, 0.00000, 3.14159);
CreateObject(7497, 1066.41406, 2110.75781, 14.41406, 356.85840, 0.00000, 3.14159);
CreateObject(7497, 1066.41406, 2110.75781, 14.41406, 356.85840, 0.00000, 3.14159);
CreateObject(7497, 1066.41406, 2110.75781, 14.41406, 356.85840, 0.00000, 3.14159);
CreateObject(7497, 1066.41406, 2110.75781, 14.41406, 356.85840, 0.00000, 3.14159);
CreateObject(7497, 1066.41406, 2110.75781, 14.41406, 356.85840, 0.00000, 3.14159);
CreateObject(7497, 1066.41406, 2110.75781, 14.41406, 356.85840, 0.00000, 3.14159);

so when I change their texture I would simple do

SetObjectMaterial(object, 0, 18202, "w_towncs_t", "hatwall256hi", 0xFFFFFFFF);

it will change the texture of all the defined Objects.

Please if I didn't do it right(the define part) please correct me, It would really help me and yeah, There is a 1 rep in helping me <3
Reply
#2

pawn Код:
for(new i = object; i < last_created_object+1; i++)
    if(GetObjectModel(i) == 7497) // if model is 7497
        SetObjectMaterial(i, 0, 18202, "w_towncs_t", "hatwall256hi", 0xFFFFFFFF);
Reply
#3

Can you do the same with the objects I defined on the main post? Please, Cause what you did, I didn't understand shit(No offence, I liked it)
Reply
#4

Wait, I think I got it! Just explain me how it works so I could so the same with my other map objects.
Reply
#5

Its scanning all created objects and checking which modelid is 7497, if model match we change his material
Reply
#6

Alright, Thanks, Luv ya <3

Rep Given.
Reply
#7

I'm getting an error

Код:
D:\Server\gamemodes\gamemode.pwn(96) : error 017: undefined symbol "last_created_object"
D:\Server\gamemodes\gamemode.pwn(100) : error 017: undefined symbol "last_created_object"
D:\Server\gamemodes\gamemode.pwn(100) : error 017: undefined symbol "i"
Reply
#8

Dude, Update your sscanf and streamer plugins + includes, that'll fix your problem of errors
Reply
#9

Why don't you just import your maps into a newer in game editor that supports texturing? It will make the process a quicker.
Reply
#10

@Voltmeter, As I said above, I just need the Gamemode temporary, I just give it to someone or just keep it for Upload. so I don't wanna go in the deep scripting stuff, Not now...

@Pottus, I did that, and I'm doing that too, lal I use you're Texture studio but the problem is that I already made the map, I don't know how to import it to your in-game Texture studio, Again as I said I'm am really new to scripting.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)