ID:1408939
 
(See the best response by SuperSaiyanGokuX.)
I'm just wonder is it possible to use animate on turfs so I can skip a few things like making all tiles transparent for water or w/e or is it not codeable in that fashion without sum kind of verb/obj thing

Best response
According to the reference, the object passed into animate() can be "an atom or image". I would assume that turfs would work.

I do know (from personal experience) that the other related features (transform/matrix/color/etc.) work for turfs, so I would guess that animate() is no different?
Could you not just change the alpha of water? Simply by doing
turf/Water
alpha = 100

well how would i go about doing it like i jsut wanna be able to code it so the turf is auto transparent without need for editing the icon itself would aniamte evne been needed or is there sum other code i can add the the whole
 turf/grass icon='b.dmi' icon_state="grass"
thing
Yeah use alpha.
how would i beable to layer water over another turf without ti beign the onyl turf cause whiel its transparent its jsut going to show darkness
An easy way to do that would be making the water an obj instead of a turf. I'm not sure if is the most efficient though.
In response to Liight
Liight wrote:
An easy way to do that would be making the water an obj instead of a turf. I'm not sure if is the most efficient though.

There are a number of ways to handle that. You can use overlays at runtime:

turf
water //the turf containing the underlay
icon = 'herp.dmi'
overlays = list(/turf/wateroverlay)
wateroverlay //the turf containing the semi-transparent overlay for the water
icon = 'derp.dmi'
alpha = 128


Or, you could simply ctrl+click on the map editor to apply multiple turfs to a location. Be aware that the overlay/underlay needs to be transparent, and the base turf needs to be fully opaque (alpha).
For some reason shift+click is not working for me. It still deletes the turf under it.
Sorry, ctrl+click
ctrl click doesnt do anything either it just places turf like it normally would
Yeah that's what I meant x.x
Hmmm, guess that doesn't work with fully opaque turfs. Either way, the first solution I offered should work quite nicely.
In response to Ter13
Mastergamerxxx wrote:
ctrl click doesnt do anything either it just places turf like it normally would

Ter13 wrote:
Or, you could simply ctrl+click on the map editor to apply multiple turfs to a location. Be aware that the overlay/underlay needs to be transparent, and the base turf needs to be fully opaque (alpha).

That's why. CTRL+click will only overlay/underlay the new turf onto the one that's there if the turf already in that location will somehow "show through". The turf going on top must be partially (or fully) transparent in at least one pixel.

Otherwise, it will completely replace the original turf placed at the location.

My advice? Just bite the bullet and edit your water turfs to be semi-transparent...lol It's actually easy (if you want one alpha level for the entire turf); the dmi editor has a little channel drop-down selection right under the pixel-shifting and rotation buttons that lets you select to Edit "RGB + Alpha" (the default), "RGB + Mask" or just "Alpha". Select "Alpha", and you'll see the editing area turn solid white. This shows all of the pixels that currently have a 255 alpha value. You can use the right slider to pick a lower alpha level (up to you; however transparent you'd like you water turfs to be) and flood-fill the icon (when editing alpha-only, the "colors" shown in the editor are varying levels of gray, depending on transparency)

Done! (well, for this icon/state/frame, anyway)

you can then switch the Edit: drop-down back to "RGB + Alpha" to see what it now looks like (and to reassure yourself that the icon is still there...lol)
In response to Ter13
Ter13 wrote:
> turf
> water //the turf containing the underlay
> icon = 'herp.dmi'
> overlays = list(/turf/wateroverlay)
> wateroverlay //the turf containing the semi-transparent overlay for the water
> icon = 'derp.dmi'
> alpha = 128
>


Or, just do this. This will work, too, but you won't be able to see this in the editor.

It will also require a special turf type that will get the water overlays at run-time, and that might make it a little less flexible in where you can place your water (or over what surfaces), because you'll need (at the very least) multiple icon_states in your "water" turf icon.

But if you make the effort to turn your water icons transparent, you can skip the overlaying part and just place water wherever you want on your map (and over top of any other turf type you want; underwater city? check. underwater forest? check.)
Something 10x easier would be to make it an object and give it the alpha he wants.
obj/Water
icon = 'NAME.dmi'
icon_state = "NAME"

alpha = 100
Easier, yes. But then you could be adding objects to potentially thousands of turfs, creating a lot of potentially large and unnecessary overhead.

Turfs take up much less "juice", so any application where you really don't need any /obj (or atom/movable) functionality, and you need a LOT of them, you're far better off just using turfs.
That'd be a misuse of objs, Liight.

Objs are movable atoms. If it isn't going to be doing any moving, it doesn't need to be movable. Thus, painting silly objs all over the map is just going to induce excessive overhead for no benefit.
Alright thanks for the lecture XD
It sounds a bit like you're brushing it off, but the fact is that we really don't want or need people to be handing out bad advice around here. It's counter-productive.

So whether or not you know any better, those of us that do know better have a certain obligation to step in and point out when we see bad advice.
Page: 1 2