Hyperlinks

Spindraft
26 Dec 2013, 15:56
Why do hyperlinks only appear to work in the main "look at" section under the object "set up" tab? I am trying to set this dialogue up in another script box (such as verb or in a function script) but no matter how I input it the entire line is printed out with no hyperlinks.

This is the way it is done in the objects "look at" section
Not really knowing what the reaction of this gruff, shadowy person might be you speak in a cautioned voice, asking about {object:fog, wall, corridor, door, stranger}


When I put this in a any other script box it does not work, why?

TriangleGames
26 Dec 2013, 17:20
There is a way to do that, but I was struggling to think how to explain it properly. Instead, see if this page from the documentation helps.

If it still isn't doing what you want, please provide a specific example of what you're doing that is NOT working so we can look at that.

jaynabonne
26 Dec 2013, 17:50

{object:fog, wall, corridor, door, stranger}



That will not work. You have to list the objects out separately:

{object:fog} {object:wall} {object:corridor} {object:door} {object:stranger}


Are you sure that's working for you?

Spindraft
26 Dec 2013, 19:35
It never worked with the multi list inside one bracket, I just copied the one I was trying to use. I never thought to separate them but that still does not explain why the code will not work in the various script boxes like when you want to add a script to a verb or a function or otherwise. When I put the code anywhere except the in the "look" description of the objects set up tab it prints it out as part of the text. I found a way to create the hyperlink using the command reference but when you click on the link in game "it doesn't understand". I have tried placing a response in every conceivable place within the command as well as in the verb section and the ask/tell (I want this separate from an actual ask/tell though).

It goes like this

{once:Overcoming your initial shock you begin to formulate many questions you would like to ask this gruff, shadowy stranger.} {object:stranger}


Click on "stranger"

SwitchOn (leapinter2b)
NewText (speak)

msg ("Not really knowing what the reaction of this gruff, shadowy person might be you speak in a cautioned voice, asking about {command:leapinterdoor:the door}")


click on "the door"

msg ("You ask'" + if there is an exit from this corridor? + "'")


The function is listed as type "string"
The command has a pattern of "the door #text#" but this is only because "regular expression did not work either and this is what is set to right now.

I have followed the directions both in wiki and on forum.

The deal is I only want these links to show when certain things have happened. I am still trying to figure out menu's and lists.

jaynabonne
26 Dec 2013, 19:47
If you could provide a small game sample (as in an attached file or complete game in a code box), it will be much easier to work out. I can't work out even how I'd try what you're doing from the smalls snippets you've given. :)

(For example, the last snippet you posted won't work, as you have literal text outside quotes.)

HegemonKhan
26 Dec 2013, 19:48
this is way above me with the in-text parsing Commands, but if you say it displays everything, than *possibly* it might be that you're leaving it (the scripts, within the GUI~Editor) as:

Print a [MESSAGE] = everything is returned~recognized as text (a string)

whereas you should change it to:

Print a [EXPRESSION] = Commands and Attributes are recognized as such (as non-text), and what is within the "____" marks is recognized as text

-------------

if you want help with menus and lists, I'd be glad~happy to help you with them! :D

Spindraft
26 Dec 2013, 20:14
This is the portion of code leading up to the problem at hand.

 <object name="stranger">
<inherit name="editor_object" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<scenery />
<gender type="string"></gender>
<article type="string"></article>
<alt type="stringlist">
<value>owner of voice</value>
<value>person</value>
<value>man</value>
<value>owner of deep voice</value>
</alt>
<displayverbs type="stringlist" />
<usestandardverblist type="boolean">false</usestandardverblist>
<useindividualverblist type="boolean">false</useindividualverblist>
<look><![CDATA[{once:Overcoming your initial shock you begin to formulate many questions you would like to ask this gruff, shadowy stranger.} {object:stranger}<br/><br/>]]></look>
<leapdoor type="simplepattern">leapinterdoor</leapdoor>
<speak type="script">
SwitchOn (leapinter2b)
NewText (speak)
</speak>
<ask type="scriptdictionary">
<item key="corridor">
msg ("A yellow corridor")
</item>
<item key="wall">
msg ("as")
</item>
<item key="fog">
msg ("as")
</item>
<item key="door">
msg ("as")
</item>
<item key="mist">
msg ("as")
</item>
<item key="cloud">
msg ("as")
</item>
<item key="you">
msg ("as")
</item>
<item key="person">
msg ("as")
</item>
<item key="stranger">
msg ("as")
</item>
</ask>
</object>
<object name="wall3">
<inherit name="editor_object" />
<alias>wall</alias>
<alt type="stringlist">
<value>wall</value>
<value>walls</value>
<value>boundary</value>
<value>border</value>
<value>edge</value>
</alt>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<scenery />
<gender type="string"></gender>
<article type="string"></article>
<look>The wall here is very hard and covered with a thick, wavy, yellow cloud which seems to mock the darkness of the corridors other wall.</look>
<kick>You nearly break all of your toes against the hard surface.</kick>
<rub>The wall is very strong, it feels like it is made from huge, well crafted stone blocks forming a formidable barrier.</rub>
<touch>The wall is very strong, it feels like it is made from huge, well crafted stone blocks forming a formidable barrier.</touch>
<punch>Left with nothing but bloody knuckles you discontinue this absurd behaviour.</punch>
</object>
<object name="leapinter2b">
<inherit name="editor_object" />
<inherit name="switchable" />
<visible type="boolean">false</visible>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<scenery />
<gender type="string"></gender>
<article type="string"></article>
</object>
</object>
<verb>
<property>ask</property>
<pattern>ask</pattern>
<defaultexpression>"You can't ask " + object.article + "."</defaultexpression>
</verb>
<command name="leapinterdoor">
<unresolved type="string"></unresolved>
<pattern>door#text#</pattern>
<script>
msg ("Is there an exit from this corridor?")
</script>
</command>
<function name="NewText" parameters="speak" type="string">
msg ("Not really knowing what the reaction of this gruff, shadowy person might be you speak in a cautioned voice, asking about the {object:leap door}")
</function>
</asl>


I am trying to call a function that kicks in a command for the chosen link that is clicked. Eventually I want to be able to use this as an alternative to having to type ask questions all the time. In other words I want when the player looks at an NPC it triggers a response with a hyperlink for the character that when clicked now shows in its menu an option for "speak to", If this is clicked then all of the questions presently available to that NPC pop up in a clickable menu or list that the player can simply choose from. Clicking any of these ? links will trigger the conversation for that topic.

jaynabonne
26 Dec 2013, 20:55
Based on what you had said before as well, is the problem that, while hyperlinks work for what's in the stranger's "look" attribute, it is not working in NewSpeak? (Absent a small working example where I can *see* the problem, I'm forced to make some guesses!)

I notice that you have {object:leap door}, but I can't see an object named "leap door". I did some tests, and I found two things:
1) If you reference an object that doesn't exist, then it actually prints out the entire {object:xxx} part. Since you're not seeing that, I'll assume the object exists.
2) More to the point, if the object exists but *does not have any verbs*, then it is not shown as a hyperlink, since (I suspect) there is nothing to do when you click on it. So if your object "leap door" has no verbs, you won't see a link.

What you might want to try is having a simple test case (perhaps in the look script) where you have seen hyperlinks and then put in the various objects and make sure they actually have links in that context. Once you know they do actually show up with hyperlinks in that known good spot, then try moving them to the new place. If that doesn't work, then please give code for both places, along with the full object definition.

Spindraft
26 Dec 2013, 21:18
Sent you a PM jaynabonne

Sent you one as well HegemonKhan

Spindraft
27 Dec 2013, 00:36
Is it possible to write code in C++ and paste it into the code here or no?

HegemonKhan
27 Dec 2013, 05:01
I don't know if quest recognizes C++, but it at least can use JS (Java Script). I don't know coding languages yet (aside from quest's own unique coding language, lol), so someone else can give you an accurate answer if you can use C++ or not, as I can't.

Quest uses XML (or at least that's what you choose for the language when using, ie within, notepad++, for quest coding), but I've no idea if XML and C++ are compatible or not...

this site's "Developer Forum": viewforum.php?f=15
"For core library, C#, VB.NET, ASP.NET or JavaScript developers contributing to the Quest open source project"

notepad++ link: http://notepad-plus-plus.org/

Pertex
27 Dec 2013, 12:41
Spindraft wrote:Is it possible to write code in C++ and paste it into the code here or no?


No, this is not possible. You can only use the build in aslx scripting language within the editor. The game engine is written in C# and VB, so you could modify the Quest engine and build some more aslx scripting components.

jaynabonne
27 Dec 2013, 13:14
You can also use JavaScript for UI related things, but you have no access to the Quest object model at that level. It is quite handy if you want to do snazzy effects, though.

Spindraft
27 Dec 2013, 21:22

I'm not sure why, but I didn't get the email. (I even looked in my Spam folder.) Could you try again?

As far as the command goes, if it's set up properly, you should be able to just type it in at the command prompt as well (e.g. "leapinterdoor"). Be sure to set your command pattern to "leapinterdoor" to match what you're looking for.

BTW, if you're more familiar with C++, you will probably appreciate writing Quest outside the editor GUI interface. It may be good for novices, but I would go insane trying to code that way. ASLX files are just XML, so you can use any text editor you like (I use Visual Studio Express 2012). You can do some fairly powerful things with the scripts, once you learn the language. I'd be happy to assist a fellow coder if you'd like to go that route.



Awesome, should have figured to call a command as you would a function, the tutorial does not give clear info on this but such is the nature of coding tutorials.