pychnight / custom-quests Goto Github PK
View Code? Open in Web Editor NEWServer Side Quests System for Terraria
Server Side Quests System for Terraria
Need a command to reset player data back to the default.
Currently there is no way to set the respawn location of the player, Please provide a way to do this for quests, so we don't always go back to Map Spawn location during quests.
Lua functionality
Store map spawn / bed spawns at the start of the quest (so, we can restore previous points)
Allow setting of the new spawn / bed points to X,Y location in the lua script.
Note Must Comply with Parties / Threading Changes.
Right now for both Leveling and Quests, the database seems to hang on closing the server for a abnormal amount of time.
Also Fix this for
Alright, it seems very likely cross server stuff is not possible. so changing that request into something that can be done. #7
Instanced Quests when players join the quest they can't see or interact players outside this quest including Monsters, Items, Fired Projectiles, Other players, Tiles everything created or generated by the player must only be view able by the players inside the instance
This includes clearing up tiles when players leave / rejoin during a instanced quest, (schematics)
Basic concept
a instanced quest is a alternative realty where tiles, items, monsters and the players themselves are sent to anther reality of the same server, where other players can't interact with them and can't see them
this might be more difficult then the cross world method, but if cross world can't be done this is the only alternative. unless you can think of a better solution.
Currently Custom Quests has a option to restrict the quest to a certain amount of attempts per day.
You should add option to allow the allowed amount to reset after a specific amount of time defined within the quests config. thus allowing Daily quests. or what ever time you put.
You should be able to specify time reset for each quest and if the value is 0 it will never reset.
Other then that ensure quests added to config including quests given to players on join can be refreshed using /reload
IF you add a invalid quest to the database it will prevent the quest list command from listing other valid quests, also ensure that default starting quests field is actually applied during reload.
Other Task
Improve Set Status to support multi-message objectives with multi-color (1 color per message)
Format
this should be maybe turned into a objectives list? where we can freely add and free objectives at will and have 5 objectives per page
so party:setObjectives("test", 0, red) will override the objective in index 0 of the objective list
it will add the strings in order from 0 to whatever number.
merged into wiki update ticket
Task List
Ensure support for parallel event Execution | #1 and #5
Ensure Plugin Stability (Prevent Crashing, Make thread safe as possible, I will be running this 24/7)
Fix Crashing with events that loop for long periods of time. (if you abort a quest while the quest is executing a loop it will cause server crashes)
Redesign Parties functionality, Add Team support and new lua events.
Redesign AddTrigger Functionality to support new parallel event execution code and ensure you can add it at any point of the file.
Example
AddTrigger(1, false, "1")
1= Wait(TimeSpan.FromSeconds(2))
1.Callback = function() party:SendMessage("Slime Counter: ".. slimeamt, Color.Magenta) end
Won't execute however this example will work.
1= Wait(TimeSpan.FromSeconds(2))
1.Callback = function() party:SendMessage("Slime Counter: ".. slimeamt, Color.Magenta) end
AddTrigger(1, false, "1")
Other examples quests should be able to do..
Example Filling room with water, while spawning sharks then having anther trigger checking to see when the water is at 30% filled in the room, and the main trigger is waiting for the player to reach X location.
Example 2: Requires 2 players to flip the switch at the same time in 2 different locations to open a door.
Add new lua feature to send the player to anther server during a quest.
Ensure during the "transfer" quest is not aborted, and continued on the other server.
This requires support for external mysql databases for Leveling, Housing, Quests Plugin.
This also requires both servers to have the same plugin and server scripts for the quest, otherwise it will error out or abort the quest.
New commands for server transfer
Room names are defined within the config file and alias for each room.
/lobby join (room name)
/lobby leave (sends you back to the previous server)
/lobby list (checks server list and status (player count + online / offline) )
/lobby send (forces a player to join targeted lobby / server)
New lua Functions to send the party over to the new server
party:sendconnect("ip","port")
Player Data that should be tracked
#10 Mentions this data
QuestStart Time, Quest Finish time (this is per quest, think as this as a anti-cheat or ladder board type data, though with cross server quests, not sure how you would handle this to ensure the data for actually finishing the quest is correct)
Quests Completed
Quests Unlocked
Currently your only able to use monster names "Green Slime" rather then it's id. you should allow the usage of both for spawning monsters and spawning items and removing items and checking items.
Ensure spawning monsters, items and other stuff always spawns the correct amount specified
Parties kicking the user out of the formed party after doing quests or aborting
should be fixed
Parties malfunctioning if the player disconnects during quest progress
Suggestion you should force the second member to become the new leader and pass down the rank. into the player can rejoin, the player on rejoin should be asked if they would like to rejoin that quest.
also add a allowrejoin in the config to prevent rejoining function from being used.
Issues with no error detection when the quest load, invalid quests are still added to the quest list and show up into they player starts them.
this should be improved.
Ensure wiki is updated with boo examples and usage.
Following Goals
Allow Unlimited execution of multi-able events at the same time
Fix Serious issues
Treat every party member inside the party as a part of the quest and allow trigger execution on all members
Including detection of hp, etc
Party Enhancements
Treat parties like actual parties and have the ability to target specific players in teams or players by themselves.
Scripting Improvements
Schematics
Database Data
Find a safe way to load schematics at a X,Y location inside a quest and unload them / despawn them after the quest is completed.
and even allow to generate a house based on a script from boo (using random generation #methods).
Merged into other ticket
Merged into other ticket
Currently if lua paths are invalid the error will just be very generic and will not give you a reason or error message on where or why this error has occurred.
Boo has proven to be more flexable then Lua and is more light weight and has shown a prefomance gain in custom npcs.
Currently everything under the parties function assumes you want to send the event to everyone in the parties such as party:SetQuestStatus("QA TEST 1.", Color.Magenta)
Parties Formation Logic
All functions and triggers should support "Parties, Leader, Index#, String" Logic | #3
Parties Keyword
should always send the event to everyone in the party. everyone can see and read the event.
Leader Keyword
should only send the event to the leader this is where the leader can only able to make a choice and the party is forced to follow.
Independent flag This flags the event to be sent independently to each player that matches the input.
such as Leader + Independent True = party leader will only get it, what ever choice made by the leader for that event will not effect other members within the same party.
Concept of Independent flag is every function and trigger will ask is this independent?
if it is then only run for that player.
Such as..
party:SetQuestStatus("QA TEST 1.", Color.Magenta, Party, true)
will run for each player inside the party and the event is Independent.
meaning this function will run as if there doing a single player run of the quest for each player inside the party.
Index# Only sends the event to a specific player within the party, Index Value should execute the event for the specific index value of that party,
"String" pretty much a player list for teams and customized list that store specific players assigned to teams.
How parties should work parties should always form up like this
Parties Index 0 = Always leader regardless (moving or becoming the new leader will always make you index 0.)
Parties Index 1 = Player 1 (always the player who joins second) as the Index value advances it changes the player, if players leaves that index spot is now free and the same player decides to rejoin the party within 5 minutes there allowed back into the quest, however if the party member willingly leaves the party using /party leave or /party kick they will not be asked this question and if this is a cross server quest, it will also not allow the player to rejoin.
After Implementation
party:SetQuestStatus("QA TEST 1.", Color.Magenta, Party, true)
it will set quest status to QA TEST for each party member and the event is Independent
party:SetQuestStatus("QA TEST 1.", Color.Magenta, Party, false)
it will set quest status to QA TEST for each party member and the event is not Independent
party:SetQuestStatus("QA TEST 1.", Color.Magenta, 2, false)
it will set quest status to QA TEST for party member of index 2 and the event is not Independent, however if there is no player on that index within the party then the quest will not execute the trigger or event. it's up to the lua coder to implement fail safes.
party:SetQuestStatus("QA TEST 1.", Color.Magenta, "Green Team", false)
it will set quest status to QA TEST for all party member of team X and the event is not Independent.
Parties Team Logic
Parties should support Teams currently it assumes all members that are within the same party are on the same team.
So we need to implement logic for being able to read and set the players teams for each party member.
Setting the team
party:giveteam(party, 1, color.red, true)
Format: Effects, Team Number: Team text color (above there heads), Forcepvp
forcepvp function will work as the player can harm all other players not on the same team.
Reading the team
if parties.team(party, 1, true) then
do crap
end
How it reads (party, team number, is pvp on?)
Making conditions for reading index value and setting them dependent on choices
select = Condition(function()
return party.index >= 0
end)
select.Callback = function()
foreach party.index do
party:SetQuestStatus("please select your team.", Color.Magenta, party, true)
party:GiveTeam(1, "Select Team", Color.Mangenta, party, true)
if party.team == 1 then
party:SetQuestStatus("Valid keywords for teams, Red, Blue.", Color.Magenta,
party, true)
else
party:SetQuestStatus("Team Already Selected", Color.Magenta,
party, true)
redteam = Condition(function()
return parties.team(party, "Red Team", true)
end)
redteam.Callback = function()
party:GiveTeam(2, "Red Team", Color.Red, party, true)
end
Condition(function()
return party.index >= 0
end
Above is non-functional code just to provide a example of use cases
New functionality and triggers are requires massive changes
party:SetPosition(Leader or party or index, X,Y, Sent To)
Sets the position of a player to X,Y point without the teleportation effect
party:SetTeam(Team Number or Attached String, Team Color, Sent to) Gives team number to specified party also attaches a string to the party, in-case lua coders prefer to use strings instead of team numbers.
party.SetSPIndex
Allows lua coders to set special index for coding purposes
allows you to store party members into strings or sets the index to a specific player.
party.SPindex(Index Number or String)
Reads the value or string list from SPIndex.
party.index
Stores Party members by index, Party leader is always index 0. This only stores all members inside the party
Party.Team(returns the set team number or string)
Returns current Team for specified input.
Party.SetPVPState(Party or Team Number or String, true)
Sets current pvp state for specified input.
Party.PVPState(Party or Team Number or String, true)
Returns current pvp state for specified input.
New commands
Make a command to change party leader to anyone in the party as long as the quest is not currently running.
Party Kick (forcefully remove player from party, can't be used unless your party leader, if used on cross server quests, it will force the player to transfer back to the main server)
#1 Party Restructure
#3 Trigger Execution order problems
Must follow above changes.
Convert old untils.lua functionality / replace
Feel free to burrow from custom npcs 2 for said functionality.
Critical missing
Redundant (no longer required?)
ForEachPlayer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.