A downloadable tutorial

Hello everyone. It's me, TheObliviousQuail, and we will be learning how to make a custom character in Baldi's Basics. Let's jump right into the tutorial. 

There will be images for each step, so don't worry too much.

  • Image 1 is for Step 1
  • Image 2 is for Step 2
  • Image 3 is for Step 3
  • Image 4 is for Steps 4 and 5

Steps

  1. Download the Baldi's Basics Decompile. Then when the file has finished downloading, open it up.
  2. Duplicate a pre-existing NPC, and remove the script linked to it. Example: If you are duplicating Baldi, remove the BaldiScript attached to the duplicate.
  3. Make some configurations with your character. Example: If you want your character to be heard really far away, set its Audio Source: Max Distance to something like 250 or whatnot. Also, don't forget to set the Spacial Blend to entirely 3D if you want your character to be heard when close enough.
  4. Duplicate the AgentTest script, and rename that script. To do this, rename the file name, and set its MonoBehaviour name to the same name you gave the new script.
  5. Make the code for your character! If you don't know exactly how to do this, you'll need to watch some Unity tutorials before moving on. Also, make sure to delete all unused namespaces except for "using System;".
  6. Make sounds and textures for your character, and match those assets with said character.
  7. Attach the new script to your character, and fill in all components when necessary.

YOU'RE DONE!

If you have any questions, please let me know.

Also, if you want me to make a script for your character, feel free to ask as well!

StatusReleased
CategoryOther
Rating
Rated 5.0 out of 5 stars
(4 total ratings)
AuthorPop'n Oyster
TagsBaldi's Basics, Character Customization, Tutorial

Comments

Log in with itch.io to leave a comment.

hi, guy who asked the banana package here, is it okay if i can let you code for my mod and use some npc scripts from your mods? i suck at coding npcs n all that, just wondering.

Sure. If you want me provide you a script, simply ask.

do you have like, discord or smth? i can give you mines too, its deeznutsfan69

hey, sorry if all of this seems like alot, and i know this post is pretty old so you rpobabl-"will you just get to the point??" yeah sorry

so i need a script, that makes my character play a sound when he sees a player (kinda like playtime saing "lets play", except the sound shouldnt loop), play a sound while wondering, and a sound when he touches the player, speaking of which, i want him to chase the player when he sees them,  i also need a cooldown so he wont just chase the player till the end of time, and i want that cooldown to start as soon as he touches the player, and obviously to make it possible to lose the character

(+1)

I may make the script later

Thanks

Oh yeah, I'm just remembering to mention this now, but the character's name is "Jake", and the script is named "my script" 

Hello! I'm the guy who asked you for help with the grabby guy a few days ago. I recently restarted and rewrote pretty much of the code to look more like Playtime's, but instead of activating a jump rope you get dragged. Now that the script is cleaned up and more legible, do you think you could help me understand why he doesn't let go of the player?

First off, you need to make sure that there is a statement in the Update void, that says something like "if (Vector3.distance(base.transform.position, this.dragdestination) < 5) { this.dragging = false }. Have you done something like that yet?

I have an OnTriggerEnter void that's supposed to put him into a cooldown mode and make him let go of the player once he collides with the trigger in the center of the room, but I must've done something wrong because even when he is in the collider he doesn't let go or activate his cooldown.

Does your character have a rigidbody, and a collider? If so, then you may want to re-check the name of the room trigger.

Yes he has both and the room name is right. I think the issue is that he is always willing to interact with the player even when he is supposed to be in cooldown. How would I disable his collider when he is meant to be in cooldown?

inside of the OnTriggerEnter script, make sure to add something like "this.dragcooldown <= 0" inside of the if statement.

So based on these other comments, do you just create working scripts for people? If so could I have a little help with a character of mine not working?

So the way the character works is that if he sees the player, he'll chase after them and then forcefully drag them to a room, similarly to how Mrs. Pomp works when angry. After getting to the room, the character lets you go and should be on a cooldown for about 15 seconds.

My main problem is that the character refuses to let go of the player, even when reaching the specified transform collider, and also does not seem to acknowledge or chase the player. Any help would be appreciated.

You need to have a separate boolean in your script that is set to true when he touches the player, and sets to false after he reaches the destination. If the boolean is set to false, then he will simply wander, but if it is set to true, then he will take the player somewhere.

Ok so I tried to make some changes to the code and now he won't interact with the player at all. Would it help if I shared the script I'm using so you could point out where I've gone wrong

Yes, please share it with me so I can help you better.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.AI;

public class YallEeverScript : MonoBehaviour

{

// Token: 0x0600030A RID: 778 RVA: 0x00016852 File Offset: 0x00014A52

private void Start()

    {

        this.agent = base.GetComponent<NavMeshAgent>();

        this.audioDevice = base.GetComponent<AudioSource>();

        this.Wander();

    }

    // Token: 0x0600030B RID: 779 RVA: 0x00016874 File Offset: 0x00014A74

    private void Update()

    {

        if (this.coolDown > 0f)

        {

            this.coolDown -= 1f * Time.deltaTime;

        }

        if (this.warpCool >= 0f)

        {

            this.warpCool -= Time.deltaTime;

        }

        if (this.isDragging & this.playerTouched)

        {

            this.player.position = new Vector3(base.transform.position.x - 1f, 4f, base.transform.position.z);

            this.agent.speed = 60f;

        }

    }

    // Token: 0x0600030C RID: 780 RVA: 0x00016920 File Offset: 0x00014B20

    private void FixedUpdate()

    {

        if (!this.ps.toBase)

        {

            Vector3 direction = this.player.position - base.transform.position;

            RaycastHit raycastHit;

            if (Physics.Raycast(base.transform.position, direction, out raycastHit, float.PositiveInfinity, 3, QueryTriggerInteraction.Ignore) & raycastHit.transform.tag == "Player" & (base.transform.position - this.player.position).magnitude <= 80f & this.warpCool <= 0f)

            {

                this.playerSeen = true;

                this.TargetPlayer();

            }

            else if (this.playerSeen & this.coolDown <= 0f)

            {

                this.playerSeen = false;

                this.Wander();

            }

            else if (this.agent.velocity.magnitude <= 1f & this.coolDown <= 0f)

            {

                this.Wander();

            }

            this.playerTouched = false;

        }

        if (this.warpCool <= 0f)

        {

            this.ps.toBase = false;

        }

    }

    // Token: 0x0600030D RID: 781 RVA: 0x00016A58 File Offset: 0x00014C58

    private void OnTriggerStay(Collider other)

    {

        if (other.tag == "Player" & !this.ps.toBase)

        {

            this.isDragging = true;

            this.playerTouched = true;

            this.agent.SetDestination(this.basePosition.position);

        }

    }

    // Token: 0x0600030E RID: 782 RVA: 0x00016AAC File Offset: 0x00014CAC

    private void OnTriggerExit(Collider other)

    {

        if (other.tag == "Player" & this.ps.toBase)

        {

            this.isDragging = false;

            this.playerTouched = false;

            this.Wander();

        }

        this.agent.speed = 15f;

    }

    // Token: 0x0600030F RID: 783 RVA: 0x00016AFC File Offset: 0x00014CFC

    private void Wander()

    {

        this.wanderer.GetNewTargetHallway();

        this.agent.SetDestination(this.wanderTarget.position);

        this.agent.speed = 15f;

        this.playerSpotted = false;

        this.coolDown = 1f;

    }

    // Token: 0x06000310 RID: 784 RVA: 0x00016B9E File Offset: 0x00014D9E

    public IEnumerator CollisionCooldown()

    {

        this.ps.toBase = true;

        yield return new WaitForSeconds(this.warpCool);

        this.ps.toBase = false;

        yield break;

    }

    // Token: 0x06000311 RID: 785 RVA: 0x00016BB0 File Offset: 0x00014DB0

    private void TargetPlayer()

    {

        this.agent.SetDestination(this.player.position);

        this.agent.speed = 25f;

        this.coolDown = 0.2f;

    }

    // Token: 0x06000307 RID: 775 RVA: 0x000167A0 File Offset: 0x000149A0

    private void OnTriggerEnter(Collider other)

    {

        if (other.tag == "Player")

        {

            this.eever.audVal = Mathf.RoundToInt(Random.Range(0f, 1f));

            base.StartCoroutine(this.GrabCool());

        }

        if (grabCollider = baseCollider)

            {

            this.isDragging = false;

            this.playerSpotted = false;

            this.playerTouched = false;

            this.warpCool = 15f;

            }

    }

