Jump to content

vrorigin expression syntax help


smbell

Recommended Posts

I've got an embedded HDA where I'm trying to access the rotation values of an object outside the HDA.

I have a string parameter for my object /obj/shot_6/sunlight on the HDA.

 

If I use vrorigin("","/obj/shot_6/sunlight/")[0] as a test, it returns the x rotation value as expected.

I can't figure out how to incorporate my HDA string chs("../../sunlight") into the expression so it evaluates correctly.

I've tried things like vrorigin("","`chs("../../sunlight")`")[0] which actually resolves to vrorigin("","/obj/shot_6/sunlight")[0] when I middle click it, but that itself doesn't evaluate to the value.

I thought maybe adding an eval() to it would work, but no dice.

Hope this makes sense.

 

Edit: I was able to work around it in vex with:

matrix m = optransform(chs("../../sunlight"));
matrix3 m_rot = matrix3(m);

v@N *= m_rot;

But it would still be nice to know how to work it in expressions.

Edited by smbell
Link to comment
Share on other sites

Not very familiar with this function but could it be because you are missing a "/" at the end of the path when you use your chs expression?

"/obj/shot_6/sunlight/" vs "/obj/shot_6/sunlight"

If so it should be possible to either just say "`chs("../../sunlight")`"+"/" or by running strcat("`chs("../../sunlight")`","/") to add these two strings together.

Edited by underscoreus
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...