#(thatkev) Conditional lore
15 messages · Page 1 of 1 (latest)
(thatkev) Conditional lore
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You could use procedure scripts for this. Write a procedure to determine an outcome, your lore in this case. Then reference the procedure in your item script lore key with <proc[my_procedure_here]>
Alrighty
Can I pass things into the procedure script? I have multiple items that need to undergo this permission check differently
^^ found it, context
Yep! That is exactly what procedure scripts do. Lemme see if I can bring up the meta.
!l procedure script
Procedure script containers are used to define a script that can be ran through a tag.
Generally called via !tag proc or !tag proc.context.
The only required key is 'script:'.
Note that procedure scripts must NEVER change external state.
That is, a procedure script cannot change anything at all, ONLY determine a value.
Setting a flag, loading a YAML document, placing a block, etc. are all examples of external changes that are NOT allowed.
This restriction comes from two main reasons:
- Tags run in arbitrary conditions. They may be read asynchronously or in other weird circumstances that can result
in applied changes crashing your server or other unexpected side effects. - Tags can run for a variety of reasons.
If you were to make a proc script 'spawn_entity' that actually...
Script Container System
great, got it working :)
Leaving it here incase anybody's stumped in the future
validatelore:
type: procedure
definitions: planet
script:
- if <player.has_permission[planet.<definition[planet]>]>:
- determine <&a><&l>Unlocked.
- else:
- determine <&c><&l>Locked.```
👍