-
Notifications
You must be signed in to change notification settings - Fork 13
Custom Scripts ~ Using Custom Scripts
The first thing necessary for understanding custom scripts is understanding the interactions between Chiventure and Lua.
For the purpose of Chiventure, Lua is a way to store information. We can pass in arguments to Lua in the form of Functions, Ints, Bools, Chars and Strings. This information is stored in the Lua Game State, and it can be accessed and changed through an Instance of Chiventures. Everything in Lua is being stored on the stack, and can be popped off the stack and returned to C at any point. Lua will return a virtual pointer to the position of the variable or function for easy access.
What custom scripts does is handle most of the more complex parts of dealing with Lua. Custom Scripts will handle initializing the Lua game state, and will record where you put your variables and functions in the Lua stack. When you pass something to Lua, Custom Scripts will create a struct that will record what type of information you've stored in Lua, and return the pointer to the struct.
Afterwards, you can use the pointer to access and change the information in the Lua stack at any point, making it significantly easier to create a more dynamic game in Chiventure
Custom Scripts allows you to dynamically generate different things depending on what you want to do.
One example is custom strings. You can use Custom Scripts to remember the player characters name, and make all strings then change to match the player's name from that point forward.
Another example is conditional actions. You can store a boolean value or an integer in Lua, and make actions dependent on that variable. You can make custom scripts so that an action is only possible if a certain item is in your inventory, or if you have a certain amount of coins.
The purpose of Custom Scripts is to make Chiventure more dynamic! Use Custom Scripts to make your game more unique and responsive!
The Interfacing functions of Custom scripts are the Object functions and the Get functions. The object function will store your variable in the Lua Stack, and return a pointer to a struct that will preserve all the information Lua has returned to find your variable. Afterwards, you can use the get function to return the variable you have stored in Lua using the pointer the the struct you have.
You can also call functions by writing a short Lua script that you can call within C and link to your instance of Chiventure. You can find examples of all these techniques in the "demo_2022.c" file within the Custom scripts folder.
If you have a more complex understanding of Lua, it is also possible to create functions to interact with your variables and create a more dynamic game environment.
The work around for using LUA in conjunction with WDL files is that you can set up a system that opens a corresponding WDL file depending on the user input. For example, if the user inputs '1', it can open 'example1.wdl' and if the user inputs '2', it can be linked to open 'example2.wdl'. Because WDL is loaded in with the game, it cannot dynamically be updated with a user input once it has been called.
-
Action Management
-
Battles
- Design Document
- Text Based Combat in Other Games
- User Stories
- Wishlist
- Battle Planning 2022
- Battle User Stories Review 2022
- Structs in Other Modules Related to Battles 2022
- Stat Changes Design Document
- Run Function Design Document
- CLI Integration Design Document
- Move Changes Design Document
- Unstubbing Stubs Design Document
- Battle Items and Equipment Design Document
- Battle Item Stats
- Battles Demo Design Document
- Battles Testing Moves, Items, and Equipment Design Document
- Sound integration with battle (design document)
-
Custom Actions
-
Custom Scripts
-
DSL
-
CLI
-
Enhanced CLI
-
Game-State
-
Graphics
- Design Plan
- Design document for integrating split screen graphics with chiventure
- GDL (Graphical Description Language)
- Graphics Sandbox
- Design Document for NPC Graphics and Dialogue
- Feature Wishlist (Spring 2021)
- Installing and Building raylib on a VM
- LibSDL Research
- Module Interactions
- Working with Raylib and SSH
- raylib
- GDL
-
Linking the Libzip and Json C to chiventure on CSIL machines
-
Lua
-
NPC
- Dependencies: Player class, Open world, Battle
- Action Documentation
- Design Document for NPC Generation in Openworld
- Design and Planning
- Establishing Dependencies
- Implementation of Custom Scripts
- Independent Feature: NPC Movement Design Document
- Player Interaction Design and Planning
- Dialogue
- Design Document for NPC Dialogue and Action Implementation
- Loading NPCs from WDL Files
- NPC Battle Integration Design Document
- NPC Battle Integration Changes Design Document
-
Open World
- Autogeneration and Game State
- Deciding an integration approach
- Designing approach for static integration into chiventure
- Feature Wishlist
- Generation Module Design layout
- Potential connections to the rest of chiventure
- Single Room Generation Module Design
- Source Document
- User Stories
- World Generation Algorithm Plan
- Loading OpenWorld Attribute from WDL
-
Player Class
-
Player
-
Quests
-
Rooms
-
Skill Trees
- Avoiding soft locks in skill tree integration
- Components of Exemplary Skill Trees
- Design Document and Interface Guide
- Environment interactions based on skill characteristics
- Integrating complex skill (combined, random, sequential, etc.) implementation
- Integration of a Leveling System
- Potential Integration with existing WDL
- Research on game balancing in regards to skill trees
- Research on skill tree support in modern day game engines
- SkillTree Wiki Summary
- Skilltree "effect" implementation and roadmap
- Summary of md doc file for skilltrees
- Design ideas in connection to other features
- Summary of Skill Tree Integration 2022
- The Difficulty of the Reading the World
- Complex Skills Summary
-
Sound
-
Stats
-
WDL