use ... with ... via point-n-click

Pertex
30 Dec 2011, 15:36One of the most requestet and expected feature in Q5 is to handle commands like use...with.. or give...to... via hyperlinks. As long this feature is not implemented, you can build your own commands with menus. I attached a simple example.
thesynapse
30 Dec 2011, 20:06Brilliant! Just what I was asking about previously.
How do I look at and use your code example? Is there some kind of plug-in registry?
Cheers!
How do I look at and use your code example? Is there some kind of plug-in registry?
Cheers!

Pertex
31 Dec 2011, 16:21thesynapse wrote:
How do I look at and use your code example? Is there some kind of plug-in registry?
open your game with an external editor and copy
<command name="use this">
<pattern>Use this #text#</pattern>
<script>
usethis (text)
</script>
</command>
<function name="usethis" parameters="text"><![CDATA[
myList = NewStringList()
foreach (element, ScopeReachable ()) {
if (element <> player and element.name <> text) {
list add (myList, element.name)
}
}
label = "use "+text+ " with"
x = ShowMenu ( label , myList , true )
if ( x = null) {
object2 = GetObject(text)
msg (DynamicTemplate("DefaultUseOn", object2, object2))
}
else {
msg ("> with " + x)
label = label + " " + x
HandleCommand (label)
}
]]></function>
to your file. Then you have to add "Use this" to Display verbs/Inventory verbs in the object-tab of your objects.