PDA

View Full Version : [TSL] Datapads


goldberry
10-16-2006, 04:09 PM
When a datapad is recieved in game, they tend to pop up on screen with thier contents shown for instant reading. When I have made datapads, this does not happen.

How do I get the message to pop up?

Any help would be appreciated.

stoffe
10-16-2006, 06:00 PM
When a datapad is recieved in game, they tend to pop up on screen with thier contents shown for instant reading. When I have made datapads, this does not happen.

How do I get the message to pop up?


It depends on how the datapad is received. If it is picked up out of the inventory of a placeable or dead body the datapad popup with its text is displayed automatically without you having to do anything.

If the datapad is given via script however (CreateItemOnObject()), the popup will not automatically show. I suppose this is by design due to the fact that the player could be in the middle of a dialog or cutscene when they receive the pad.

In those circumstances you can use the DisplayDatapad() function in the same script where you give the datapad. It takes an object reference to the datapad in question, and will cause the popup window with its text to appear. For example...
void main() {
DelayCommand(0.2, DisplayDatapad(CreateItemOnObject("vaapad", GetFirstPC(), 1, TRUE)));
}

...would create the datapad in the player's inventory and display the popup datapad window with its text. If you do this in a dialog, make sure you run the script just before the dialog exits, or it may mess up the GUI if the pad window is shown while the main GUI is hidden.

goldberry
10-17-2006, 04:18 PM
Okay, thanks stoffe. I'll stick it in a placeable then.