New to the forum? Say hello in this topic! Make sure to read the rules.
RULE NR 3 UPDATED: Don't hurt, harass or provoke other forum members or people.

Checking if an object is a bg/solid

Share questions and tutorials related to the ScriptAPI and give suggestions for new functions you want to see.
Forum rules
By using the forum you agree to the following rules.
Post Reply
Armadyl5
Superfighter
Superfighter
Posts: 109
Joined: Sun Mar 20, 2016 9:50 am
Started SFD: 1.2.1
Gender:
Age: 18

Checking if an object is a bg/solid

Post by Armadyl5 » Wed Nov 15, 2017 1:25 pm

Hi ! :D

Is there a way to check if a certain object in the map is a background tile , a solid tile , or else?

Or maybe if an object is "Collidable"?
0 x
Never Surrender !

Always Fight For Your Rights , and Don't Let Your Friends Down .

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 257
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 19

Post by JakSparro98 » Wed Nov 15, 2017 2:00 pm

Armadyl5 wrote:
Wed Nov 15, 2017 1:25 pm
Hi ! :D

Is there a way to check if a certain object in the map is a background tile , a solid tile , or else?

Or maybe if an object is "Collidable"?
So far the solution I adopted for background tiles is to check if in the name of the tile there is the prefix "Bg" using String.StartsWith or String.Contains.

for checking if an object is collidable there isn't an easy way, you must understand Collision filtering made with the AlterCollisionTile, then compare category, mask and above bits in order to know if the object is actually collidable with another.

Can I ask you why do you need that? Are you thinking about creating a sort of Raycast?
1 x

Armadyl5
Superfighter
Superfighter
Posts: 109
Joined: Sun Mar 20, 2016 9:50 am
Started SFD: 1.2.1
Gender:
Age: 18

Post by Armadyl5 » Wed Nov 15, 2017 2:20 pm

JakSparro98 wrote:
Wed Nov 15, 2017 2:00 pm
So far the solution I adopted for background tiles is to check if in the name of the tile there is the prefix "Bg" using String.StartsWith or String.Contains.
Smart ;) , Sounds good .
JakSparro98 wrote:
Wed Nov 15, 2017 2:00 pm
Can I ask you why do you need that? Are you thinking about creating a sort of Raycast?
My purpose is making a bot jump when facing an object, not a bg/farbg .

Thank you for the help mate :)
1 x
Never Surrender !

Always Fight For Your Rights , and Don't Let Your Friends Down .

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest