Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] How does the defer command work?

#1
At the end of a multiplayer death match, "user wins" is written to the console signifying that the round has ended. I've been experimenting with autoexec.cfg and I'd like to start using the defer cmd.

I want to wait for the line I mentioned above and, when it is detected, fire a series of subcmds. I have three in mind; they are teamstatus, something that will print all the lines on the console to a private server of mine, and quit (in that order).

Is it possible to complete such a task and if so could you give me an idea of how it can be implemented?
Reply

#2
defer is a bit of a strangely functioning command;
The entire command line is executed at the same time, so multiple defers will trigger at the same time.
The easiest way to work around this is to increase the time for each consecutive defer, e.g. alias sv_hook_gameend "teamstatus; defer 1 \"condump mylog.txt\"; defer 2 quit"
[Image: 230.png]
Reply

#3
Hi mario, sorry it's been a really long time since I asked this question but I've tried to implement what you said to no avail... I can't find many resources that include examples of how this code works so it's hard for me to learn therefore I can't spot the error myself. Could you explain for instance how defer would work with only just 1 defer? say I wanted to just quit at game end? If you have better things to do than teach me how to code I'd understand haha but maybe you have a good resource though that you could include so I could learn on my own? Thanks
Reply

#4
If you just want to close the server when the match ends, then an alternative method could be to quit when the match ends via quit_and_redirect. Setting it to "self" may work best.
Options like that can be found via CACS: http://xonotic.org/tools/cacs

As for how to use the console for scripting, nowhere explains every detail, but some tips are available:
http://forums.xonotic.org/showthread.php?tid=2987
[Image: 230.png]
Reply

#5
This is what ended up working for me...

alias cl_hook_gameend "teamstatus; defer 1 \"condump mylog.txt\"; defer 2 quit"

I just had to change the hook_gameend part. Couldn't have done it without you, thanks a bunch!
Reply



Possibly Related Threads...
Thread Author Replies Views Last Post
  [NEED HELP] cl_gunalign doesn't seem to work on some servers/maps Aguaumreal 2 172 09-10-2019, 03:42 AM
Last Post: Aguaumreal
  [NEED HELP] Buffs Don't Work 3agle427 0 384 01-19-2019, 04:46 PM
Last Post: 3agle427
  [BUG] Command line typing issues teratorn 5 933 04-12-2018, 04:02 AM
Last Post: teratorn
  [NEEDS INFO] lsmaps command -maniac|Su- 4 977 03-29-2017, 05:17 PM
Last Post: cefiar
  [SOLVED] Surround sound refuses to work with C-Media CMI-8788 soundcards Lee_Stricklin 2 1,377 03-06-2017, 08:24 PM
Last Post: Lee_Stricklin
  [SOLVED] Xonotic doesn't work with overwolf Ch4mp 2 1,826 08-12-2016, 02:44 AM
Last Post: Ch4mp
  [FIXED] assault map don't work Brot 3 2,132 10-13-2015, 05:44 PM
Last Post: Mario
  [SOLVED] Cannot get cl_simpleitems_postfix to work sev 12 7,086 09-09-2014, 07:31 AM
Last Post: tZork
  [SOLVED] How to get Xonotic to work with the open-source Radeon driver? MirceaKitsune 16 13,032 11-19-2013, 06:49 AM
Last Post: MirceaKitsune
  [SOLVED] Joystick wont work? axe 7 6,409 04-05-2013, 04:31 PM
Last Post: Mr. Bougo

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-