Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to navigate upwards from child node #4

Open
ryantpayton opened this issue Jun 3, 2019 · 6 comments
Open

How to navigate upwards from child node #4

ryantpayton opened this issue Jun 3, 2019 · 6 comments

Comments

@ryantpayton
Copy link

ryantpayton commented Jun 3, 2019

This might be something completely not worth while but I am having troubles implementing this feature so any help would be greatly appreciated!

Old wz files in MapleStory uses a property on the node called source to link to another place in the wz file. It's easy to find this location because it contains the whole string. So take off the root of the path. And then "node.root(); node.resolve(source);" and viola it works.

Current GMS implements a new strategy in which it uses _inlink and _outlink. _outlink is I believe the same as source, but _inlink is dynamic and refers to only a few places above. For example "ani/17/0" which is referenced in "ani/17/1"

Using root() and resolve() gets you the wrong place in the wz file. I would like to navigate upwards. Node is at "ani/17/1", two parents up. So maybe call node.parent() twice and then resolve the link. But unfortunately there is nothing like this implemented.

Any guidance again, would be greatly helpful and appreciated! Thank you!

@retep998
Copy link
Member

retep998 commented Jun 3, 2019

The way the NX file format is implemented a node can have multiple parents, so there is no way to navigate upwards.

@ryantpayton
Copy link
Author

ryantpayton commented Jun 4, 2019

I realize they can have multiple but is it possible to just get the immediate parent. For instance

UI.wz (null)
.UIAlliance.img (UI.wz)
..UIAlliance (UIAlliance.img)
...9 (UIAlliance)
...8 (UIAlliance)
...7 (UIAlliance)
..UIBasic (UIAlliance.img)
...9 (UIBasic)

It could even be a string. It would just help in building an index upward from where you are currently at.

If it's not possible I understand and you can close this but thank you for your time!

Edit: Sorry I actually realize that having the immediate parent might not help. Not sure if it's possible to put a path string in the node where it's at. For example the last node in my example would be: "UI.wz/UIBasic/9"

@retep998
Copy link
Member

retep998 commented Jun 4, 2019

What I'll probably do is implement support directly in wz to nx conversion to handle _inlink. I'm not sure what I'll do with _outlink though.

@ryantpayton
Copy link
Author

I think _outlink is similar to source in the older GMS wz files. It has the whole path, I believe.

I do appreciate your help!

@ryantpayton
Copy link
Author

Just for an FYI and to help if you need it (:

UI.wz (v204.1 GMS):
Basic.img/Cursor/4/0/_inlink: Cursor/1/0
Points to: Basic.img/Cursor/1/0

UI.wz (v204.1 GMS):
Basic.img/Cursor/34/1/_outlink: UI/UIWindow4.img/bossInstallation/harpoon/aim/1

For some reason I can't find "source" atm

@ryantpayton
Copy link
Author

@retep998 Hey, Peter. Sorry to bother, just checking if you had a chance to fix this yet? I honestly would do it myself but I have a hard time understanding the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants