inserting html in 5.4

guzmere
01 Mar 2013, 21:18
Hi I'm trying to insert an html file to clear the header but the error message I'm getting is
Error running script: The 'insert' script command is not supported for games written for Quest 5.4 or later. You can output HTML directly using the 'msg' command instead.
<start type="script">
request (Hide, "Location")
insert ("Header.html")
</start>
Can someone explain this please :D Happy Adventuring :D

sgreig
01 Mar 2013, 22:50
The insert command no longer exists as of Quest 5.4. If you want to include HTML now you have to use it within a msg() command, like:


msg ("<a href="#">This is a link that goes nowhere</a>")

guzmere
02 Mar 2013, 11:22
How would I put that in context when I'm trying to get rid of the header in my game. Would it be something like this:-
"<a href="Header.html"></a>" or better still how do I now hide the header? Thanks :D Happy Adventuring :D

Pertex
02 Mar 2013, 18:38
Copy the complete text from your header.html into a msg. You have to remove all linebreaks, which are in the header.html

guzmere
02 Mar 2013, 19:47
Hi Pertex I'm sorry to be a pain but I truly don't understand that is it possible you could do me an example please Thanks.
:D Happy Adventuring :D
Update I've just sussed it million thanks, but wont it be a bit of a pain if there is a substantial coding in html to bring into the section of the game. Once again many thanks.

Pertex
02 Mar 2013, 22:34
Yes, it's not really comfortable, but at he moment you could do some nice and perhaps some ugly things with Q5.4 :D

jaynabonne
03 Mar 2013, 23:21
I have been having some nice success with direct HTML massaging, and what works well for me is to put the HTML into a string attribute on an object. Then you can format it as you like (not forced to remove line breaks, etc). If you don't have an object handy, you can create one...

Example:

<object name="holder">
<CharLayer>
<![CDATA[
<div id='CharLayer' style='position:absolute; z-index:100; visibility:hidden'>
<font face='verdana, arial, helvetica, sans-serif' size='2'>
<div style='float:left; background-color:#e0e0e0; padding:3px; border:1px solid black'>
<b>Stats</b><br>
Class: {player.classname}<br>
Combat Dice: {player.combatdice}<br>
Armour: {player.armour}+<br>
Wounds: {player.wounds}/{player.maxwounds}<br>
Magic Dice: {player.magicdice}<br>
Speed: {player.speed}<br>
Gold: {player.gold}<br>
<br>
<a href='javascript:void(0)' onclick='hideIt("CharLayer");'>Close</a>
</div>
</font>
</div>
]]>
</CharLayer>
</object>


Then you just do:


msg(holder.CharLayer)

Much nicer than forcing it all onto one line. :)

Pertex
04 Mar 2013, 08:11
great idea! Woudn't you like to add a howto to the wiki with such a popup menu?

jaynabonne
04 Mar 2013, 10:08
I can. Let me get the pieces together. :)

guzmere
04 Mar 2013, 15:13
Nice one Jaynabonne will have a good look at your coding when I get the chance, been in the garden the last two days moving a greenhouse. On my own as usual back aches, shoulders ache,neck aches hands cramping but my feet are ok. Thanks again :D Happy Adventuring :D