Jump to content

Home

Force Cage Shut Down script


Scorge

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...