#Pathfinding that acts exactly like braindeads

220 messages · Page 1 of 1 (latest)

latent isle
#
IF ltrg.Trg.Active left
IF rtrg.Trg.Active right
MUL R2 DeltaTime 7.5
SIN R0 grp1.Rot.Y
COS R1 grp1.Rot.Y
MUL R0 R0 R2
MUL R1 R1 R2
ADD grp1.Pos.X grp1.Pos.X R0
ADD grp1.Pos.Z grp1.Pos.Z R1
SLEEP 0
GOTO loop
LABEL left
ADD grp1.Rot.Y grp1.Rot.Y -45
MUL R2 DeltaTime 7.5
SIN R0 grp1.Rot.Y
COS R1 grp1.Rot.Y
MUL R0 R0 R2
MUL R1 R1 R2
ADD grp1.Pos.X grp1.Pos.X R0
ADD grp1.Pos.Z grp1.Pos.Z R1
SLEEP 0
GOTO loop
LABEL right
ADD grp1.Rot.Y grp1.Rot.Y 45
MUL R2 DeltaTime 7.5
SIN R0 grp1.Rot.Y
COS R1 grp1.Rot.Y
MUL R0 R0 R2
MUL R1 R1 R2
ADD grp1.Pos.X grp1.Pos.X R0
ADD grp1.Pos.Z grp1.Pos.Z R1
SLEEP 0
GOTO loop```

second code
```LABEL Label0
SET Player.SelId Player.LocalId
SET R2 0.07
LABEL Label1
SET R6 grp1.Pos.X
SET R7 grp1.Pos.Z
SET R3 Player.Pos.X
SUB R3 R3 R6
SET R4 Player.Pos.Z
SUB R4 R4 R7
ATAN2 R1 R3 R4
SET R5 R1
SUB R5 R5 grp1.Rot.Y
GREATER R6 R5 179
IF R6 Fix positive
LESS R6 R5 -179
IF R6 Fix negativr
GOTO Smooth
LABEL Smooth
MUL R5 R5 R2
ADD grp1.Rot.Y grp1.Rot.Y R5
GOTO Label0
LABEL Fix positive
SUB R5 R5 360
SUB grp1.Rot.Y grp1.Rot.Y 360
GOTO Smooth
LABEL Fix negativr
SUB R5 R5 -360
SUB grp1.Rot.Y grp1.Rot.Y -360
GOTO Smooth
``` btw change the 0.07 to 0.01-7 the lower it is the smarter it gets
shut wind
#

YE

#

S

#

THANK YOU

#

ONG

#

ONG

#

OMG

sterile skiff
#

Coolio code

#

W nelson

latent isle
#

aga_standi yay

peak grove
#

What it do

latent isle
#

pathfind

chilly flare
latent isle
#

yes

sterile skiff
#

Currently this code follows the player who's headset runs the code. This is new code that follows the nearest player instead of the active player

SET R9 999999
SET Player.SelId 0
LABEL nextplayer
ADD Player.SelId Player.SelId 1
GREATER R0 Player.SelId Player.Count
IF R0 done
SUB R0 Player.Pos.X grp1.Pos.X
SUB R1 Player.Pos.Z grp1.Pos.Z
MUL R0 R0 R0
MUL R1 R1 R1
ADD R0 R0 R1
LESS R1 R0 R9
IF R1 newclosest
GOTO nextplayer
LABEL newclosest
SET R9 R0
SET R8 Player.SelId
GOTO nextplayer
LABEL done
SET Player.SelId R8
SET R2 0.07
SET R6 grp1.Pos.X
SET R7 grp1.Pos.Z
SET R3 Player.Pos.X
SUB R3 R3 R6
SET R4 Player.Pos.Z
SUB R4 R4 R7
ATAN2 R1 R3 R4
SET R5 R1
SUB R5 R5 grp1.Rot.Y
GREATER R6 R5 179
IF R6 fixpos
LESS R6 R5 -179
IF R6 fixneg
GOTO smooth
LABEL smooth
MUL R5 R5 R2
ADD grp1.Rot.Y grp1.Rot.Y R5
GOTO loop
LABEL fixpos
SUB R5 R5 360
SUB grp1.Rot.Y grp1.Rot.Y 360
GOTO smooth
LABEL fixneg
SUB R5 R5 -360
SUB grp1.Rot.Y grp1.Rot.Y -360
GOTO smooth ```
odd loom
#

don’t go lying

#

this ain’t even close to how mine works

latent isle
#

well i mean is similar