    // Token: 0x06000308 RID: 776 RVA: 0x0001683B File Offset: 0x00014A3B

    private IEnumerator GrabCool()

    {

        this.Hit.enabled = false;

        yield return new WaitForSeconds(15f);

        this.Hit.enabled = true;

        yield break;

    }

    // Token: 0x0400039F RID: 927

    public Collider Hit;

    // Token: 0x040003A0 RID: 928

    public YallEeverScript eever;

    // Token: 0x040003A1 RID: 929

    public Collider grabCollider;

    // Token: 0x040003A2 RID: 930

    public bool playerTouched;

    // Token: 0x040003A3 RID: 931

    public bool db;

    // Token: 0x040003A4 RID: 932

    public bool playerSeen;

    // Token: 0x040003A5 RID: 933

    public bool enemySeen;

    // Token: 0x040003A6 RID: 934

    public int audVal;

    // Token: 0x040003A7 RID: 935

    public Transform player;

    // Token: 0x040003A8 RID: 936

    public PlayerScript ps;

    // Token: 0x040003A9 RID: 937

    public Transform wanderTarget;

    // Token: 0x040003AA RID: 938

    public AILocationSelectorScript wanderer;

    // Token: 0x040003AB RID: 939

    public float coolDown;

    // Token: 0x040003AC RID: 940

    public float warpCool;

    // Token: 0x040003AD RID: 941

    public bool playerSpotted;

    // Token: 0x040003AE RID: 942

    private NavMeshAgent agent;

    // Token: 0x040003B6 RID: 950

    public AudioSource audioDevice;

    // Token: 0x040003B7 RID: 951

    public Collider baseCollider;

    // Token: 0x040003B8 RID: 952

    public bool isDragging;

    public Transform basePosition;

}

You have to make it so that when the character's distance from the destination is less than 5, the dragging booleans are set to false. I'm not sure if it has something to do with the ps.isBase boolean, as you may want to replace it. This script is kinda long.

Can you make a script for a character called Foggy Copter, and he has multiple angles like 1st prize, and he wanders around and if he touches you, it becomes foggy for 30 seconds. Can you code that please?

Will the fog event from BB+ be in your game?

(1 edit)

No, because the only tutorial I could find on it was hard to understand, and there was no video for it.

(1 edit)

Ok 

using System;
using UnityEngine;
using UnityEngine.AI;
using System.Collections;
// Token: 0x020000CE RID: 206
public class FoggyScript : MonoBehaviour
{
    // Token: 0x060009B7 RID: 2487 RVA: 0x000254D9 File Offset: 0x000238D9
    private void Start()
    {
        this.agent = base.GetComponent<NavMeshAgent>(); // Define the AI Agent
    }
    // Token: 0x060009B8 RID: 2488 RVA: 0x000254ED File Offset: 0x000238ED
    private void Update()
    {
        if (this.coolDown > 0f)
        {
            this.coolDown -= 1f * Time.deltaTime;
        }
    }
    // Token: 0x060009B9 RID: 2489 RVA: 0x00025518 File Offset: 0x00023918
    private void FixedUpdate()
    {
         if (this.agent.velocity.magnitude <= 1f & this.coolDown <= 0f)
         {
             this.Wander();
         }
    }
    // Token: 0x060009BA RID: 2490 RVA: 0x000255CD File Offset: 0x000239CD
    private void Wander()
    {
        this.wanderer.GetNewTarget();
        this.agent.SetDestination(this.wanderTarget.position); //Set its destination to position of the wanderTarget
        this.coolDown = 1f;
    }
    private void OnTriggerEnter(Collider other)
    {
        if (other.name == "Player" & !this.collided)
        {
            this.collided = true;
            this.StartCoroutine(this.FogTime());
        }
    }
    private IEnumerator FogTime()
    {
        RenderSettings.fogDensity += 0.1f;
        yield return new WaitForSeconds(30f);
        RenderSettings.fogDensity -= 0.1f;
        this.collided = false;
    }
    public bool collided;
    // Token: 0x040006B4 RID: 1716
    public Transform wanderTarget;
    // Token: 0x040006B5 RID: 1717
    public AILocationSelectorScript wanderer;
    // Token: 0x040006B6 RID: 1718
    public float coolDown;
    // Token: 0x040006B7 RID: 1719
    public NavMeshAgent agent;
}

