Hi all,
I am still fairly new to Skript having taken a large break from it the last year, I want to resurrect an old project and while I had some success doing things myself with the documentation, my next project is a bit more ambitious and before I start down the wrong road I wanted to ask if anyone can suggest a functional way of storing the data I want, that won't cause things to get messy later on.
Let me explain the project.
I am currently running a DND campaign via a well known TTS (Table top simulator) and I want to have some parts automated for the characters downtime allowing them to do things in the MC world in-between sessions rewarding time and effort without my having to be party to it.
This relies on me having some kind of stored stat system for each player in-game, I was planning on using normal variables, but after reading Sluhties post on performant ways to store data figured id start this thread and update as I create my skript.
After reading it through I want to make sure I am not creating issues for myself in the future.
An example below before I update this evening with a framework for the skript. Tips in advance are more than welcome, anything that is glaringly wrong feel free to tell me, once I am home and can test I will adjust as needed based on what I can find, or potentially what someone can post here to save me before I need saving
For clarity, all rewards are just examples I plan on having named items that aren't available in the playable area themed around the activity they chose to do, with those rewards exchangeable for items in the DND campaign on the TTS.
I haven't worked out the best way to connect the two worlds other then having player rewards named by the skripts and then have them give them to me in MC to then manually add onto the TTS but I won't worry about tht until later. ((Meaning they can swap rewards or trade In MC for things the other players can then roll for which are only locked to character after naming etc))
Edit: Changed it after running through the parser
I am still fairly new to Skript having taken a large break from it the last year, I want to resurrect an old project and while I had some success doing things myself with the documentation, my next project is a bit more ambitious and before I start down the wrong road I wanted to ask if anyone can suggest a functional way of storing the data I want, that won't cause things to get messy later on.
Let me explain the project.
I am currently running a DND campaign via a well known TTS (Table top simulator) and I want to have some parts automated for the characters downtime allowing them to do things in the MC world in-between sessions rewarding time and effort without my having to be party to it.
This relies on me having some kind of stored stat system for each player in-game, I was planning on using normal variables, but after reading Sluhties post on performant ways to store data figured id start this thread and update as I create my skript.
After reading it through I want to make sure I am not creating issues for myself in the future.
An example below before I update this evening with a framework for the skript. Tips in advance are more than welcome, anything that is glaringly wrong feel free to tell me, once I am home and can test I will adjust as needed based on what I can find, or potentially what someone can post here to save me before I need saving
Code:
on first join:
if {Strength::%player%} is not set:
set {Strength::%player%} to 10
if {Dexterity::%player%} is not set:
set {Dexterity::%player%} to 10
if {Constitution::%player%} is not set:
set {Constitution::%player%} to 10
if {Intelligence::%player%} is not set:
set {Intelligence::%player%} to 10
if {Wisdom::%player%} is not set:
set {Wisdom::%player%} to 10
if {Charisma::%player%} is not set:
set {Charisma::%player%} to 10
if {Exhaustion::%player%} is not set:
set {Exhaustion::%player%} to 0
on death:
add 1 to {Exhaustion::%player%}
# commands to set stats usable by GM etc - I haven't tested this it may be completely incorrect to set a variable like this.
command /setstr <number> <player>:
Trigger:
if player has the permission "set.stats":
if arg-1 and arg-2 is set:
set {Strength::[arg-2]} to arg-1
else:
message "set value followed by player name."
else:
message "You do not have permission to use this command"
# rewards based on stats - very rough and I expect to use this as a framework to make multiple different activities
on mine:
if block is stone:
if {Exhaustion::%player%} >= 17:
chance of 0.001%
clear drops
drop emerald named "&aGemstone"
if {Exhaustion::%player%} >= 20:
chance of 0.01%
clear drops
drop emerald named "&aGemstone"
chance of 0.001%
drop emerald named "&aRare Gemstone"
else:
chance of 0.2%
clear drops
message "You aren't skilled enough to harvest this gemstone"
drop stone named "&eBroken Gemstone"
For clarity, all rewards are just examples I plan on having named items that aren't available in the playable area themed around the activity they chose to do, with those rewards exchangeable for items in the DND campaign on the TTS.
I haven't worked out the best way to connect the two worlds other then having player rewards named by the skripts and then have them give them to me in MC to then manually add onto the TTS but I won't worry about tht until later. ((Meaning they can swap rewards or trade In MC for things the other players can then roll for which are only locked to character after naming etc))
Edit: Changed it after running through the parser
Last edited: