[SOLVED: Thread can be ignored. Solution at the end.]
Hello folks, I need some assistance and would appreciate your help if have the time and correct mood.
I'm working with an program called novelty, which is basically running with angelscript (some variation of it???)
You need to know (if you don't already do): there are buttons in novelty which are some kind of a subclass of objects.
Now novelty gives us directly the possibility to change the caption of the button to change it (in theory) by script.
This is exactly what I wanna do.
With that SetCaption(...) method-thing
-> More information here: www.visualnovelty.com/docs/script_button.html
But as I'm mainly a newby in programming, I totally fail at exactly understanding this manual, even the samples wont bring me further.
My exact problem:
Via novelty I already prepared a button to show up at a certain point.
The button is given a script which automatically runs, as soon as the button shows up.
And I want this script to change the caption of the button.
So something between the clamps:
event ButtonCaptionRenamer.OnShow
{
...
}
But I don't know what I should add here..
...I'm pretty sure it's something really simple, but as it seems, I don't understand the whole thing good enough.
Maybe I need to use those handles @ but I have absolutely no idea how to do this.
The idea why I wanna do this is to fill a visual list of buttons with names (existing as strings) into the captions of the buttons.
(The captions of prepared buttons should show the names(strings)). But the names vary from time to time,
because they are alphabetically sorted at certain points, so the captions must be controlled by a script.
The whole scripted sorting-process works already, now I only need to get those damn strings into the button caption.
Thanks for your help in advance.
For more background-Informations to novelty:
Objects: www.visualnovelty.com/docs/script_object.html
Events: www.visualnovelty.com/docs/script_events.html
Game variables: www.visualnovelty.com/docs/script_vars.html
index: www.visualnovelty.com/docs/index.html
EDIT:
I finally found a solution by creating a handle, so you don't need to waste time with this thread. If you are interested in the solution, here it is:
event ButtonCaptionRenamer.OnShow
{
Button@ btn = Scene.GetObject("Button") as Button;
btn.SetCaption("BLA");
}
Explanation: As the button was put in the scenery, it has gotten the caption "Button" given by the designer (and as default name). Now, as soon as the Button get's the command to show itself, the caption changes from "Button" to "BLA". Achieved by creating a Buttonhandle (Button@) which is named btn here.