lapis barn
latent isle
#

yes

grizzled sierra
#

This is no where near braindeads

sterile skiff
dawn quiver
sterile skiff
woeful lagoon
formal quarry
shut wind
latent isle
latent isle
#

Pathfinding that acts exactly like braindeads

sterile skiff
#

It was quick wrote

#

I heard somewhere grab will still let R7+ work, so it uses those.

#

If thats the issue ima rewrite it in grab (the code was a collage of differnt code)

warped sable
#

Yo, what up my friend Nelson? I didn't realize you Made a useful snippet.

cursive roost
#

is there anyway someone could make a setup guide

latent isle
worthy crater
#

how?

fleet siren
#

no typing

tough valley
#

W

sterile skiff
latent isle
sterile skiff
latent isle
#

oh ok

left cove
latent isle
#

put the triggers upper and farther from monster

shut wind
sterile skiff
stone canyon
#

Wut do the triggers connect to

shut wind
tender shell
vapid crypt
#

Yo what do I connect
And I need help on it because I don’t know what to connect the trigger and codingWahh

latent isle
polar parrot
shut wind
polar parrot
#

Or dat other game I found on ps5

shut wind
#

its a test rig, named bean..

#

og fmh didnt make it

polar parrot
#

Some random guy told me dat

#

Ik that but that’s the only thing I could think of ngl

quick lichen
#

it goes through the walls

quick lichen
polar parrot
# quick lichen

Fix pivot and adjust triggers in equal distance from each other and equal size.

quick lichen
#

pivot for what and do you have an example for triggers?

polar parrot
quick lichen
#

nothing works

polar parrot
#

Make walls thicker too

quick lichen
white elk
#

How do you set it up please someone make a video 🙏

quick lichen
#

first code LABEL loop

IF ltrg.Trg.Active left
IF rtrg.Trg.Active right

MUL R2 DeltaTime 4
SIN R0 grp1.Rot.Y
COS R1 grp1.Rot.Y
MUL R0 R0 R2
MUL R1 R1 R2

ADD grp1.Pos.X grp1.Pos.X R0
ADD grp1.Pos.Z grp1.Pos.Z R1

SLEEP 0
GOTO loop

LABEL left
ADD grp1.Rot.Y grp1.Rot.Y -12
SLEEP 0.12
GOTO loop

LABEL right
ADD grp1.Rot.Y grp1.Rot.Y 12
SLEEP 0.12
GOTO loop second code LABEL start

SET Player.SelId Player.LocalId
SET R2 0.03

LABEL follow

SET R6 grp1.Pos.X
SET R7 grp1.Pos.Z

SET R3 Player.Pos.X
SUB R3 R3 R6

SET R4 Player.Pos.Z
SUB R4 R4 R7

ATAN2 R1 R3 R4

SET R5 R1
SUB R5 R5 grp1.Rot.Y

GREATER R6 R5 180
IF R6 fixPos

LESS R6 R5 -180
IF R6 fixNeg

GOTO smooth

LABEL smooth
MUL R5 R5 R2
ADD grp1.Rot.Y grp1.Rot.Y R5
SLEEP 0
GOTO follow

LABEL fixPos
SUB R5 R5 360
GOTO smooth

LABEL fixNeg
ADD R5 R5 360
GOTO smooth optional for front trigger add in first code IF ftrg.Trg.Active back Goto Loop LABEL back
ADD grp1.Rot.Y grp1.Rot.Y 180
SLEEP 0.2
GOTO loop

quick lichen
cursive roost
#

can someone show me how i set it up from the start

worldly belfry
latent isle
#

bc it isnt, well i mean it does (kinda) maneuver around corners and, does what its supposed to but it acts close to braindeads

frozen acorn
sterile skiff
latent isle
#

look

sly plover
#

how do i make it slower

latent isle
sly plover
#

wdym

frozen acorn
frozen acorn
sterile skiff
#

I think it should probably fix the code

frozen acorn
#

it reads select id as invalid BC its used as a input

sterile skiff
frozen acorn
#

ok

#

i did Smith wrong

#

Something

sterile skiff
#

Your all right.

frozen acorn
#

ok

sterile skiff
#

If the code doesn't detect any player it just heads -180⁰ y axis

frozen acorn
#

ok

#

does anything have to be start active

sterile skiff
#

After player is optional for the second code block. There's as small chance that it will improve behavior in some circumstances

frozen acorn
sterile skiff
sterile skiff
frozen acorn
#

YO IT CUTS YOU OFF THIS IS FIRE🔥🔥🔥🔥

