question-circle Recording system - looking for help

  • Gary
  • Gary's Avatar Topic Author
  • Offline
  • Intermediate Marbler
  • Intermediate Marbler
  • Hi all
  • Posts: 80
  • Thank you received: 8
10 Jun 2014 05:54 #1
Hey guys!

sorry for these stupid questions. but i don't know how to slow it
the first question is: how the recording system works. i want to make a more advanced recording system but i looked up the TDN but i found nothing about record the keyboard action. so how to do it?(i really need this)
the second question: how to delete a file by using torque script? i can't find it on TDN, too.

Thanks.
Gary

HappyRoll Mod Leader
C++ Beginner

Please Log in or Create an account to join the conversation.

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1333
  • Thank you received: 604
11 Jun 2014 03:33 - 11 Jun 2014 03:35 #2
Had to look into these two myself for quite a while. Some things are easier than others:

The recording system captures keypresses and "replays" all data coming from the game's connection. Not sure if this is multiplayer-friendly, haven't ever tried it. If you want to start recording, you call
Code:
recordDemo(%recordingFile, %missionFile);
before the server is created (normally this happens in PM_StartMission with $doRecordDemo, you can call it manually yourself if needed. Playing back a recording is just as simple, all you need to do is call
Code:
playDemo(%recordingFile);
Beyond that, any events that happen during the demo are replicated (mostly). The demo system is quite unstable at times, but unless you're trying to use random/time based events it should be fine.

Deleting a file (as far as I know) is not possible in this version of the Torque Engine. Torque 3D has a fileDelete method, but it doesn't exist in this version of the engine. Best you can do is to overwrite the file with blank text and leave a blank file in its place:
Code:
%f = new FileObject(); //If we can open the file if (%f.openForWrite(%fileToErase)) { //Write blank %f.writeLine(""); } //Clean up %f.close(); %f.delete();

-HiGuy

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }
Last edit: 11 Jun 2014 03:35 by HiGuy.

Please Log in or Create an account to join the conversation.

  • Gary
  • Gary's Avatar Topic Author
  • Offline
  • Intermediate Marbler
  • Intermediate Marbler
  • Hi all
  • Posts: 80
  • Thank you received: 8
12 Jun 2014 05:30 #3
Thank you for that but i still have questions to ask.
How to captures keypresse by using Torque Scripts ? the aim to know how it works is that i want to make a more advanced recording/replay system which have Ghost Play mode and other functions. I had done a replay system but it is not enough for my mode :lol:
and... is there any code in titlegui.gui , productiongui.gui and presentsgui.gui ? if is, what's it for?
Could you help me about the question?
Thanks again~

Gary

HappyRoll Mod Leader
C++ Beginner

Please Log in or Create an account to join the conversation.

Moderators: Doomblah
Time to create page: 0.772 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.