Research Table ๐Ÿ”ฌ

Research Table ๐Ÿ”ฌ

141k Downloads

[Suggestion] - Add support for scoreboards

BasieBrinkie opened this issue ยท 15 comments

commented

hello dev,

I'm currently developing a modpack centred around your mod for handling the gamestages integration. I want to create a system that allows questlines in FTB Quests to be locked behind certain research. Every questline has a certain amount of required researchpoints before the user can unlock it. My idea was to display a scoreboard within the menu of the research table which is called researchpoints or RP for short. Each research tab in the table would consume research points set by Crafttweaker with:
.consumeRP(int)
That way I can add points with FTB Quests with the command:
/scoreboard players @p add researchPoints xAmount

Hopefully you will implement such a system, nonetheless thanks for reading
BasieBrinkie

commented

My English is bad. Let me conclude this:

You want to unlock a research by consuming points from scoreboard right?

commented

That's basically it yes, whether it is by minecrafts native scoreboard system or an internal scoreboard added by your mod, as long as it is accessible by a command for compatibility between FTB Quests.

BTW, your English doesn't seem bad to me looking at your past responses and your code

commented

You can execute commands when you complete a research. it does not meet your need?

commented

What I meant was a command that can be executed in FTB Quests to grant points when you complete quests, if you were to implement a scoreboard system.

commented

I think I got that. But it is a big work and it won't be done very fast. What is ETA of your pack?

commented

at least a few months, it all being made with gamestage so no hurry there

commented

Added in 0.7

commented

Thanks for the quick update, been toying with it for a while now. Would it be possible to display a scoreboard in the description of researches? I'm not a fan of having the sidebar permanently displaying the score.
Another suggestion would be to create the scoreboard if it doesn't exist yet. This can be useful because otherwise, packdevs need to throw another mod in the pack that creates the scoreboard at world creation.
Also, would you mind telling me what the use is of the .setTrigger(Item/Command) functions?

If you are interested you could drop by my modpack GitHub and see how I've currently implemented your mod with crafttweaker zenclasses.
https://github.com/BasieBrinkie/AstroCraft/blob/master/scripts/initialScripts/classes/mods/researchTable.zs

commented

The sidebar is just for demonstrating, you do not have to run that command. setRequiredScore only checks if the score meets requirement but it does not subtract points. So trigger is used to run a command to "remove score".

If you need create a score objective when game started, you can use ZenScript to do that (not very sure)

commented

As far as the CT2 wiki goes there is no event for world creation, the closest you get is onPlayerJoin for running the command.
I do know that the sidebar is not needed but how do players otherwise see how many points they have? My implementation involves that every research has got its own worth of points. Everytime you want to do research it will consume points, it could be very confusing for players that sometimes the player can do one research and sometimes five times in a row. therefore I'm asking for something that makes the user vlear how many points (researchpoints they have within the description of a research. is .setRewardCommand and .setTriggerCommand equal then?

commented

Reward: run when research complete
Trigger: run when research start

commented

I have added a simple indicator but I discovered that you have to set the score somewhere to let minecraft sync the score. It is possible to fix but I hope someone else may fix it, I am lazy

commented

I've figured out that you need to run /scoreboard objectives setdisplay sidebar scoreboardDummy before you can do any research with scoreboards. Is that what you mean by syncing the score? Also could you send a screenshot of how you implemented the score indicator, mine is not working but that could be because of the complicated zenscripting with custom zenClasses I created.

commented

You need to set the objectives display somewhere to make server sync the score data to clients.

I saw your codes. https://github.com/BasieBrinkie/AstroCraft/blob/master/scripts/stages/stagesResearchTable.zs#L140

It is correct if your objective's name is researchPoints

commented

If you set scores to indicator, the scores will be cached now.