Tips and Tricks wishlist
Posted: Thu Nov 26, 2020 8:27 am
I've been exploring the new tips and tricks functionality, and have compiled a small list of features and/or changes that I would like to see surrounding them. Since there's no documentation for them yet, it's been a bit of a challenge.
Before the list, I want to point something out to the modders reading this: there are undocumented and unused properties on tips and tricks prototypes called init_file and update_file. These can be used in place of init and update, and allow you to write the simulation code in a separate file, taking advantage of language server features and decluttering the prototype definitions.
Now, to the list:
1. Enable require to work in the simulation scripts. This is extremely important, as without this, you literally can't make tips to show off any sort of custom mod functionality. It also means you can't use any sort of external util files for simulations.
2. Separate the simulation functions into a new simulation global and add runtime documentation for them. That would make it clear that those functions only work in simulations.
3. New trigger type: held item. I would like a trigger that will unlock the tip when the player holds a specific item for the first time.
4. Custom triggers via control scripting. The idea is to add a function to the player that signals to unlock the specified tip. My usecase is to unlock a tip after a player uses my mod's item for the first time, but there are infinite possibilities with a function like this.
I will update this post if I think of anything more. I encourage others who are experimenting with tips and tricks to post their thoughts here as well, to promote further discussion.
Before the list, I want to point something out to the modders reading this: there are undocumented and unused properties on tips and tricks prototypes called init_file and update_file. These can be used in place of init and update, and allow you to write the simulation code in a separate file, taking advantage of language server features and decluttering the prototype definitions.
Now, to the list:
1. Enable require to work in the simulation scripts. This is extremely important, as without this, you literally can't make tips to show off any sort of custom mod functionality. It also means you can't use any sort of external util files for simulations.
2. Separate the simulation functions into a new simulation global and add runtime documentation for them. That would make it clear that those functions only work in simulations.
3. New trigger type: held item. I would like a trigger that will unlock the tip when the player holds a specific item for the first time.
4. Custom triggers via control scripting. The idea is to add a function to the player that signals to unlock the specified tip. My usecase is to unlock a tip after a player uses my mod's item for the first time, but there are infinite possibilities with a function like this.
I will update this post if I think of anything more. I encourage others who are experimenting with tips and tricks to post their thoughts here as well, to promote further discussion.