#Issue with open_requirement

1 messages ยท Page 1 of 1 (latest)

mellow wind
#

Heya! I'm having an issue with the open_requirement, for some reason it doesnt want to work ๐Ÿ˜„

the issue is following -

they do not open with both no.class or assassin.class permissions

I have 5 npcs with menus

from a 6th npc i receive the permission no.class

all of the menus should be able to open

after i click on the npc assassin and click join it will remove my no.class permission and put assassin.class and i can open only the assassin menu, not elemental, priest, hunter or warrior which will need either no.class or class .class permission

I've attached my menu.

maybe the open_requirement is wrong? idk, im trying to fix it for 4-5 hours now ;D

astral copper
#

if you want to make the permissions optional, you need to define that

#
open_requirement:
  minimum_requirements: 1
  stop_at_success: true
  requirements:
    permission1:
      type: has permission'
      permission: 'assassin.class'
      optional: true
    permission2:
      type: has permission
      permission: no.class
      optional: true
mellow wind
#

wont that make it when i dont have both permissions it will still open?

astral copper
#

wait

#

in the one i sent there is a clear yaml error

#

also i misunderstood

#

ahh

mellow wind
#

yeah i tried, they didnt load

astral copper
#

it's not actually an error

#

but it's including the ' in the has permission

#

you see? in the first one

#

has permission'

#

remove that and also you don't need minimum_requirements: 1

#

that's why I thought you wanted optional

#
open_requirement:
  requirements:
    permission1:
      type: has permission
      permission: 'assassin.class'
    permission2:
      type: has permission
      permission: no.class
mellow wind
#

idea is that i need one of those permissions

#

not both

#

because you first start classless and you need to access all 5 npcs with menus

#

and when you get your class you get the permission assassin/elemental/etc.class

#

and no.class is removed

mellow wind
astral copper
#

very confused, you seem to want what I originally put

#
open_requirement:
  minimum_requirements: 1
  stop_at_success: true
  requirements:
    permission1:
      type: has permission #removed the '
      permission: 'assassin.class'
      optional: true
    permission2:
      type: has permission
      permission: no.class
      optional: true
#

this will make it so if you have either permission, you can open the menu

mellow wind
#

is it required for the permission to have '' ?

astral copper
#

no, that is part of yaml formatting for strings

mellow wind
#

weird.. cuz i tried everything except with ' ' and it didnt work and now yours work.. ๐Ÿ˜„

#

im confused lmao

#

thank you

astral copper
#

I pointed out the error with the has permission'

#

It said

type: has permission'
#

only one ' at the end

mellow wind
#

ye ye i i misstyped, it wasnt here before that, still didnt work

#

idk what i did tbh

astral copper
#

so the string was has permission'

#

and to make them optional it needs to be defined

#

๐Ÿคทโ€โ™€๏ธ oh well, glad it's workin now!

mellow wind
#

ye!, thanks again ๐Ÿ™‚