Placeables that turn on?
Come here for tutorials and 3d training. The aim is to point out good 3d training sites or methods.

Moderators: Winterhawk99, Mermut, Bannor Bloodfist

Post Reply
Chandigar
Posts: 153
Joined: Fri Apr 01, 2005 6:00 pm
ctp: No
dla: No
TBotR: No
nwnihof: No
Contact:

Placeables that turn on?

Post 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?

lord rosenkrantz
Posts: 165
Joined: Sun Aug 21, 2005 6:46 pm
ctp: No
dla: No
TBotR: No
nwnihof: No

Post by lord rosenkrantz »

I reckon that you can only fire those animations by script, sadly.

User avatar
DM_Mask
Posts: 181
Joined: Sun Jul 18, 2010 4:44 am

Post 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.

Post Reply