What to put in Agent and WanderTarget?

WanderTarget: AI_LocationSelector.

(1 edit)

Can you make a script for me? My character will be called Tattle Time, and if he sees you breaking any rules, he will tell principle and then the principle will be chasing you. Can you code that?

using System;
using UnityEngine;
using UnityEngine.AI;
// Token: 0x02000024 RID: 36
public class CharForOtherMod : MonoBehaviour
{
    // Token: 0x0600007E RID: 126 RVA: 0x00004355 File Offset: 0x00002755
    private void Start()
    {
        this.agent = base.GetComponent<NavMeshAgent>();
        this.aq = base.GetComponent<AudioSource>();
    }
    private void Update()
    {
        if (this.cooldown > 0)
        {
            this.cooldown -= 1f * Time.deltaTime;
        }
        if (this.tattlecooldown > 0)
        {
            this.tattlecooldown -= 1f * Time.deltaTime;
        }
    }
    private void FixedUpdate()
    {
        if (this.agent.velocity.magnitude < 1 & this.cooldown <= 0)
        {
            this.Wander();
        }
        if (this.ps.guilt > 0)
        {
            Vector3 direction = this.ps.transform.position - base.transform.position;
            RaycastHit raycastHit;
            if (Physics.Raycast(base.transform.position, direction, out raycastHit, float.PositiveInfinity, 769, QueryTriggerInteraction.Ignore) && (raycastHit.transform.tag == "Player"))
            {
                if (this.tattlecooldown <= 0)
                {
                    this.tattlecooldown = 20;
                    this.aq.PlayOneShot(this.tellonprincipal);
                }
            }
        }
    }
    private void Wander()
    {
        this.ail.GetNewTarget();
        this.agent.SetDestination(this.dest.position);
    }
    private float cooldown;
    private float tattlecooldown;
    public PlayerScript ps;
    private AudioSource aq;
    // Token: 0x0400009C RID: 156
    private NavMeshAgent agent;
    public AILocationSelectorScript ail;
    public Transform dest;
    public Transform[] classroomLocations;
    public Transform[] exitLocations;
    public int locationID;
    public AudioClip tellonprincipal;
}

There you go.

What to put in dest?

AI_LocationSelector

Can you make a script for me


if you get 2 exits baldi will appear and chase you fast but if he sees you look at him he will stop if you look away he will chase you

I hope you can do this

I can't make custom scripts for pre-existing original characters. Sorry.

Its fine I can ask redzils if he can because he made a creepypasta baldi mod named BASICS if you want to play it I'll send the game

https://gamebanana.com/mods/494365

Hello, can you made an script for a character for me.

Mechanics: If you interact to it for the first time an Audio will play. If you give for him a quarter the sprite wont change but you will get an item and an audio will play.

I hope you understand :D

Hello, sorry that I did not have time to create the script. I will be sure to create one soon.

https://www.mediafire.com/file/cqoo1dkf785qf1m/ADTestScript.cs/file

where can i find the AgentTest script?

You can find it in the scripts folder of your decompile

thank you for telling me

My character will be the Dorito Robot. It will be just like 1st prize, but it can leave behind zesty bars when moving. Can you make the code for it?

Not at the moment. I'm taking a break from developing right now.

Ok. I can wait.

Unfortunately, I am unable to make clones of items for Unity. Try suggesting something else.

How about 1st prize but gets stunned for 10 seconds when he bumps into a wall while he pushes you?

(+1)

I'll try to make that work.

(1 edit)

Can you make a script that makes my character appear when you have 4 notebooks, and make it collect up to 2 notebooks before you can, and you need to get the notebooks back by using a bsoda on him, and then the notebooks appear next to each other where he as before you used the bsoda? 

(4 edits)

I don't know who your character is. Also, try suggesting another idea that doesn't have to do with your character collecting notebooks.

ok

(1 edit)

Cool tutorial better than every Gamebanana tutorial for characters!

toturial

(1 edit)

Oh wait, nvmd you were correcting him.

Fixed.

(+2)

delete using System; if you are using object or random

(1 edit) (+1)

As I was saying, is it true that you were a former BBCCS contributor? If so, what did you contribute to that series?