[Help] Is possible make a NPC detect a block?

Description: Internal scripting system of SMBX-38A Engine based on the simple VB-like language
Moderators: Lx Xzit, Yoshi021, 5438A38A, Semi-moderatos, Moderators

Lx Xzit M
Topic author, Moderator
Moderator
Avatar
Lx Xzit M
Topic author, Moderator
Moderator
Reputation: 402
Posts: 757
Joined: 9 Nov 2015
Website

Post #1by Lx Xzit » 23 Jan 2017, 7:42

I'm trying to make an upside-down buzzy bettle, the current code is okay but I've got a problem, I need the NPC faces to the other side when its in the edges (I mean cliffturn). Due its gravity is inverted I can't use parallel execution, so all what I need is a way to detect if the NPC is touching a block or not, or some example about how do I make the NPC do a cliffturn in a code. Can anyone please help me? I would appreciate it a lot, is all what I need to finish a NPC pack. :(

Spoiler
Image
VISIT MY YOUTUBE CHANNEL! LX XZIT
Join our 38A Discord server!

Image

TheCreator520
Close friend
Close friend
Avatar
TheCreator520
Close friend
Close friend
Reputation: 64
Posts: 91
Joined: 21 Feb 2016

Post #2by TheCreator520 » 23 Jan 2017, 8:27

It is not effecient to let the npc do the following codes per frame , so please make the npc detect each three or four frames .

Code: Select all

For val(Blocks) =1 to sysval(BCount)

Next

You can add something into them .
This function make the npc detect all blocks in the level to find out the block which is match with your given conditions .
To use the block's variable , use this :

Code: Select all

block(val(Blocks))
Image


Return to “TeaScript”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest