Forum rules - please read before posting.

Pulling hotspot labels from an external URL text file?

How would someone do this?  I've tried scripting this but it never seems to work for me.  I've been working on this for a few hours, but there's no simple explanation available, it seems.

The reason I need this is because I have someone who wants to be able to edit a 'virtual tour' - a gallery with custom-loaded art items and customizable text overlays (i.e. hotspot labels) after it has been output to HTML5/WebGL, and while I've managed to figure out how to load textures from a URL, for whatever reason getting this to work for hotspot labels is causing all sorts of issues for me.

I just thought I'd throw this out there and see if anyone here has already done something like this, and (perhaps) could assist with solving this problem.

Comments

  • Have you visited the scripting guide?  A Hotspot's label can be set by changing the value of the hotspotName string variable.
  • I've tried working with the reference, and no matter what I try (and I've tried messing with the code in many different ways) it throws an error.  I'm not very experienced with C# yet which is why AC was so important to me to have as a tool.  (And PlayMaker!)  I'm more of a 3d artist/animator/texture artist and my coding skills are weak by comparison.

    Keep getting an error on one line of my script saying 'example_0001' is undefined, even though it is the name of the hotspot object in the level, that my script is attached to as a component of the example_0001 object.

    I have defined name0001 as a piece of text data pulled from a web document, and that works correctly.  But example_0001, which is the name of the hotspot object itself, isn't?

    Here's my line of code near the end of the script that throws an error.  I've tried a lot of different ways of writing it and none of them work so far.  At this point my brain seems to be kind of stuck and I'm getting quite frustrated.  I get the feeling I'm missing something very basic and obvious but not sure what that is:

         AC.Hotspot.example_0001.SetName(name0001, -1);

    BTW, I am running out of time on this project.  This really needs to be solved and I'm prepared to pay a few $ if necessary, to have the issue solved.  I don't have much on hand but I can probably justify giving $10 or so to anyone who can explain how to correctly write this line of code assigning the value of 'name0001' to the hotspot 'example_0001'.
  • While this isn't a forum for learning general coding, you're trying to manipulate an undefined variable.

    However, if the script is attached to the same Hotspot you wish to affect, you can just use GetComponent:
    GetComponent ().SetName (name0001, -1);
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.