Advertisement

novelty : fail to caption buttons via script [solved]

Started by September 08, 2016 02:09 PM
1 comment, last by MakroModus 8 years, 2 months ago

[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.

I'm glad you found the solution.

I noticed that the syntax used in VisualNovelty is a bit different than the default syntax provided by AngelScript. Probably the author of VisualNovelty has made some customizations, or else he might be using some preprocessing to translate the custom syntax into the AngelScript syntax that the script compiler understands.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement

I'm glad you found the solution.

I noticed that the syntax used in VisualNovelty is a bit different than the default syntax provided by AngelScript. Probably the author of VisualNovelty has made some customizations, or else he might be using some preprocessing to translate the custom syntax into the AngelScript syntax that the script compiler understands.

Thanks.

Yeah, you're right. I feel like kind of an bloodhound to search for all the things the programer of novelty has implemented from angelscript and which not - because not everything is documented in his documentation. Some doesn't exist (not implemented), some are renamed, the syntax is different and many other things. Some methods I could only find out via trial and error, typing in something that sounds similar, even looking at case sensitivity.

I would ask the programer directly but it seems that he isn't existing anymore or simply lost interest in his software or doesn't have time, because he never finished it. Which is pretty sad, this software really has some potential and even in it's "unfinished" state, it is the best program I've found for my specific purpose.

Even the community seems to be closed - Because every registrator needs the direct permission from the programer to enter the forum... Too bad he is inactive. Makes me kind of sad.

This topic is closed to new replies.

Advertisement