Making a character creation/level up menu

ArtWizard
05 Dec 2013, 18:59
I was thinking as a new user... Is there a way to create a menu like in attached pic using basic quest utilities? Or can I somehow do it with javascript?
chargen.JPG

george
06 Dec 2013, 01:50
That's a good question. Do you want the player to use the screen with the keyboard or is just the mouse OK?

ArtWizard
06 Dec 2013, 13:39
george wrote:Do you want the player to use the screen with the keyboard or is just the mouse OK?


I was thinking just mouse.

george
06 Dec 2013, 15:12
I don't have time to try this out right now, but I'm thinking that yes you'll want to use Javascript to update the stat values 'in place' so to speak. I don't think you can do that in Quest (you'd need to reload the whole screen or something like that).

jaynabonne
07 Dec 2013, 11:36
Here's a kind of clunky way to do it, using Quest stuff. The trick is using commands to change the values. You could have a separate command for each link, but I tried using common "Inc" and "Dec" commands to make it simpler. You could probably make a cleaner version with HTML/JavaScript.

<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="AttributeScreen">
<gameid>4f057de8-9f23-4b22-96a5-9f1fe4ac65e2</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<enter type="script">
ChooseAttributes
</enter>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<strength type="int">0</strength>
<agility type="int">0</agility>
<intelligence type="int">0</intelligence>
</object>
</object>
<command name="IncCommand">
<pattern>Inc #text#</pattern>
<script>
value = GetAttribute(player, text)
set(player, text, value+1)
ChooseAttributes
</script>
</command>
<command name="DecCommand">
<pattern>Dec #text#</pattern>
<script>
<![CDATA[
value = GetAttribute(player, text)
if (value <> 0) {
set(player, text, value-1)
}
ChooseAttributes
]]>
</script>
</command>
<function name="ChooseAttributes"><![CDATA[
ClearScreen
msg ("Strength: {command:Dec strength:<} {player.strength} {command:Inc strength:>}")
msg ("Agility: {command:Dec agility:<} {player.agility} {command:Inc agility:>}")
msg ("Intelligence: {command:Dec intelligence:<} {player.intelligence} {command:Inc intelligence:>}")
]]></function>
</asl>

ArtWizard
08 Dec 2013, 17:27
jaynabonnes code helped a quite a lot. I was able to hack it to my own needs and now it works just the way I like it to. Thanks a lot!