Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[NEED HELP] How to do newlines within a setting?

#1
For example.
Code:
alias sv_hook_gamestart_all "say ^7Welcome.; say ^7All matches on this server except CTS have a 2 minute warm up phase.; say ^7To begin the match, ready up (default key: ^1F4^7).;";
While this is more legible, it only causes the server to print a welcoming message when server.cfg is executed.
Code:
alias sv_hook_gamestart_all "\
say ^7Welcome.; \
say ^7All matches on this server except CTS have a 2 minute warm up phase."; \
say ^7To begin the match, ready up (default key: ^1F4^7).;";
Reply

#2
You can't have new lines in aliases, but what you could do is throw those into a separate config file, which you then execute from the alias:
alias sv_hook_gamestart_all "exec welcome.cfg"

The contents of welcome.cfg (which would of course go in data) would look something like this:
Code:
say ^7Welcome.
say ^7All matches on this server except CTS have a 2 minute warm up phase.
say ^7To begin the match, ready up (default key: ^1F4^7).
[Image: 230.jpg]
Reply

#3
I don't think you can do it without re-writing the parser. Newlines are used as the delimiter for command (including alias):
https://gitlab.com/xonotic/darkplaces/bl...md.c#L1596

EDIT: not sure why but Mario's reply didn't show up at first.
Reply

#4
(06-15-2017, 12:35 PM)Mario Wrote: You can't have new lines in aliases, but what you could do is throw those into a separate config file, which you then execute from the alias:
alias sv_hook_gamestart_all "exec welcome.cfg"

The contents of welcome.cfg (which would of course go in data) would look something like this:
Code:
say ^7Welcome.
say ^7All matches on this server except CTS have a 2 minute warm up phase.
say ^7To begin the match, ready up (default key: ^1F4^7).

What's the clever work around for
Code:
g_maplist "acid3dm10_q3 afterslime aggressorx_wz_04 bloodrun_a3 boil_b4 bloodprison_xon_r2 charon3dm13 crescent_q3 cpm1a cpm7 cpm10_nex_r1 cpm15 cpm16_nex_r1 cpm17 cpm24_nex_r1 cpm29_nex_r1 cucumber_v2 cure_full_r2 darkzone downer_final_r1 drain finalrage fuse hub3aeroq3a_nex_r4 imprisoned-final_r3 lostworld_ql luminar map-everything_else_is_green_v1r0 mint_r1  monsoon_q3 opium_v4 pukka3tourney2 rota3dm2 ruinerx runningman solarium silentsiege stormkeep syntheticv1 toxicity warfare xoylent "
//need to shuffle otherwise will show the first listed maps above.
g_maplist_shufflenow
where each map is ideally on its own line for legibility. (It's already in its own file).

(06-15-2017, 01:47 PM)BuddyFriendGuy Wrote: I don't think you can do it without re-writing the parser. Newlines are used as the delimiter for command (including alias):
https://gitlab.com/xonotic/darkplaces/bl...md.c#L1596

EDIT: not sure why but Mario's reply didn't show up at first.


Well at least its in C.
Reply

#5
I guess if you have an idea of how you want them organized, you could split them into addtolist calls:


Code:
g_maplist "a few unsorted maps"
alias addmaps "addtolist g_maplist ${* ?}"

addmaps "solarium darkzone runningman solarium silentsiege stormkeep warfare xoylent"
addmaps "opium_v4 downer_final_r1"
[Image: 230.jpg]
Reply

#6
I wanted them organized alphabetically.
On their own lines.
Can't I just suggest you people to tinker with the parser a bit?
Reply

#7
I'd love a more powerful parser, but I can't really justify that being a high priority. How about write your own config pre-processor (in say Python or Perl) that produces Xonotic's cfg from whatever better syntax you'd like to use?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Setting up infinite ammo in instagib? DECtape 4 7,657 11-03-2015, 09:44 PM
Last Post: lister
  [SOLVED] Question about Treasure Island setting BuddyFriendGuy 9 9,339 07-08-2015, 08:50 AM
Last Post: sev
  [SOLVED] Per map setting? BuddyFriendGuy 3 4,114 06-17-2015, 01:03 AM
Last Post: BuddyFriendGuy
  Server setting => g_antilag ? evit 6 8,661 02-06-2012, 03:58 PM
Last Post: evit

Forum Jump:


Users browsing this thread:
1 Guest(s)

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