Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Anyway to change "My Inventory" color?

6 years ago
I can change link colors, hovering over link colors, and fonts in general, but I can't seem to find away to change the "My Inventory" text from black to another color. Does anyone know how? Thanks.

Anyway to change "My Inventory" color?

6 years ago

One possible CSS selector for that would be td h2 (which selects a secondary heading inside a table cell).

Anyway to change "My Inventory" color?

6 years ago
Could you please elaborate on that, or direct me to one of the tutorials that discusses that? Thanks.

Anyway to change "My Inventory" color?

6 years ago

It's the part of CSS that defines what you're styling. In a global script, you'd do something like this:

$PAGETEXT := "<style>
td h2 {
  color: red;
}
</style>" + $PAGETEXT

Anyway to change "My Inventory" color?

5 years ago
Bump. @BradinDvorak

td h2 in the global script successfully changed the font color of My Inventory. So thanks for that. Now I'm on the bigger and better things... two questions, if you don't mind:

(1) If td h2 controls the text of my inventory, what controls the BORDER color? Is it accessible, and if so, why couldn't I do the same thing to change the color of that?

(2) Does anyone know of a hex code color that is transparent? If so, I'd add to the global script that part as well, changing at least the font to transparent, and if possible, the border as well.

Anyway to change "My Inventory" color?

5 years ago
I broke it with this:

$PAGETEXT := "[style]

table {visibility:hidden

}

[/style]" + $PAGETEXT

with brackets replaced by <> obviously

It certainly HID the border. It also hid the entire inventory, including all my items, making it impossible to click on them, lol.

Anyway to change "My Inventory" color?

5 years ago

That's the start of it, but that's just making the table and all of its contents invisible. Fortunately, the way visibility works, you're able to specify elements inside a hidden element to be visible again. This CSS hides and unhides elements to make this:

table, table table tr:nth-child(3) td:nth-child(2) {
  visibility: hidden;
}

table table tr td {
  visibility: visible;
}

Anyway to change "My Inventory" color?

5 years ago

Rather than start a new thread, I'd like to ask a follow up on this. The above script does indeed make the inventory border disappear, which is great, but suppose I still wanted the word "Inventory" to be visible, how could I do that?

I do not care in the slightest how that is accomplished, other than I don't want it looking like a clickable link. If it's adding text after the links at the bottom I'm okay. I may even be cool with it being a dead link, as long as I can remove the dot next to the link for ONLY that link.

Any suggestions are welcome as I investigate this. I noticed you did say you can specify which elements remain visible, but of course I don't know the names of the actual elements.

As usually, thanks for all replies and support.

Anyway to change "My Inventory" color?

5 years ago

Figured it out, never mind. Here is what I added:

table td:nth-child(4) { visibility: visible ; }

So apparently child(4) is the words "My Inventory." So here is my total script, which results in all my items being visible, underneath the word Inventory, with a transparent border (with brackets replacing less than and greater than symbols):

$PAGETEXT :="[style] table, table table tr:nth-child(3) td:nth-child(2) { visibility: hidden; } table table tr td { visibility: visible ; } table td:nth-child(4) { visibility: visible ; } [/style]" + $PAGETEXT

So this one is solved.

Anyway to change "My Inventory" color?

5 years ago

The border is a bunch of images in the edgemost cells of the inventory table. You can't reliably change the actual images with CSS, but you can load secondary images as background content and push the originals out of view (which is what this does using versions with transparent backgrounds). You could use an actual CSS border on the inventory table, too, but you'd still need to hide the original border images.

Transparent hex codes aren't fully supported, but there are other options, including the keyword "transparent" for full transparency and rgba colors (like "rgba(255, 127, 127, .5)") for intermediate values.

Anyway to change "My Inventory" color?

5 years ago
Thanks. But, as it turns out, all of your help in the other thread has (temporarily) superceded the need to make that border invisible. FINALLY GOT THAT STUPID OPTIONS LINK TO WORK, thanks to all of you guys.

Nevertheless, I'll probably have more questions about this later, because I'm still not sure if I want to include items or not in this game. But much appreciated!

Anyway to change "My Inventory" color?

6 years ago
Or go through the horrifically long process of making your own variable item system, which is cracking fun.

Anyway to change "My Inventory" color?

6 years ago
This is what I would do in the first place in a game with a lot of items. Just some 0-1 toggles tucked away behind a nice clean link instead of huge mess of cluttered icons on every page.

Anyway to change "My Inventory" color?

6 years ago
I'm talking all out, filthy javascript to recreate the current item system with way more versatile variable control. It allows you to personalise the item system, make it your own, combine items easily etc.- something I'm still working on (ft. stolen code from BD). Basically Zikara's article but with script that doesn't have errors in.

Uhh, still has cluttered icons though. I guess I could script in an inventory toggle...

Anyway to change "My Inventory" color?

6 years ago

Do you mean this article?

Scripting Variable Items

Anyway to change "My Inventory" color?

6 years ago
Yeah mate, once upon a time I trailed through articles searching for increasingly complex ways to use the advanced editor to equip my main WIP with as much diversity as possible. The variable item system is the holy grail which nobody has actually ever gone to the effort of implementing into a storygame, as far as I'm aware. That's probably because, while it's plain better than the legit item system (especially in the hands of someone creative who can code), it's very long winded to implement.

If you really want to use it though I can give you code that actually works and show you how to use it. Considering making/amending Zikara's article once I properly test it out. If you just want to change the colour, however, then BD has that much, much simpler solution.

Anyway to change "My Inventory" color?

6 years ago
I'm not sure if I'm ready for that, but... I'd be very interested in seeing what you have even if it's beyond me at this point. Also, have you thought about writing another tutorial article based on your update version? That would be pretty cool if site admin would allow it to be published.

Anyway to change "My Inventory" color?

6 years ago
I can give you all the code to copy and paste and a breakdown of what to do. Yes, I probably will get around to making an article for this, and explaining it to you would be fairly useful for making that article actually.

I can show you a very rough-around-the-edges version of the one I'm working on. Test Storygame. Click on this and go to the purple link (ignore the red one, I was going to use that but realised it would take ages to change the links all over again to my updated version).

Try out the 'Pick up ITEM' links and see what you think of the item system. This isn't how it will actually look- in my WIP you just click on pictures to pick up items, not ugly links. You can insert images, but mine are empty as I'm still creating images for my items.

If you're interested, just send a PM my way and I'll see what I can do.

Like I say, can't take much credit for this- most of the code is stolen from/kindly helped by Zikara/BD.

E: Added a 'Pick up all items' link in red. Little buggy but gives you an idea of what an inventory with multiple items would look like. Thought I'd mention the whole look can still be polished a lot, and of course you could toggle the whole inventory on page like it does with the item descriptions if you want.

Anyway to change "My Inventory" color?

6 years ago
Thanks. I would very much appreciate that. I will be sending a PM shortly, and about to look into your test game. I can't say I'll use it just yet, because I'm still learning this site's language, but anything can help.

Anyway to change "My Inventory" color?

6 years ago
Mizal, you mean just have variable based links as you acquire items? I could probably do it that way, but then I wouldn't have pretty pictures in the inventory.

Although, I suppose what I could do is just paste each picture above the item link, and have a master link on every page that functions like a satchel or a pocket or something where you hold your items.

Anyway to change "My Inventory" color?

6 years ago
^ General idea behind variable item system, with the 'satchel' being the whole inventory toggle I mentioned before that I might work on.

Anyway to change "My Inventory" color?

6 years ago
Yes, this, or basically any idea that gives inventory its own separate page. List of items picked up isn't much different from the basic idea of a journal codex.

Anyway to change "My Inventory" color?

6 years ago
The only problem is, would this become annoying if the reader had to go to the inventory page frequently?

Anyway to change "My Inventory" color?

6 years ago
E: Nm saw your other post above

Anyway to change "My Inventory" color?

6 years ago
Just in case anyone else is interested:

Text in purple indicates what you should swap out for your own specific names, descriptions, etc. Moving on to the breakdown:

