Scorge Posted October 13, 2012 Share Posted October 13, 2012 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 Link to comment Share on other sites More sharing options...
JCarter426 Posted October 14, 2012 Share Posted October 14, 2012 You need to do two things. First, you need to get the cage to play the shut down animation: 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: DestroyObject(oCageBlocker, 0.0, 0, 0.0, 0) The tags vary, so you'll have to look them up. Link to comment Share on other sites More sharing options...
Scorge Posted October 14, 2012 Author Share Posted October 14, 2012 Thanks, but how do I put all that in one script? [im sorry im horrible at scripting.] Link to comment Share on other sites More sharing options...
JCarter426 Posted October 14, 2012 Share Posted October 14, 2012 No worries... this one is pretty simple. As I said you need to look up the tags, but I can type out everything else: void main() { object oPrisoner = GetFirstPC(); object oCage = GetNearestObjectByTag([color="Red"]"tag"[/color], oPrisoner, 1); object oCageBlocker = GetNearestObjectByTag([color="Red"]"tag"[/color], 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 GetFirstPC(); with GetObjectByTag([color="Red"]"tag"[/color], 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. Link to comment Share on other sites More sharing options...
Scorge Posted October 14, 2012 Author Share Posted October 14, 2012 Thanks. Do you add this line under the pc part GetObjectByTag("tag", 0); if your trying to release you and another npc? Link to comment Share on other sites More sharing options...
JCarter426 Posted October 15, 2012 Share Posted October 15, 2012 Then you would need to do everything twice, using different variable names, like such: void main() { object oPrisoner = GetFirstPC(); object oPrisoner2 = GetObjectByTag([color="Red"]"tag"[/color], 0); object oCage = GetNearestObjectByTag([color="Red"]"tag"[/color], oPrisoner, 1); object oCageBlocker = GetNearestObjectByTag([color="Red"]"tag"[/color], oPrisoner, 1); object oCage2 = GetNearestObjectByTag([color="Red"]"tag"[/color], oPrisoner2, 1); object oCageBlocker2 = GetNearestObjectByTag([color="Red"]"tag"[/color], 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); } Link to comment Share on other sites More sharing options...
Scorge Posted October 15, 2012 Author Share Posted October 15, 2012 Ok, thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.