Jump to content
smbell

vrorigin expression syntax help

Recommended Posts

Posted (edited)

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

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×