Page 1 of 1

Placeables that turn on?

Posted: Sat Jul 19, 2008 6:08 am
by Chandigar
So, I understand that there are the animations on, off, on2off, off2on etc but how do I get them to actually work?

If I want to create a placeable where it plays an animation in a loop after you click on it, I assumed that just means that you set up the animations as above... but this doesn't work.

This is the same as if you place a standard BW floor lever. Its got animations for on/off but clicking on it in game does nothing. I assume this means that it will only play the animation if the "on" is linked to a script of some sort that actually does something.

Any idea how to set up an object so it'll just play the on/off loops after clicking on it?

For example, I want to be able to have a pipe where you can click on it to turn the wheel then steam appears. Any ideas?

Posted: Sat Jul 19, 2008 3:50 pm
by lord rosenkrantz
I reckon that you can only fire those animations by script, sadly.

Posted: Sun Jul 20, 2008 6:26 pm
by DM_Mask
As for the On/Off script side, Bioware placeables use x2_plc_used_act

Code: Select all

//::///////////////////////////////////////////////
//:: OnUse: Toggle Activate
//:: x2_plc_used_act
//:: Copyright (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*

    Simple script to toggle the placeable animation
    state for placeables that support Activate and
    DeActivate Animations

    Placeables are best set to be DeActivated by
    default with this script.

*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-09-10
//:://////////////////////////////////////////////
void main()
{
    // * note that nActive == 1 does  not necessarily mean the placeable is active
    // * that depends on the initial state of the object
    int nActive = GetLocalInt (OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE");
    // * Play Appropriate Animation
    if (!nActive)
    {
      ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    }
    else
    {
      ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
    }
    // * Store New State
    SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",!nActive);
}
Give that a try and see if you want anything changed from there. I'm sure you'll find at least a couple people here can script a bit.