Jump to content

Moving Big amount of Objects


Pilot

Recommended Posts

Hello,

I'm making maps for a server, Full Theft Auto

and I have some Map Editor problems:

I created a very good Club, but the location of it have been changed,

I need to move the club with all it's content (bottles, speakers, lights, etc.) to a different city, from LV to SF

Please help me, I don't know how to move it, is there some kind of a moving option or what?

Link to comment

Here's a basic mass move script:

local ElementTypes =  { "object", "pickup", "marker", "vehicle", "blip" }
 
function batchMoveElements(elements, dx, dy, dz)
for _,e in ipairs(elements) do
local x, y, z = getElementPosition(e)
	x = x + dx
	y = y + dy
	z = z + dz
setElementPosition(e, x, y, z)
triggerEvent("syncProperty", root, "position", {x, y, z}, e)
end
end
 
function consoleMoveObjects(playerSource, command, dx, dy, dz, elementTypes)
dx, dy, dz = tonumber(dx) or 0, tonumber(dy) or 0, tonumber(dz) or 0
for _,elementType in pairs(ElementTypes) do
if (elementTypes and elementType == elementTypes) or not elementTypes then
local elements = getElementsByType(elementType)
if elements then
			batchMoveElements(elements, dx, dy, dz)
end
end
end
end
addCommandHandler("mmove", consoleMoveObjects)

You just have to run this resource while editing your map, open up the console and type mmove x y z, where x, y, and z is the result of your guesswork. ;)

Link to comment

It doesn't work, you said the resource, so I made a resource for my first time

I made meta.xml with this content:

And 1move.lua with with script that you gave me, I started the resource, opened the and typed: mmove X, Y, Z (coordinates instead of x, y, z ), It didn't do anything

and I did load the map.

What did I do wrong?

For 1move.lua I just copied the script you gave me

EDIT: IT does work but not what I need, It moves it back and forward by coordinates you tell it

i.e. I put mmove 0, 0, 22 it moves it forward by 22 coordinates

or it can go up or down by coordinates, mmove 0, 0, 0, 5 to go up by 5

the first 2 numbers don't do anything at all.

How do you go left and right? If I knew that I could solve my problem, could take a little longer, but I could solve it that way, if there was a way!

Link to comment
  • 2 weeks later...
  • 2 months later...

With this script, the x y z coordinates, is that the change in x y z values that we want the items so +50 along z, +1000 in y etc? Or do we input the new coordinates that we want these items to be moved to?

if that makes sense.

Link to comment
  • 2 weeks later...

You can add more element types to move by editing first line:

local ElementTypes =  { "object", "pickup", "marker", "vehicle", "blip", "racepickup", "spawnpoint" }

Here, "racepickup" and "spawnpoint" are used in race maps. If you have maps for other game modes, you'll have to add the element types that those game modes require.

Link to comment
You can add more element types to move by editing first line:
local ElementTypes =  { "object", "pickup", "marker", "vehicle", "blip", "racepickup", "spawnpoint" }

Here, "racepickup" and "spawnpoint" are used in race maps. If you have maps for other game modes, you'll have to add the element types that those game modes require.

Thats rich man !!! Thanks im noob on this because i put pickup and not racepickup xD, but spawnpoint dont work I try, but thats is not bad at all, because spawnpoints are easy do do again , pickups no.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...