Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

[Harlowe]Something Wrong With My Code?

edited October 2016 in Help! with 2.0
In my game I've coded this as my death screen thing:
{<center><big><big><big><big>(color: "black")[(text-style: "shadow")[''The End'']]</big></big></big></big></center>}
<center><small>(color: "red")[Of Your Life]</small></center>

(color: "black")[{(link: "Load Game")[(if: $slot is 1)[(load-game:"Slot A")]
(if: $slot is 2)[(load-game:"Slot B")
(if: $slot is 3)[(load-game:"Slot C")]
]]}
[[Quit To Title ->title]]]

However, when I'm testing it and I die, this is what comes up:

https://twinery.org/forum/utility/thumbnail/971/Uploader/27/7dd960a9928ea47a005a0c09f0a2ea.png

What'sup with that?

Comments

  • I could give you CSS if you want.
  • I'm assuming your question is about the links not appearing in the attached image.

    Try replacing your passage content with the following, it uses named hooks to identify the three sections of your layout (header1, header2, and links)
    |header1>[The End]
    |header2>[Of Your Life]
    
    |links>[ \
    (link: "Load Game")[{
    	(if: $slot is 1)[(load-game:"Slot A")]
    	(else-if: $slot is 2)[(load-game:"Slot B")]
    	(else-if: $slot is 3)[(load-game:"Slot C")]
    }]
    [[Quit To Title->title]] \
    ]
    
    Then use CSS selectors based on the names of the named hooks to style each section.
    tw-hook[name="header1"] {
    	display: block;
    	text-align: center;
    	font-weight: bold;
    	font-size: 200%;
    	color: black;
    	text-shadow: rgb(0, 0, 0) 0.08em 0.08em 0.08em;	
    }
    tw-hook[name="header2"] {
    	display: block;
    	text-align: center;
    	font-size: 70%;
    	color: red;
    }
    tw-hook[name="links"] tw-link {
    	color: black;
    }
    

    note: By default you can't use the (text-color:) or (color:) macros to change the colour of a link because it is hard-wired to be a shade of blue.
  • greyelf wrote: »
    I'm assuming your question is about the links not appearing in the attached image.

    Try replacing your passage content with the following, it uses named hooks to identify the three sections of your layout (header1, header2, and links)
    |header1>[The End]
    |header2>[Of Your Life]
    
    |links>[ \
    (link: "Load Game")[{
    	(if: $slot is 1)[(load-game:"Slot A")]
    	(else-if: $slot is 2)[(load-game:"Slot B")]
    	(else-if: $slot is 3)[(load-game:"Slot C")]
    }]
    [[Quit To Title->title]] \
    ]
    
    Then use CSS selectors based on the names of the named hooks to style each section.
    tw-hook[name="header1"] {
    	display: block;
    	text-align: center;
    	font-weight: bold;
    	font-size: 200%;
    	color: black;
    	text-shadow: rgb(0, 0, 0) 0.08em 0.08em 0.08em;	
    }
    tw-hook[name="header2"] {
    	display: block;
    	text-align: center;
    	font-size: 70%;
    	color: red;
    }
    tw-hook[name="links"] tw-link {
    	color: black;
    }
    

    note: By default you can't use the (text-color:) or (color:) macros to change the colour of a link because it is hard-wired to be a shade of blue.

    But will this make saving not work?
  • Deadshot wrote: »
    But will this make saving not work?
    A story's ability to save is only disabled when you assign a complex object** as the value of a variable, my example does make an assignment to a variable.

    ** The definition of a complex object includes things like the return value of a Changer type macro or Javascript objects like Date. It does not include things like Harlowe's Array, Datamap, and Dataset collection objects.
  • greyelf wrote: »
    Deadshot wrote: »
    But will this make saving not work?
    A story's ability to save is only disabled when you assign a complex object** as the value of a variable, my example does make an assignment to a variable.

    ** The definition of a complex object includes things like the return value of a Changer type macro or Javascript objects like Date. It does not include things like Harlowe's Array, Datamap, and Dataset collection objects.

    OK. Cool. I put a beta of my game on my discussion called 'My New Game' if you wanna check it out.
  • greyelf wrote: »
    I'm assuming your question is about the links not appearing in the attached image.

    Try replacing your passage content with the following, it uses named hooks to identify the three sections of your layout (header1, header2, and links)
    |header1>[The End]
    |header2>[Of Your Life]
    
    |links>[ \
    (link: "Load Game")[{
    	(if: $slot is 1)[(load-game:"Slot A")]
    	(else-if: $slot is 2)[(load-game:"Slot B")]
    	(else-if: $slot is 3)[(load-game:"Slot C")]
    }]
    [[Quit To Title->title]] \
    ]
    
    Then use CSS selectors based on the names of the named hooks to style each section.
    tw-hook[name="header1"] {
    	display: block;
    	text-align: center;
    	font-weight: bold;
    	font-size: 200%;
    	color: black;
    	text-shadow: rgb(0, 0, 0) 0.08em 0.08em 0.08em;	
    }
    tw-hook[name="header2"] {
    	display: block;
    	text-align: center;
    	font-size: 70%;
    	color: red;
    }
    tw-hook[name="links"] tw-link {
    	color: black;
    }
    

    note: By default you can't use the (text-color:) or (color:) macros to change the colour of a link because it is hard-wired to be a shade of blue.

    Hey, I didn't know that you could use hooks in CSS! That's so cool!
  • greyelf wrote: »
    Deadshot wrote: »
    But will this make saving not work?
    The definition of a complex object includes things like the return value of a Changer type macro or Javascript objects like Date. It does not include things like Harlowe's Array, Datamap, and Dataset collection objects.

    Does this mean that the code for my thing which happens everyday would still work?
  • greyelf wrote: »
    I'm assuming your question is about the links not appearing in the attached image.

    Try replacing your passage content with the following, it uses named hooks to identify the three sections of your layout (header1, header2, and links)
    |header1>[The End]
    |header2>[Of Your Life]
    
    |links>[ \
    (link: "Load Game")[{
    	(if: $slot is 1)[(load-game:"Slot A")]
    	(else-if: $slot is 2)[(load-game:"Slot B")]
    	(else-if: $slot is 3)[(load-game:"Slot C")]
    }]
    [[Quit To Title->title]] \
    ]
    
    Then use CSS selectors based on the names of the named hooks to style each section.
    tw-hook[name="header1"] {
    	display: block;
    	text-align: center;
    	font-weight: bold;
    	font-size: 200%;
    	color: black;
    	text-shadow: rgb(0, 0, 0) 0.08em 0.08em 0.08em;	
    }
    tw-hook[name="header2"] {
    	display: block;
    	text-align: center;
    	font-size: 70%;
    	color: red;
    }
    tw-hook[name="links"] tw-link {
    	color: black;
    }
    

    note: By default you can't use the (text-color:) or (color:) macros to change the colour of a link because it is hard-wired to be a shade of blue.

    I've done that, but now the links won't show up.
Sign In or Register to comment.