Garry's Mod

Garry's Mod

Image Stickers - Internet pictures attached to entities
109 Comments
Saiko 24 May @ 6:45am 
Getting a consistent LUA error that keeps lagging my server

[Image Stickers - Internet pictures attached to entities] lua/entities/image_sticker.lua:430: attempt to call method 'CreateImage' (a nil value)
1. onsuccess - lua/entities/image_sticker.lua:430
2. unknown - lua/includes/modules/http.lua:29 (x2)

We have alot of image stickers on the map and its causing massive slow down at random times. it gets better when multiple people are online though, but if only 1 person is online there are massive lag spiked every 45sec (goes from 230fps to 12-15 for second, freezes, then goes back up)
We tried just one sticker but even just one caused the issues
ProGamer Fastboi 11 Feb @ 3:16am 
the image sticker is broken the i.imgur.com image is broken pls fix it pls
TobyCat 31 Dec, 2024 @ 11:24am 
WHAT when did you add the shrinkwrap shit that's so cool
mrnicolas23045 19 Oct, 2024 @ 10:06am 
help how do i add images?
X 11 Aug, 2024 @ 9:42am 
made by a pedo award
GoodAndSwordy 6 Apr, 2024 @ 5:38pm 
This changes everything
Kenshinius_YT 25 Mar, 2024 @ 4:27am 
i dont know why but i had to weld it to a prop for the dupe not to break
march  [author] 25 Mar, 2024 @ 4:05am 
Duping with both advdupe2/normal duplicator should just work fine
march  [author] 25 Mar, 2024 @ 4:05am 
@Kenshinius_YT Was there a Lua error? Can't help much without some more context
Kenshinius_YT 16 Mar, 2024 @ 12:46pm 
how do i save the image as a dupe?
when i tried it just showed up as a plastic 2x2 piece
march  [author] 11 Mar, 2024 @ 5:08pm 
No problem!
meloman-rrr 11 Mar, 2024 @ 5:33am 
@march, well, that's the point :D i want to attach sticker to a car. Vinyls, ya know.
no need to apologize, it's okay :3
Well then, it means that i've already did everything i could
thank you
march  [author] 11 Mar, 2024 @ 1:53am 
@meloman-rrr Hopefully I understand the issue now...

You don't need to weld/parent the image sticker to anything, unless that thing moves; then you do. The "Recalculate Shrinkwrap" doesn't stick the individual points of the image onto the entity or anything like that, that's still up to you to do.

The reason being that the process of wrapping around an object, default source traces or not, is still very taxing on performance; so your client calculates the wrap around the model, then sends it to the server for other clients.

(sorry for the late response, I forget to check comments...)
meloman-rrr 8 Mar, 2024 @ 6:16pm 
@march, thanks for the explanations, i really should've explain myself better. The things is that i clearly understand the process itself, i don't get the easiest part. Do i need to use welding or something, or there's a button that i'm missing?
march  [author] 8 Mar, 2024 @ 10:13am 
Also, and I forgot to mention (and assumed you might already know this, which is my bad if I was incorrect); you have to actually calculate the shrinkwrap. The gizmo is there to give you a rough understanding of how it will be projected, but you have to actually click the button to finalize the operation.
march  [author] 8 Mar, 2024 @ 8:07am 
@meloman-rrr Might have to provide more information on what's going wrong. I know there's an error right now that sometimes happens with shrinkwrapping that I need to fix. But generally it should work as described.

Something that might throw you off is that it does a "low precision" wrap in the gizmo (the live preview, shown in the image), but once calculated it does a "high precision" wrap. The difference being that low precision uses built-in Garry's Mod traces (which only trace physical hitboxes) while high precision uses a custom tracing function that can trace around visual models.

