How do I spawn a computer panel in TSL using scripting?
Too many smilys is bad, don't abuse them! Thanks. -RH
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.
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
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.
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 .
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. ;)
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?