Jump to content

[REL] Drag and Drop (resource script)


Recommended Posts

Drag and Drop 1.1 resource for MTA:SA DM DP2 by Ace_Gambit

This resource allows you to drag and drop MTA elements almost like in the MTA Race editor.

You can run this resource as part of your own script or stand-alone.

Features:

- Old style drag and dropping of MTA elements

- Supports objects and vehicles (possibly even pickups but hasn't been tested)

- Free movement when cursor is hidden

- Rotate elements over x and z-axis

Download:

https://community.multitheftauto.com/index.php?p= ... ils&id=137

246.png

Version 1.1:

- Added ability to rotate elements!

- Added world rotation of selected element (toggle with F2)

- Fixed README (missing controls and typo's)

Usage:

Drop the archive in your resource folder and start it. The original distribution is designed to run as stand-alone. This means that you can run it parallel to your favourite map editor resource. In stand-alone modus players are automatically registered as editors.

In order to run this resource as part of your own script you must edit the meta.xml. Change the "runstandalone" setting (meta.xml) to "false". The resource will not register newly joined players as editors anymore. You will have to do it in your script instead using one of the following export functions.

Exports:

- regPlayerAsEditor(element player)

- unregPlayerAsEditor

Controls:

- F1 toggles drag and drop mode on (requires the cursor to be visible!) or off *

- F2 toggles world position/rotation of the selected element

- Mouse1 selects an MTA element (press Mouse1 again to drop the MTA element)

- LSHIFT (hold) snaps the selected MTA element to the world or any object beneath

- F3 toggles rotation controls on or off

Rotation: **

- Mouse2 (hold) + Arrow left/right smoothly rotates the element over the x-axis

- Mouse2 (hold) + Arrow down/up smoothly rotates the element over the z-axis

- Scroll up/down fast rotation over the z-axis

- LCTRL (hold) + Scroll up/down fast rotation over the x-axis

- SPACE resets the element to its default rotation

The dragging is pretty straight forward. Just move your mouse to anywhere on the screen.

Free movement:

This resource supports dragging without the cursor being visible. This comes in handy if you want to move the object high into the air with a jetpack or something. As long as drag and drop mode is enabled you can toggle the cursor on and off. It has to be visible when you want to select a new MTA element though.

Note:

When you select a vehicle all passengers are thrown out. This is to prevent bugs when the client script is temporary disabling the element's collision.

Also be aware that other players can not select the same MTA element or see an element being moved by a remote player. The MTA element is synchronized again when the remote player drops it.

* When drag and drop is enabled a yellow corona and red arrow appear.

** In order to prevent interference with running resources the rotation controls are toggable (F3).

Credits to the MTA team

Edited by Guest
Link to comment

Drag and Drop 1.1 resource for MTA:SA DM DP2 by Ace_Gambit

This resource allows you to drag and drop MTA elements almost like in the MTA Race editor.

You can run this resource as part of your own script or stand-alone.

Features:

- Old style drag and dropping of MTA elements

- Supports objects and vehicles (possibly even pickups but hasn't been tested)

- Free movement when cursor is hidden

- Rotate elements over x and z-axis

Download:

https://community.multitheftauto.com/index.php?p= ... ils&id=137

246.png

Version 1.1:

- Added ability to rotate elements!

- Added world rotation of selected element (toggle with F2)

- Fixed README (missing controls and typo's)

Usage:

Drop the archive in your resource folder and start it. The original distribution is designed to run as stand-alone. This means that you can run it parallel to your favourite map editor resource. In stand-alone modus players are automatically registered as editors.

In order to run this resource as part of your own script you must edit the meta.xml. Change the "runstandalone" setting (meta.xml) to "false". The resource will not register newly joined players as editors anymore. You will have to do it in your script instead using one of the following export functions.

Exports:

- regPlayerAsEditor(element player)

- unregPlayerAsEditor

Controls:

- F1 toggles drag and drop mode on (requires the cursor to be visible!) or off *

- F2 toggles world position/rotation of the selected element

- Mouse1 selects an MTA element (press Mouse1 again to drop the MTA element)

- LSHIFT (hold) snaps the selected MTA element to the world or any object beneath

- F3 toggles rotation controls on or off

Rotation: **

- Mouse2 (hold) + Arrow left/right smoothly rotates the element over the x-axis

- Mouse2 (hold) + Arrow down/up smoothly rotates the element over the z-axis

- Scroll up/down fast rotation over the z-axis

- LCTRL (hold) + Scroll up/down fast rotation over the x-axis

- SPACE resets the element to its default rotation

The dragging is pretty straight forward. Just move your mouse to anywhere on the screen.

Free movement:

This resource supports dragging without the cursor being visible. This comes in handy if you want to move the object high into the air with a jetpack or something. As long as drag and drop mode is enabled you can toggle the cursor on and off. It has to be visible when you want to select a new MTA element though.

Note:

When you select a vehicle all passengers are thrown out. This is to prevent bugs when the client script is temporary disabling the element's collision.

Also be aware that other players can not select the same MTA element or see an element being moved by a remote player. The MTA element is synchronized again when the remote player drops it.

* When drag and drop is enabled a yellow corona and red arrow appear.

** In order to prevent interference with running resources the rotation controls are toggable (F3).

Credits to the MTA team

Edited by Guest
Link to comment

Looks like an awesome script!

Maybe it's somehow possible to (pseudo-)synchronize the moving objects by having a timer send the position of the object every few seconds, and to make it go smooth the object should get moved by using the moveObject() function

I can't seem to find the download link though!

Link to comment

Looks like an awesome script!

Maybe it's somehow possible to (pseudo-)synchronize the moving objects by having a timer send the position of the object every few seconds, and to make it go smooth the object should get moved by using the moveObject() function

I can't seem to find the download link though!

Link to comment
Looks like an awesome script!

Maybe it's somehow possible to (pseudo-)synchronize the moving objects by having a timer send the position of the object every few seconds, and to make it go smooth the object should get moved by using the moveObject() function

I can't seem to find the download link though!

Whoops, I edited my post and forgot to paste the link back again. It should be fixed now. And yea, I have been thinking of doing it that way (updating with the server every few seconds) but left it out for some reason. But maybe I'll do that later on.

Link to comment
Looks like an awesome script!

Maybe it's somehow possible to (pseudo-)synchronize the moving objects by having a timer send the position of the object every few seconds, and to make it go smooth the object should get moved by using the moveObject() function

I can't seem to find the download link though!

Whoops, I edited my post and forgot to paste the link back again. It should be fixed now. And yea, I have been thinking of doing it that way (updating with the server every few seconds) but left it out for some reason. But maybe I'll do that later on.

Link to comment
  • 5 months later...
  • 1 year later...

I'd love to use your script, but I think I'm doing something wrong. When I spawn an object, with offedit or map, I can't select it. I press F1 and click the object, but nothing happens. The description says that the cursor has te be visible, so I opened up the console with F8 and tried again, but nothing happens. I stopped freeroam UI (since it uses F1 for the freeroam menu), but still the same problem. I'm sure the resource is loaded. I have the feeling that I'm missing something stupid.

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