Jump to content

Home

How do I spawn a computer panel in TSL?


Darth Xander

Recommended Posts

How do I spawn a computer panel in TSL using scripting?

 

Too many smilys is bad, don't abuse them! Thanks. -RH

 

Computer consoles in the game are just dialog files that have a special flag set. Entry nodes are what's shown in the text area of the console, while reply nodes are the options the player can choose in the lower area. So, create a new DLG file for your console with tk102's DLG Editor, click on the root/top node in the tree view and in the lower panel change the Conversation typesetting from Human to Computer.

 

If you want a placeable to trigger this computer console when the player activates it, you give it a script like this in the OnUsed event script slot in the .UTP file...

void main() {
   SetKeepStealthInDialog(TRUE);
   ActionStartConversation(GetLastUsedBy(), "[color=Yellow]DLGFile[/color]");
}

...where you change DLGFile to the name of the DLG file containing the console dialog.

Link to comment
Share on other sites

I already have the utp and the dlg but I need a script to spawn it and i'm not after a on enter one

 

It's easier to just place the console in the area directly, unless it shouldn't be there all the time. But if you want to do it via a script anyway for some reason it should work to do like:

 

void main() {
   vector vPos;
   float fAngle = [color=Red]90.0[/color]; // Angle (0-360) the placeable should be facing

   vPos.x = [color=Pink]10.0[/color]; // X-coordinate in game world where the placeable should appear
   vPos.y = [color=PaleGreen]6.0[/color];  // Y-coordinate in game world where the placeable should appear
   vPos.z = [color=SkyBlue]0.0[/color];  // Z-coordinate (elevation) where the placeable should appear

   CreateObject(OBJECT_TYPE_PLACEABLE, "[color=Yellow]UTPfile[/color]", Location(vPos, fAngle));
}

 

Change 90.0 to the angle (0-360 degrees) the placeable should be rotated, 10.0 to the x coordinate, 6.0 to the y coordinate and 0.0 to the z coordinate (elevation) in the game world the placeable should appear. (Use the whereami armband to get x,y,z coordinates.)

 

Finally change UTPfile to the name of the UTP template to spawn the placeable from.

Link to comment
Share on other sites

Once you spawned a Computer Terminal simply place the name of the dialog file it will use in its (ResRefConversation) Conversation/Dialog node in the terminals utp file.

 

Computer terminals like most other things in the game run dialogs when you use them. ;)

Link to comment
Share on other sites

I have recently made a computer panel in tsl and successfully spawned it in 003ebo but its dialog won't inititate and it IS party interactable .

 

Did you compile the script in post #2 in this thread and set its name in the OnUsed event script slot of the computer panel placeable?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...