#calling on a JSON UI using scripts

1 messages ยท Page 1 of 1 (latest)

haughty cypress
#

its just a simple form with a few buttons

#

activated with using a custom item

#

the custom ui is a modified server form file

#

namespace is of "server_form"

#

how could i cativate this ui using my custom item instead of a regular form?

haughty cypress
#

anyone?

gusty raft
#

I can explain how it's done but I can't show you ๐Ÿคก

You need a binding within the server_form checking for the title. Then you just need to set that same title you set in the json file in the .title() of your ActionForm. Once you've done that, your custom form should display instead of the default server form.

inland jungle
gusty raft
# inland jungle So, how about opening many different forms?

You'll have to create additional json files. From there you pretty much have to reference each and every form you're trying to use inside of the server_form file. I actually managed to find some of my old code but here's how you go about creating a custom form that you can use from another json file.

"controls": [
  {
    "long_form@common_dialogs.main_panel_no_buttons": {
      "$title_panel": "common_dialogs.standard_title_label",
      "$title_size": ["100% - 14px", 10],
      "size": [225, 200],
      "$text_name": "#title_text",
      "$title_text_binding_type": "none",
      "$child_control": "server_form.long_form_panel",
      "layer": 2,
      "bindings": [
        {
          "binding_name": "#title_text"
        },
        {
          "binding_type": "view",
          "source_property_name": "((#title_text - 'custom_form') = #title_text)",
          "target_property_name": "#visible"
        }
      ]
    }
  },
  {
    "custom_form@custom_form.main_panel": {
      "layer": 2,
      "bindings": [
        {
          "binding_name": "#title_text"
        },
        {
          "binding_type": "view",
          "source_property_name": "(not ((#title_text - 'custom_form') = #title_text))",
          "target_property_name": "#visible"
        }
      ]
    }
  }
]```
#

From the code I provided of course you'll need the extra file I mentioned with the namespace being "custom_form" and you'll need to reference the file path inside of the ui_defs.json file so that the game can also find that file ๐Ÿ‘

inland jungle
#

If I add another form, is it the same as above?

#

I mean add more custom forms

gusty raft
#

well you'll have to add more to the source_property_name to make sure it filters out the other custom forms

inland jungle
#

like custom1, custom2

gusty raft
#

yeah, you can keep doing that technically

#

it's all about making sure the source property name is correct otherwise it wont work

#

I've always hated figuring out how to write that part properly though

inland jungle
#

I got it

#

thank you for sharing

gusty raft
#

You're welcome ๐Ÿ˜… I'm trying lol

haughty cypress
#

uh strange

#

i have an issue

#

@gusty raft

#

this is NOT the ui that is supposed to showe

#

this is the default form which i edited

#

i used what you told me

#

the file of the custom ui is

#

"doll.json"

#

it is defined in ui defs

#
"controls": [
    {
      "long_form@common_dialogs.main_panel_no_buttons": {
        "$title_panel": "common_dialogs.standard_title_label",
        "$title_size": ["100% - 14px", 10],
        "size": [225, 200],
        "$text_name": "#title_text",
        "$title_text_binding_type": "none",
        "$child_control": "server_form.long_form_panel",
        "layer": 2,
        "bindings": [
          {
            "binding_name": "#title_text"
          },
          {
            "binding_type": "view",
            "source_property_name": "((#title_text - 'custom_form') = #title_text)",
            "target_property_name": "#visible"
          }
        ]
      }
    },
    {
      "custom_form@custom_form.main_panel": {
        "layer": 2,
        "bindings": [
          {
            "binding_name": "#title_text"
          },
          {
            "binding_type": "view",
            "source_property_name": "(not ((#title_text - 'custom_form') = #title_text))",
            "target_property_name": "#visible"
          }
        ]
      }
    }
  ]
}```
#

used this

deep prawn
#

I would lend you mine to make an advanced one, but I find it difficult to understand

haughty cypress
#

thats ok

#

the one im working with is pretty advanced too.

#

"source_property_name": "(((#title_text - $maps) = #title_text) and ((#title_text - $emojis) = #title_text) and ((#title_text - $cosmetics) = #title_text) and ((#title_text - $grid) = #title_text) and ((#title_text - $rank) = #title_text) and ((#title_text - $rules) = #title_text)))",

haughty cypress
#

this is a snippet from server form

deep prawn
#

Tell me what you're trying to do

#

Maybe I can help you

haughty cypress
#

various custom ui forms

haughty cypress
#

so i dont have to do any special title things to get this

#

i made a large grid form

#

that i am trying to call on

#

but dont know hopw

deep prawn
#

I will send mine in a file, for you to study

haughty cypress
#

ty

#

ill take a look and see if that can help me fix the issue

#

also nice ui

deep prawn
haughty cypress
#

the problem is this

haughty cypress
#

which should trigger my custom grid form

#

and is not

deep prawn
#

I understand that you want to call the UI, but I don't understand where it is

#

Oh, I think I understand

#

Do you want to change the name "custom_form"?

haughty cypress
#

good if u dont maybe i can send u the files

#

if i cant manage to fix it

deep prawn
haughty cypress
#

by titling my form

#

"custom_form"

#

it SHOULD call on my grid ui

#

but does not

deep prawn
#

I'll give you two ways to fix this

haughty cypress
#

this is what i had before

#

"source_property_name": "((#title_text - 'grid') = #title_text)",

#

it just dispolays the text 'grid" rather then actually displaying the UI

deep prawn
#

I can't understand what you want

#

Can it be direct?

#

I don't speak your language and that's making things difficult

haughty cypress
#

all i want is to activate my json grid ui

#

i dont care how

#

i dont know how to get it to trigger

#

i dont mind what method i use

#

how can i do that

deep prawn
#

Your interface isn't showing up and you want it to show up, but you don't know why it isn't showing up

#

And that?

haughty cypress
#

yes

#

correct

#

how can i render my ui?

deep prawn
#

Yes

haughty cypress
#

im so confused

#
                                        "source_property_name": "((#title_text = 'grid')",
                                        "target_property_name": "#visible"```
#

taht should work

#

but it doesnt....

#

@deep prawn

#

can i send u the grid form so u can take a look at it

#

bc i have no damn clue how to fix this

#

ive been working on this for hours

gusty raft
#
  1. custom_form is whatever you want to call it
  2. @custom_form is the namespace at the top of your custom form
  3. .main_panel is the chunk of code you're referring to from your custom form
haughty cypress
#

it worked

#

new problem....

#
   "binding_type": "view",
                            "source_property_name": "((#title_text = 'grid')",
                            "target_property_name": "#visible"```
#

thats what im using

#

it is showingt my custom form

#

however it is also showing the default form underneath...

#

wait nvm i fixed it

#

๐Ÿ™‚

gusty raft
#

might wanna go careful on the zeqa ui though

sharp bone
# deep prawn

How did you get the player to render like that on the top left corner?

#

Also does that overwrite the doll? That shows up

#

And is that a stamina bar too?

#

I've been looking for help on making a stamina bar using scripts but no luck

ocean prism
ocean prism
ruby moon
sharp bone
# deep prawn

How do you make the player head appear like that on the top left corner?

dawn plover