More than one 'custom status panes'?

Hello community!

I "made" (read: copy/paste and modified) a custom status pane (Se screenshot).
It works like a charm and adds a new layer of... well... anxiety to my game.




My questions are:
#1
Can one have more than one custom status panes?
I'd like to have another just like this one but green and named "Hope".
(yeah I know, I know, I could just try but since I'm not a coder it took me forever to make the "anxiety-one" work and I would like to know if it's possible before doing that again.

#2
Does anyone know who wrote this: http://docs.textadventures.co.uk/quest/custom_panes.html
I'd very much like to give him/her credit in the game, like I have all of you peeps who've helped me along the way!


I wrote it.

If you are good at JavaScript you can have as many custom panes as you like...

Otherwise, how about having just one, but displaying two progress bars in it?

s = "<table width=\"100%\">"
s = s + " <tr>"
s = s + "   <td style=\"text-align:right;\" width=\"50%\">Anxiety:</td>"
s = s + "   <td style=\"text-align:left;\" width=\"50%\"><span id=\"anxiety-span\">---</span></td>"
s = s + " </tr>"
s = s + " <tr>"
s = s + "   <td colspan=\"2\" style=\"border: thin solid;background:white;text-align:left;\">"
s = s + "   <span id=\"anxiety-indicator\" style=\"background-color:black;padding-right:200px;\"></span>"
s = s + "   </td>"
s = s + " </tr>"
s = s + " <tr>"
s = s + "   <td style=\"text-align:right;\" width=\"50%\">Hope:</td>"
s = s + "   <td style=\"text-align:left;\" width=\"50%\"><span id=\"hope-span\">---</span></td>"
s = s + " </tr>"
s = s + " <tr>"
s = s + "   <td colspan=\"2\" style=\"border: thin solid;background:white;text-align:left;\">"
s = s + "   <span id=\"hope-indicator\" style=\"background-color:black;padding-right:200px;\"></span>"
s = s + "   </td>"
s = s + " </tr>"
s = s + "</table>"

JS.setCustomStatus (s)
if (HasScript(player, "changedhope")) {
  do (player, "changedhope")
}
if (HasScript(player, "changedanxiety")) {
  do (player, "changedanxiety")
}

And:

player.changedhope => {
  JS.eval ("$('#hope-span').html('" + game.pov.hope + "/" + game.pov.maxhope + "');")
  JS.eval ("$('#hope-indicator').css('padding-right', '" + (200 * game.pov.hope / game.pov.maxhope) + "px');")
}
player.maxhope = 70
player.hope = 70

player.changedanxiety => {
  JS.eval ("$('#anxiety-span').html('" + game.pov.anxiety + "/" + game.pov.maxanxiety + "');")
  JS.eval ("$('#anxiety-indicator').css('padding-right', '" + (200 * game.pov.anxiety / game.pov.maxanxiety) + "px');")
}
player.maxanxiety = 70
player.anxiety = 70

I am just guessing what attribute names you are using, so check!


@The Pixie

I almost suspected you did. You were already in the credits!

AND:
The only thing I had to change were the colours. It's working superiorly!
Thank you so much!

I totally suck at java! And xml. And C+. And.... etc. etc.


@ CheeseMyBaby:

most of the guides/code/libraries/help/documentation/etc are Pixies, wink

Pixie is a machine, hehe :D


what Pixie is doing in his code:

is known as 'concatenation' (literally putting things next to each other), though he's doing it with the custom pane graphics JS code stuff

so Pixie is using concatenation to make (put next to each other) multiple stat bars in one pane/window of JS graphic coding


concatenation vs addition, example concepts:

Addition:
5 + 5 = 10
55 + 55 = 110

Concatenation:
"5" + "5" = "55"
"55" + "55" = "5555"

"mama" + "mia" = "mamamia"
"mama" + "5" = "mama5"
"mama" + "5" + "mia" = "mama5mia"

"mama " + "mia" = "mama mia" // hard to see, but I got: "mama{SPACE}" + "mia" = "mama{SPACE}mia"
"mama" + " mia" = "mama mia" // hard to see, but I got: "mama" + "{SPACE}mia" = "mama{SPACE}mia"
"mama" + " " + "mia" = "mama mia" // hard to see, but I got: "mama" + "{SPACE}" + "mia" = "mama{SPACE}mia"

the 'SPACE/WHITE_SPACE' acts just like (technically/actually it IS) a letter/number character/symbol, but only within/as a String Value only


for an example:

example_string_variable = "1"
msg (example_string_variable)
// output: 1

example_string_variable = example_string_variable + "2"
msg (example_string_variable)
// output: 12

example_string_variable = example_string_variable + "3"
msg (example_string_variable)
// output: 123

example_string_variable = example_string_variable + "4"
msg (example_string_variable)
// output: 1234

example_string_variable = example_string_variable + "_1234"
msg (example_string_variable)
// output: 1234_1234

// ------------------------------------------

example_string_variable = "1"
msg (example_string_variable)
// output: 1

example_string_variable = "2" + example_string_variable
msg (example_string_variable)
// output: 21

example_string_variable = "3" + example_string_variable
msg (example_string_variable)
// output: 321

example_string_variable = "4" + example_string_variable
msg (example_string_variable)
// output: 4321

example_string_variable = "4321_" + example_string_variable
msg (example_string_variable)
// output: 4321_4321

another example of concatenation application/usage:

player.alias = ""
player.full_name_string_attribute = ""

msg ("(First) Name?")
get input {
  player.alias = result
  player.full_name_string_attribute = result
  ask ("Do you have/want a Middle Name?") {
    if (result) {
      msg ("Middle Name?")
      get input {
        player.full_name_string_attribute = player.full_name_string_attribute + " " + result
      }
    }
    ask ("Do you have/want a Last Name?") {
      if (result) {
        msg ("Last Name?")
        get input {
          player.full_name_string_attribute = player.full_name_string_attribute + " " + result
        }
      }
      msg ("Your (First) Name is: " + player.alias)
      msg ("Your Full Name is: " + player.full_name_string_attribute)
    }
  }
}

@hegemonkhan
I'll need a bigger head to fit all this amazing knowledge!
Thanks man!


Log in to post a reply.

Support

Forums