-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Revscriptsys] RevNpcSys version 1.0 (lua npcs / NpcType / new npc system) #4671
Commits on Apr 30, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5539c3f - Browse repository at this point
Copy the full SHA 5539c3fView commit details -
- tree handling talkstates - a few bugfixes and corrections
Configuration menu - View commit details
-
Copy full SHA for 1c181d5 - Browse repository at this point
Copy the full SHA 1c181d5View commit details
Commits on May 1, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 860580e - Browse repository at this point
Copy the full SHA 860580eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7814076 - Browse repository at this point
Copy the full SHA 7814076View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad194ec - Browse repository at this point
Copy the full SHA ad194ecView commit details -
- adding storagevalue requirements for easy checks with failure respond function
Configuration menu - View commit details
-
Copy full SHA for 30ea721 - Browse repository at this point
Copy the full SHA 30ea721View commit details
Commits on May 2, 2024
-
documentation and splitting in files
- added documentation and annotations - split all the functions in different files for better overview and organization
Configuration menu - View commit details
-
Copy full SHA for e2aa611 - Browse repository at this point
Copy the full SHA e2aa611View commit details -
optimizations & better documentation
- if you add a callback to a keyword it can return false and also return a string for the failure respond message - changed order of calling functions in events 1) checks callback 2) checks requirements 3) opens shop now we are not opening shop even tho requirements or callback was not correct - added an example usage of callback in handler.lua - corrections in documentation
Configuration menu - View commit details
-
Copy full SHA for cb5d1da - Browse repository at this point
Copy the full SHA cb5d1daView commit details
Commits on May 3, 2024
-
requirements, modules & documentation
- constants.lua adding more messages to MESSAGE_LIST - events.lua fixing a problem where the player could say keywords without greeting the npc first added requirements added a `help` default keyword, which will tell the player to which keywords the npc responds - general better documentation - added modules.lua - added requirements.lua - added a test example npc data/npc/lua/#test.lua
Configuration menu - View commit details
-
Copy full SHA for 226419c - Browse repository at this point
Copy the full SHA 226419cView commit details -
remove unused function & other improvements
- removed `requireStorage` it's redundant as we have the same in requirements - renamed `setGreetRespond` -> `setGreetResponse` `setFarewellRespnd` -> `setFarewellResponse` - added `setGreetKeywords` `setFarewellKeywords`
Configuration menu - View commit details
-
Copy full SHA for d004a07 - Browse repository at this point
Copy the full SHA d004a07View commit details
Commits on May 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d788476 - Browse repository at this point
Copy the full SHA d788476View commit details
Commits on May 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for eac6ea2 - Browse repository at this point
Copy the full SHA eac6ea2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 683b96b - Browse repository at this point
Copy the full SHA 683b96bView commit details
Commits on May 6, 2024
-
- moved everything to NpcType - we don't create a NpcScriptInterface per npc created rather just load it by each NpcType -
Configuration menu - View commit details
-
Copy full SHA for 81fc9f3 - Browse repository at this point
Copy the full SHA 81fc9f3View commit details
Commits on May 7, 2024
-
- we are sharing one NpcScriptInterface instead of creating one for each npc
Configuration menu - View commit details
-
Copy full SHA for 7b15f62 - Browse repository at this point
Copy the full SHA 7b15f62View commit details -
forgot to include Co-Authored-By: Sarah Wesker <sarahelizabetwesker@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for fe9fb0f - Browse repository at this point
Copy the full SHA fe9fb0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d45354c - Browse repository at this point
Copy the full SHA d45354cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 29a4605 - Browse repository at this point
Copy the full SHA 29a4605View commit details -
improvements on keywords & responses
- `keyword` and `respond` support now multiple inserts via table - if there is multiple keywords for the same outcome we just point to one metatable instead of creating several (memory efficient)
Configuration menu - View commit details
-
Copy full SHA for ea11545 - Browse repository at this point
Copy the full SHA ea11545View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5acc33f - Browse repository at this point
Copy the full SHA 5acc33fView commit details -
added the missing events & callbacks
- made all the get functions of `NpcType` into const - added `NpcType.onMove`,`NpcType.onPlayerCloseChannel` and `NpcType.onPlayerEndTrade` with their callback functions - correction for lua npcs at ~NpcEventsHandler() which caused them to have no scripting interface when an npc was removed and respawned
Configuration menu - View commit details
-
Copy full SHA for ffa54e8 - Browse repository at this point
Copy the full SHA ffa54e8View commit details
Commits on May 8, 2024
-
shop works with item name aswell
- you can now use item names aswell for shop items
Configuration menu - View commit details
-
Copy full SHA for df23ff9 - Browse repository at this point
Copy the full SHA df23ff9View commit details -
- we are sending errors in console if the item does not exist or if it doesn't have the property to be able to pick it up
Configuration menu - View commit details
-
Copy full SHA for 4467f40 - Browse repository at this point
Copy the full SHA 4467f40View commit details
Commits on May 11, 2024
-
more functionality and slight fixes
- adding `NpcsHandler:farewell()` function to release focus on yourself on certain keywords. - fixed correct order of trying to get a failureResponse when working with callbacks - shows an error message if there is no set failureResponse
Configuration menu - View commit details
-
Copy full SHA for 477731a - Browse repository at this point
Copy the full SHA 477731aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4824668 - Browse repository at this point
Copy the full SHA 4824668View commit details -
changing pointers from shared_ptr to unique_ptr
- changing npcEventHandler shared_ptr to unique_ptr
Configuration menu - View commit details
-
Copy full SHA for 3b85b28 - Browse repository at this point
Copy the full SHA 3b85b28View commit details
Commits on May 12, 2024
-
added NpcVoices & few other things
- we can now add voices that the npc randomly talk or yell certain phrases - callback now when returning true can also directly return the message the npc shall respond with, if it's left empty or nil it'll fall back to the default respond message - few spelling fixes removeFocus -> releaseFocus - added NpcHandler:farewell() & NpcHandler:talk(table) functions
Configuration menu - View commit details
-
Copy full SHA for bf967d4 - Browse repository at this point
Copy the full SHA bf967d4View commit details -
- we are now able to set sub-keywords onto keywords which are triggered by storagevalues, if the player has the required storagevalue it'll move the talkState onto the sub-keyword instead of staying on the normal keyword - I've also changed the check order, requirements are now first load and then everything else gets executed if the check was good, if not we do an early return
Configuration menu - View commit details
-
Copy full SHA for b580581 - Browse repository at this point
Copy the full SHA b580581View commit details
Commits on May 13, 2024
-
- we check storage/level now with string operators ">=,==,<=,<,>" in requirements - we can set now custom failureRespond messages for requirements ex: failureRespond(REQUIREMENTS.storage, "I don't talk to normal people") this message would appear now if storage requirements are not met - added REQUIREMENTS to constants.lua - added NpcsHandler:setStorageValue(key, value)
Configuration menu - View commit details
-
Copy full SHA for 69cd124 - Browse repository at this point
Copy the full SHA 69cd124View commit details -
We now have to handle greeting with keywords, this decision was made due to npcs giving different respond greetings depending on storage values, that's why I moved the entire logic into keywords now
Configuration menu - View commit details
-
Copy full SHA for de5c7bc - Browse repository at this point
Copy the full SHA de5c7bcView commit details
Commits on May 15, 2024
-
- removed `__index` from keywords table, as we don't need it for that metatable - added `NpcsHandler:onCheckStorage` to erase some repetitive code
Configuration menu - View commit details
-
Copy full SHA for c74fb12 - Browse repository at this point
Copy the full SHA c74fb12View commit details -
adding onAnswer() & money transfer dupe
- onAnswer() can be used to get an answer from a player which doesn't match a keyword (transfer/deposit on a banker npc) it requires always to have a callback or it'll throw a warning message - added answer functions (add/get/reset) - fixed a bug when player transfers money to another player and the server would crash it would duplicate the money
Configuration menu - View commit details
-
Copy full SHA for b629df4 - Browse repository at this point
Copy the full SHA b629df4View commit details -
We don't reset the talkState if there is an onAnswer on this talkState
Configuration menu - View commit details
-
Copy full SHA for 2b71c28 - Browse repository at this point
Copy the full SHA 2b71c28View commit details
Commits on May 16, 2024
-
renamed get/add/reset answers into data
getAnswers -> getAllData getAnswer -> getData addAnswer -> addData resetAnswers -> resetData I've also fixed the travel module and added the greet keywords
Configuration menu - View commit details
-
Copy full SHA for 8dae802 - Browse repository at this point
Copy the full SHA 8dae802View commit details -
- removing npc:spawn() it's redundant - forgot to change one shared_ptr to unique_ptr
Configuration menu - View commit details
-
Copy full SHA for eba30a3 - Browse repository at this point
Copy the full SHA eba30a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 17d11e0 - Browse repository at this point
Copy the full SHA 17d11e0View commit details
Commits on May 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 37be7c5 - Browse repository at this point
Copy the full SHA 37be7c5View commit details -
We are now checking if npc is idle before we execute onThink this decreases cpu usage quite a lot, therefore the spectator range has been increased that the npc goes out of idle once a player is in yell range
Configuration menu - View commit details
-
Copy full SHA for 331e15e - Browse repository at this point
Copy the full SHA 331e15eView commit details -
- added inline constexpr for the Viewport calculation (can be evaluated once at compile time) - removed the non necessary declarations which thrown compile errors
Configuration menu - View commit details
-
Copy full SHA for 42b6302 - Browse repository at this point
Copy the full SHA 42b6302View commit details
Commits on May 21, 2024
-
- now players data gets properly erased once the player leaves the conversation with the npc
Configuration menu - View commit details
-
Copy full SHA for f82770e - Browse repository at this point
Copy the full SHA f82770eView commit details
Commits on May 23, 2024
-
- removed info struct and moved everything to public
Configuration menu - View commit details
-
Copy full SHA for cbfe62c - Browse repository at this point
Copy the full SHA cbfe62cView commit details -
- delay is now global and was removed out of the voices table, default delay is 30s and the delay can be set at handler:talk(voices, delay) - we check now if the voice it wants to say is the same as the last voice and then roll again until it finds another one if there are several to choose from
Configuration menu - View commit details
-
Copy full SHA for 75d3c85 - Browse repository at this point
Copy the full SHA 75d3c85View commit details
Commits on May 24, 2024
-
syncing players money on transfer
This now saves the player who was sending the money regardless if the receiver is online/offline and does a db query for the receiver to keep the bank balance in sync
Configuration menu - View commit details
-
Copy full SHA for 53dbb16 - Browse repository at this point
Copy the full SHA 53dbb16View commit details
Commits on May 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e6a1c43 - Browse repository at this point
Copy the full SHA e6a1c43View commit details
Commits on May 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 4a409f6 - Browse repository at this point
Copy the full SHA 4a409f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab9c994 - Browse repository at this point
Copy the full SHA ab9c994View commit details -
Configuration menu - View commit details
-
Copy full SHA for a3a3e66 - Browse repository at this point
Copy the full SHA a3a3e66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 21ad5bf - Browse repository at this point
Copy the full SHA 21ad5bfView commit details -
correcting parameters in onMove
Co-Authored-By: Sarah Wesker <sarahelizabetwesker@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 80a793c - Browse repository at this point
Copy the full SHA 80a793cView commit details -
The npc was not correctly focusing players when they talked to him, this bug is now fixed. Co-Authored-By: Sarah Wesker <sarahelizabetwesker@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for ff98732 - Browse repository at this point
Copy the full SHA ff98732View commit details
Commits on May 28, 2024
-
now you can check in requirements for certain vocations in order to pass
Configuration menu - View commit details
-
Copy full SHA for 0e4362b - Browse repository at this point
Copy the full SHA 0e4362bView commit details
Commits on May 29, 2024
-
- added some linter corrections and additions - changed player:getItemCount(id, subType) -> player:getItemCount(id, subType, ignoreEquipped) that way we can exclude equipped items or not - added NpcsHandler:addItems(table--[[,container, inbox]]) we can add a table of items with that, if the player doesn't have enough space or capacity then the items will be send to inbox - added Player.sendInboxItems(self, items, containerId) - re worked onStorageValue callback we can now set a "range" with ex: onStorageValue(1, ">", 10, "<") - re worked requirements (level & storagevalue) checks, they accept now ranged checks aswell level(1, ">=", 9, "<=") storage(10, ">", 50, "<") - changed NpcsHandler:teleport(pos) -> NpcsHandler:teleport(pos, magicEffectFromPos, magicEffectToPos) default is CONST_ME_TELEPORT - added NpcType:health(...) & NpcType:maxHealth(...) functions -added NpcRequirements:items(table) & NpcRequirements:removeItems(table) - added some stuff in constants.lua
Configuration menu - View commit details
-
Copy full SHA for cc3b704 - Browse repository at this point
Copy the full SHA cc3b704View commit details