How to make enemy npc

yes that what i mean also you can help with that?

1 Like

Yeah, currently I’m helping you clarify your ideas a bit first.

If you have clear ideas on each detail you want for your NPC, you can easily find a good approach in DevForum and tutorials out there.

Looking for something like: “Check distance between player and a specific position” will help you more than looking for “How to create SCP-049”…
Looking for “How to raycast as a NPC sight” will help more than “Make an SCP that can stalk you and talk bla bla”…

Idk if what I mean its understandable.

1 Like

but i dont know how to script i only know the basics not pathfinding and other

how do i make a table of sounds and make one of them play?

In that case. I suggest 2 approaches:

  • Start using toolbox models that maybe could do something similar to what you want

OR

  • Pause your project a little bit, and focus on learning the basics of scripting, instances in roblox engine, how the engine works, how scripting works.

Otherwise you will never be able to achieve the desired results for your SCP game. Trying to build a game when you dont understand how to script causes more headaches than learning to script first. Or do you want a cheap game with SCPs that looks like a cheap joke?

1 Like

i only have the model

but its hard to learn scripting for me

1 Like

Lets say you have 2 folders inside the SCP which holds some sound phrases. Then when you want to play a random one depending on the state you could:

local StalkPhrases = SPC.Stalk:GetChildren()
local AttkPhrases = SPC.Attk:GetChildren()

-- When SCP is stalking
StalkPhrases[math.random(1, #StalkPhrases)]:Play()

-- when scp is attaking or found a player
AttkPhrases[math.random(1, #AttkPhrases)]:Play()
1 Like

i was thinking about adding a folder but i didnt know that it will work

Learning to script is hard for everyone, even for geniuses I suppose…
Its kinda a choice you should take, if you really love game development, being brave and start learning. Or just give up, cause its not really important being able to build your dreams. Any choice is good, just grab one and go on.

1 Like

wait i have a question. when a function loops like maybe a function for searching players is it possible to make it play sound in the function one time and then wait cooldown and play it again if again searching?

Anything is possible on programming (almost everything).
I dont quite understand what you are asking for, this is what I get

  • A function that iterates all players in game
  • Per player found it will play a sound
  • Per player found and sound played, it should wait a certain cooldown before to continue with the next player

Thats what you are asking?

1 Like

yes and also will the searching folder play the choosed sound in the middle of the model? btw i called the folder like that

Yes, its perfectly possible, remember that almost everything is possible in programming… if it wouldnt how those amazing games would exist?..

This thread is getting a little offtopic, and we dont want to simply bump it over and over again with a conversation, if you have more doubts I would suggest send me a DM and I could help you further.

1 Like

DM where? ???

I started making topics yesterday.

Click my user icon and select to send a message to me

alright im gonna leave this topic alone

1 Like

From what I read, you should learn about finite state machines. It is a good thing to know when making AI.
After that, you can continue further with Behavior Trees, they work similarly to state machines, but has a better hierarchy and can allow more complex behaviors.
You would then be able to determine if 049 is stalking or doing whatsoever and make him perform a set of actions according to his state.

Tip: when making behavior trees (or even state machines), I find it useful to take draft paper and draw a tree with conditions and actions to help you visualize what you want your AI to be. Visualization is very useful, that is why Unreal Engine has a blueprint visual scripting editor.

edit: I found this post about finite state machines.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.