PDA

View Full Version : Checking same as item...



RebelHill
03-08-2011, 06:14 AM
So... Im trying to find a way to perform a check to see if a given item in layout has a same as item control or not set in its motion options...

Not necessarily a "given" item as its sai... though this could work just as well, but generically has or not...

I guess mainly Id be looking to see if there's an item associated, something along the lines of...

{
SelectItem("Whatever");

if(PositionItem == nil)
{
info("no sai");
}

else
{
info("some sai");
}
}

I suppose checking the channels themselves could also work just as well.. along the line of...

{
SelectItem("Whatever");

if(XController == 7)
{
info("some sai");
}

else
{
info("no sai");
}
}

Whilst neither of those pseudo scripts actually work, as in neither report the actual state of an items motion control... neither one fails or erros either... I assume because the if() doesnt really care what string is being tested for... and if it can't find a defined function for whats in the string, then it jsut reports the "else"...

Anyhow... if anyone's got a way to test this, would like to hear.

Thanks.

RebelHill
03-08-2011, 06:20 AM
Oh yes... and i also tried...

if(XController(7))

But that just reported "none" (if it was actuall on), whilst also then proceeding to change the Xcontroller to sai (if it was off ofc)

dballesg
03-08-2011, 06:57 AM
Hi Craig,

The command is XController(7), but that it's to set the X axis of the object controlled by a SameAsItem. But it's to SET it. Not to get which controller is applied to the object.

I hope Mike Green can share some light, because I've been looking on the LScript documentation and I couldn't found "How to get the controller".

If I find something i will post it here.

David

RebelHill
03-08-2011, 07:44 AM
yeah, the most recent LSdocs make no mention of PositionItem, RotationItem, etc... nor controller type (7).

Hopefully someone might know... or maybe there's something somewhere buried in the sdk docs.

RebelHill
03-08-2011, 08:18 AM
Well, i found a solution to my problem, though not THE problem.

Whilst checking same as item would have been good, in my situation I can jsut as easily check something else, namely target... so...

{

mymesh = Mesh("Whatever");

if(mymesh.target == nil)
{
info("none");
}

else
{
info("some");
}
}

Works jsut fine for what Im trying to do...

Might still be nice to know if the original idea is doable though... might come in useful somewhere.

I also tried some guesswork... typing in mymesh.rotationitem, mymesh.rotation, mymesh.RotationItem, etc... but none of those are recognised. it does appear though that there might be a string for it, as mymesh.pole works as expected, so clearly at least some of the new motion option types from the 9.6 camp have been entered into LS.