#Adware [CardsPlus]

1 messages Ā· Page 1 of 1 (latest)

chrome sand
#

Ads that spawn a bit outside the screen cannot be closed

#

@spark sail

#

also just gonna add it here, it's hard to realize what actually triggers the ad on the player and the delay when you can use it again

#

Ads [CardsPlus]

#

Adware [CardsPlus]

spark sail
#

There is a purple (magenta?) cooldown bar that only shows up when the ability is cooling down. That should be enough indication of when you can use it again I think, if you know to look out for it

#

btw, is this issue happening on 1.5.1 or 1.5.0?

#

@chrome sand

chrome sand
#

uhm latest when I released?

#

also I think the ability cooldown bar wasn't showing up then

#

cause I saw nothing close to my player

#

unless I'm really blind

#

nvm just blind then, but yeah the ads where spawning outside the screen from what I understood (I was the one with the card)

spark sail
#

I thought I fixed that.... Their root position should be center of screen, and when spawned they're given a random offset:

int maxDeltaX = (Screen.width - 500) / 2;
int maxDeltaY = (Screen.height - 400) / 2;

popupTransform.anchoredPosition += new Vector2(Random.Range(-maxDeltaX, maxDeltaX), Random.Range(-maxDeltaY, maxDeltaY));

(500 and 400 are the width and height of the ads respectively)
I thought this was enough to guarantee they never went off screen- apparently not

chrome sand
#

no clue? maybe some people have small screens?

#

I wasn't the one seeing the effect so can't add more to this

spark sail
#

What should I be seeing in that recording?

#

oh

#

the smoke?

#

no

chrome sand
#

not really I was uploading it to check for the cooldown if it seemed strange

spark sail
#

it's hard to tell with the resolution, but I'm pretty sure it's there

chrome sand
#

tho having the card that alters the player size doesn't help

spark sail
#

good point

#

Maybe it should be horizontal, above the player heal bar?

#

Or just a normal UI element in screen space instead of world space

chrome sand
#

hmhm dunno I think it's fine, just make it stand out more somehow? like a white outline or something

#

as I think it blends in too much

spark sail
#

I can do that šŸ‘

chrome sand
#

should help yeah

#

also try to somehow display it on top everything? know that it's a mess with render priority but should be doable

chrome sand
spark sail
#

I'll also whip up a quick change that adds a config letting you toggle the ability of Adware to target friendlies or not- this would let you target yourself, and may make it easier to demonstrate popups going off-screen

chrome sand
#

I mean yeah can be a config

#

should be hd now if you wanna check back the video

spark sail
#

nice

spark sail
chrome sand
#

yeah yeah

spark sail
#

My monitors are all a bit abnormal dimensions/resolution, so maybe that's why I can't recreate. If you'd be willing I could just make a quick build that has targeting friendlies enabled already and send it to you, if you were willing to test

chrome sand
#

well I can't really know how it was as I said it wasn't me seeing them, but I guess I can try to replicate it on my setup

spark sail
#

Yeah, but if you can target yourself then it is could be replicatable in sandbox ig

#

In the mean time I’ll try making the randomized ranges smaller

#

At least on my screen it looks like these pending changes prevent anything from getting too close to a screen edge. I'll push it and hope the defect is corrected

static pewter
#

instead of using screen width/height multiplied by a constant you probably need to check the actual pixel width/height of the ad boxes

static pewter
#

you could also just change your resolution in options to test it yourself x)

spark sail
#

the width and height of the ads are supposed to be constant... unless there's a canvas scaler on the unbound canvas

#

and there may be

static pewter
#

well yea but while their width/height are a constant amount of pixels the screen width/height multiplied by a constant is different for every resolution

#

i don’t think it scales right?

spark sail
#

that's what Screen.width is for

#

and Screen.height

static pewter
#

can’t you just do Screen.width - ad.width, add 0.5*ad.width to x coordinates and then randomly spawn in that zone?

#

and similar for y

#

like if you have a 1920 screen width and ad is 200 pixels it would be a random range from 100 to 1820 (should work assuming the ads spawn on the center of the coordinate) and they shouldn’t go outside

spark sail
#

That's pretty much exactly what I'm doing now :P, with slightly different order of operations:

int maxDeltaX = (Screen.width / 2) - 500;
int maxDeltaY = (Screen.height / 2) - 400;

popupTransform.anchoredPosition += new Vector2(Random.Range(-maxDeltaX, maxDeltaX), Random.Range(-maxDeltaY, maxDeltaY));

Where 500 and 400 are the ad width and height, or what they should be

static pewter
#

and then same thing for y

#

ok i have no clue why that doesn’t work then šŸ˜‚

spark sail
#

this order of operations should leave a bit more margin around the edges

static pewter
#

are some of the ads different sizes?

spark sail
#

afaik this does work

#

That's the new behavior, as of a couple hours ago

static pewter
#

oh ok

chrome sand
#

adding to this effect volume is way too high

spark sail
#

I turned it down to 20% ;-; but yeah, it is too much even so