frozen acorn
tender meteor
#

It keeps running into walls and getting stuck

worldly belfry
tender meteor
#

So I got it working nicley

#

One issue

#

It likes walls alot and can occasionally go through em

#

But overall its working decently fine

worldly belfry
#

then double check

#

if it can go throug hthem its often a trigger issue or a number issue

tender meteor
#

Well it is chasing me

worldly belfry
#

ok then keep it if it satisfies you

tender meteor
#

But has a seizure when it hits a wall

#

which ig I can live with

frozen acorn
frozen acorn
tender meteor
#

The walls are pretty thick, and the triggers aren't touching the bot.

frozen acorn
tawdry talon
#

Urn what da sigma

frozen acorn
#

yo now i got a problem uhh it just doesn't follow nearest it just follows a random person but if he is not there then he targets somebody else

latent isle
frozen acorn
#

the one that block builder gave

sterile skiff
frozen acorn
#

ok yay

sterile skiff
frozen acorn
#

WAIT SO I RESTARTED LIKE THREE TIMES THINKING I DID SOMETHING WRONG BUT IT WAS NOT MY FAULT

#

😭

sterile skiff
#

The reason I was trying to help ya was because I thought it worked because when I tested it it actually did work, because I messed up my code and nelsons

frozen acorn
#

Bruh lol

#

Nah it's fine

sterile skiff
frozen acorn
#

Wait so does that mean that in a sec I will have a fire Ai bot

#

BOT

#

I MEANT BOT

#

Oh wait I can edit

sterile skiff
#

Nvm I get it

frozen acorn
#

👍

frozen acorn
#

have you fixed it yet?

dawn quiver
#

It works perfectly fine for me

frozen acorn
#

i dont think the nearest code is tbe problem

polar parrot
frozen acorn
#

but i had the issue before i added it

frozen acorn
#

Code 1:

#

LABEL loop
IF ltrg.Trg.Active left
IF rtrg.Trg.Active right
MUL R2 DeltaTime 12.5
SIN R0 grp1.Rot.Y
COS R1 grp1.Rot.Y
MUL R0 R0 R2
MUL R1 R1 R2
ADD grp1.Pos.X grp1.Pos.X R0
ADD grp1.Pos.Z grp1.Pos.Z R1
SLEEP 0
GOTO loop
LABEL left
ADD grp1.Rot.Y grp1.Rot.Y -15
MUL R2 DeltaTime 7.5
SIN R0 grp1.Rot.Y
COS R1 grp1.Rot.Y
MUL R0 R0 R2
MUL R1 R1 R2
ADD grp1.Pos.X grp1.Pos.X R0
ADD grp1.Pos.Z grp1.Pos.Z R1
SLEEP 0
GOTO loop
LABEL right
ADD grp1.Rot.Y grp1.Rot.Y 15
MUL R2 DeltaTime 7.5
SIN R0 grp1.Rot.Y
COS R1 grp1.Rot.Y
MUL R0 R0 R2
MUL R1 R1 R2
ADD grp1.Pos.X grp1.Pos.X R0
ADD grp1.Pos.Z grp1.Pos.Z R1
SLEEP 0
GOTO loop

#

Code 2:

#

LABEL Loop
SET grp1.Rot.X 0
SET grp1.Rot.Z -90
SET R6 999999
SET R7 0
SET R4 0
SET R5 1
LABEL PlayerCheck
LESS R0 R7 Player.Count
IF R0 SelectPlayer
GOTO FaceTarget
LABEL SelectPlayer
SET Player.SelIndex R7
SET Player.SelPart 0
IF Player.Valid CalcDist
GOTO NextPlayer
LABEL CalcDist
SUB R1 Player.Pos.X grp1.Pos.X
SUB R2 Player.Pos.Z grp1.Pos.Z
MUL R3 R1 R1
MUL R0 R2 R2
ADD R3 R3 R0
LESS R0 R3 R6
IF R0 NewClosest
GOTO NextPlayer
LABEL NewClosest
SET R6 R3
SET R4 R1
SET R5 R2
LABEL NextPlayer
ADD R7 R7 1
GOTO PlayerCheck
LABEL FaceTarget
GREATER R0 R3 200
IF R0 Label7
ATAN2 R0 R4 R5
SET grp1.Rot.Y R0
SLEEP 20
GOTO Loop
LABEL Label7
RAND R0 40
SUB R0 R0 20
ADD grp1.Rot.Y grp1.Rot.Y R0
SLEEP 20
GOTO Loop

