[FilterScript] Attached Object Editor
#1

Attached Object Editor
Someone has made one of these before, I looked at it, and found myself wanting more, so I made one

[ame]http://www.youtube.com/watch?v=n85lVIcdPLE[/ame]

Installation
You will need to create a folder `attachments` in your scriptfiles directory. This is the directory where object files are saved. You can change the SAVE_PATH in the script if you wish.

To compile this filterscript, you will need the new 0.3c includes
You will also need Y-Less sscanf2 plugin
https://sampforum.blast.hk/showthread.php?tid=120356
and the zcmd command processor by Zeex
https://sampforum.blast.hk/showthread.php?tid=91354

Note: change the value of the MAX define in the script to reflect your servers number of slots, or you can simply replace MAX with MAX_PLAYERS

Instructions for use
You will need to be an RCON admin to load and use the editor.
Once loaded, use /editor to enter the interface. Your model will be frozen, and the camera set behind you.
Textdraws will appear to help with commands / keys(green), also a quick reference guide to bone numbers(red) and finally some indicators so you know which attachment index and editing style you have selected(blue)




Global Movement keys
There are four modes of movement ( camera, offset, rotation and scale ) all of which are adjusted using the same keys. UP / DOWN for Yaxis, LEFT / RIGHT for Xaxis, and LSHIFT/LCTRL for Z axis. ( check textdraws if you have custom keys defined ). You can hold down SPACE to speed up the movement. It won't take you long to become familiar with these keys.

Camera Movement
Hold down the LMB ( or equivalent ) and use the 6 direction keys to move the camera. You can also toggle 'freeze' mode with the MMB. When you are unfrozen the blue textdraws will dissapear, and editing the object is suspended.
There is also the option to /camera, this returns you to normal GTA operation ( while still in the editor ). These options are useful for getting a good look at the objects you have adited.

Adding or removing objects
/index will give you a descrition of the options for adding and removing objects.
/index [index 1-5] [model#] [bone] to add a new object
/index [index 1-5] to switch to editing a different index if you have more than one object attached
/index [index 1-5] 0 to remove an object from a specific index

/scale - this command will return the object to 1:1:1 scale, because this is almost impossible to do any other way

At any time you can /asave and /aload files into the editor, this is handy when making complex combinations of objects. Object files can contain 1-5 objects, and they are saved in a format which can be pasted directly into other scripts inside the SetPlayerAttachedObject function.

You can also /aload a file from outside the editor, and it will add it to your model.

Download
Pastebin
http://pawn.pastebin.com/J9z0fNhi

Attached_Object_Editor.pwn
http://rapidshare.com/files/44175757...ect_Editor.pwn
Attached_Object_Editor.amx
http://rapidshare.com/files/44175768...ect_Editor.amx


Anyway, I hope you find this filterscript useful.
[edit] re-uploaded files without silly typo
Reply
#2

This is good, I like the textdraw information!
Reply
#3

This is nice, may have to try this out soon.
Reply
#4

Help plis

[pawn]
C:\Documents and Settings\Administrador\Escritorio\Internacional RP\filterscripts\AEditor.pwn(512) : error 017: undefined symbol "code"
C:\Documents and Settings\Administrador\Escritorio\Internacional RP\filterscripts\AEditor.pwn(512) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Escritorio\Internacional RP\filterscripts\AEditor.pwn(517) : error 017: undefined symbol "code"
C:\Documents and Settings\Administrador\Escritorio\Internacional RP\filterscripts\AEditor.pwn(517) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Escritorio\Internacional RP\filterscripts\AEditor.pwn(521) : error 017: undefined symbol "code"
C:\Documents and Settings\Administrador\Escritorio\Internacional RP\filterscripts\AEditor.pwn(52 : error 017: undefined symbol "code"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
[pawn/]
Reply
#5

you can upload it with. amx, my I do not compile.
Reply
#6

sorry my bad, go to line 512 and change
pawn Код:
code = 0;

//change to

new code = 0;
I missed that when I took out the server specific functions that were in the script
(this is also a good scripting test for scripters)

I will re-upload the things shortly
Reply
#7

is not working..
Код:
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(183) : error 017: undefined symbol "RemovePlayerAttachedObject"
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(237) : error 017: undefined symbol "RemovePlayerAttachedObject"
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(242) : error 017: undefined symbol "RemovePlayerAttachedObject"
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(257) : error 017: undefined symbol "SetPlayerAttachedObject"
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(293) : error 017: undefined symbol "RemovePlayerAttachedObject"
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(349) : error 017: undefined symbol "SetPlayerAttachedObject"
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(413) : error 017: undefined symbol "SetPlayerAttachedObject"
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(468) : error 017: undefined symbol "SetPlayerAttachedObject"
C:\Documents and Settings\adrian\Desktop\Ravens\filterscripts\Attached_Object_Editor.pwn(737) : error 017: undefined symbol "SetPlayerAttachedObject"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


9 Errors.
Reply
#8

This is a 0.3c filterscript
Reply
#9

whops sorry..
Reply
#10

No offense, I don't really understand this. Could you make it more understandable and user-friendly? Something like Hold Studio would be good but HS doesn't support attach slots.
Reply
#11

Very nice 10/10
Reply
#12

Quote:
Originally Posted by Retardedwolf
View Post
No offense, I don't really understand this. Could you make it more understandable and user-friendly? Something like Hold Studio would be good but HS doesn't support attach slots.
just load it, type /editor, then type /index 1 [model] [bone]
then press lots of buttons.

I can't see how I can make it more user friendly considering all the textdraws.
Reply
#13

Really nice, might need that swat shield thing for my server, if thats a valid object id on samp -.-
Reply
#14

When i save says
Code:
ERROR: creating file
and..where i see my holdobject?
Reply
#15

Well yeah, one more, but none of the 3 supports "attach object editor" for vehicles.
Reply
#16

Quote:
Originally Posted by Speederx
View Post
When i save says
Code:
ERROR: creating file
and..where i see my holdobject?
Make sure you have a folder 'attached' created in scriptfiles ( read the installation section above )
When you are in the editor, and you type '/index [index] [model] [bone] it will give you a client message saying
'Attached object# [model] to bone [bone] index [index]' Then you should see the object on your character. If not, then I guess the model ID was incorrect, or your client doesn't support all the 0.3c objects.

Quote:
Originally Posted by exora
Well yeah, one more, but none of the 3 supports "attach object editor" for vehicles
I don't understand what you mean. I havn't scripted the vehicle attachment editor yet.
Reply
#17

sweeet
Reply
#18

Very cool FS nice joob dood.
Reply
#19

Really useful to make new things for my server
Reply
#20

What do i have to write in the AttachObjectToPlayer line??
I have this ini File:
0,18643,2,0.08,0.04,0.03,0.0,-304.0,-267.0,0.36,0.07,1.01
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)