SA-MP Forums Archive
Raising a whole map itself.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Raising a whole map itself.. (/showthread.php?tid=379902)



Raising a whole map itself.. - slayer101 - 23.09.2012

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...


AW: Raising a whole map itself.. - Nero_3D - 23.09.2012

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++;
}



Re: AW: Raising a whole map itself.. - slayer101 - 23.09.2012

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.


AW: Raising a whole map itself.. - Nero_3D - 23.09.2012

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


Re: AW: Raising a whole map itself.. - slayer101 - 23.09.2012

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.


Re: Raising a whole map itself.. - Glint - 23.09.2012

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.


Re: Raising a whole map itself.. - mamorunl - 23.09.2012

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


AW: Re: Raising a whole map itself.. - Nero_3D - 23.09.2012

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


Re: AW: Re: Raising a whole map itself.. - mamorunl - 23.09.2012

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