#

pls tell me if you know why it goes through walls

frozen acorn
#

ok tysm for helping

#

lol i honestly crashed out on it bc it didn't work

sterile skiff
sterile skiff
frozen acorn
sterile skiff
#

When it works it works just like the original code lol

#

Except it has roaming and nearest player

frozen acorn
#

Oh

#

That's weird than

#

Wait so why does it do that in the vid

sterile skiff
frozen acorn
#

Wait i can use the level file and retry it

cunning mesa
#

Wait... Are you friends or are N0V_VR? Or nah because I seen that in his level

fading moat
#

yo

#

what do i make the trigger activate

latent isle
#

Nothing just connect the trigger to the code block

fading moat
#

what should the triggred code use (Start, Stop, Restart, Toggle, Reset.)

latent isle
#

no connections on the triggers! connect the triggers FROM the code block

fading moat
#

o

#

yeah

river umbra
#

I’m commenting on this so it’s saved

#

I’m on phone rn

polar parrot
#

Lol I found slins 5th grade pic

sick ruin
cunning mesa
sick ruin
woeful lagoon
sick ruin
devout shuttle
#

200 messagesrrrrrr

latent isle
#

Addition for nearest```
LABEL Get Nearest - EB
SET blk1.Pos.Y R4
SET R6 1600
SET R4 0
SET R7 0
LABEL Loop
LESS R5 R7 Player.Count
NOT R5 R5
IF R5 Done
SET Player.SelIndex R7
EQUAL R5 Player.Valid 1
NOT R5 R5
IF R5 Next
SUB R0 Player.Pos.X Obj.Pos.X
SUB R1 Player.Pos.Y Obj.Pos.Y
SUB R2 Player.Pos.Z Obj.Pos.Z
MUL R0 R0 R0
MUL R1 R1 R1
MUL R2 R2 R2
ADD R3 R0 R1
ADD R3 R3 R2
LESS R5 R3 R6
IF R5 Update
LABEL Next
ADD R7 R7 1
GOTO Loop
LABEL Update
SET R6 R3
SET R4 Player.Id
GOTO Next
LABEL Done
SET blk1.Pos.Y R4
SLEEP 0
GOTO Get Nearest - EB


```LABEL Label0
SET Player.SelId blk1.Pos.Y
SET R2 0.03
LABEL Label1
SET R6 grp1.Pos.X
SET R7 grp1.Pos.Z
SET R3 Player.Pos.X
SUB R3 R3 R6
SET R4 Player.Pos.Z
SUB R4 R4 R7
ATAN2 R1 R3 R4
SET R5 R1
SUB R5 R5 grp1.Rot.Y
GREATER R6 R5 179
IF R6 Fix positive
LESS R6 R5 -179
IF R6 Fix negativr
GOTO Smooth
LABEL Smooth
MUL R5 R5 R2
ADD grp1.Rot.Y grp1.Rot.Y R5
GOTO Label0
LABEL Fix positive
SUB R5 R5 360
SUB grp1.Rot.Y grp1.Rot.Y 360
GOTO Smooth
LABEL Fix negativr
SUB R5 R5 -360
SUB grp1.Rot.Y grp1.Rot.Y -360
GOTO Smooth
gloomy portal
#

This is the peak of pathfinding

bright dragon
#

Also does anyone have a prefab with a general monster that runs this?? I got all the code right i checked but he’s just spazzing about in a weird circle

sterile skiff
# bright dragon How do you connect it

That code is broken currently, like the one that I sent, if you want one that follows nearest player consistently there is one in #1480716187288731769

#

It works well if not slightly better in most situations

sage edge
#

wait a bunch of people are saying that it doesn’t work??

cunning mesa
bright dragon
sick ruin
#

SET R11 R12
SET R12 0.01
DIV R12 R12 3
LABEL grav
SLEEP 0
SUB grp1.Pos.Y grp1.Pos.Y R11
ADD R11 R11 R12
IF trg1.Trg.Active stop
IF trg2.Trg.Active jump
GOTO grav
LABEL stop
SET R11 0
ADD grp1.Pos.Y grp1.Pos.Y 0.03
GOTO grav
LABEL jump
SET R11 0
ADD grp1.Pos.Y grp1.Pos.Y 0.5
GOTO grav

sick ruin
#

ok

#

(don't ask about the registers)

#

They're fine

velvet eagle
#

w speed

spice ravine
#

Could you please send a video telling us how to build the set up, and the links for the code block

#

so i can get it good