ID:1530805
 
(See the best response by Koshigia.)
Code:


Problem description: Trying to figure out how to code turfs and all other objects using the group function only solution i have is making my wall turfs into mobs

What are you trying to accomplish with the group list? There may be another solution rather than trying to mold your entire game around a very specific and limited feature.
im trying to make it where when a projectile interacts with a wall or mob it will just move it aside and displace the mob or object kinda like a magnet repelling objects
or turf
Best response
Ok. I would nevermind then group list then. It was only ever intended to handle mobs for RPGs and the likes. I think a more appropriate solution would be to handle it yourself.

The one thing to remember though, is that turfs are not "movable". You can't move a turf one way or the other, so your back to the original dilemma of whether or not you should convert all your turfs to mobs. I'd still say no.

So how else could you handle it? I'd say that when a projectile bumps a wall, do the interactions there. If you want the wall to display some animation for being hit, you can do it. If you want it to MOVE, you'd actually have to use some brainpower and change the turf and surrounding affected turfs as opposed to simply moving them.
well thank you maybe i can make it delete the tile and replace a floor or other object within a 1 block radius but it cant form in the projectiles path only on its sides not sure how id accomplish that seems like itd be a massive code job and im still new lol


Will making turfs mobs generate more lag? Is there any negative side effect?
Every X,Y,Z has to have a turf. This means you'll need a turf even if you have objects or mobs on that turf.

If you're looking to just pass over it, you can shift the icon using pixel_x and pixel_y, and return 1 on Enter for the projectile (allowing it to pass). If not, you're going to need to be more specific on what needs to happen - breaking it down in steps and explaining what the end result is.
In response to Pirion
This is the projectile( ~ )these are the walls aka dense turfs the projectile is solid



OOOOO A (
~OOOOO B (the projectile is about to interact with
OOOOO C ( wall B

O
OOOOO A (
~OOOO B ( here the projectile has dislodged wall B
OOOOO C ( forcing it to bump wall A and by doing so
has bumped Wall A out of place so now wall B is above the projectile in the second frame. And Wall A is forced to a new location kinda like marbles.


So basically Projectile bumps Wall B then wall B Bumps Wall A and Wall A has to bump to a new spot.

So on bump you'll want to do the action and, you'll want to determine which how far this effect will go, then create a loop that'll tell each turf to move upwards. This code goes until there is no more dense objects

I.E.
projectile/Bump(a)
if(isturf(a))
a.Bumped()
turf/proc/Bumped()
src.shift(NORTH)
turf/proc/shift(DIR)
var/turf/a = get_step(src,DIR)
if(a && a.density = 1)
var/new_loc = a.loc
a.shift(DIR)
src.loc = new_loc
Ill copy this code and disect it till i understand all the terms that are listed within not sure a && a is lol is it referring to turf/a? Thank you very much . I have a feeling this will make alot of lag
The && is boolean AND,

The line says "if a is not null AND a.density is true"
&& is a handy one to know. It basically means "and" in English. You might do well to know all the operators. They are tools. The more tools you have in your head to use, the easier it is to solve problems.

Even though I've been here for well over a decade, I am not a professional programmer, and I still frequently browse through the documentation (f1 key in dream maker) to refresh my memory on how a particular function works, or to perhaps find a feature that I forgot existed.

*edit* sorry for the duplicate answer about '&&'
lol its ok thank you both. your additional input helped me aswell