Results 1 to 3 of 3

Thread: ItemActive()

  1. #1
    Newbie Member eFFeFFe's Avatar
    Join Date
    Feb 2004
    Location
    Belgium
    Posts
    53

    ItemActive()

    Hi ... I'm not an expert in Lscript, I can't seem to find a command to get the active/inactive (visible in Scene Editor) state of an object ... Does anybody know a way to get this state ? Also, with ItemActive() you can set the active/inactive state but it needs a value, 1 or 2 or ... But it does not matter what (numeric?) value you give, it always toggles between on and off ...

    Below is the script I'm working on, something very simple to set the active/inactive and visibility state of selected objects ... now, you change toggle between active and inactive, but if in your selection of objects are some inactive and other active, you can not set them all to inactive (or active), you can only toggle them to the other state ...

    @warnings
    @name HIDER
    @version 2.3

    generic
    {
    var1 = 1;
    var4 = 1;

    reqbegin("HIDER");
    reqsize(472,165);

    c1 = ctltext("","// Hider v0.3 //");
    ctlposition(c1,20,13,475,13);

    s1 = ctlsep(-1,185);
    ctlposition(s1,0,40,475,5);

    c2 = ctlchoice(">",var1,@"/ HIDEN /","/ B_BOX /","/ WIRES /","/ F_F_WIRES /","/ TEXTURE /"@);
    ctlposition(c2,20,60,375,21);

    c3 = ctlchoice("> CHANGE ACTIVITY",var4,@"/ YES /","/ NO /"@);
    ctlposition(c3,20,99,214,21);

    return if !reqpost();

    var1 = getvalue(c2);
    varA = getvalue(c3);
    if (var1 == 3)
    var1 = 5;
    else
    if (var1 == 4)
    var1 = 6;
    else
    if (var1 == 5)
    var1 = 7;

    OBJECTOR = Scene().getSelect();
    var0 = 0;
    var2 = OBJECTOR.size();

    reqend();

    while (var0 < var2)
    {
    var0 = var0 + 1;
    IDENTICATOR = OBJECTOR[var0].id;
    SelectItem(OBJECTOR[var0].id);
    ItemVisibility(var1);
    if (varA == 1)
    ItemActive(1);
    }
    }

  2. #2
    I didn't check out your code, but: obj = Scene().getSelect(); returns an array of all selected items.

    You can then deal with the items as you wish.


    obj = Scene().getSelect();
    for(i=1 ; i<=obj.size() ; i++) { sItems += obj[i].name; }

    This scrap of code happens to load the selected items into an array called sItems. I used this in a ctlPopup.

    -nuff said

    Somewhere, over the rainbow....

  3. #3
    Similarly,

    Scene().visibility can be used to determine the display state of an object in the scene.

    p122 LScript Reference has more details.

    Somewhere, over the rainbow....

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •