Altitude Game: Forums  

Go Back   Altitude Game: Forums > Altitude Support > Dedicated Server
FAQ Community Calendar

Dedicated Server Discuss technical issues related to hosting your own servers.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2010, 04:48 PM
idk idk is offline
Senior Member
 
Join Date: Feb 2010
Location: Sweden
Posts: 120
Default Is it possible to create custom commands?

I did just notice the command "/vote custom x", what is the second parameter, is it possible to create custom commands? In that case, how?
Reply With Quote
  #2  
Old 02-11-2010, 06:38 PM
Shogi Shogi is offline
Junior Member
 
Join Date: Jan 2010
Location: Brazil
Posts: 19
Send a message via Skype™ to Shogi
Default

Lam posted on the last update notes:

Quote:
Originally Posted by lamster View Post
You can now execute console commands on servers while they're running by writing lines to the file ~Altitude/servers/command.txt
Example: change the server running on port 27275's current map to ffa_cave
echo 27275,console,changeMap ffa_cave>> ~Altitude/servers/command.txt

Added support for custom voteable commands (edit ~Altitude/servers/launcher_config.xml to define custom commands)
Example: add a 'startLadder' command that requires 60% yes votes to pass:
Open ~Altitude/servers/launcher_config.xml with a text editor
For each server you'd like to modify, replace the line "<customCommands />" (or add a line just before <consoleCommandPermissions> if you're using an outdated config file) with:
Code:
      <customCommands>
        <CustomCommandDescriptor name="startLadder" votePassPercentage="60" />
      </customCommands>
You can then set up custom code to monitor the log file and respond to the custom command, for example when a line like this appears in ~Altitude/servers/log.txt:
Code:
	{"command":"startLadder","type":"customCommand","time":20428,"port":27275}
	(Note: your script should use a JSON-compliant parser to discover type=customCommand, command=startLadder, port=27275)
You can run custom code to initiate other events, for example show a message, balance teams, start a tournament, and change to a randomly selected map:
Code:
	echo 27275,console,serverMessage Initiating ladder game, leavers will be banned>> ~Altitude/servers/command.txt
	echo 27275,console,balanceTeams>> ~Altitude/servers/command.txt
	echo 27275,console,startTournament>> ~Altitude/servers/command.txt
	echo 27275,console,changeMap tbd_core>> ~Altitude/servers/command.txt
If that is what you're looking for.
Reply With Quote
  #3  
Old 02-11-2010, 07:27 PM
Varonth Varonth is offline
Member
 
Join Date: Dec 2009
Posts: 66
Default

The problem is, that this "tutorial" doesn't say where to define the costum command.

Code:
      <customCommands>
        <CustomCommandDescriptor name="startLadder" votePassPercentage="60" />
      </customCommands>
This works, ok... now you can run /vote costum startLadder.
But where do i define what startLadder will do.

For example

Code:
      <customCommands>
        <CustomCommandDescriptor name="startLadder" votePassPercentage="60" />
        <log>"Your log message"</log>
        <command>"Your first command"</command>
        <command>"Your second command"</command>
      </customCommands>
Writing my commands between <customCommands> and </customCommands> doesn't work.
Reply With Quote
  #4  
Old 02-11-2010, 08:12 PM
nobodyhome nobodyhome is offline
Senior Member
 
Join Date: Apr 2009
Posts: 1,088
Default

From my understanding, you can't define what a custom command will do in the launcher config. The only thing you can do is to define a command, which will then be logged onto log.txt. From there, you must have a parser attached to log.txt which will notice when that command is logged, and then that parser itself will in turn have to write to command.txt to do the desired actions.
Reply With Quote
  #5  
Old 02-11-2010, 08:31 PM
lamster lamster is offline
Administrator
 
Join Date: May 2008
Posts: 1,655
Default

What nobodyhome said is right: custom commands aren't exposing a scripting layer or anything like that, rather they're providing a very simple hook into the game's console/vote system for 3rd-party mods to watch for in the log file.
Reply With Quote
  #6  
Old 02-12-2010, 09:12 PM
spc spc is offline
Senior Member
 
Join Date: Oct 2009
Location: CA, USA
Posts: 110
Default

is it possible to use the /testcameraviewscale command in the command.txt file?
Reply With Quote
  #7  
Old 02-12-2010, 09:28 PM
tec27 tec27 is offline
Super Moderator
 
Join Date: Apr 2009
Posts: 178
Default

Quote:
Originally Posted by spc View Post
is it possible to use the /testcameraviewscale command in the command.txt file?
I would think its possible, try:
Code:
echo 27275,console,testCameraViewScale 200>> ~Altitude/servers/command.txt
Reply With Quote
  #8  
Old 02-13-2010, 12:24 AM
spc spc is offline
Senior Member
 
Join Date: Oct 2009
Location: CA, USA
Posts: 110
Default

thx, but i tried it and it doesnt seem to work for some reason.
Reply With Quote
  #9  
Old 02-13-2010, 12:48 AM
nobodyhome nobodyhome is offline
Senior Member
 
Join Date: Apr 2009
Posts: 1,088
Default

Make sure that the server is already running before you try to write a command to command.txt. Tec's use of the "echo" command works for a server on the UNIX platform ("echo" is a unix command), but I assume you are running a server on windows or mac. In this case you will have to

1. Run the server

2. Add the line tec wrote (minus the echo) to the bottom of the file. Make sure that there aren't any spaces between the commas (I've found that that makes it not work).

3. Save the file

That should do it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:11 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
2008 Nimbly Games LLC