Closed Hucaru closed 4 years ago
Will the source be moving from gomacro to JS? Yes, it does make sense and it is structured well. Will state be required for scripting or is that just for this test script?
Yea, I will be moving from gomacro to JS.
Will state be required for scripting or is that just for this test script?
State management will be up to the writer to implement in whatever fashion they want (could write their own fancy lookup table for a super complicated npc). For example if you have a shop script you could implement it in just:
var goods = [ [id1] , [id2, custom_price], [id3] ]
function run(npc, player) {
npc.sendShop(goods)
}
Since this npc isn't doing anything stateful then no state is managed. Whereas the example provided earlier is a demo of all the npc chat windows that can be used (apart from the pet one and an unknown one I need to figure out)
That makes sense. This seems like a logical switch. This way scripts can be pulled from existing sources and modified to work, rather than creating new scripts.
I have a PR up for the new script system and script hot loading. I have also converted the Henesys taxi script to the new format and tested it. I will merge it tomorrow unless there are any comments to address.
@ErwinsExpertise I have made progress on a script system for NPCs - the scripts are written in JavaScript. Is the following script clear?: