Closed KVonGit closed 3 months ago
Correct, here is the error from TKAM using new Quest/new Compiler. Firstly, PI is being repeated in the code somewhere. It only appears in the Compiler game.js file once, so it's being added from somewhere else. I manually commented one out and refreshed.
Then:
Uncaught TypeError: game is undefined
init file:///C:/Users/Adam/Desktop/TE-To Kill A Mongbat (NPC)/Compiled/game.js:30245
onBodyLoad file:///C:/Users/Adam/Desktop/TE-To Kill A Mongbat (NPC)/Compiled/index.html:29
onload file:///C:/Users/Adam/Desktop/TE-To Kill A Mongbat (NPC)/Compiled/index.html:1
This appears to be a problem with how and when GAME is being defined.
It sounds like you have a game.js
file in your main game folder.
Any code in any JS file in your main game folder will be automatically added to the end of the game.js
file in your converted game. That same error with Pi led me to this conclusion.
To elaborate:
During conversion, the game.js file in the converter's main folder is copied, then all the data from your game is translated into JS piece by piece, then added to that copied game.js file line by line as it goes through the game data.
So, the game.js file for a converted game has the same first 3000 lines or so as the original game.js, then it has the specific game code after that.
When you have a game.js file in your main game folder, all that JS code is written at the end of the converted game's game.js file, hence duplicating the first 3000 or so lines of code at the end of the file.
To elaborate further:
In this instance, Pi
is set up as a constant variable by game.js. Trying to redeclare or change a constant variable always throws an error in JS.
If Pi
was a normal variable, it would be okay to redeclare or change it later in the code.
Anyway, searching for const Pi =
in the code when I ran into that error led me to finding that lines 1 - 3000 were identical to lines 24,458 - 27,458, and then I noticed a game.js file in the main game folder, and then I smoked my Sherlock Holmes pipe and played my violin for while.
Well... I don't have a violin; so, I just played my 12 string Takamine instead.
Also, just like the game panes accordion stuff, I have "fixed" the code to let setCustomStatus()
work, but then I run into literally 15 new errors because of other stuff that breaks.
This jQuery and jQuery-UI (and all this JS stuff) is from like 2016 or earlier.
Can't update it in the converter without updating in Quest, and you can't update it in Quest without breaking everything in Quest.
Catch 22, anyone?
Can you send me the coded files with a "working" setCustomStatus()? I think I know which directions we can go for an NPC specifically. I don't know how to handle "any" kind of custom pane, but one specific to an NPC we could do, so...
How does Quest display a custom pane? I understand that it's written to display this information, but "how"? Why can't we use something else besides JS to replicate this "how"?
Even if the Compiler is JS, it can add whatever code we want it to add, so we just need a code that a browser understands. We know it understands the regular Status pane, so that seems like half the solution....? We're just plugging in the values from a different source...? Is it that the NPC isn't identical to the Player, because then we could tackle duplicating the player as a TYPE, and NPCs would follow a template using those same values.
To elaborate:
During conversion, the game.js file in the converter's main folder is copied, then all the data from your game is translated into JS piece by piece, then added to that copied game.js file line by line as it goes through the game data.
So, the game.js file for a converted game has the same first 3000 lines or so as the original game.js, then it has the specific game code after that.
When you have a game.js file in your main game folder, all that JS code is written at the end of the converted game's game.js file, hence duplicating the first 3000 or so lines of code at the end of the file. Well I discovered the problem. You were right about the duplicate game file, but it was using a duplicate ASLX file that was in the same folder. I don't know why it would include that though if it's not linked as a Library?
Can you send me the coded files with a "working" setCustomStatus()?
Err... If (1) I didn't just UNDO everything from inside the editor without saving the file in that state and (2) I can figure out which game folder it was in.
Basically:
setCustomStatus()
to do its thing (or to at least try).grep "soAndSo" ./js/*
I think I know which directions we can go for an NPC specifically. I don't know how to handle "any" kind of custom pane, but one specific to an NPC we could do, so...'
Why not just code that into the Quest game file (or a library) using JS?
We know that the code in any JS file in the main game folder is getting directly copied to the end of game.js during conversion. So, you could just put whatever JS code would work in the Quest Converter into your game instead, and the converter will automatically add that code during conversion.
How does Quest display a custom pane? I understand that it's written to display this information, but "how"? Why can't we use something else besides JS to replicate this "how"?
It just uses an HTML element to display it and jQuery to update everything in it every turn.
There are hundreds of lines in the Quest code (spread across different functions) that deal with it all. And that stuff got updated since Alex was writing this converter.
Even if the Compiler is JS, it can add whatever code we want it to add, so we just need a code that a browser understands. We know it understands the regular Status pane, so that seems like half the solution....? We're just plugging in the values from a different source...? Is it that the NPC isn't identical to the Player, because then we could tackle duplicating the player as a TYPE, and NPCs would follow a template using those same values.
That's not the problem (I don't think).
I think the problem is that Quest was updated five or six times since this was written. The old code in the converter probably needs to be tweaked in several places to make it work again. I don't really know what I'm doing with all that code; so, it would be a case of changing one thing, adding debugging messages all over the place to see what is running when and what parameters it working with and what those values are and where they are coming from, and then compare all that to the same stuff in the updated code in Quest.
The problem with that, though, is that every change to function A will cause function B and function C to go haywire. Then, function B makes 10 more functions go crazy, and function C ends up being used by other 50 functions and then the game spontaneously combusts. [MANIACAL LAUGH]
(I ventured down that path for about three hours the other day, and I then grew perturbed and hung it out to dry.)
So, yeah... or no? I don't know, but I think I maybe might revisit it one day. Gotta let that part of my brain reset for a day or two first. That usually leads to a revelation on the third day.
Again, though, if new code were written to display a custom custom status pane, then that code could just be included in the game folder.
You could also check where the game is being played from within a Quest script and put IF/ELSE conditions to either do nothing when in the desktop player or online OR use the custom script to create the pane your own way when in a converted game.
But, if we were to take time to deal with lots of code to make the actual setCustomStatus()
Quest behave as expected, I think altering the existing old code to work properly would be the only way to respectfully do that in the converter. Else, people who stumble upon this one day and try it out might be very confused as to what the heck is going on. What do Pixie and mrangel call that when they tell me this? Oh yeah: best practice.
Best practice sucks, but I have no sound arguments against it, haha!
You know... I wonder if running the game in Chrome version 39.0 would work differently....
That's what I'm about to go do right now, if I can find Chrome version 39.0, which is what is in Quest. Well, it's Chromium version 39.0... I'll have to look to see which Chrome corresponds with which Chromium.
Can you upload a zip archive of that folder in https://github.com/KVonGit/Raists-Game-File-Sharing ?
You should be able to just click Add File from the main page of that repo and drop it and click upload.
LOL I just deleted everything to start with an empty folder, which was why I deleted my comment before. Clean compiled of TKAM without custom pane works. Checking TKAM with custom pane...
Checking TKAM with custom pane...
I disabled the function. So, the game should work, just with no custom pane.
This is the very last line of code in game.js (before actually converting a game):
function setCustomStatus(){
//do nothing
}
The real function is in playercore.js, which is not used in a converted game.
https://github.com/KVonGit/quest-compiler/blob/master/Compiler/js/playercore.js#L1131C1-L1134C2
function setCustomStatus(s) {
el = $('#customStatusPane');
el.html(s);
}
So, when trying to make it work, the first thing I did was add that real version of the function the test game's game.js.
That led to an error, which led to another error, which led to another error, and on and on...
...and that led to me revert that game.js in the test game folder back to its state before I added the real setCustomStatus()
function to it.
Then, I decided to add playercore.js to the HTML file in the test game folder. That led to more errors and me adding more JS files to the HTML file, which led to more errors....
...and led me to UNDO all the changes to the HTML file.
It also made my me curse a lot, haha!
Archive uploaded. How are you turning on CustomStatus?
What if we had a function that gathered all the values we need from all over, and then use that function to render CustomStatus? Then you would only need to find all the setCustomStatus values one....?
S is not defined. Is PlayerCore being ignored when the game is compiling then?
S is not defined.
Sure isn't.
That's because you need other functions from playercore.js to work with setCustomStatus()
.
And those functions need other functions from the JS file with "accordion" in the name.
And the JS file with "accordion" in the name throws a giant monkey wrench into everything in the game.
Is PlayerCore being ignored when the game is compiling then?
No, it gets copied to the JS folder. The HTML file just doesn't have the line of code to include it because it causes other errors when included. It would have to be added to the HTML file, if you want to include it.
EDITED TO FIX LINK This Post from a Few Minutes Ago explains it.
This part of index.htm is where all the files are included: https://github.com/KVonGit/quest-compiler/blob/master/Compiler/index.htm#L4-L22
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/xregexp-min.js"></script>
<script type="text/javascript" src="game.js"></script>
<link rel="stylesheet" href="js/jjmenu.css" />
<link rel="stylesheet" href="bootstrap.css" />
<style>
body {
padding-top: 60px; /* for fixed navbar */
}
</style>
<link rel="stylesheet" href="bootstrap-responsive.css" />
<script src="js/bootstrap.min.js"></script>
<script src="js/jjmenu.js"></script>
<link id="styleLink" rel="Stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="jquery-ui.structure.css" />
<link rel="stylesheet" type="text/css" href="jquery-ui.theme.css" />
That is the same way Alex had it before he abandoned the project, too.
https://github.com/textadventures/quest-js/blob/master/Compiler/index.htm#L4-L19
If you want to mess around with it, you need to add this line in that same section of game.htm in the test game folder:
<script type="text/javascript" src="js/jquery-ui.js"></script>
But it probably matters where you put it, because of the order that everything loads when the browser opens the page.
I don't know where that should be... Let's look at where Quest adds it....
https://github.com/textadventures/quest/blob/master/Player/Blank.htm#L4-L17
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="res://local/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="res://local/jquery-ui.min.js"></script>
<script type="text/javascript" src="res://local/jquery.multi-open-accordion-1.5.3.js"></script>
<script type="text/javascript" src="res://local/playercore.js"></script>
<script type="text/javascript" src="res://local/desktopplayer.js"></script>
<script type="text/javascript" src="res://local/paper.js"></script>
<script type="text/paperscript" canvas="gridCanvas">
// GRID_JS_PLACEHOLDER
</script>
<!-- EXTERNAL_SCRIPTS_PLACEHOLDER -->
<link rel="Stylesheet" type="text/css" href="res://local/jquery-ui.min.css" />
<link rel="Stylesheet" type="text/css" href="res://local/playercore.css" />
<link rel="Stylesheet" type="text/css" href="res://local/desktopplayer.css" />
<!-- EXTERNAL_STYLESHEETS_PLACEHOLDER -->
I gotta go to the grocery store. I shall return shortly.
Okay, so ChatGPT said to setCustomStatus to accept a variable: function setCustomStatus(s){ var el = $('#customStatusPane'); el.html(s); } Now the error for s is not defined is gone. (resolved that)
Now I'm looking at function ui_init never being coded in any file.
I got no errors, but the page is obviously not loading correctly because right-click doesn't work at all. When you try to restart the game, it opens the game in another tab, then in the first tab it opens the window for restart.
I uploaded the archive with where I currently am, and a few things I had to fix with variable naming.
This has everything to do with GetAttribute function not being written. ChatGPT wrote a suggested block of code based on the code so far.
- _nope. changing from uiinit() to InitUserInterface() fixed this error, as it was looking for a different function and couldn't find GetAttribute to fit nothing, I guess
EDIT: This also needs to be updated for GamePanes in the html file. There are labels and
Now I'm looking at function ui_init never being coded in any file.
I made it to that point, too.
The ui_init
in Quest doesn't do anything in the web player version: https://github.com/textadventures/quest/blob/63f159054e088a40b3b22ed1954392c4d3cb9974/WebPlayer/playerweb.js#L8
It does this in the desktop player in Quest: https://github.com/textadventures/quest/blob/63f159054e088a40b3b22ed1954392c4d3cb9974/Player/desktopplayer.js#L58
And it does quite a bit of stuff in the online mobile Quest player file: https://github.com/textadventures/quest/blob/63f159054e088a40b3b22ed1954392c4d3cb9974/WebPlayer/Mobile/playermobile.js#L40-L64
For now, I think you could just add this to game.js and see what happens:
function ui_init(){
//Do nothing
console.log ("Bypassing ui_init().");
{
I got no errors, but the page is obviously not loading correctly because right-click doesn't work at all. When you try to restart the game, it opens the game in another tab, then in the first tab it opens the window for restart.
Yep. Same exact thing happened to me. I thought I described it to you, especially that last part when trying to restart, but I can't find where I shared that bit of info.
I uploaded the archive with where I currently am
I shall check this out shortly, as soon as I finish eating lunch.
js/playercore.js
Lines 89-96
I changed it from e.preventDefault()
to e.stopPropagation()
, and it fixed the issue when clicking the little button to restart AND the right-clicking.
$(document).on("click", "a", function (e) {
var href = $(this).attr("href");
if (href) {
goUrl(href);
}
\\e.preventDefault();
e.stopPropagation();
});
I think you meant forward slash and not the back slash, but in any case, that didn't work for me.
$(document).on("click", "a", function (e) {
var href = $(this).attr("href");
if (href) {
goUrl(href);
}
//e.preventDefault();
e.stopPropagation();
});
One thing, I changed ui_init() to InitUserInterface(), because that's where all the NPC variables were defined for S.
EDIT: Should we have been using ui_init as the function inside Quest?
Okay, so ChatGPT said to setCustomStatus to accept a variable: function setCustomStatus(s){ var el = $('#customStatusPane'); el.html(s); }
Yep. See this post above: https://github.com/KVonGit/quest-compiler/issues/3#issuecomment-2286351640
This has everything to do with GetAttribute function not being written. ChatGPT wrote a suggested block of code based on the code so far.
game.js
Lines 2009- 2016 (from the game.js in the file you just put in the repo with your test game):
function GetAttribute(object, attribute) {
// Check if the object has the attribute
if (object && object.hasOwnProperty(attribute)) {
return object[attribute];
}
// If attribute is not found, return undefined or handle it as needed
return undefined;
}
And again: Lines 2771-2774 (from the game.js in the file you just put in the repo with your test game):
function GetAttribute(element, attribute) {
attribute = attribute.replace(/ /g, "___SPACE___");
return element[attribute];
}
And again: Lines 29831-29835 (from the game.js in the file you just put in the repo with your test game):
function GetAttribute(element, attribute)
{
var attribute = attribute.replace(/ /g, "___SPACE___");
return (element[attribute]);
}
Note that the last one in your game.js file will be the one it uses.
The first one I listed looks like the best one, because it checks if the attribute exists first to avoid errors. Besides that, those three are doing the same exact thing.
It is here in the converter's game.js: https://github.com/KVonGit/quest-compiler/blob/master/Compiler/game.js#L2965-L2968
And it is ALSO here in the converter's game.js: https://github.com/KVonGit/quest-compiler/blob/master/Compiler/game.js#L3030-L3036
I think you meant forward slash and not the back slash, but in any case, that didn't work for me.
Hot dog, you're right. And when I changed mine to forward slashes, it messes up again. Haha!
Got it, for real this time.
playercore.js, lines 89-95:
$(document).on("click", "a", function (e) {
var href = $(this).attr("href");
if (href && href != "#gameMore"){ //Modified by KV
goUrl(href);
}
e.preventDefault();
});
One thing, I changed ui_init() to InitUserInterface(), because that's where all the NPC variables were defined for S.
Aha! Sounds like someone previously replaced ui_init()
with InitUserInterface()
during an update to Quest.
EDIT: Should we have been using ui_init as the function inside Quest?
Probably not, especially if everything was working without it.
Well... This stops clicking the little button to bring up the screen to click Restart from opening a new tab: https://github.com/KVonGit/quest-compiler/issues/3#issuecomment-2286783227
...but right-clicking still doesn't work.
Well... This stops clicking the little button to bring up the screen to click Restart from opening a new tab: #3 (comment)
...but right-clicking still doesn't work.
It's some kind of collision between what playercore.js added and what already existed.
This, line 127 playercore.js?
var overrideContextMenuClick = function(e) { if (!e) e = window.event; if ((e.type && e.type == "contextmenu") || (e.button && e.button == 2) || (e.which && e.which == 3)) { return false; } return true; }; if (document.layers) document.captureEvents(Event.MOUSEDOWN); document.onmousedown = overrideContextMenuClick; document.oncontextmenu = overrideContextMenuClick;
EDIT: Yep! Comment that code out. No errors, right-click works, but the restart is still opening a second window.
Does clicking on object links still work after commenting out overrideContextMenuClick()
?
Also, I don't think it needs to run most of that stuff in playercore.js.
It looks like that's duplicating a BUNCH of stuff from game.js, and it is probably not identically duplicating everything.
I can't tell what all you've changed in this test game's files; so, I'm about to make a game with one room and one object, convert it, and play with that code. Should be much easier to navigate that way.
If I can steal a function or two from playercore.js without having to actually include that file in the HTML, I'm going to try doing that.
Also, I don't think it needs to run most of that stuff in playercore.js.
It looks like that's duplicating a BUNCH of stuff from game.js, and it is probably not identically duplicating everything.
I can't tell what all you've changed in this test game's files; so, I'm about to make a game with one room and one object, convert it, and play with that code. Should be much easier to navigate that way.
If I can steal a function or two from playercore.js without having to actually include that file in the HTML, I'm going to try doing that.
Object links still worked after commenting out overrideContextMenuClick(). I was just thinking something similar, because I am using a program called WinMerge to compare both game.js and playercore.js and I can see where some functions are lined up, but have different code. I don't think we need anything that doesn't pertain to the CustomPane.
Oh yeah, and we need the HTML tags for CustomPane. I'm thinking that because I used status_div inside Quest, I need to use that same name as the id? I don't quite understand how the Panes are defined.
Example from game.js:
function showStatusVisible(visible) { if (visible) { $("#statusVars").show(); $("#statusLabel").show(); } else { $("#statusVars").hide(); $("#statusLabel").hide(); } }
Code from playercore.js:
function showStatusVisible(visible) { if (visible) { $("#statusVars").show(); $("#statusVarsAccordion").show(); $("#statusVarsLabel").show(); } else { $("#statusVars").hide(); $("#statusVarsAccordion").hide(); $("#statusVarsLabel").hide(); } }
EDIT: Okay, so I removed playercore.js from the html scripts, and I began copying over what I believed to be relevant code for CustomPane. Then I saw code for GRID, playercore is adding some functionality for other things.
Oh yeah, and we need the HTML tags for CustomPane. I'm thinking that because I used status_div inside Quest, I need to use that same name as the id? I don't quite understand how the Panes are defined.
Ooh, I'll have to brush up on that before I can answer, haha. Oddly, the first thing I learned was HTML and a little CSS. Then, I started fooling with JS and forgot most of the CSS along the way.
Anyway, I used to know that. So, shouldn't take me long to refresh my memory.
EDIT: Okay, so I removed playercore.js from the html scripts, and I began copying over what I believed to be relevant code for CustomPane. Then I saw code for GRID, playercore is adding some functionality for other things.
Hrmm. See, I don't know... The Quest repo has 3 different playercore.js files. One in the desktop player, one in the web player, and one in the mobile web player. The one in the web player doesn't do anything when it calls ui_init
by design, and that makes me think maybe we should compare this old playercore.js file in the converter repo to the playercore.js file in the Quest web player.
Also, I haven't seen Alex Warren (creator of all this stuff) post anything on the site ever, and he just posted on the Squiffy forum that he is currently helping fix up issues on the site.
Depending upon how active he becomes, maybe you can convince him to look into one of these issues with the converter.
I have no clue if he'll be active in the forums at all. I've never had the opportunity to correspond with him before (hence the need I felt to thank him for the site and the software in that forum post).
Oh yeah, and we need the HTML tags for CustomPane. I'm thinking that because I used status_div inside Quest, I need to use that same name as the id? I don't quite understand how the Panes are defined.
Ooh, I'll have to brush up on that before I can answer, haha. Oddly, the first thing I learned was HTML and a little CSS. Then, I started fooling with JS and forgot most of the CSS along the way.
Anyway, I used to know that. So, shouldn't take me long to refresh my memory.
EDIT: Okay, so I removed playercore.js from the html scripts, and I began copying over what I believed to be relevant code for CustomPane. Then I saw code for GRID, playercore is adding some functionality for other things.
Hrmm. See, I don't know... The Quest repo has 3 different playercore.js files. One in the desktop player, one in the web player, and one in the mobile web player. The one in the web player doesn't do anything when it calls
ui_init
by design, and that makes me think maybe we should compare this old playercore.js file in the converter repo to the playercore.js file in the Quest web player.Also, I haven't seen Alex Warren (creator of all this stuff) post anything on the site ever, and he just posted on the Squiffy forum that he is currently helping fix up issues on the site.
Depending upon how active he becomes, maybe you can convince him to look into one of these issues with the converter.
I have no clue if he'll be active in the forums at all. I've never had the opportunity to correspond with him before (hence the need I felt to thank him for the site and the software in that forum post).
Well lets get the custom pane working first and then see about Grid, but I think we're really close. If we hit a significant roadblock I can see if he's around though. Once we determine the relevant code from playercore, we can look at which playercore works.
https://github.com/KVonGit/quest-compiler/discussions/6
I think maybe I fumbled my way through fixing it(?).
6
I think maybe I fumbled my way through fixing it(?).
Maybe, but on my end the game is coming up with init is undefined. I tried a couple of different versions of the compiled game.js too.
Error: Uncaught ReferenceError: init is not defined Line 28 in index.html:
function onBodyLoad() {
init();
}
Should I make these changes to the Compiler's game.js and re-compile instead?
EDIT: Wait, I got it. I had to make more changes to game.js on my end. Now the problem is that the pane doesn't updated with the NPC stats after selecting the NPC type.
Changes needed, in addition to what you already added to game.js: Change line 2643
function Mid(text, start, count) {
return text.substr(start - 1, count);
}
to:
function Mid(text, start, count) {
return text.substring(start - 1, count);
}
I had to remove this too:
$ grep "setPanes" *
playercore.js:function setPanes(fore, back, secFore, secBack, highlight)
Now the custompane appears at the top of the game window, with the attributes at 0 to start, but they do not update after the NPC type is selected.
Hey! You fixed the thing with Mid()
. I saw that error once or twice a few days ago and never remembered to go look at that.
Rock and roll.
Also, my bad: the grep
is from the BASH terminal, finding which file the function was in. Whoops, I shouldn't have posted that bit.
Now the custompane appears at the top of the game window, with the attributes at 0 to start, but they do not update after the NPC type is selected.
Hrmm... I'm pretty sure you have to run JS.setCustomStatus()
each time something is changed. Unless you have a div id for the stat value to change that bit with jQuery or something like that. Wait... If it works in Quest, it should work here. I assume it works in Quest?
Drop your current game folder (the whole thing, including the Quest game files) into the other repo (you don't have to zip it first, I can just clone it from git
to download it easy peasy): https://github.com/KVonGit/Raists-Game-File-Sharing/upload/main
Hey! You fixed the thing with
Mid()
. I saw that error once or twice a few days ago and never remembered to go look at that.Rock and roll.
Also, my bad: the
grep
is from the BASH terminal, finding which file the function was in. Whoops, I shouldn't have posted that bit.Now the custompane appears at the top of the game window, with the attributes at 0 to start, but they do not update after the NPC type is selected.
Hrmm... I'm pretty sure you have to run
JS.setCustomStatus()
each time something is changed. Unless you have a div id for the stat value to change that bit with jQuery or something like that. Wait... If it works in Quest, it should work here. I assume it works in Quest?
Correct, it does work in Quest. The way the tutorial set it up was the function InitUserInterface, JS.eval sets up all the html span classes, var s is defined using all the html
if (HasScript(lady3, "changedhealth")) {
do (lady3, "changedhealth")
}
if (HasScript(lady3, "changedweapon")) {
do (lady3, "changedweapon")
}
if (HasScript(lady3, "changedstr")) {
do (lady3, "changedstr")
}
if (HasScript(lady3, "changedint")) {
do (lady3, "changedint")
}
if (HasScript(lady3, "changeddex")) {
do (lady3, "changeddex")
}
if (HasScript(lady3, "changedmp")) {
do (lady3, "changedmp")
}
if (HasScript(lady3, "changedphysical")) {
do (lady3, "changedphys")
}
if (HasScript(lady3, "changedfireh")) {
do (lady3, "changedfire")
}
if (HasScript(lady3, "changedcold")) {
do (lady3, "changedcold")
}
if (HasScript(lady3, "changedpoi")) {
do (lady3, "changedpoison")
}
if (HasScript(lady3, "changedenergy")) {
do (lady3, "changedener")
}
JS.eval ("$('#status_div').insertAfter($('#compassAccordion'))")
Now, after the player selects the NPC, those values call those functions and update the values for each attribute in Quest.
EDIT: archive uploaded
I see.
That sounds right. In fact, it was what I was planning to suggest, haha.
I am updating the game.js and index.html in this repo, then I'm going to check out your game files.
I see.
That sounds right. In fact, it was what I was planning to suggest, haha.
I am updating the game.js and index.html in this repo, then I'm going to check out your game files.
Object links are broken. I'm seeing: You can go {go {} towards the North, { the North, {} towards the West, { the West, {} towards the Falconer's Inn or {e Falconer's Inn or {}.
They were working there for a minute LOL
EDIT: Crap, we broke all the panes...
Dude... I hate Visual Studio. I'm sure it's because this little laptop with 2 gigs of RAM just cant handle it, but dude... I hate Visual Studio.
I am typing this on a tablet. I've been waiting for VS to open one document for 41 minutes, I know by the time of my last post. That was when I started.
Aha! Finally! Switching back to the PC where I can check the game out in 5.
I changed Mid()
from substr
to substring
as per this: https://github.com/KVonGit/quest-compiler/issues/3?notification_referrer_id=NT_kwDOAdPHVbQxMTg5ODY0ODA3MDozMDY1NjM0MQ#issuecomment-2287162573
That is what broke the object links. Change it back in your game's game.js and see if it fixes it.
...and that makes no sense to me. I was sure that was just a typo you found. Now I have to go look up substr
VS substring
in JS.
What was throwing the Mid()
error anyway? Do you remember? It only threw that error once and I could never reproduce it.
https://stackoverflow.com/questions/3745515/what-is-the-difference-between-substr-and-substring
The difference is in the second argument. The second argument to substring is the index to stop at (but not include), but the second argument to substr is the maximum length to return.
So, if I know what calls Mid()
that throws an error, I can probably finagle something to catch it and use the proper thingy.
Just uploaded updated game.js and a new release that fixes lots of stuff, probably breaks some stuff too, but I didn't see anything directly concerning setCustomStatus()
mess up after playing for a couple of minutes.
Closing this one.
What made you look at Mid()
?
I'm mildly curious.
setCustomStatus()
doesn't work and is disabled.