Raising a whole map itself..
#1

Does anyone know how to raise the a whole custom map itself, like if I wanted to raise like 5 z coords up, but not doing it the hard way...
Reply
#2

I expect your create all objects in a row, after each other
Than you just loop from the first till the last object and raise it

Example code
pawn Код:
new
    Float: X,
    Float: Y,
    Float: Z
;
while(first != last) {
    GetObjectPos(first, X, Y, Z);
    SetObjectPos(first, X, Y, Z + 5.0);

    first++;
}
Reply
#3

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
I expect your create all objects in a row, after each other
Than you just loop from the first till the last object and raise it

Example code
pawn Код:
new
    Float: X,
    Float: Y,
    Float: Z
;
while(first != last) {
    GetObjectPos(first, X, Y, Z);
    SetObjectPos(first, X, Y, Z + 5.0);

    first++;
}

Well not to sound lazy, but there are 12k objects, and I want to raise the whole map instead of doing it piece by piece.
Reply
#4

Do you want to raise the map constantly or just step by step while the game is running?

Also the code is fully enough, you loop from the first or your 12k objects till the last one and the code raises every object y 5.0
Reply
#5

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Do you want to raise the map constantly or just step by step while the game is running?

Also the code is fully enough, you loop from the first or your 12k objects till the last one and the code raises every object y 5.0
So your saying the code will rise every object of mine? And I just want to raise the map this time only once, and ingame could help I guess.
Reply
#6

I really don't think that you can do it.

And i don't think you can modify any object that you didn't create, you can only delete them using JernJel's map editor.
Reply
#7

Put them all in a file, read the file, read all Z values, increase the Z values by x amount, write it back to the file, , profit
Reply
#8

Quote:
Originally Posted by slayer101
Посмотреть сообщение
So your saying the code will rise every object of mine? And I just want to raise the map this time only once, and ingame could help I guess.
Its an example code, you only need to specify the first and the last object

Quote:
Originally Posted by [Lexi]
Посмотреть сообщение
I really don't think that you can do it.

And i don't think you can modify any object that you didn't create, you can only delete them using JernJel's map editor.
He said

Quote:
Originally Posted by slayer101
Посмотреть сообщение
a whole custom map
But at the moment I am not sure if he meant a custom map, also created with CreateObject, or San Andreas

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
Put them all in a file, read the file, read all Z values, increase the Z values by x amount, write it back to the file, , profit
Also fine but I dont think there is a problem if you put an loop in OnGameModeInit
Reply
#9

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Its an example code, you only need to specify the first and the last object



He said



But at the moment I am not sure if he meant a custom map, also created with CreateObject, or San Andreas



Also fine but I dont think there is a problem if you put an loop in OnGameModeInit
If you want to redo the whole thing everytime you start the server... Else it is easier to do it just once and then never use it again which will save you some cpu
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)