Version 1.0 released

I have uploaded version 1.0.

There was no particular milestone; it just seemed to get to the point where it was about done. There have been no big changes for a while, and bug fixes have been getting fewer too. That is not to say it is bug-free, but we have to get to a full release at some point.

It can be found here:
https://github.com/ThePix/QuestJS/releases/tag/v1.0.0

You just need the QuestJS-1-0.zip file; the other two are added by GitHub and include some unnecessary files.

ETA: Version 1.1 now out, use this instead:
https://github.com/ThePix/QuestJS/releases/tag/v1.1.0


Now to create an editor...


Awesome! And Congrats! Moving over to the official 1.0!

Ah yes, the editor... I must admit though, I have been having fun cracking open Notepad++. It's been awhile.

Steve


Congrats! It sure does feel good (to me at least) to get to stamp that 1.0 on something.
Looking forward to seeing how that editor works out, even if it probably won't be compatible with the heavily edited v0.7 I've been using haha.


I have uploaded version 1.1 (already!) in part due to bugs pointed out on this forum. Also updates RPG lib for setting NPCs to guard.
https://github.com/ThePix/QuestJS/releases/tag/v1.1.0

In addition, this release significantly modified the "respond" function, which is used by other things, the most important being the NPC reactions system. If you do not use the "respond" function and do not use NPC reactions, this will not affect you. If you do, read on.
https://github.com/ThePix/QuestJS/wiki/The-respond-function

If you use the "respond" function with a default - the third parameter to the function - this will no longer work. You need to add an "extraScript" attribute to the first parameter.

// previously this worked
const params = {
  text:text1,
  text2:text2,
  actor:this,
  action:action,      
}
return respond(params, list, this.askTellDone)
// now should be this
const params = {
  text:text1,
  text2:text2,
  actor:this,
  action:action,
  extraScript:this.askTellDone,
}
return respond(params, list)

You can also add an "extraTest" attribute; this will be used with every response, in addition to its "test" function, if it exists.

Both "extraTest" and "extraScript" will be passed the params and the relevant response. Note that response could be undefined for "extraScript".

To illustrate, here is the new code for handling reactions. First the params are set up, with these new attributes. Then "respond" is called.

    const params = {
      char:this,
      noResponseNotError:true,
      extraScript:function(params, response) {
        if (!response) return
        if (!response.allowRepeat) params.char.reactionFlags.push(response.name)
        if (!response.noPause) params.char.pause()
        if (response.override) params.char.reactionFlags = params.char.reactionFlags.concat(response.override)
      },
      extraTest:function(params, response, ) {
        return !params.char.reactionFlags.includes(response.name)
      },
    }
    respond(params, this.reactions)

The built-in ASK/TELL system uses the "respond" function with a default, but that is all updated in the library, so there is nothing to do there.

The NPC reaction system now uses the "respond" function, which means that the "action" attribute needs to be changed to "script".
https://github.com/ThePix/QuestJS/wiki/NPCs:-Reactions

// previously this worked
    reactions:[
      {
        name:'bigHat',
        test:function() {
          return game.player.getOuterWearable("hat") === w.bigHat
        },
        action:function() { 
          msg("'Wow, what a great hat,' Mary says.") 
        },
        override:["smallHat"],
      },

      {
        name:'smallHat',
        test:function() {
          return game.player.getOuterWearable("hat") === w.smallHat
        },
        action:function(npc) {
          msg("'What a lovely hat,' " + lang.getName(npc) + " says.") 
        },
      },
    ],
// now should be this
    reactions:[
      {
        name:'bigHat',
        test:function() {
          return game.player.getOuterWearable("hat") === w.bigHat
        },
        script:function() { 
          msg("'Wow, what a great hat,' Mary says.") 
        },
        override:["smallHat"],
      },

      {
        name:'smallHat',
        test:function() {
          return game.player.getOuterWearable("hat") === w.smallHat
        },
        script:function(npc) {
          msg("'What a lovely hat,' " + lang.getName(npc) + " says.") 
        },
      },
    ],

Apologies if all this is a big headache to anyone, but to be honest I would be surprised if anyone is using these things. That said, you really should, if you want to create great NPCs!


Awesome! Onward and upward!

Thanks for the official release

Steve


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums