Howdy, Stranger!

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

Shop item listing

edited February 2016 in Help! with 2.0
Hi!
Sorry if a similar question's been answered already, only checked the first few pages in the general and sugarcube sections.

Anyway, I have a very basic inventory and shop system (they work fine)(Twine 2, SugarCube 1). Items look something like this:
Item 1
Item 2
Item 3

However, say, the player buys Item 2, there's still a gap between Item 1 and 3, like this:
Item 1

Item 3

What I'd like it to look like is this:
Item 1
Item 3

Is there an easy-ish way to do this? Thanks in advance!

Here's a code snippet just in case: (spoiler tag didn't want to work for me, sorry)
<<if $PCArmor.NormHelmet is 1>>\
<<elseif $Cash gte 1500>>\
ArmorShop2][($PCArmor.NormHelmet to 1) and ($Cash -= 1500) Description here... 1500 coins\
<<else>>ArmorShop][alert("You don't have enough money!") Description here... 1500 coins\
<<endif>>\

Comments

  • Enclose in <<nobr>><<endnobr>> tags and insert explicit <br> tags exactly where you want them.
  • TheLag wrote: »
    Here's a code snippet just in case: (spoiler tag didn't want to work for me, sorry)
    Use the code tag instead of spoiler, it is the C button in the tool-bar.
  • edited February 2016
    With nobr there's still an empty line after the user buys the item though. Guess I'll add an "Out of stock" or something to the line, seems simpler than embedding a bunch of ifs.
    Thanks for the answer tho!
  • Hmmm. Got the nobr's in the right place?
    <<nobr>>
    <<if $PCArmor.NormHelmet is 1>>
    <<elseif $Cash gte 1500>>
    <br>[[Normal helmet|ArmorShop2][($PCArmor.NormHelmet to 1) and ($Cash -= 1500)]] Description here... 1500 coins
    <<else>><br>[[Normal helmet|ArmorShop][alert("You don't have enough money!")]] Description here... 1500 coins
    <<endif>>
    <<if $PCArmor.NormShield is 1>>
    <<elseif $Cash gte 1500>>
    <br>[[Normal shield|ArmorShop2][($PCArmor.NormShield to 1) and ($Cash -= 1500)]] Description here... 1500 coins
    <<else>><br>[[Normal shield|ArmorShop][alert("You don't have enough money!")]] Description here... 1500 coins
    <<endif>>
    <<endnobr>>
    
  • That was it, I put the br in the wrong place.
    Thanks a bunch!
Sign In or Register to comment.