1) Create a variable called 'ANYITEM', as well as 'HASITEM' variables (swapping ITEM for the actual item name you want). Also, create 'USEITEM' variables for each item you want and an 'ITEMFAIL' variable. If you really want to personalise your game, you can even create ITEMFAIL variables for each item so you can customise what the text says at the bottom of the page when the player uses an item on a page they aren't supposed to where it has no effect. I love little bits of polish like that but they take ages so fair enough if you just want one ITEMFAIL.

2) Copy and paste this sexy bit of script into your global page:

# BD's Dank Greedy Toggle Function that he kindly gave me $PAGETEXT := "<script> function toggleGreedy(a, b) { var e = document.getElementById(a); if (!e) return false; c = document.getElementsByClassName(b || e.className) || document.getElementsByClassName(e.className); for (i = 0; i < c.length; i++) if (c[i] !== e) c[i].style.display = 'none'; e.style.display = e.style.display === 'none' ? 'block' : 'none'; return false; } </script>" + $PAGETEXT

# Inventory Heading IF %ANYITEM >= 1 THEN $PAGETEXT := $PAGETEXT + "<HR><center><font size=4>Inventory</font></center><hr>"

# Buttons IF %HASITEM1 = 1 THEN $PAGETEXT := $PAGETEXT + "<a href='#' onClick='return toggleGreedy(&quot;para1&quot;, &quot;para&quot;);'><img src='URL HERE' width=60 height=60/></a>" IF %HASITEM2= 1 THEN $PAGETEXT := $PAGETEXT + "<a href='#' onClick='return toggleGreedy(&quot;para2&quot;, &quot;para&quot;);'><img src='URL HERE' width=60 height=60/></a>" IF %HASITEM3 = 1 THEN $PAGETEXT := $PAGETEXT + "<a href='#' onClick='return toggleGreedy(&quot;para4&quot;, &quot;para&quot;);'><img src='URL HERE' width=60 height=60/></a>"

# Descriptions IF %HASITEM1 = 1 THEN $PAGETEXT := $PAGETEXT + "<div id='para1' class='para' style='display:none'> <table border='0' cellpadding='0' cellspacing='0' width='600'> <td width= '150'><a href='#' onClick='return toggleGreedy(&quot;para1&quot;);'><img src='URL' width=100 height=100 /></a></td> <td valign='top'><hr><br/> <h2>ITEM1 NAME HERE</h2> <p>ITEM1 DESCRIPTION HERE<br/></p> <p align='center'>ITEM LINKS HERE- DROP, USE ETC</p><br/><hr> </td> </table> </div>"

IF %HASITEM2 = 1 THEN $PAGETEXT := $PAGETEXT + "<div id='para2' class='para' style='display:none'> <table border='0' cellpadding='0' cellspacing='0' width='600'> <td width= '150'><a href='#' onClick='return toggleGreedy(&quot;para2&quot;);'><img src='URL' width=100 height=100 /></a></td> <td valign='top'> <hr><br/><h2>ITEM2 NAME HERE</h2><p>ITEM2 DESCRIPTION HERE<br/></p><p align='center'>ITEM LINK(S) HERE</p><br/><hr></td></table></div>"

IF %HASITEM3 = 1 THEN $PAGETEXT := $PAGETEXT + "<div id='para3' class='para' style='display:none'><table border='0' cellpadding='0' cellspacing='0' width='600'><td width= '150'><a href='#' onClick='return toggleGreedy(&quot;para3&quot;);'><img src='THUMBNAIL URL HERE' width=100 height=100 /></a></td><td valign='top'><hr><br/><h2>ITEM3 NAME HERE</h2><p>ITEM3 DESCRIPTION HERE<br/></p><p align='center'>ITEM LINK(S) HERE</p><br/><hr></td></table></div>"