If that messes with things, you can try turning off "Shrinkwrap using individual mesh?" in the Shrinkwrapping setting on the entity.
meloman-rrr 6 Mar, 2024 @ 11:43am 
so how do you actually use shrinkwrapping? it doesn't seem to work like in the image. I've adjusted how i want the image to be, but it doesn't wrap, at the starting point
Kimo [.gg/ryukai 13 Feb, 2024 @ 9:37am 
[Image Stickers - Internet pictures attached to entities] Warning! A net message (march.imagestickers.assignowner) is already started! Discarding in favor of the new message! (march.imagestickers.assignowner)
1. func - lua/imagestickers/assignment.lua:15
2. unknown - lua/includes/extensions/net.lua:38
3. xpcall - [C]:-1
4. unknown - [string "__phys_aa_caller.lua"]:7


I Have big problem for my serv are u have solution ?
toyota 20 Dec, 2023 @ 3:20pm 
no problem
march  [author] 20 Dec, 2023 @ 2:57pm 
Good, thanks for checking!
toyota 20 Dec, 2023 @ 11:03am 
it works :)
march  [author] 19 Dec, 2023 @ 6:53pm 
@Xrafy Try testing it now?
toyota 19 Dec, 2023 @ 6:52pm 
no way
march  [author] 19 Dec, 2023 @ 6:37pm 
Nevermind that near future was tonight, I finally was able to reproduce and fix the glitching
march  [author] 19 Dec, 2023 @ 5:20pm 
Sorry, I lost a lot of motivation to work on this... Will be returning to it at some point in the near future.

@Zrafy Already aware of the issue, just can't find a root cause (yet), had some theories on how to fix it, will test
@OceFist Been a while, but try either setting the color opacity of the entity to 254 (or anything thats below 255) or enabling the Translucent option. Either works; but the alpha option works better. Blame source/gmod for that one
toyota 11 Dec, 2023 @ 8:42am 
welp it was last updated in september and its still broken
OceFist 11 Dec, 2023 @ 6:21am 
i tried uploading a image with transparent background to imgur but the background is black?? so it wanst transparent
toyota 24 Sep, 2023 @ 7:54am 
for some reason my images become squared static glitched out photos
march  [author] 23 Sep, 2023 @ 1:49pm 
The additive/translucency change causes the sticker to update the materials flags, so if flipping one of those causes the problem to go away, my theory is that, for whatever reason, the flags sometimes get incorrectly set. May be as simple as doing as this says [github.com], because I wasn't setting VERTEXCOLOR and VERTEXALPHA in the flags, didn't think I needed to. Will test & push a change that adds these two to the flags after I hear back about if changing those parameters causes the black square to go away
march  [author] 23 Sep, 2023 @ 1:43pm 
Does the same problem you described before occur, where almost in an instant the sticker goes from having an image to being a black square? Also, try changing a few parameters around on the image sticker like additive/translucency, since those change parameters of the IMaterial, just to see if those parameters changing at all causes a refresh (and temporarily fixes the issue). If that does fix the issue then that slightly narrows down the problem.
march  [author] 23 Sep, 2023 @ 1:30pm 
@Electricstar Good to hear, and no worries, I probably wouldn't have been able to do much work on this anyway this week. Appreciate you testing the new changes, I can try a couple other things maybe this weekend/later this week... what will likely happen is a last-resort "refresh all" button/console command. Not ideal but will hopefully help a little bit.

Let me know if anything else comes up and I'll let you know as well if I implement any changes

@Xrafy 705 Not sure why you needed to make an Imgur account, I never had to make one. Again at some point in the future a broader whitelist is coming, just more of a pain due to code structure fails on my part & lack of time
Electricstar 23 Sep, 2023 @ 9:43am 
Hey sorry for the long reply, was busy during the week with stuff. Anyhow, it would appear the update has caused the problem to happen less frequently at the very least, I still sometimes get the black box treatment, but not every time I load up a save anymore, so it's definitely a step in the right direction.
toyota 22 Sep, 2023 @ 4:21pm 
nvm i had to make an imgur account
toyota 22 Sep, 2023 @ 4:10pm 
why does it always fucking say image does not exist
march  [author] 18 Sep, 2023 @ 12:03am 
@Electricstar Pushed a change just now that *may* fix the "black screen/glitching" problems, but definitely fixes the bug I found awhile back. Let me know if it fixes it or not
march  [author] 15 Sep, 2023 @ 9:23pm 
I only briefly looked at the problem since I've been pretty busy, sorry.

I did most of my testing with a few addons and the final tests with -noworkshop and -noaddons, so it could honestly be an addon conflict of some kind since I never had this issue in my testing... I don't know how, or with what addon, though. I wouldn't think it would be some kind of material name/global table/hook name conflict for sure, given those all used unique names.

By right afterward I assume you mean around the next game tick (very quickly) right? My best guess was that it has something to do with how I'm caching materials, and I was planning to mess with that anyway due to aforementioned different bug (basically, two image stickers using the same URL can cause properties to unintentionally affect other stickers with the same URL). I think I know a fix for that though, and I'm kind of hoping that fix also fixes the black screen issue. I'll give it a try later tomorrow and see what happens.
Electricstar 14 Sep, 2023 @ 7:45pm 
If it helps any I have noticed a thing with the black images, when you load a save it originally loads up the image just fine, but right afterward it goes totally black or glitched out. As if the map is loading something and once it loads that something, it conflicts with the addon.
march  [author] 10 Sep, 2023 @ 12:02am 
@Vilbys Tested really quick, doesn't seem like I can replicate the issue. I know I've had a similar issue before, but it seemed random and I wasn't able to replicate it. Will see what I can do but not much I can do when I can't replicate the problem. (I tried duping, spawning new entities and putting the URL in, etc). Did discover a different bug though which may be related to the problem, I'll experiment more with it tomorrow.

Out of curiosity, are you on the x86-64 branch of Garry's Mod? Not sure if there's any material rendering differences there (kind of doubt it) but worth checking I guess. Easiest way to check is if Garry's Mod has a [x86-64] on the right-side of its name in Steam's game list.
march  [author] 9 Sep, 2023 @ 11:41pm 
@Electricstar Didn't think about saves, I'll look into the problem tomorrow. Could just be me forgetting to do something on my end honestly

@Vilbys Sounds like it could be a caching issue then. The addon saves the material for later use so it doesn't have to request more than once per game session. Send me the link in particular and I'll try to see if I can figure out the issue
Bilirubin 9 Sep, 2023 @ 10:57pm 
I put in an image and it worked at first, then i put in the same image again and it kept coming out as a black screen
Electricstar 9 Sep, 2023 @ 6:29pm 
Not sure if it's lua related or caused by a conflicting addon, but every time I load up a save I need to re-upload the image to Imgur and copypasta the link, and even then it's a coinflip on whether or not it works.
march  [author] 9 Sep, 2023 @ 6:23pm 
If I remember correctly I got a similar bug but it was a one-time thing and I wasn't able to replicate it. So anything that can help replicate the issue would be really helpful
march  [author] 9 Sep, 2023 @ 6:22pm 
That's... weird, but I'll look into it. No lua errors or anything? @Vilbys @Electricstar
Electricstar 8 Sep, 2023 @ 1:44pm 
Yeah, this is a useful tool but the images constantly going fully black or glitched out makes it hard to work with...
Bilirubin 8 Sep, 2023 @ 1:29am 
I love how when i put an image in it just becomes a black screen no matter what i do
march  [author] 6 Sep, 2023 @ 9:31am 
Spawn an Image Sticker in the Fun & Games category. Use the Context Menu (hold C, then right click on the image sticker) on the entity. @FTL
♥♥♥♥♥ 6 Sep, 2023 @ 3:47am 
how do you even apply images ?
Anothuor 5 Sep, 2023 @ 8:14am 
squidiskool 4 Sep, 2023 @ 4:47pm 
oh no