[Solved] Hide/show interface elements while game is running.
TBear
30 Dec 2014, 21:12Hi,
I am working on a game where I want to mix text adventure elements and game book elements (Parts are decisions through links, others with command input). This means that I need to hide the command bar and other interface elements, through scripts in the game and show them again later.
My problem is I have difficulties getting this to work in practice.
I have tried setting the following game attributes
but it did not work for me.
I also attempted to set the stylesheet of the html elements through java script by setting the style but I have to admit, I am not very good with js and couldn't get it to work.
getElementById("txtCommandDiv").style.display = "none";
If somebody could assist me with this issue I would be extremely grateful.
I am working on a game where I want to mix text adventure elements and game book elements (Parts are decisions through links, others with command input). This means that I need to hide the command bar and other interface elements, through scripts in the game and show them again later.
My problem is I have difficulties getting this to work in practice.
I have tried setting the following game attributes
game.showpanes = false
game.showcommandbar = false
but it did not work for me.
I also attempted to set the stylesheet of the html elements through java script by setting the style but I have to admit, I am not very good with js and couldn't get it to work.
getElementById("txtCommandDiv").style.display = "none";
If somebody could assist me with this issue I would be extremely grateful.
HegemonKhan
30 Dec 2014, 21:17hopefully this has the info that you need:
viewtopic.php?f=10&t=4853&hilit=hiding+command+bar
I hope one of my links, goes to another post by Jay~Pixie that answers it more directly... they have some post that does... somewhere.. anyways, lol.
viewtopic.php?f=10&t=4853&hilit=hiding+command+bar
I hope one of my links, goes to another post by Jay~Pixie that answers it more directly... they have some post that does... somewhere.. anyways, lol.
TBear
30 Dec 2014, 21:29Thanks for the quick response. I followed a few of the links in the post you linked which hinted at the "request" feature. I found the solution here: http://docs.textadventures.co.uk/quest/ ... quest.html
For future reference, the solution:
request (PanesVisible, "disabled")
request (Hide, "Command")
For future reference, the solution:
request (PanesVisible, "disabled")
request (Hide, "Command")
Silver
30 Dec 2014, 21:50The hide command bar is now in my muscle memory. A bit of code, eh, HK? 

HegemonKhan
30 Dec 2014, 22:06chuckles, I haven't used 'Request (Hide..whatever,lol)' code yet myself, laughs 
but, ya, add more 'code muscle memory', and at some point... you'll be weened off of the GUI~Editor (muwahaha) ... hehe
(though advancing in coding ability... that's the hard part... argh!)

but, ya, add more 'code muscle memory', and at some point... you'll be weened off of the GUI~Editor (muwahaha) ... hehe

(though advancing in coding ability... that's the hard part... argh!)
TBear
30 Dec 2014, 22:11Seems I was a bit to eager adding that "[Solved]".
I need some more help.
Is it possible to enable/disable or show/hide the map, if one is using that.
And the same for hyperlinks. I don't want to have hyperlinks when I have a part of the story as text adventure, but I do want them when I have a part as "game book", since I use this guide (viewtopic.php?f=18&t=4772&p=33055&hilit=text+adventure+as+gamebook#p33055) as a starting point.
Thanks again.
I need some more help.
Is it possible to enable/disable or show/hide the map, if one is using that.
And the same for hyperlinks. I don't want to have hyperlinks when I have a part of the story as text adventure, but I do want them when I have a part as "game book", since I use this guide (viewtopic.php?f=18&t=4772&p=33055&hilit=text+adventure+as+gamebook#p33055) as a starting point.
Thanks again.
Silver
30 Dec 2014, 22:24What are you using the gambook part for? I've decided that part of my game will be in gamebook mode. Basically I want conversations to work as they do in RPG games rather than open ended. I haven't done this yet but how I'm *hoping* to solve this is to disable the parser and have the conversation structured in rooms like would happen in twine. Then I can use aliases on exits and call them using the text processor. I have no idea if this will work... in fact I should probably start experimenting with it soon. But it involves never having hyperlinks enabled and just calling on them when needed. Um. No idea about disabling hyperlinks or the map though, sorry.
HegemonKhan
30 Dec 2014, 23:15It definately can be done, but I don't know of any sources (posts) for you directly, but for the: map~grid, you can search for it in the wiki:
http://docs.textadventures.co.uk/quest/
( there's a search text box under 'documentation', which you can type in 'grid' or 'grid_' or 'map' )
http://docs.textadventures.co.uk/quest/ ... layer.html
http://docs.textadventures.co.uk/quest/ ... tions.html (scroll down to 'grid_' to see all the functions for it)
http://docs.textadventures.co.uk/quest/ ... a_map.html
http://blog.textadventures.co.uk/2012/0 ... quest-5-3/
etc links.
http://docs.textadventures.co.uk/quest/
( there's a search text box under 'documentation', which you can type in 'grid' or 'grid_' or 'map' )
http://docs.textadventures.co.uk/quest/ ... layer.html
http://docs.textadventures.co.uk/quest/ ... tions.html (scroll down to 'grid_' to see all the functions for it)
http://docs.textadventures.co.uk/quest/ ... a_map.html
http://blog.textadventures.co.uk/2012/0 ... quest-5-3/
etc links.
TBear
02 Jan 2015, 10:36@Silver
Missed your post earlier. For the moment I am just toying with the idea of using gamebook hyperlinks for explaining backstory, and allowing the player to have some influence on the back story. Kinda difficult though, because I can't just change what the player has in his inventory halfway through the game, because of a flashback.
@HegemonKhan
Thanks, I had a look at the links, especially grid_ShowCustomLayer (false), but I couldn't get it to hide the map. For now I'll simply disable the map and then I may revisit this issue later if I think I urgently need the map.
I also found out about the hyperlinks:
game.enablehyperlinks = boolean
Missed your post earlier. For the moment I am just toying with the idea of using gamebook hyperlinks for explaining backstory, and allowing the player to have some influence on the back story. Kinda difficult though, because I can't just change what the player has in his inventory halfway through the game, because of a flashback.
@HegemonKhan
Thanks, I had a look at the links, especially grid_ShowCustomLayer (false), but I couldn't get it to hide the map. For now I'll simply disable the map and then I may revisit this issue later if I think I urgently need the map.
I also found out about the hyperlinks:
game.enablehyperlinks = boolean
Silver
02 Jan 2015, 11:00You can change a player's inventory though.