#Can someone help me with a kinda advanced script?
1 messages · Page 1 of 1 (latest)
so basically
I want it to
like
detect when a player hits npc
and then all npcs agro at player
and start chasing him and attacking
and then I also want blocks for both npc and player but I think i can do that alone
@neon crow
I would not make the system like this. And make a class for a group of enemies, so you won’t have every single npc in the map agro, as that will result in some weird effects
different folders for different levels
dw
It can also help you optimise your pathfinding by using birdoid style pathfinding (unless you’re using flow paths, but I don’t would prefer it)
A class would be nicer to be frank
that would be awesome!
I mean whatever u think best
I js did what i thought COULD work
A lot of things can work. But some just result in better performance and/or feeling
yes
Anyways, as I said:
make a class for a “group” of enemies. Make it consist of enemies (all the same, or a mix of multiple, your choice). Then as one member of the group agros, make it send a signal to the group class, to then agro all enemies in said group
Then as for pathfinding, you can just make all but one npc behave as “limbs”, to follow the main npc around
Do you know how to write OOP?
Or ECS, or all that matters
I mean, it can work with a folder. But I would say that that would result in a rather ugly code
no
Im dumb for this bro
I js know like]
basics
I never did AI
or stuff
sorry 😭
I js really need a deep ahh explenation
:(
Just start off by learning what OOP is. Then just make a class