I am trying to modify the verbcoin template for my game such that it only shows the verbs that are available (ie, have functions attached) for any given object.
I have the code that can grab the object into either a hotspot, object, or character variable. (Let's assume hotspot for now; it's simpler). I have some code which parses the executable for all the functions that exist (mostly). However I have just now realized that htspt.Name does not use the script name, but the hotspot's description
, which means I can only use this if I always give script names that are guessable from the description, but I'd like to not have to do that. (Especially since I was planning on sharing this code).
I know this question was asked here
, but it wasn't answered - the asker was given a different solution for his/her particular issue.
So: Can I get a hotspot's script name from the script?
If it helps to understand my question, here is the code I am currently using:
String obj = "NONE";
if (htspt != null) obj = htspt.Name;
if (chr != null) obj = chr.Name;
if (invobj != null) obj = invobj.Name;
if (obj == "NONE")
interact_button.Visible = false;
look_button.Visible = false;
custom_button1.Visible = false;
talk_button.Visible = false;
interact_button.Visible = General.FunctionExists(obj, "Interact");
look_button.Visible = General.FunctionExists(obj, "Look");
custom_button1.Visible = General.FunctionExists(obj, "PickUp");
talk_button.Visible = General.FunctionExists(obj, "Talk");