This is an example and needs personalising to work. I have included 3 trial items into the code, but more can be added. Firstly, onto Inventory customisation: To change the font or colour of the 'Inventory' text, or even what the text says, go to the inventory heading subtitle (#Inventory Heading, near top) and you can add things like <font color= red>Inventory</font>

Don't know how familiar you are with HTML, but you'd need to put it within the font tag, just next to the font size. E.g: IF %ANYITEM >= 1 THEN $PAGETEXT := $PAGETEXT + "<HR><center><font size=4 color= red>Inventory</font></center><hr>"

...would give you a red font. I won't go into font family as it's easy to look up, but it's implementable in the same way. Save the script for now and close.

3) Create a new page in your story, title it 'LINKS' and set up a link from the first page to this new page. On the LINKS page, set up a link for 'Pick up ITEM' for each item, with the destination leading to the page you actually pick up the item. Go into the link script for each link and copy and paste:

IF %HASITEM = 0 THEN BEGIN %HASITEM:= 1 %ANYITEM:= %ANYITEM + 1 END

...changing the ITEM to the actual name of the item you want to pick up (you get the idea by now).

4) If you have a page where you want an item/items to be picked up, open it up. If not, create one. For identification's sake, I will call this the "ITEM PICKUP PAGE". I'm going to assume all items can be picked up on the same page because it's easier, but the same steps can be followed for different pages.

Copy and paste this at the bottom of the page:

%%HASITEM1%=%0%<a onclick='PostBack(&#39;FollowLink&#39;,&#39;NUMBER&#39;);return false;' href='#'><img src='URL' width=75 height=75/></a> %%%%HASITEM2%=%0%<a onclick='PostBack(&#39;FollowLink&#39;,&#39;NUMBER&#39;);return false;' href='#'><img src='URL' width=75 height=75/></a> %%

Just to show you how two items would string together if you could get two on a page- hopefully you know about one page scripting with all the %%VARIABLE%=%1%Blah blah%%%%VARIABLE%=%2%other blah%% stuff. Copy and past for however many items you want on that page, correcting the item names. Don't delete the spaces- they're important.

5) Go into you storygame preview, click onto the LINKS page, and right click somewhere on the page. Go into 'view source page' like a legit hacker (I've seen Die Hard 5, I know what that shit's about), then press ctrl+F and type in the link description for your first item's 'pick up ITEM' link. You should now be looking at something like this:

<a onclick="PostBack(&#39;FollowLink&#39;,&#39;631&#39;);return false;" href="#">Pick up ITEM</a>

Copy that number in the middle- 631 in this case. Go back into the ITEM PICKUP PAGE and paste that to replace 'NUMBER. You can now pick up the item in the story viewer and toggle it in the inventory.

6) To create a 'USE ITEM' link, make a link on the LINKS page, doesn't matter where it links to, and copy and paste the following code into the link script:

IF %USEITEM = 1 THEN BEGIN IF $PAGEID = PAGE ID NUMBER OF PAGE WHERE THEY CAN USE ITEM THEN $DEST:= @PPAGE ID NUMBER OF PAGE USING THE ITEM LEADS TO %USEITEM:= 0 END ELSE BEGIN $DEST:= @NONE %ITEMFAIL:= 1 END

...changing the numbers as explained in the script. If you're only using one ITEMFAIL variable, skip to the next step. If not, obviously you'll need to change the variable name in the script to whichever specific variable corresponds to that particular item's use.

7) In the page script of the page you can use an item on, copy and paste:

IF %ITEMFAIL := 1 $PAGETEXT := $PAGETEXT + "That item cannot be used here."

You can personalise the message and do the same thing in step 6 if using more than one ITEMFAIL variable.

Also, in EVERY link leading to a page that an item can be used on, you must put in the copy and paste this into the link scipt(s):

%USEITEM:= 1

Again, go into the story viewer>LINKS page>right click>View page source. ctrl+F and type in the use item link description, copy the whole line of code this time (looks something like this: <a onclick="PostBack(&#39;FollowLink&#39;,&#39;661&#39;);return false;" href="#">Use ITEM</a>), go to the global page and paste to replace where the respective 'ITEM LINK(S) HERE' is. Then change all the couple quotation marks (") in that line of script to single ones (').

You can now use items. You can alter the use item link script in the LINKS page to do anything you wish the item to do. You can create 'drop item' links etc. in a similar way.

8) Almost there! Now you just have to rinse and repeat for each item (it gets alot easier once you have all your items and their links done and all their script in the global page, I promise). So for each new item you have to copy a button. General formula is:

IF %HASITEM = 1 THEN $PAGETEXT := $PAGETEXT + "<a href='#' onClick='return toggleGreedy(&quot;para1&quot;, &quot;para&quot;);'><img src='URL HERE' width=60 height=60/></a>"

BUT, you need to change the number next to "para" to correspond one above the last number, so it goes 'para1, para2, para3...' for the button scripts in ITEM1, ITEM2, and ITEM3. I've already done this for the first three, but you need to continue doing this if you want to add items.

Next, copy and paste a description script for the added item. General formula is:

IF %HASITEM1 = 1 THEN $PAGETEXT := $PAGETEXT + "<div id='para1' class='para' style='display:none'> <table border='0' cellpadding='0' cellspacing='0' width='600'> <td width= '150'><a href='#' onClick='return toggleGreedy(&quot;para1&quot;);'><img src='URL' width=100 height=100 /></a></td> <td valign='top'><hr><br/> <h2>ITEM1 NAME HERE</h2> <p>ITEM1 DESCRIPTION HERE<br/></p> <p align='center'>ITEM LINKS HERE- DROP, USE ETC</p><br/><hr> </td> </table> </div>"

Again, change the number next to "para" so it matches the number for the button of that item, this time there are two "para"s yo need to change.

And, of course, you'll need to set up 'pick up item' links and 'use item' links for each one in the LINKS page and use the script shown above. To enable the player to use an item on more than one page, just add to the script in the 'use item' links in a similar way shown: using the page ID to adjudicate where the player should be sent and what variables should be changed (always change the 'USEITEM' variable to 0 though).

Anyway to change "My Inventory" color?

6 years ago
Turn this into an article please.

Anyway to change "My Inventory" color?

6 years ago
Yeah I was planning to: just need to follow it through myself to make sure it works and cut it down/try to make it more foolproof first.

E: Oh yeah, and work out how to do the whole inventory toggle thing.

Anyway to change "My Inventory" color?

6 years ago
Thought I'd mention I've streamlined the variable item system guide so it takes less time and is easier to follow:

Text in bold purple indicates what you should swap in your own specific names, descriptions, etc. Moving on to the breakdown:

1) Create a variable called 'ANYITEM', a variable called 'ITEMFAIL'. Then create 'HASITEM' variables for each item you want (swapping 'ITEM' for the actual name). If you really want to personalise your game, you can create 'ITEMFAIL' variables for each item and customise what the text says at the bottom of the page when the player uses an item on a page they aren't supposed to where it has no effect.

2) Copy and paste this sexy bit of script into your global page:

# BD's Dank Greedy Toggle Function $PAGETEXT := "<script>function toggleGreedy(a, b) {var e = document.getElementById(a);if (!e) return false;c = document.getElementsByClassName(b || e.className) ||document.getElementsByClassName(e.className);for (i = 0; i < c.length; i++)if (c[i] !== e) c[i].style.display = 'none';e.style.display = e.style.display === 'none' ? 'block' : 'none';return false;}</script>" + $PAGETEXT

# Inventory Heading IF %ANYITEM >= 1 THEN $PAGETEXT := $PAGETEXT + "<HR><center><font size=4>Inventory</font></center><hr>"

# Buttons IF %HASITEM1 = 1 THEN $PAGETEXT := $PAGETEXT + "<a href='#' onClick='return toggleGreedy(&quot;para1&quot;, &quot;para&quot;);'><img src='URL HERE' width=60 height=60/></a>" IF %HASITEM2= 1 THEN $PAGETEXT := $PAGETEXT + "<a href='#' onClick='return toggleGreedy(&quot;para2&quot;, &quot;para&quot;);'><img src='URL HERE' width=60 height=60/></a>" IF %HASITEM3 = 1 THEN $PAGETEXT := $PAGETEXT + "<a href='#' onClick='return toggleGreedy(&quot;para3&quot;, &quot;para&quot;);'><img src='URL HERE' width=60 height=60/></a>"

