LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   Holowan Laboratories (http://www.lucasforums.com/forumdisplay.php?f=324)
-   -   Force Cage Shut Down script (http://www.lucasforums.com/showthread.php?t=211247)

Scorge 10-13-2012 08:07 PM

Force Cage Shut Down script
 
Hey guys, does anybody here know the script to shut down a force cage for TSL? Like when the player is inside one and someone shuts it down.

-Thanks

JCarter426 10-13-2012 09:36 PM

You need to do two things. First, you need to get the cage to play the shut down animation:
Code:

AssignCommand(oCage, ActionPlayAnimation(202, 1.0, 0.0));
Second, you need to destroy the invisible placeable that blocks you from entering or exiting the cage:
Code:

DestroyObject(oCageBlocker, 0.0, 0, 0.0, 0)
The tags vary, so you'll have to look them up.

Scorge 10-13-2012 09:44 PM

Thanks, but how do I put all that in one script? [Im sorry im horrible at scripting.]

JCarter426 10-13-2012 10:03 PM

No worries... this one is pretty simple. As I said you need to look up the tags, but I can type out everything else:
Code:

void main() {

        object oPrisoner = GetFirstPC();
        object oCage = GetNearestObjectByTag("tag", oPrisoner, 1);
        object oCageBlocker = GetNearestObjectByTag("tag", oPrisoner, 1);

AssignCommand(oCage, ActionPlayAnimation(202, 1.0, 0.0));
DestroyObject(oCageBlocker, 0.0, 0, 0.0, 0);

}

If the prisoner is someone other than the player, just replace
Code:

GetFirstPC();
with
Code:

GetObjectByTag("tag", 0);
Also note this doesn't play the cage shut off sound. But there is a universal script in the game for that; it would be easier to run that through the DLG file in addition to this, since everything is already set up.

Scorge 10-14-2012 09:42 AM

Thanks. Do you add this line under the pc part
Code:

GetObjectByTag("tag", 0);
if your trying to release you and another npc?

JCarter426 10-15-2012 03:31 AM

Then you would need to do everything twice, using different variable names, like such:
Code:

void main() {

        object oPrisoner = GetFirstPC();
        object oPrisoner2 = GetObjectByTag("tag", 0);
        object oCage = GetNearestObjectByTag("tag", oPrisoner, 1);
        object oCageBlocker = GetNearestObjectByTag("tag", oPrisoner, 1);
        object oCage2 = GetNearestObjectByTag("tag", oPrisoner2, 1);
        object oCageBlocker2 = GetNearestObjectByTag("tag", oPrisoner2, 1);

AssignCommand(oCage, ActionPlayAnimation(202, 1.0, 0.0));
DestroyObject(oCageBlocker, 0.0, 0, 0.0, 0);
AssignCommand(oCage2, ActionPlayAnimation(202, 1.0, 0.0));
DestroyObject(oCageBlocker2, 0.0, 0, 0.0, 0);

}


Scorge 10-15-2012 04:04 PM

Ok, thanks :)


All times are GMT -4. The time now is 10:31 AM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.