Castle of Chaos

@Lordirish, it’s incredible that you’ve made it to 286 moves. After that many moves in someone else’s game, I’d sure be wanting to see some fresh content. I have many ideas for new content, but they are sidelined while I am figuring out the database save system. But maybe I can add at least some teeny bit of new content this weekend. I’ll see. My plate is stacked so high. Right now I have to go visit the eye doctor.

I haven’t had a chance to post about the new save system yet. I wanted to make sure it worked before I posted, and your feedback has been invaluable towards achieving that goal. I’ll post something soon; it’s on my to-do list.

@eposic
No hurry I have a project of my own so I know how it is. And no new content won’t hurt me I have a goal to reach the end, it may take me months and months but I want to kick that crazy wanabe god’s theeth in.
And cool on the code for the save look forward to it. Alway glade to be of service.

Lol I can not always get my laptop out, now that is several pieces, while I get loaded and unloaded. So have spent some time crawling. Did about 500 moves then started over, now that I truely understand the game. I have also taken to tracking it on graph paper. So far I have tracked 210 rooms. Lol I can pinpiont a fountian 95%, have not nailed down the teleport rooms, YET.:wink:

@Lordirish, that is damn impressive.

Have you figured out how to use the teleport rooms to teleport to other teleport rooms that you’ve previously visited? Just curious.

Sorry I’ve not had a chance to add new content. Have had too much to do for the job that pays my salary.

Wish I had a job that pays a salary. Wish I had a job that pays.

I hear you, @Shoelip. My son is in the same boat as you. It’s very difficult these days. All the more reason to do the best I can to keep the one I have.

Nods that is why I drive truck across country, I was somethings else in another life but the job got cut and my skills where no longer needed.
@eposic
No not yet but will but on my todo list. But may be awhile. I once started a DC of my own but dropped it as there was some thoughts of infringment. I think I can make one just generic but full of story and adventure. Its a side project for now. You have inspired me to work on it again.

@Eposic
I think the game could be enhanced by adding images to show what the room looks like from above, just an idea.

I love to crawel dungeons, but pictures to me would take away from the mental image I have of the place. I can envision so much more then some picture could possiblely provide.

@Lordirish
Not detailed pictures, I mean sort of like the ones in Three Classes, basic outline.

It seriously triple posted me, I blame lag.

It seriously triple posted me, I blame lag.

@eposic
I am on my laptop so differant login, for some reason I can’t get my phone to log in the same. But that is not why I am posting, I take it to get the stats to show like they are you made an entry into the index file it’s self. I am guessing <b>Armor:</b> <span id="stat_armor">. I have seen such examples, but what I am unclear is how would I call the info from the the scene to the stat. thanks.

I think I am good now, read a lot. THen played around with the code. But I am sure I will have more questions later. lol.

I was wrong spent the last three hours filling it all out to no avail. I have the index file looking like I want, but failing to get it to change when entering a room. I am sure you have a lot of nice coding involved that I am missing. Of course I am taking a differant approach as this is a much smaller DC so designing each room. so this is a sample of what it looks like entering the room.
*label room_00 *set x 0 *set y 1 *set direction "Entering" *set item1 "50ft. rope" *set item2 "Metal spike" *set item3 "Metal spike" *set item4 "Metal spike" *set item5 "Dagger" *set item6 "Potion for healing" Room opening
now the varibles have changed but not showing on the index page. So I assume there is some code I need to add to make it draw in the information on to it. Thanks for any help you can offer.

Yes, @lordirishdas, you are on the right track with adding the bold label and a span tag after it on the index.html page. Make sure the span tag has a unique id, as you have shown in your example. Then you need to have a JavaScript function that will do the update of the span tag’s contents, and call the JavaScript function from inside your scene at the appropriate time, using the *script command. You’ll create a .js file in which you save your JS function, and you’ll have to make sure you reference that .js file from inside your index.html file. Such a reference would look like this, assuming your .js file is called update.js and is located in the same directory as the other .js files:

<script src='../update.js'></script>

Your JavaScript function inside the update.js file might look something like this, assuming you only had one stat to display, with a name of “armor”:

function updateDisplay() {
    var statElem = document.getElementById("stat_armor");
    if (statElem) {
      statElem.innerHTML = stats["armor"];
    }
}

If you have more than one stat to display, you can be a little smart about writing it. First, set up an array called statNames that holds all of the names of the stats you want to include in your display. Then write your function to loop over the array, like so:

var statNames = ["weapon1", "weapon2", "armor"];
function updateDisplay() {
  var i;
  for (i=0; i<statNames.length; ++i) {
    statElem = document.getElementById("stat_" + statNames[i]);
    if (statElem) {
      statElem.innerHTML = stats[statNames[i]];
    }
}

If your span tags have ids of stat_weapon1, stat_weapon2, and stat_armor, then the above will update those span tags with the data from your stats.

To call this function from your scene file, you’d use this command:

*script updateDisplay();

Call it any time any of your stats might change, if you want your display to always be current.

Hope that helps.

1 Like

Yes this looks great will try it out in the next few days. Thank you. Also I sent you a pm.

Ok getting close but still so far. I started off with 3 errors, managed to fix two of them. This one has me stumped. The value of the proprty ‘updateDisplay’ is null or undefined, not a function object. I have read until my head hurts, but JS is still greek to me.
In the update.js, which I did save with the other .js files, I have
var statNames = ["name", "level", "ep"]; function updateDisplay() { var i; for (i=0; i<statNames.length; ++i) { statElem = document.getElementById("stat_" + statNames[i]); if (statElem) { statElem.innerHTML = stats[statNames[i]]; } }
in the index
`

in the room file
*comment rooms level one
"set name “Mud”
*set level +1
*set ep +10

*script updateDisplay();
`
What am I missing please? Thank you.

The following line of code in the index.html file has one too many double quote characters:

<script src=""../update.js"></script>

This prevents your update.js file from loading, and so your updateDisplay function never gets defined, which is why the error message is that updateDisplay is null or undefined.

Everything else looks fine to me.

I removed the double ", still getting the same error. I thought it might be IE so I tried Google Chrome and Firefox. Still same error. So I moved it up to my website, there again same error. So I am out of ideas. I can always post the code at the start of each room for now until someone smarter then me, which is most of ya =P~ , can maybe help me solve this issue. Thanks all. I will start posting this in a new thread so I do not bog down your thread with my problems. :smiley: