<npc.name> tag in world script

Discuss Denizen as a thing in general here. Also discuss the forum itself.
Mateo_
New
New
Posts: 6

<npc.name> tag in world script

Postby Mateo_ » February 11th, 2018, 3:16 am

Hey guys,
I am trying to make an inventory menu that narrates some stuff after choosing an option.

I've made a format script with <npc.name> tag but it couldn't be filled in that world script (on player clicks TestGUI_menu_yes in TestGUI_menu:).

Is there an option how to determine how the <npc.tag> has to be filled in that world script so that I wouldn't have to write the name manually?

Here is the script for better undestanding:
https://pastebin.com/rDMNxYHH

Mateo_
New
New
Posts: 6

Re: <npc.name> tag in world script

Postby Mateo_ » February 11th, 2018, 4:25 am

I came up with this:

https://pastebin.com/DPZYdL8p

Doesn't seem to be very effective... (it works tho)

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 168
Location: Los Angeles, California, USA
Contact:

Re: <npc.name> tag in world script

Postby mcmonkey » February 11th, 2018, 2:11 pm

You could add to the narrate commands an NPC argument, of the form like npc:<server.flag[relevantNPC]>
Denizen lead developer.
http://mcmonkey.org

Mateo_
New
New
Posts: 6

Re: <npc.name> tag in world script

Postby Mateo_ » February 12th, 2018, 8:14 am

How exactly? I haven't met with that yet.
I assume I should flag that NPC at the start of the interact script

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 168
Location: Los Angeles, California, USA
Contact:

Re: <npc.name> tag in world script

Postby mcmonkey » February 12th, 2018, 3:08 pm

Assign a flag with the value "<npc>" while it's available, however/whenever/wherever needed to track it correctly. Then just use that argument mentioned above on the end of any command that needs it, with npc: and then a tag that will read the flag.
Denizen lead developer.
http://mcmonkey.org

Mateo_
New
New
Posts: 6

Re: <npc.name> tag in world script

Postby Mateo_ » February 13th, 2018, 1:41 pm

Code: Select all

npc:<server.flag[relevantNPC]>
returns either true or false, so it wouldn't parse that NPCs name, would it?

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 168
Location: Los Angeles, California, USA
Contact:

Re: <npc.name> tag in world script

Postby mcmonkey » February 14th, 2018, 10:24 am

That shouldn't be returning a true/false at all...
It returns whatever value you put in it. In this case you'd be putting an NPC object in it.
Denizen lead developer.
http://mcmonkey.org

Mateo_
New
New
Posts: 6

Re: <npc.name> tag in world script

Postby Mateo_ » February 14th, 2018, 11:42 am

Okay, I have put there npc:n@id, works fine - is it better to use the server flag?

User avatar
mcmonkey
Site Admin
Site Admin
Posts: 168
Location: Los Angeles, California, USA
Contact:

Re: <npc.name> tag in world script

Postby mcmonkey » February 14th, 2018, 12:17 pm

... Yes. It is better to use the flag.
Denizen lead developer.
http://mcmonkey.org

Mateo_
New
New
Posts: 6

Re: <npc.name> tag in world script

Postby Mateo_ » February 14th, 2018, 12:46 pm

I mean, I still have to put it on the end of every narrate command (as written above)


Return to “General Denizen Discussion and Suggestions”

Who is online

Users browsing this forum: No registered users and 1 guest