#(drjoenh) Determine with logic

13 messages · Page 1 of 1 (latest)

sharp escarp
#

Hello, I would like to suggest possibility to use logic within determine command
What do I mean?

The way we are now determining booleans:

1:

Using if command. This one is pretty straightforward but we are still doing if something true -> return true, else -> return false (just more lines...)

check_some_level:
  type: procedure
  definitions: __player|required_level|some_data
  script:
    - if <player.flag[some_level]> >= <[required_level]> and <player.has_flag[can_buy_things]> or <[some_data].get[enabled]>:
      - determine true
    - determine false

2:

Using just tags. This one becomes unreadable after we add more complex logic.

check_some_level:
  type: procedure
  definitions: __player|required_level|some_data
  script:
    - determine <player.flag[some_level].is_more_than_or_equal_to[<[required_level]>].and[<player.has_flag[can_buy_things]>].or[<[some_data].get[enabled]>]>

What would it look like if we could use logic within determine command?

check_some_level:
  type: procedure
  definitions: __player|required_level|some_data
  script:
    - determine <player.flag[some_level]> >= <[required_level]> and <player.has_flag[can_buy_things]> or <[some_data].get[enabled]>
boreal umbraBOT
#

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.

flint oarBOT
#
Changed to Discussion

Thread is now a Discussion thread. This indicates that the thread is not requesting help in any way, and is just discussing a broad topic openly. If you need help with something, use </helpthread:1028674284870180883> to switch the thread back to a normal help thread.

sharp escarp
#

will leave it as discussion thread for now so that everyone can express their opinion about this

keen quartz
#

personally i'd prefer readability over compactness, but that's just me

#

i don't think the logic stuff in the determine command is a bad idea though

#

wouldn't it require a good bit of effort refactoring the determine command though? idk might just be me blabbering

plush orbit
#

I have a feeling if it were to be valid in a determine, it should be valid anywhere
No sense in adding this to only one specific command

sharp escarp
sharp escarp
dapper parcel
#

I agree, it does make sense

plush orbit