[FilterScript] DrEdit - Ingame Object Editor | 0.3e+ | Save, load and export files | dini, zcmd & sscanf
#1



v1.0 - 19.04.2012
Functions

Create, delete and modify objects ingame
Move objects using commands or 0.3e object editor function
Apply custom textures (models) to the objects
Duplicate objects and "gotoobject" function
Ingame options dialog, individual editor preference setting for each player
MTA-like object editor "flycam" with activatable fadecross
Save and load object files
Export objects files in the CreateObject() format (can be restricted to RCON admins)
Help dialogs explaining commands and settings
Customizable defines for the server owner
Text messages for info on actions done to an object
Ability to restrict the editor to RCON admins or players who have been given permission by an RCON admin


Commands

Below is a list of all commands included in the filterscript:

/openeditorOpens/Closes the editor
/createnewobjectCreates a new object
/deleteobjectDeletes an object
/deleteallobjectsDeletes all object
/setobjectxoffset
/setobjectyoffset
/setobjectzoffset
Moves an object on the command associated axis
/setallobjectsxoffset
/setallobjectsyoffset
/setallobjectszoffset
Moves all objects on the command associated axis
/setobjectxrotation
/setobjectyrotation
/setobjectzrotation
Sets the command associated rotation of an object
/nearestobjectGets the closes object to your position
/gotoobjectTeleports you to an object
/replaceobjectmodelReplaces an object with a new object model
/duplicateobjectDuplicates an object
/setobjectmaterialChanges the texture of an object
/setobjectposSets an object to an exact position
/editobjectModifies an object using the object editing tool
/selectobjectSelects an object by clicking on it
/flyeditorEnters the flyeditor editor mode
/saveobjectsSaves an object file
/loadobjectsLoads an object file
/exportobjectsExports an object file in the CreateObject() format
/editorcommandsShows the editor commands help
/editorsettingsShows the editor settings dialog to a player
/esettingshelpShows editor settings help
/toggleeditorCan be used by an RCON admin to allow a player to use the editor (-> see 'defines' category
You can also type /editorcommands ingame to get a dialog with all commands.


Defines

pawn Code:
#define RCON_ADMINS_ONLY                    false
#define TOGGLED_ONLY                        false
#define USE_COMMAND_SHORTCUTS               true
#define USE_MAX_CREATE_DISTANCE             true       
#define USE_MAX_MOVE_DISTANCE               true       
#define MAX_CREATE_DISTANCE                 200.0      
#define MAX_MOVE_DISTANCE                   400.0      
#define ALLOW_EXPORT_MAP_FILE               false      
#define ALLOW_EDIT_OBJECT_ON_DUPLICATE      true       
#define ALLOW_USE_MATERIAL_CHANGE_DIALOG    true       
#define ALLOW_EDIT_OBJECT_ON_CREATE         true       
#define ALLOW_KEEP_MATERIAL                 true       
#define ALLOW_USE_CROSS                     true       
#define ALLOW_TRANSFER_MATERIAL             true
Explanation

- RCON_ADMINS_ONLY
This restricts the usage of the object editor to RCON admins. If a player who is not logged in as an RCON admin tries to open the editor, he will get an error message. If it's set to false, every user can use the object editor.

- TOGGLED_ONLY
If this is set to true, only players who have been given the permission to use the object editor by an RCON admin can use the object editor (/toggleeditor). However, if RCON_ADMINS_ONLY is also set to true, those players will not be able to use it. If TOGGLED_ONLY is set to false, users can use it without being given the permission.

- USE_COMMAND_SHORTCUTS
If this is set to true, users can use command shortcuts, so they do not have to type out the complete command (createnewobject -> /cno). Even if it's enabled, users can still use both command versions, normal and shortcutted version.

- USE_MAX_CREATE_DISTANCE
Restricts the distance a user can create an object in front of him. If set to false, the distance is unlimited.

- USE_MAX_MOVE_DISTANCE
Restricts the distance a user can move an object. If set to false, the distance is unlimited.

- MAX_CREATE_DISTANCE
Defines the max. distance a user can create an object in front of him. This will only be used if USE_MAX_CREATE_DISTANCE is set to true.

- MAX_MOVE_DISTANCE
Defines the max. distance a user can move an object. This will only be used if USE_MAX_MOVE_DISTANCE is set to true.

- ALLOW_EXPORT_MAP_FILE
If it's set to true, all users can export objects in the CreateObject() format. If set to false, only RCON admins can.

- ALLOW_EDIT_OBJECT_ON_CREATE
Allows the user to activate an option which automatically puts the EditObject() cross onto an object after creating it. If set to false, this option will be grayed out in the /editorsettings and he can not use this feature.

- ALLOW_EDIT_OBJECT_ON_DUPLICATE
Allows the user to activate an option which automatically puts the EditObject() cross onto an object after duplicating it. If set to false, this option will be grayed out in the /editorsettings and he can not use this feature.

- ALLOW_USE_MATERIAL_CHANGE_DIALOG
Allows the user to activate an option which replaces the /setobjectmaterial command with all it's parameters with a handy dialog. If set to false, this option will be grayed out in the /editorsettings and he can not use this feature.


The material changing dialog

- ALLOW_KEEP_MATERIAL
Allows the user to activate an option which keeps the custom texture on an object after changing the object's model. If set to false, this option will be grayed out in the /editorsettings and he can not use this feature.

- ALLOW_USE_CROSS
Allows the user to activate an option which puts a fade cross in the middle of the screen when they're in the flyeditor editor mode. If set to false, this option will be grayed out in the /editorsettings and he can not use this feature.

- ALLOW_TRANSFER_MATERIAL
Allows the user to activate an option which automatically transfers a custom texture to the object just being duplicated from it (read: the duplicated object gets the texture of it's "mother" object. If set to false, this option will be grayed out in the /editorsettings and he can not use this feature.



The settings dialog. If an option is grayed out, it has been disabled by the owner


Download

Current version: v1.0.0 for SA-MP 0.3.7(12.06.2015)

Sendspace


Installation
  1. Download the file (WinRar or similar program needed)
  2. Put 'sscanf2', 'zcmd' and 'dini' into your Pawno/Includes folder
  3. Put the objecteditor.pwn and objecteditor.amx into your filterscripts folder
  4. Put the 'ObjectEditor' folder into your scriptfiles directory
  5. Add 'objecteditor' to the filterscripts in your server.cfg
    Code:
    filterscripts objecteditor
  6. Add 'sscanf' to the plugins in your server.cfg
    Code:
    plugins sscanf
  7. Open the objecteditor.pwn and adjust the defines as you wish
  8. Compile the .pwn file
  9. Done!

Bugs

There are currently no found bugs.

However, if you find one, PLEASE REPORT IT TO ME! Either post a reply in this topic or send me a PM


Suggestions

Suggestions are always welcome. If you have a suggestion, please let me know about it by posting here or sending me a PM.
Only this way the editor will continue growing.
However, there are some things I plan for the future:
  • Support for Incognito's Streamer
  • A y_ini Version
  • Support for SetObjectMaterialText()

Changelog

Code:
-v1.0.0- (19.04.2012)

Initial release
Credits

Drebin - coding and idea
DracoBlue - dini
****** - sscanf
ZeeX - zcmd
h02 - flyeditor base code
Reply
#2

You sir are great! I will test it later today but from what I can see from the x and y axis and rotation axis, is that how you move the object? Can you pls make a dialog box or something so when we press the arrows in keyboard, we can move the object without typing the coordinates?

Like this editor : http://forum.sa-mp.com/showthread.ph...=object+editor

Or this: http://forum.sa-mp.com/showthread.ph...=object+editor
Reply
#3

You can also drag the object with your mouse if you want to (/editobject [object]), but I will consider your idea .
Reply
#4

Nevermind. I didn't know you can drag with your mouse! Awesome! And is this compatable with SA-MP 0.3d?
Reply
#5

Quote:
Originally Posted by TheMightyEddy
View Post
Nevermind. I didn't know you can drag with your mouse! Awesome! And is this compatable with SA-MP 0.3d?
No, only 0.3e and above.
Reply
#6

Awesome.

Move it to Y_INI, is faster.

+
Reply
#7

Do you think u can make compatable with 0.3d?
Reply
#8

Quote:
Originally Posted by TheMightyEddy
View Post
Do you think u can make compatable with 0.3d?
It's imposible, dragging a object with mouse is possible only on 0.3e.
Reply
#9

Quote:
Originally Posted by TheMightyEddy
View Post
Do you think u can make compatable with 0.3d?
No because the script is using the new 0.3e fuctions like EditObject which is only for 0.3e..
Reply
#10

Very Nice 10/10
Reply
#11

Oh okay. Can people using 0.3d client still be able to join when I'm using 0.3e server?
Reply
#12

Quote:
Originally Posted by TheMightyEddy
Посмотреть сообщение
Oh okay. Can people using 0.3d client still be able to join when I'm using 0.3e server?
No. And this is not a thread for 0.3e discussion:P.
Wait till 0.3e is released, shouldn't take that long anymore.
Reply
#13

Okay thx
Reply
#14

I think you forgot to mention the "openeditor" command :P
I'm also building an object editor with flymode and I also had a problem with player facing angle after exit flymode, however, you can use this https://sampforum.blast.hk/showthread.php?tid=274958

Anyway, nice work there man!
Reply
#15

Amazing !!
Reply
#16

Great drebin! I will try it tomorrow - One suggestion: Make less CMDs, they are annoying while editing. Maybe a key opens a textdraw menu where you can click on the function you want?
Reply
#17

Very Good 10 / 10 !!
Reply
#18

Good job drebin
Reply
#19

Damn 1000/1000 Fucking awesome work
Reply
#20

Wow brother, you are good! I'm so happy 0.3e got released today!

Edit: Hmm it's sad that this doesn't work. I tried it but when I create an object, it doesn't show up and when I type /gotoobject (/goo) , it takes me to Blueberry Acres. I have all the plugins and stuff in the right folder and everything is configured. What can be wrong?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)