> For the complete documentation index, see [llms.txt](https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/deluxe-battle-kit-for-v21.1/mid-battle-scripting/advanced-scripting.md).

# Advanced Scripting

The pages in this subsection will go over some advanced ways of setting up your custom midbattle scripts.&#x20;

* In the subsection "Speech Utilities", I will go over everything related to setting up speech and dialogue in much more thorough detail.
* In the subsection "Variable Utilities", I will introduce the midbattle variable, how to edit it's value, and how you can make something happen in response to its value changing.
* In the subsection "Storing Scripts", I will go over how to store entire midbattle hashes in the plugin scripts themselves so that you may call upon them when you need them. This not only allows you to save space in your event scripts themselves, but makes your midbattle scripts more accessible and easily re-usable for multiple battle calls.
* In the subsection "Hardcoding", I will go over an entirely different method of setting up midbattle scripts where you may simply hardcode entire battle scenarios freehand, rather than relying on the pre-made hash system where you input certain values for certain outcomes. This method requires you to be fairly competent at coding, so I recommend sticking with the hash system if you aren't confident in your abilities.
* In the subsection "Global Scripts", I will go over a way to implement midbattle scripts that can apply globally to any battle, without having to set a battle rule for a specific battle.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lucidious89-tutorials.gitbook.io/deluxe-battle-kit-tutorial/deluxe-battle-kit-for-v21.1/mid-battle-scripting/advanced-scripting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