# Descriptions IF %HASITEM1 = 1 THEN $PAGETEXT := $PAGETEXT + "<div id='para1' class='para' style='display:none'><table border='0' cellpadding='0' cellspacing='0' width='600'><td width= '150'><a href='#' onClick='return toggleGreedy(&quot;para1&quot;);'><img src='URL' width=100 height=100 /></a></td><td valign='top'><hr><br/><h2>ITEM1 NAME HERE</h2><p>ITEM1 DESCRIPTION HERE<br/></p><p align='center'>ITEM LINKS HERE- DROP, USE ETC</p><br/><hr></td></table></div>"

IF %HASITEM2 = 1 THEN $PAGETEXT := $PAGETEXT + "<div id='para2' class='para' style='display:none'><table border='0' cellpadding='0' cellspacing='0' width='600'><td width= '150'><a href='#' onClick='return toggleGreedy(&quot;para2&quot;);'><img src='URL' width=100 height=100 /></a></td><td valign='top'><hr><br/><h2>ITEM2 NAME HERE</h2><p>ITEM2 DESCRIPTION HERE<br/></p><p align='center'>ITEM LINK(S) HERE</p><br/><hr></td></table></div>"

IF %HASITEM3 = 1 THEN $PAGETEXT := $PAGETEXT + "<div id='para3' class='para' style='display:none'><table border='0' cellpadding='0' cellspacing='0' width='600'><td width= '150'><a href='#' onClick='return toggleGreedy(&quot;para3&quot;);'><img src='THUMBNAIL URL HERE' width=100 height=100 /></a></td><td valign='top'><hr><br/><h2>ITEM3 NAME HERE</h2><p>ITEM3 DESCRIPTION HERE<br/></p><p align='center'>ITEM LINK(S) HERE</p><br/><hr></td></table></div>"

This is an example and needs personalising to work. I have included 3 trial items into the code, but more can be added as discussed in step 8. Save the script.

3) Create a new page in your story, title it 'LINKS', and set up a link to it from the first page. On the LINKS page, set up a link for 'Pick up ITEM' for each item, with the link leading to the page you actually pick up the item. In the link script for each link, copy and paste this:

%HASITEM:= 1

4) Open/create a page where you want an item/items to be picked up. Let's this the "ITEM PICKUP PAGE". I'm going to assume all items can be picked up on the same page because it's easier, but the same steps can be followed for different pages.

Copy and paste this at the bottom of the page:

%%HASITEM1%=%0%<a onclick='PostBack(&#39;FollowLink&#39;,&#39;FIRST NUMBER&#39;);return false;' href='#'><img src='URL' width=75 height=75/></a> %%%%HASITEM2%=%0%<a onclick='PostBack(&#39;FollowLink&#39;,&#39;SECOND NUMBER&#39;);return false;' href='#'><img src='URL' width=75 height=75/></a> %%%%HASITEM3%=%0%<a onclick='PostBack(&#39;FollowLink&#39;,&#39;THIRD NUMBER&#39;);return false;' href='#'><img src='URL' width=75 height=75/></a> %%

Hopefully you know how to use on page script so you can add more items if you want- just copy and paste.

5) Go into you storygame preview, go to the LINKS page, then right click somewhere on the page. Go into 'view source page' like a legit hacker (I've seen Die Hard 4.0, I know what I'm talking about). Press ctrl+F and type in the link description for your first item's 'pick up ITEM' link. You should now be looking at something like this:

<a onclick="PostBack(&#39;FollowLink&#39;,&#39;631&#39;);return false;" href="#">Pick up ITEM</a>

That number in purple will be different for you. Copy whatever it is- 631 in this case. Go back into the ITEM PICKUP PAGE and paste that to replace 'NUMBER' in the corresponding item on page script. You can now pick up the item in the story viewer and toggle it in the inventory. Huzzah.

6) Now we want a 'USE ITEM' link in the toggle box of items, so make a link for each item on the LINKS page (doesn't matter where it links to, pick any old page). Type into the link description: 'Use ITEM'.

7) In the page scripts of pages you can use an item on, copy and paste:

IF %ITEMFAIL := 1 BEGIN %ITEMFAIL:= 0 $PAGETEXT := $PAGETEXT + "You can't use that here mate- try using your noggin, not this item." END

You can change the message, even more so if using more than one ITEMFAIL variable.

Again, go into the story viewer--->LINKS page--->right click--->View page source. ctrl+F and type in the use item link description, copy the whole line of code this time (looks something like this: <a onclick="PostBack(&#39;FollowLink&#39;,&#39;661&#39;);return false;" href="#">Use ITEM</a>), go to the global page and paste to replace where the respective 'ITEM LINK(S) HERE' is. Then change all the double quotation marks (") in that line of script to single ones ('). If you ever get an error message saying the script is incorrect, it's likely you haven't swapped the quotes.

You can now use items! You can create 'drop item' links etc. in a similar way (putting in the link script: %HASITEM:= 0)

8) Almost there! Now you just have to repeat for each item (it gets alot easier once you have all their links done and all the script in the global page, I promise). Each new item needs its own button, as seen in stage 2. This is the general formula:

IF %HASITEM = 1 THEN $PAGETEXT := $PAGETEXT + "<a href='#' onClick='return toggleGreedy(&quot;paraNUMBER&quot;, &quot;para&quot;);'><img src='URL HERE' width=60 height=60/></a>"

BUT, you need to change the 'NUMBER' to correspond to one above the previous 'NUMBER', so it goes 'para1, para2, para3...' and so on for the button scripts in ITEM1, ITEM2, and ITEM3... etc. I've already done this for the first three, but you need to continue doing this if you want to add items.

Next, copy and paste a description script for the added item. General formula is:

IF %HASITEM1 = 1 THEN $PAGETEXT := $PAGETEXT + "<div id='paraNUMBER' class='para' style='display:none'><table border='0' cellpadding='0' cellspacing='0' width='600'><td width= '150'><a href='#' onClick='return toggleGreedy(&quot;paraNUMBER&quot;);'><img src='URL' width=100 height=100 /></a></td><td valign='top'><hr><br/><h2>ITEM NAME HERE</h2><p>ITEM DESCRIPTION HERE<br/></p><p align='center'>ITEM LINKS HERE- DROP, USE ETC</p><br/><hr></td></table></div>"

Again, change the NUMBER next to "para" so it matches the number for the button of that item, this time there are two "para"s you need to change.

Of course, make 'USE ITEM' links as shown above for each new item.

9) Go into the LINKS page, go into a 'use ITEM' link script, and copy and paste this:

IF $PAGEID = ID OF PAGE YOU USE ITEM THEN $DEST:= @PID OF PAGE USING ITEM LEADS TO ELSE IF $PAGEID = SECOND ID OF PAGE YOU USE ITEM THEN $DEST:= @PSECOND ID OF PAGE USING ITEM LEADS TO ELSE BEGIN $DEST:= @NONE %ITEMFAIL:= 1 END

Make sure you type in page ID numbers only, not the little '#' next to them editor. From now on, anytime you want to add a new item effect, just copy and paste one of those 'ELSE IF' statements above and alter the numbers as prompted.

10) Done! It's long winded to set up, but quick to add effects for items. I think it's worth it because you can do loads of cool stuff with this system if you put in the time and have the creativity, like set up combine item links or block item use/descriptions until players have set off certain variables.

Anyway to change "My Inventory" color?

5 years ago
Not to bump an old thread, especially with such a deliciously complex code posted already, but I don't think I'm quite ready for that. So I'd like to ask an additional question:

Is there a way to just make the entire Inventory box disappear, leaving only the item icons themselves? I ask because I know that you can do exactly that with the title of every page in the Global Page script (thanks to Ogre11), so I'm just wondering if there is a way to do it. As always, thanks for any input.

Anyway to change "My Inventory" color?

5 years ago
NVM. Picture disappeared. SMH.