[Plugin] S-ART [place any picture on the map like an object!]
#1

PROJECT CONTINUES HERE AS INCLUDE
================================================== ==============
Hello! Some time ago I made the tool for using pictures in your gamemodes. Now I present the plugin with that feature!

It wasn't easy to use the tool, but now is't VERY easy. Just use CreateArt / DestroyArt functions like CreateObject / DestroyObject ones:

I changed the pattern, now second parameter is the art type:
CreateArt(path_to_png_image, art_type, other_default_parameters...)

example:
Код:
#include <s-art>
.......
new art = CreateArt("D:\\my_image.png", 2, -704.1531, 1849.0200, 18,   45, 45, 45, 100); 
//picture should be in 24-bit PNG type
.......
DestroyArt(art);
also now it supports streamer plugin (use CreateDynamicArt).

I'm total noob in plugin writing, so you can modify, improve or do whatever you want with it.
SOURCE CODE
(include and DLL files are in /build/ folder)

demo:

yeah, that's what this thing was made for. To place the photo of Redirect_Left (owner and creator of sumo server) to the map.

currently plugin supports 4 size types:
type 2, size = X
type 3, size ~= 3*X
type 1, size ~= 6*X
type 0, size ~= 12*X

(it's not easy to find not-shadowed almost square single-textured objexts!!)
(if you do REALLY need another sizes, ask me, there're few less convenient objects unused)

size types:


The result isn't perfect, the objects I've used aren't square, so resize your original pictures to achieve better results.

It's still VERY recommended to use pictures with dimensions multiple of 15
Reply
#2

Glad to see this working as a plug-in; rather than a /manual/, frustrating process.
Reply
#3

Finally! I'm going to use it in near future. Thanks again
Reply
#4

Great job!
Reply
#5

Really good job.
Reply
#6

Have you solved the lag, i mean whenever i used the tool, player experienced lag. I think it was due to image streaming only.
Reply
#7

Quote:
Originally Posted by $$inSane
Посмотреть сообщение
Have you solved the lag, i mean whenever i used the tool, player experienced lag. I think it was due to image streaming only.
just use smaller images. more objects = more data to download = more lags

I can try to increase the pixel amount per object to reduce the total objects amount... last time I've tried to do that, there was limit of 2048 symbols in line (so all my pictures are made of 15*15 blocks, max 15*15*9 + 15 = 2040 symbols)
Reply
#8

Quote:
Originally Posted by DialUp
Посмотреть сообщение
just use smaller images. more objects = more data to download = more lags

I can try to increase the pixel amount per object to reduce the total objects amount... last time I've tried to do that, there was limit of 2048 symbols in line (so all my pictures are made of 15*15 blocks, max 15*15*9 + 15 = 2040 symbols)
Oh, i got it, all i need to use is 15* symmetry.

Also, do this supports .gif
Reply
#9

Quote:
Originally Posted by $$inSane
Посмотреть сообщение
Oh, i got it, all i need to use is 15* symmetry.

Also, do this supports .gif
no, it supports only 24-bit PNG images (to keep it small and simple - I can use giant library like OpenCV, but then it will require external DLLs). I think it's not so hard to re-save GIF in another format with something like Paint
Reply
#10

There's was a small tool written in phyton which did the same thing but yeah ofcourse this is better. Good job.

Oh okay, It was you who made the tool.
Reply
#11

Good Job man!
Reply
#12

I haven't checked the plugin source but from what I've seen on the include, the invoke function could work wrongly in some cases (where the object created under invoke might not be the 1st server created object)
pawn Код:
CreateObject(0,0.0,0.0,0.0,0.0,0.0,0.0);
    SetObjectMaterialText(0, Var, 0, OBJECT_MATERIAL_SIZE_512x512, "Webdings", 35, 0, 0, 0, 0);
    SetObjectMaterial(0, 1, -1, "none", "none", 0);
    DestroyObject(0);
You've declared a variable named "Var" but never used it, I suppose it was meant to save object IDs. The above code simply sets material text and textures object ID of 0 value, which may not be the object ID which was created under invoke function.
Reply
#13

Make, on linux and i love u
Reply
#14

Quote:
Originally Posted by DialUp
Посмотреть сообщение
no, it supports only 24-bit PNG images (to keep it small and simple - I can use giant library like OpenCV, but then it will require external DLLs). I think it's not so hard to re-save GIF in another format with something like Paint
I think he wasn't talking about the format of the picture itself, but rather does it support moving images like .gifs.
Reply
#15

Finally xD
Reply
#16

Awesome!
Reply
#17

Which directory should I use, if I want to load pictures from my gamemode folder? Include, plugin or samp-server.exe folder?
Reply
#18

I've tested the first version of the script but when i get closer of objects it dont loads at all because of streamer limit, if i don't use streamer i can't create maps on my server, so theres any way to reduce the numbers of objects used to create the image? Its one of the bests works ever i saw on sa-mp. Congrats, rep + 3 again.
Reply
#19

Strange, it doesn't work. No errors in console, but no image either. My code:
Quote:

CMD:traffic(playerid, params[])
{
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateArt("H:\\lol.png", x, y, z, 0, 0, 0, 100, 2);
return 1;
}

Reply
#20

Quote:
Originally Posted by iWhite
Посмотреть сообщение
Strange, it doesn't work. No errors in console, but no image either. My code:
Probably you need to increase your Z position because SA-MP art is a very very big rectangle and if you use same position as your player it should be under the ground... try z + 50.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)