Is there anything like an "AGS Best Practices" document for coding novices that suggests ways to avoid shooting oneself in the foot? I've just run into an issue.
When I edit the interactions for a region in AGS 2.72, and I want a response to an attempt to use an inventory item on an object, I can either use "Conditional - If Inventory Item Was Used" and pick an Inventory ID number, or manually script in something like this:
Code: ags
The problem is, neither solution seems ideal. The use of ID numbers means that any renumbering of the inventory will turn my code into a huge mess, but using a script means that I have do dive into the scripts to edit messages. Is there a smarter solution that I'm missing?
When I edit the interactions for a region in AGS 2.72, and I want a response to an attempt to use an inventory item on an object, I can either use "Conditional - If Inventory Item Was Used" and pick an Inventory ID number, or manually script in something like this:
String nameofused = player.ActiveInventory.Name;
if ((nameofused == "Flint") || (nameofused == "Torch")) {
Display("Sliding down a flaming railing would be a neat trick, but the thing just won't light.");
(.. etc...)
The problem is, neither solution seems ideal. The use of ID numbers means that any renumbering of the inventory will turn my code into a huge mess, but using a script means that I have do dive into the scripts to edit messages. Is there a smarter solution that I'm missing?