Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

How do I spawn a computer panel in TSL?

Page: 1 of 1
 Darth Xander
10-21-2007, 8:00 PM
#1
How do I spawn a computer panel in TSL using scripting?

Too many smilys is bad, don't abuse them! Thanks. -RH
 stoffe
10-22-2007, 6:58 AM
#2
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(), "DLGFile");
}

...where you change DLGFile to the name of the DLG file containing the console dialog.
 Darth Xander
10-22-2007, 9:48 AM
#3
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
 stoffe
10-22-2007, 11:12 AM
#4
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 = 90.0; // Angle (0-360) the placeable should be facing

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

CreateObject(OBJECT_TYPE_PLACEABLE, "UTPfile", 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.
 Darth Xander
10-25-2007, 8:34 AM
#5
thnks stoffe

Edit: Hi, 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 .
 RedHawke
10-26-2007, 11:59 AM
#6
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. ;)
 stoffe
10-26-2007, 7:20 PM
#7
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?
Page: 1 of 1