mirror of
https://github.com/Ragora/T2-ACCM.git
synced 2026-01-20 03:14:44 +00:00
Lots of changes
This commit is contained in:
parent
fc510c3de7
commit
182661dd82
|
|
@ -1,3 +1,14 @@
|
|||
ACCM 1.5.0 --------------------------------------------------
|
||||
* DarkDragonDX takes up development.
|
||||
* Fixed saving of objects with names set via /name (generators, solar panels, etc are excluded as they are supposed to display frequency #)
|
||||
* Removed a bunch of Sentinel Stuff (by Blnukem) -- their AI was never actually finished it seemed.
|
||||
* Chat command '/killzombies' used to only half the zombie population. Now it kills them all.
|
||||
* Several occurances of console spam were fixed.
|
||||
* Removed unused files, reorganized files slightly.
|
||||
* Added Linux shell script for deleting .dso files if you're weird like me and run on some Linux operating system via WINE.
|
||||
* Team 6 is now the 'offical zombie team'. This just means zombie teams are set to this by default.
|
||||
* Added player.setSkin() and player.setName() -- they need tested
|
||||
|
||||
ACCM 1.4.0 [For Deflun :] ------------------------------
|
||||
* The turret override (disable / enable turrets) now works outside of purebuild.
|
||||
* Emplacements can no longer be controlled via the command circuit.
|
||||
|
|
|
|||
2055
Scripts/CTFGame.cs
2055
Scripts/CTFGame.cs
File diff suppressed because it is too large
Load diff
|
|
@ -1,616 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// LobbyGui.cs
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
$InLobby = false;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyGui::onAdd( %this )
|
||||
{
|
||||
// Add the Player popup menu:
|
||||
new GuiControl(LobbyPlayerActionDlg) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
|
||||
new ShellPopupMenu( LobbyPlayerPopup ) {
|
||||
profile = "ShellPopupProfile";
|
||||
position = "0 0";
|
||||
extent = "0 0";
|
||||
minExtent = "0 0";
|
||||
visible = "1";
|
||||
maxPopupHeight = "200";
|
||||
noButtonStyle = "1";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyGui::onWake( %this )
|
||||
{
|
||||
if ( !%this.initialized )
|
||||
{
|
||||
LobbyPlayerList.setSortColumn( $pref::Lobby::SortColumnKey );
|
||||
LobbyPlayerList.setSortIncreasing( $pref::Lobby::SortInc );
|
||||
|
||||
%this.initialized = true;
|
||||
}
|
||||
|
||||
$InLobby = true;
|
||||
|
||||
//pop any key maps
|
||||
moveMap.pop();
|
||||
if ( isObject( passengerkeys ) )
|
||||
passengerKeys.pop();
|
||||
if ( isObject( observerBlockMap ) )
|
||||
observerBlockMap.pop();
|
||||
if ( isObject( observerMap ) )
|
||||
observerMap.pop();
|
||||
|
||||
$enableDirectInput = "0";
|
||||
deactivateDirectInput();
|
||||
|
||||
LobbyMessageVector.attach(HudMessageVector);
|
||||
LobbyMessageScroll.scrollToBottom();
|
||||
updateLobbyPlayerList();
|
||||
|
||||
LobbyServerName.setText( $clServerName );
|
||||
|
||||
%headerStyle = "<font:" @ $ShellLabelFont @ ":" @ $ShellFontSize @ "><color:00DC00>";
|
||||
%statusText = "<spop><spush>" @ %headerStyle @ "MISSION TYPE:<spop>" SPC $clMissionType
|
||||
NL "<spush>" @ %headerStyle @ "MISSION:<spop>" SPC $clMissionName
|
||||
NL "<spush>" @ %headerStyle @ "OBJECTIVES:<spop>";
|
||||
|
||||
for ( %line = 0; %this.objLine[%line] !$= ""; %line++ )
|
||||
%statusText = %statusText NL "<lmargin:10>* <lmargin:24>" @ %this.objLine[%line];
|
||||
|
||||
LobbyStatusText.setText( %statusText );
|
||||
|
||||
fillLobbyVoteMenu();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyGui::onSleep( %this )
|
||||
{
|
||||
if ( %this.playerDialogOpen )
|
||||
LobbyPlayerPopup.forceClose();
|
||||
|
||||
LobbyVoteMenu.clear();
|
||||
LobbyVoteMenu.mode = "";
|
||||
LobbyCancelBtn.setVisible( false );
|
||||
LobbyStatusText.setText( "" );
|
||||
$InLobby = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function lobbyDisconnect()
|
||||
{
|
||||
MessageBoxYesNo( "CONFIRM", "Are you sure you want to leave this game?", "lobbyLeaveGame();", "" );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function lobbyLeaveGame()
|
||||
{
|
||||
Canvas.popDialog( LobbyGui );
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function lobbyReturnToGame()
|
||||
{
|
||||
Canvas.setContent( PlayGui );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyChatEnter::onEscape( %this )
|
||||
{
|
||||
%this.setValue( "" );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyChatEnter::send( %this )
|
||||
{
|
||||
%text = %this.getValue();
|
||||
if ( %text $= "" )
|
||||
%text = " ";
|
||||
commandToServer( 'MessageSent', %text );
|
||||
%this.setValue( "" );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyPlayerList::initColumns( %this )
|
||||
{
|
||||
%this.clear();
|
||||
%this.clearColumns();
|
||||
%this.addColumn( 0, " ", 24, 24, 24, "center" ); // Flag column
|
||||
%this.addColumn( 6, "lobby_headset", 36, 36, 36, "headericon" ); // Voice Com column
|
||||
%this.addColumn( 1, "Player", $pref::Lobby::Column1, 50, 200 );
|
||||
if ( $clTeamCount > 1 )
|
||||
%this.addColumn( 2, "Team", $pref::Lobby::Column2, 50, 200 );
|
||||
%this.addColumn( 3, "Score", $pref::Lobby::Column3, 25, 200, "numeric center" );
|
||||
%this.addColumn( 4, "Ping", $pref::Lobby::Column4, 25, 200, "numeric center" );
|
||||
%this.addColumn( 5, "PL", $pref::Lobby::Column5, 25, 200, "numeric center" );
|
||||
|
||||
commandToServer( 'getScores' );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyPlayerList::onColumnResize( %this, %col, %size )
|
||||
{
|
||||
$pref::Lobby::Column[%this.getColumnKey( %col )] = %size;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyPlayerList::onSetSortKey( %this, %key, %increasing )
|
||||
{
|
||||
$pref::Lobby::SortColumnKey = %key;
|
||||
$pref::Lobby::SortInc = %increasing;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function updateLobbyPlayerList()
|
||||
{
|
||||
if ( $InLobby )
|
||||
{
|
||||
// Let the server know we want an update:
|
||||
commandToServer( 'getScores' );
|
||||
schedule( 4000, 0, updateLobbyPlayerList );
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function lobbyUpdatePlayer( %clientId )
|
||||
{
|
||||
%player = $PlayerList[%clientId];
|
||||
if ( !isObject( %player ) )
|
||||
{
|
||||
warn( "lobbyUpdatePlayer( " @ %clientId @ " ) - there is no client object with that id!" );
|
||||
return;
|
||||
}
|
||||
|
||||
// Build the text:
|
||||
if ( %player.isSuperAdmin )
|
||||
%tag = "SA";
|
||||
else if ( %player.isAdmin )
|
||||
%tag = "A";
|
||||
else if ( %player.isZombieKeeper )
|
||||
%tag = "ZK";
|
||||
else if ( %player.isBot )
|
||||
%tag = "B";
|
||||
else
|
||||
%tag = " ";
|
||||
|
||||
if ( %player.canListen )
|
||||
{
|
||||
if ( %player.voiceEnabled )
|
||||
{
|
||||
%voiceIcons = "lobby_icon_speak";
|
||||
if ( %player.isListening )
|
||||
%voiceIcons = %voiceIcons @ ":lobby_icon_listen";
|
||||
}
|
||||
else
|
||||
%voiceIcons = %player.isListening ? "lobby_icon_listen" : "";
|
||||
}
|
||||
else
|
||||
%voiceIcons = "shll_icon_timedout";
|
||||
|
||||
if ( $clTeamCount > 1 )
|
||||
{
|
||||
if ( %player.teamId == 0 )
|
||||
%teamName = "Observer";
|
||||
else
|
||||
%teamName = $clTeamScore[%player.teamId, 0] $= "" ? "-" : $clTeamScore[%player.teamId, 0];
|
||||
%text = %tag TAB %voiceIcons TAB %player.name TAB %teamName TAB %player.score TAB %player.ping TAB %player.packetLoss;
|
||||
}
|
||||
else
|
||||
%text = %tag TAB %voiceIcons TAB %player.name TAB %player.score TAB %player.ping TAB %player.packetLoss;
|
||||
|
||||
if ( LobbyPlayerList.getRowNumById( %clientId ) == -1 )
|
||||
LobbyPlayerList.addRow( %clientId, %text );
|
||||
else
|
||||
LobbyPlayerList.setRowById( %clientId, %text );
|
||||
|
||||
if ( $InLobby )
|
||||
LobbyPlayerList.sort();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function lobbyRemovePlayer( %clientId )
|
||||
{
|
||||
LobbyPlayerList.removeRowById( %clientId );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyPlayerList::onRightMouseDown( %this, %column, %row, %mousePos )
|
||||
{
|
||||
// Open the action menu:
|
||||
%clientId = %this.getRowId( %row );
|
||||
LobbyPlayerPopup.player = $PlayerList[%clientId];
|
||||
|
||||
if ( LobbyPlayerPopup.player !$= "" )
|
||||
{
|
||||
LobbyPlayerPopup.position = %mousePos;
|
||||
Canvas.pushDialog( LobbyPlayerActionDlg );
|
||||
LobbyPlayerPopup.forceOnAction();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyPlayerActionDlg::onWake( %this )
|
||||
{
|
||||
LobbyGui.playerDialogOpen = true;
|
||||
fillPlayerPopupMenu();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyPlayerActionDlg::onSleep( %this )
|
||||
{
|
||||
LobbyGui.playerDialogOpen = false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyPlayerPopup::onSelect( %this, %id, %text )
|
||||
{
|
||||
//the id's for these are used in DefaultGame::sendGamePlayerPopupMenu()...
|
||||
//mute: 1
|
||||
//admin: 2
|
||||
//kick: 3
|
||||
//ban: 4
|
||||
//force observer: 5
|
||||
//switch team: 6
|
||||
|
||||
switch( %id )
|
||||
{
|
||||
case 1: // Mute/Unmute
|
||||
togglePlayerMute(%this.player.clientId);
|
||||
|
||||
case 2: // Admin
|
||||
MessageBoxYesNo( "CONFIRM", "Are you sure you want to make " @ %this.player.name @ " an admin?",
|
||||
"lobbyPlayerVote( VoteAdminPlayer, \"ADMIN player\", " @ %this.player.clientId @ " );" );
|
||||
|
||||
case 3: // Kick
|
||||
MessageBoxYesNo( "CONFIRM", "Are you sure you want to kick " @ %this.player.name @ "?",
|
||||
"lobbyPlayerVote( VoteKickPlayer, \"KICK player\", " @ %this.player.clientId @ " );" );
|
||||
|
||||
case 4: // Ban
|
||||
MessageBoxYesNo( "CONFIRM", "Are you sure you want to ban " @ %this.player.name @ "?",
|
||||
"lobbyPlayerVote( BanPlayer, \"BAN player\", " @ %this.player.clientId @ " );" );
|
||||
|
||||
case 5: // force observer
|
||||
forceToObserver(%this.player.clientId);
|
||||
|
||||
case 6: //change team 1
|
||||
changePlayersTeam(%this.player.clientId, 1);
|
||||
|
||||
case 7: //change team 2
|
||||
changePlayersTeam(%this.player.clientId, 2);
|
||||
|
||||
case 8:
|
||||
adminAddPlayerToGame(%this.player.clientId);
|
||||
|
||||
case 9: // enable/disable voice communication
|
||||
togglePlayerVoiceCom( %this.player );
|
||||
|
||||
case 10:
|
||||
confirmAdminListAdd( %this.player, false );
|
||||
|
||||
case 11:
|
||||
confirmAdminListAdd( %this.player, true );
|
||||
|
||||
Canvas.popDialog( LobbyPlayerActionDlg );
|
||||
}
|
||||
}
|
||||
|
||||
function confirmAdminListAdd( %client, %super )
|
||||
{
|
||||
if( %super )
|
||||
MessageBoxYesNo( "CONFIRM", "Are you sure you want to add " @ %client.name @ " to the server super admin list?", "toSuperList( " @ %client.clientId @ " );" );
|
||||
|
||||
else
|
||||
MessageBoxYesNo( "CONFIRM", "Are you sure you want to add " @ %client.name @ " to the server admin list?", "toAdminList( " @ %client.clientId @ " );" );
|
||||
}
|
||||
|
||||
function toSuperList( %client )
|
||||
{
|
||||
commandToServer( 'AddToSuperAdminList', %client );
|
||||
}
|
||||
|
||||
function toAdminList( %client )
|
||||
{
|
||||
commandToServer( 'AddToAdminList', %client );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyPlayerPopup::onCancel( %this )
|
||||
{
|
||||
Canvas.popDialog( LobbyPlayerActionDlg );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function togglePlayerMute(%client)
|
||||
{
|
||||
commandToServer( 'togglePlayerMute', %client );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function togglePlayerVoiceCom( %playerRep )
|
||||
{
|
||||
commandToServer( 'ListenTo', %playerRep.clientId, !%playerRep.voiceEnabled, true );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function forceToObserver( %client )
|
||||
{
|
||||
commandToServer( 'forcePlayerToObserver', %client );
|
||||
}
|
||||
|
||||
function AdminAddPlayerToGame(%client)
|
||||
{
|
||||
CommandToServer( 'clientAddToGame', %client );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function changePlayersTeam(%client, %team)
|
||||
{
|
||||
commandToServer( 'changePlayersTeam', %client, %team);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
function fillLobbyVoteMenu()
|
||||
{
|
||||
LobbyVoteMenu.key++;
|
||||
LobbyVoteMenu.clear();
|
||||
LobbyVoteMenu.tourneyChoose = 0;
|
||||
commandToServer( 'GetVoteMenu', LobbyVoteMenu.key );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function fillLobbyTeamMenu()
|
||||
{
|
||||
LobbyVoteMenu.key++;
|
||||
LobbyVoteMenu.clear();
|
||||
LobbyVoteMenu.mode = "team";
|
||||
commandToServer( 'GetTeamList', LobbyVoteMenu.key );
|
||||
LobbyCancelBtn.setVisible( true );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function fillPlayerPopupMenu()
|
||||
{
|
||||
LobbyPlayerPopup.key++;
|
||||
LobbyPlayerPopup.clear();
|
||||
|
||||
LobbyPlayerPopup.add(LobbyPlayerPopup.player.name, 0);
|
||||
commandToServer( 'GetPlayerPopupMenu', LobbyPlayerPopup.player.clientId, LobbyPlayerPopup.key );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function fillLobbyMissionTypeMenu()
|
||||
{
|
||||
LobbyVoteMenu.key++;
|
||||
LobbyVoteMenu.clear();
|
||||
LobbyVoteMenu.mode = "type";
|
||||
commandToServer( 'GetMissionTypes', LobbyVoteMenu.key );
|
||||
LobbyCancelBtn.setVisible( true );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function fillLobbyMissionMenu( %type, %typeName )
|
||||
{
|
||||
LobbyVoteMenu.key++;
|
||||
LobbyVoteMenu.clear();
|
||||
LobbyVoteMenu.mode = "mission";
|
||||
LobbyVoteMenu.missionType = %type;
|
||||
LobbyVoteMenu.typeName = %typeName;
|
||||
commandToServer( 'GetMissionList', LobbyVoteMenu.key, %type );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function fillLobbyTimeLimitMenu()
|
||||
{
|
||||
LobbyVoteMenu.key++;
|
||||
LobbyVoteMenu.clear();
|
||||
LobbyVoteMenu.mode = "timeLimit";
|
||||
commandToServer( 'GetTimeLimitList', LobbyVoteMenu.key );
|
||||
LobbyCancelBtn.setVisible( true );
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
addMessageCallback( 'MsgVoteItem', handleVoteItemMessage );
|
||||
addMessageCallback( 'MsgPlayerPopupItem', handlePlayerPopupMessage );
|
||||
addMessageCallback( 'MsgVotePassed', handleVotePassedMessage );
|
||||
addMessageCallback( 'MsgVoteFailed', handleVoteFailedMessage );
|
||||
addMessageCallback( 'MsgAdminPlayer', handleAdminPlayerMessage );
|
||||
addMessageCallback( 'MsgAdminAdminPlayer', handleAdminAdminPlayerMessage );
|
||||
addMessageCallback( 'MsgSuperAdminPlayer', handleSuperAdminPlayerMessage );
|
||||
addMessageCallback( 'MsgAdminForce', handleAdminForceMessage );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleAdminForceMessage()
|
||||
{
|
||||
alxPlay(AdminForceSound, 0, 0, 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleAdminAdminPlayerMessage( %msgType, %msgString, %client )
|
||||
{
|
||||
%player = $PlayerList[%client];
|
||||
if(%player)
|
||||
%player.isAdmin = true;
|
||||
alxPlay(AdminForceSound, 0, 0, 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleAdminPlayerMessage( %msgType, %msgString, %client )
|
||||
{
|
||||
%player = $PlayerList[%client];
|
||||
if(%player)
|
||||
%player.isAdmin = true;
|
||||
alxPlay(VotePassSound, 0, 0, 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleSuperAdminPlayerMessage( %msgType, %msgString, %client )
|
||||
{
|
||||
%player = $PlayerList[%client];
|
||||
if(%player)
|
||||
{
|
||||
%player.isSuperAdmin = true;
|
||||
%player.isAdmin = true;
|
||||
}
|
||||
alxPlay(AdminForceSound, 0, 0, 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleVoteItemMessage( %msgType, %msgString, %key, %voteName, %voteActionMsg, %voteText, %sort )
|
||||
{
|
||||
if ( %key != LobbyVoteMenu.key )
|
||||
return;
|
||||
|
||||
%index = LobbyVoteMenu.rowCount();
|
||||
LobbyVoteMenu.addRow( %index, detag( %voteText ) );
|
||||
if ( %sort )
|
||||
LobbyVoteMenu.sort( 0 );
|
||||
$clVoteCmd[%index] = detag( %voteName );
|
||||
$clVoteAction[%index] = detag( %voteActionMsg );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handlePlayerPopupMessage( %msgType, %msgString, %key, %voteName, %voteActionMsg, %voteText, %popupEntryId )
|
||||
{
|
||||
if ( %key != LobbyPlayerPopup.key )
|
||||
return;
|
||||
|
||||
LobbyPlayerPopup.add( " " @ detag( %voteText ), %popupEntryId );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleVotePassedMessage( %msgType, %msgString, %voteName, %voteText )
|
||||
{
|
||||
if ( $InLobby )
|
||||
fillLobbyVoteMenu();
|
||||
|
||||
alxPlay(VotePassSound, 0, 0, 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleVoteFailedMessage( %msgType, %msgString, %voteName, %voteText )
|
||||
{
|
||||
if ( $InLobby )
|
||||
fillLobbyVoteMenu();
|
||||
|
||||
alxPlay(VoteNotPassSound, 0, 0, 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function lobbyVote()
|
||||
{
|
||||
%id = LobbyVoteMenu.getSelectedId();
|
||||
%text = LobbyVoteMenu.getRowTextById( %id );
|
||||
|
||||
switch$ ( LobbyVoteMenu.mode )
|
||||
{
|
||||
case "": // Default case...
|
||||
// Test for special cases:
|
||||
switch$ ( $clVoteCmd[%id] )
|
||||
{
|
||||
case "JoinGame":
|
||||
CommandToServer( 'clientJoinGame' );
|
||||
schedule( 100, 0, lobbyReturnToGame );
|
||||
return;
|
||||
|
||||
case "ChooseTeam":
|
||||
commandToServer( 'ClientJoinTeam', -1, true );
|
||||
schedule( 100, 0, lobbyReturnToGame );
|
||||
return;
|
||||
|
||||
case "VoteTournamentMode":
|
||||
LobbyVoteMenu.tourneyChoose = 1;
|
||||
fillLobbyMissionTypeMenu();
|
||||
return;
|
||||
|
||||
case "VoteMatchStart":
|
||||
startNewVote( "VoteMatchStart" );
|
||||
schedule( 100, 0, lobbyReturnToGame );
|
||||
return;
|
||||
|
||||
case "MakeObserver":
|
||||
commandToServer( 'ClientMakeObserver' );
|
||||
schedule( 100, 0, lobbyReturnToGame );
|
||||
return;
|
||||
|
||||
case "VoteChangeMission":
|
||||
fillLobbyMissionTypeMenu();
|
||||
return;
|
||||
|
||||
case "VoteChangeTimeLimit":
|
||||
fillLobbyTimeLimitMenu();
|
||||
return;
|
||||
|
||||
case "Addbot":
|
||||
commandToServer( 'addBot' );
|
||||
return;
|
||||
}
|
||||
|
||||
case "team":
|
||||
commandToServer( 'ClientJoinTeam', %id++ );
|
||||
LobbyVoteMenu.reset();
|
||||
return;
|
||||
|
||||
case "type":
|
||||
fillLobbyMissionMenu( $clVoteCmd[%id], %text );
|
||||
return;
|
||||
|
||||
case "mission":
|
||||
if( !LobbyVoteMenu.tourneyChoose )
|
||||
{
|
||||
startNewVote( "VoteChangeMission",
|
||||
%text, // Mission display name
|
||||
LobbyVoteMenu.typeName, // Mission type display name
|
||||
$clVoteCmd[%id], // Mission id
|
||||
LobbyVoteMenu.missionType ); // Mission type id
|
||||
}
|
||||
else
|
||||
{
|
||||
startNewVote( "VoteTournamentMode",
|
||||
%text, // Mission display name
|
||||
LobbyVoteMenu.typeName, // Mission type display name
|
||||
$clVoteCmd[%id], // Mission id
|
||||
LobbyVoteMenu.missionType ); // Mission type id
|
||||
LobbyVoteMenu.tourneyChoose = 0;
|
||||
}
|
||||
LobbyVoteMenu.reset();
|
||||
return;
|
||||
|
||||
case "timeLimit":
|
||||
startNewVote( "VoteChangeTimeLimit", $clVoteCmd[%id] );
|
||||
LobbyVoteMenu.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
startNewVote( $clVoteCmd[%id], $clVoteAction[%id] );
|
||||
fillLobbyVoteMenu();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LobbyVoteMenu::reset( %this )
|
||||
{
|
||||
%this.mode = "";
|
||||
%this.tourneyChoose = 0;
|
||||
LobbyCancelBtn.setVisible( false );
|
||||
fillLobbyVoteMenu();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function lobbyPlayerVote(%voteType, %actionMsg, %playerId)
|
||||
{
|
||||
startNewVote(%voteType, %playerId, 0, 0, 0, true);
|
||||
fillLobbyVoteMenu();
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
$sent::patrolwaittime = 10; // 10 secs
|
||||
$sent::patrolsaturation = 2; // 2 sentinel patrolling one point at a time
|
||||
|
||||
// 1 = Normal Sentinel
|
||||
// 2 = Sentinel Monitor
|
||||
|
||||
//==============================================================================
|
||||
// CreateSentinel
|
||||
//------------------------------------------------------------------------------
|
||||
// %pos = position
|
||||
// %team = team
|
||||
// %quantity = how many sentinels to spawn
|
||||
// %type = the type of sentinel to spawn [regular/monitor]
|
||||
//------------------------------------------------------------------------------
|
||||
// It creates a sentinel.
|
||||
//==============================================================================
|
||||
function CreateSentinel(%pos, %quantity, %type)
|
||||
{
|
||||
if(%quantity < 1)
|
||||
return;
|
||||
|
||||
while(%quantity)
|
||||
{
|
||||
%data = (%type == 2 ? "SentinelMonitor" : "SentinelVehicle");
|
||||
%sent = new FlyingVehicle() {
|
||||
datablock = %data;
|
||||
};
|
||||
|
||||
%sent.setTransform(%pos SPC "0 0 1 0");
|
||||
%sent.team = 1;
|
||||
|
||||
MissionCleanup.add(%sent);
|
||||
|
||||
setTargetSensorGroup(%sent.getTarget(), 1);
|
||||
|
||||
$ignoreNextBotConnection = true;
|
||||
%ai = aiConnect("_AISent");
|
||||
ChangeName(%ai, "Sentinel"@%ai);
|
||||
|
||||
%ai.isSentinel = true;
|
||||
%ai.sentVehicle = %sent;
|
||||
%ai.sentinelType = %type;
|
||||
|
||||
%ai.setControlObject(%sent);
|
||||
|
||||
// SentinelAI_PatrolArea(%ai);
|
||||
warn("Sentinel created: "@%ai@", VEHID"@%sent);
|
||||
%quantity--;
|
||||
}
|
||||
}
|
||||
|
||||
function DropSentinel(%id)
|
||||
{
|
||||
if(!isObject(%id) || %id.isSentinel != true)
|
||||
return;
|
||||
|
||||
if(isObject(%id.sentVehicle) && %id.sentVehicle.getDamageState() !$= "Destroyed")
|
||||
%id.sentVehicle.setDamageState(Destroyed);
|
||||
|
||||
%id.drop();
|
||||
}
|
||||
|
||||
function AIConnection::Sentinel_MoveTo(%client, %coords)
|
||||
{
|
||||
%client.clearStep();
|
||||
|
||||
%client.setPilotAim(%coords);
|
||||
%client.setPilotDestination(%coords);
|
||||
}
|
||||
|
||||
function AIConnection::Sentinel_Damaged
|
||||
|
|
@ -1,654 +0,0 @@
|
|||
//==============================================================================
|
||||
// Sentinel Data - Made by Blnukem
|
||||
//==============================================================================
|
||||
// Sentinel Sounds
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
datablock EffectProfile(SentinelTurretSwitchEffect)
|
||||
{
|
||||
effectname = "powered/turret_light_activate";
|
||||
minDistance = 2.5;
|
||||
maxDistance = 5.0;
|
||||
};
|
||||
|
||||
datablock EffectProfile(SentinelTurretFireEffect)
|
||||
{
|
||||
filename = "fx/vehicles/tank_chaingun.wav";
|
||||
minDistance = 2.5;
|
||||
maxDistance = 8.0;
|
||||
};
|
||||
|
||||
datablock EffectProfile(SentinelDeactivateEffect)
|
||||
{
|
||||
effectname = "powered/turret_heavy_reload";
|
||||
minDistance = 2.5;
|
||||
maxDistance = 5.0;
|
||||
};
|
||||
|
||||
datablock EffectProfile(SentinelActivateEffect)
|
||||
{
|
||||
effectname = "powered/turret_light_reload";
|
||||
minDistance = 2.5;
|
||||
maxDistance = 5.0;
|
||||
};
|
||||
|
||||
datablock EffectProfile(SentinelIdleEffect)
|
||||
{
|
||||
effectname = "powered/turret_light_idle";
|
||||
minDistance = 1;
|
||||
maxDistance = 2;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SentinelTurretSwitchSound)
|
||||
{
|
||||
filename = "fx/powered/turret_light_activate.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
effect = SentinelTurretSwitchEffect;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SentinelTurretFireSound)
|
||||
{
|
||||
filename = "fx/vehicles/tank_chaingun.wav";
|
||||
description = AudioDefaultLooping3d;
|
||||
preload = true;
|
||||
effect = SentinelTurretFireEffect;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SentinelIdleSound)
|
||||
{
|
||||
filename = "fx/powered/turret_light_idle.wav";
|
||||
description = AudioDefaultLooping3d;
|
||||
preload = true;
|
||||
effect = SentinelIdleEffect;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SentinelActivateSound)
|
||||
{
|
||||
filename = "fx/powered/turret_light_reload.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
effect = SentinelActivateEffect;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SentinelDeactivateSound)
|
||||
{
|
||||
filename = "fx/powered/turret_heavy_reload.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
effect = SentinelDeactivateEffect;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Vehicle Data
|
||||
//==============================================================================
|
||||
// Standard Sentinel
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
datablock FlyingVehicleData(SentinelVehicle) : SentinelDamageProfile
|
||||
{
|
||||
spawnOffset = "0.0 0.0 0.1";
|
||||
|
||||
catagory = "Sentinels";
|
||||
shapeFile = "stackable2s.dts";
|
||||
multipassenger = false;
|
||||
computeCRC = true;
|
||||
|
||||
debrisShapeName = "debris_generic.dts";
|
||||
debris = TurretDebris;
|
||||
renderWhenDestroyed = false;
|
||||
|
||||
drag = 0.15;
|
||||
density = 1.0;
|
||||
|
||||
numMountPoints = 0;
|
||||
|
||||
cameraMaxDist = 15;
|
||||
cameraOffset = 2.5;
|
||||
cameraLag = 0.9;
|
||||
explosion = TurretExplosion;
|
||||
explosionDamage = 0.5;
|
||||
explosionRadius = 5.0;
|
||||
|
||||
maxDamage = 0.5;
|
||||
destroyedLevel = 0.5;
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 160;
|
||||
maxEnergy = 280;
|
||||
rechargeRate = 0.8;
|
||||
|
||||
minDrag = 30;
|
||||
rotationalDrag = 2000;
|
||||
|
||||
maxAutoSpeed = 15;
|
||||
autoAngularForce = 400;
|
||||
autoLinearForce = 300;
|
||||
autoInputDamping = 0.95;
|
||||
|
||||
maxSteeringAngle = 5;
|
||||
horizontalSurfaceForce = 6;
|
||||
verticalSurfaceForce = 4;
|
||||
maneuveringForce = 5000;
|
||||
steeringForce = 3000;
|
||||
steeringRollForce = 0;
|
||||
rollForce = 10;
|
||||
hoverHeight = 10;
|
||||
createHoverHeight = 2;
|
||||
maxForwardSpeed = 15;
|
||||
|
||||
jetForce = 4500;
|
||||
minJetEnergy = 0;
|
||||
jetEnergyDrain = 0; // Auto stabilize speed
|
||||
vertThrustMultiple = 0;
|
||||
|
||||
mass = 100;
|
||||
bodyFriction = 0;
|
||||
bodyRestitution = 0.5;
|
||||
minRollSpeed = 0;
|
||||
softImpactSpeed = 14;
|
||||
hardImpactSpeed = 25;
|
||||
|
||||
minImpactSpeed = 10;
|
||||
speedDamageScale = 0.06;
|
||||
|
||||
collDamageThresholdVel = 23.0;
|
||||
collDamageMultiplier = 0.02;
|
||||
|
||||
jetSound = "";
|
||||
engineSound = SentinelIdleSound;
|
||||
softImpactSound = SoftImpactSound;
|
||||
hardImpactSound = HardImpactSound;
|
||||
|
||||
softSplashSoundVelocity = 10.0;
|
||||
mediumSplashSoundVelocity = 15.0;
|
||||
hardSplashSoundVelocity = 20.0;
|
||||
exitSplashSoundVelocity = 10.0;
|
||||
|
||||
exitingWater = VehicleExitWaterMediumSound;
|
||||
impactWaterEasy = VehicleImpactWaterSoftSound;
|
||||
impactWaterMedium = VehicleImpactWaterMediumSound;
|
||||
impactWaterHard = VehicleImpactWaterMediumSound;
|
||||
waterWakeSound = VehicleWakeMediumSplashSound;
|
||||
|
||||
dustEmitter = LiftoffDustEmitter;
|
||||
triggerDustHeight = 1.0;
|
||||
dustHeight = 0.1;
|
||||
canControl = false;
|
||||
|
||||
minMountDist = 4;
|
||||
|
||||
splashEmitter[0] = VehicleFoamDropletsEmitter;
|
||||
splashEmitter[1] = VehicleFoamEmitter;
|
||||
|
||||
shieldImpact = VehicleShieldImpact;
|
||||
|
||||
cmdCategory = "Tactical";
|
||||
cmdIcon = CMDFlyingScoutIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_scout_grey";
|
||||
targetNameTag = 'Standard';
|
||||
targetTypeTag = 'Sentinel';
|
||||
sensorData = combatSensor;
|
||||
sensorRadius = combatSensor.detectRadius;
|
||||
sensorColor = "9 9 255";
|
||||
|
||||
checkRadius = 5.5;
|
||||
observeParameters = "1 5 5";
|
||||
canObserve = true;
|
||||
|
||||
runningLight[0] = ShrikeLight1;
|
||||
|
||||
shieldEffectScale = "2.0 2.0 2.0";
|
||||
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Sentinel Monitor Vehicle Data
|
||||
//==============================================================================
|
||||
|
||||
datablock FlyingVehicleData(SentinelMonitor) : SentinelDamageProfile
|
||||
{
|
||||
spawnOffset = "0.0 0.0 0.0";
|
||||
|
||||
catagory = "Sentinels";
|
||||
shapeFile = "beacon.dts";
|
||||
multipassenger = false;
|
||||
computeCRC = true;
|
||||
|
||||
debrisShapeName = "debris_generic.dts";
|
||||
debris = TurretDebris;
|
||||
renderWhenDestroyed = false;
|
||||
|
||||
drag = 4.15;
|
||||
density = 1.0;
|
||||
|
||||
numMountPoints = 0;
|
||||
|
||||
cameraMaxDist = 15;
|
||||
cameraOffset = 2.5;
|
||||
cameraLag = 0.9;
|
||||
explosion = TurretExplosion;
|
||||
explosionDamage = 0.5;
|
||||
explosionRadius = 5.0;
|
||||
|
||||
maxDamage = 50.00;
|
||||
destroyedLevel = 50.00;
|
||||
|
||||
isShielded = true;
|
||||
rechargeRate = 2.5;
|
||||
energyPerDamagePoint = 1;
|
||||
maxEnergy = 500;
|
||||
rechargeRate = 50.0;
|
||||
|
||||
minDrag = 30;
|
||||
rotationalDrag = 2000;
|
||||
|
||||
maxAutoSpeed = 15;
|
||||
autoAngularForce = 400;
|
||||
autoLinearForce = 300;
|
||||
autoInputDamping = 0.95;
|
||||
|
||||
maxSteeringAngle = 5;
|
||||
horizontalSurfaceForce = 6;
|
||||
verticalSurfaceForce = 4;
|
||||
maneuveringForce = 5000;
|
||||
steeringForce = 1000;
|
||||
steeringRollForce = 0;
|
||||
rollForce = 100;
|
||||
hoverHeight = 15;
|
||||
createHoverHeight = 2;
|
||||
maxForwardSpeed = 15;
|
||||
|
||||
jetForce = 1500;
|
||||
minJetEnergy = 0;
|
||||
jetEnergyDrain = 0; // Auto stabilize speed
|
||||
vertThrustMultiple = 0;
|
||||
|
||||
mass = 100;
|
||||
bodyFriction = 0;
|
||||
bodyRestitution = 0.5;
|
||||
minRollSpeed = 0;
|
||||
softImpactSpeed = 14;
|
||||
hardImpactSpeed = 25;
|
||||
|
||||
minImpactSpeed = 25;
|
||||
speedDamageScale = 0.06;
|
||||
|
||||
collDamageThresholdVel = 23.0;
|
||||
collDamageMultiplier = 0.02;
|
||||
|
||||
minTrailSpeed = 0.1;
|
||||
trailEmitter = ContrailEmitter;
|
||||
|
||||
jetSound = "";
|
||||
engineSound = SentinelIdleSound;
|
||||
softImpactSound = SoftImpactSound;
|
||||
hardImpactSound = HardImpactSound;
|
||||
|
||||
softSplashSoundVelocity = 10.0;
|
||||
mediumSplashSoundVelocity = 15.0;
|
||||
hardSplashSoundVelocity = 20.0;
|
||||
exitSplashSoundVelocity = 10.0;
|
||||
|
||||
exitingWater = VehicleExitWaterMediumSound;
|
||||
impactWaterEasy = VehicleImpactWaterSoftSound;
|
||||
impactWaterMedium = VehicleImpactWaterMediumSound;
|
||||
impactWaterHard = VehicleImpactWaterMediumSound;
|
||||
waterWakeSound = VehicleWakeMediumSplashSound;
|
||||
|
||||
dustEmitter = LiftoffDustEmitter;
|
||||
triggerDustHeight = 2.0;
|
||||
dustHeight = 0.0;
|
||||
canControl = false;
|
||||
|
||||
damageEmitter[0] = LightDamageSmoke;
|
||||
damageEmitter[1] = LightDamageSmoke;
|
||||
damageEmitter[2] = DamageBubbles;
|
||||
damageEmitterOffset[0] = "0.0 0.0 0.0 ";
|
||||
damageLevelTolerance[0] = 0.3;
|
||||
damageLevelTolerance[1] = 0.7;
|
||||
numDmgEmitterAreas = 1;
|
||||
|
||||
minMountDist = 4;
|
||||
|
||||
splashEmitter[0] = VehicleFoamDropletsEmitter;
|
||||
splashEmitter[1] = VehicleFoamEmitter;
|
||||
|
||||
shieldImpact = VehicleShieldImpact;
|
||||
|
||||
cmdCategory = "Tactical";
|
||||
cmdIcon = CMDCameraIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_camera_grey";
|
||||
targetNameTag = '';
|
||||
targetTypeTag = 'Monitor';
|
||||
sensorData = combatSensor;
|
||||
sensorRadius = combatSensor.detectRadius;
|
||||
sensorColor = "9 9 255";
|
||||
|
||||
checkRadius = 10.5;
|
||||
observeParameters = "1 5 5";
|
||||
canObserve = true;
|
||||
|
||||
runningLight[0] = ShrikeLight1;
|
||||
|
||||
shieldEffectScale = "2.0 2.0 2.0";
|
||||
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Image Data
|
||||
//==============================================================================
|
||||
// Standard Sentinel Image Data:
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
datablock ShapeBaseImageData(BodyImage) : SentinelVehicle
|
||||
{
|
||||
offset = "0.0 -0.2 0.3";
|
||||
rotation = "0 0 1 0";
|
||||
shapeFile = "turret_mortar_large.dts";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(RightWing) : SentinelVehicle
|
||||
{
|
||||
offset = "0.2 0.0 0.4";
|
||||
rotation = "0 0 -1 90";
|
||||
shapeFile = "pack_deploy_sensor_pulse.dts";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(LeftWing) : SentinelVehicle
|
||||
{
|
||||
offset = "-0.2 0.0 0.4";
|
||||
rotation = "0 0 1 90";
|
||||
shapeFile = "pack_deploy_sensor_pulse.dts";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(Eye) : SentinelVehicle
|
||||
{
|
||||
offset = "0.0 1.1 0.22";
|
||||
rotation = "1 0 0 90";
|
||||
shapeFile = "beacon.dts";
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Sentinel Monitor Image Data:
|
||||
//==============================================================================
|
||||
|
||||
datablock ShapeBaseImageData(Front) : SentinelMonitor
|
||||
{
|
||||
offset = "0.0 -0.02 0.0";
|
||||
rotation = "1.0 0.0 0.0 90.0";
|
||||
shapeFile = "camera.dts";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(Rear) : SentinelMonitor
|
||||
{
|
||||
offset = "0.0 0.02 0.0";
|
||||
rotation = "-1.0 0.0 0.0 90.0";
|
||||
shapeFile = "camera.dts";
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Decals and Projectiles
|
||||
//==============================================================================
|
||||
// Default Sentinel bullet Decal image:
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
datablock DecalData(SentinelDecal1)
|
||||
{
|
||||
sizeX = 0.15;
|
||||
sizeY = 0.15;
|
||||
textureName = "special/bullethole3";
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Standard Sentinel Bullet:
|
||||
//==============================================================================
|
||||
|
||||
datablock TracerProjectileData(SentinelBullet)
|
||||
{
|
||||
doDynamicClientHits = true;
|
||||
|
||||
directDamage = 0.15;
|
||||
directDamageType = $DamageType::Sentinel;
|
||||
explosion = "ChaingunExplosion";
|
||||
splash = ChaingunSplash;
|
||||
HeadMultiplier = 1.5;
|
||||
LegsMultiplier = 0.5;
|
||||
|
||||
kickBackStrength = 50.0;
|
||||
sound = ChaingunProjectile;
|
||||
|
||||
dryVelocity = 800.0;
|
||||
wetVelocity = 100.0;
|
||||
velInheritFactor = 1.0;
|
||||
fizzleTimeMS = 3000;
|
||||
lifetimeMS = 3000;
|
||||
explodeOnDeath = false;
|
||||
reflectOnWaterImpactAngle = 0.0;
|
||||
explodeOnWaterImpact = false;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 3000;
|
||||
|
||||
tracerLength = 10.0;
|
||||
tracerAlpha = false;
|
||||
tracerMinPixels = 6;
|
||||
tracerColor = 10.0/255.0 @ " " @ 30.0/255.0 @ " " @ 240.0/255.0 @ " 0.75";
|
||||
tracerTex[0] = "special/tracer00";
|
||||
tracerTex[1] = "special/tracercross";
|
||||
tracerWidth = 0.15;
|
||||
crossSize = 0.20;
|
||||
crossViewAng = 0.990;
|
||||
renderCross = true;
|
||||
|
||||
decalData[0] = SentinelDecal1;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 8.0;
|
||||
lightColor = "0.5 0.5 0.175";
|
||||
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Turret Data
|
||||
//==============================================================================
|
||||
// Standard Sentinel Turret:
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
datablock TurretData(SentinelTurret) : TurretDamageProfile
|
||||
{
|
||||
className = VehicleTurret;
|
||||
catagory = "Turrets";
|
||||
shapeFile = "turret_belly_base.dts";
|
||||
preload = true;
|
||||
|
||||
mass = 1.0;
|
||||
maxDamage = 1.0;
|
||||
destroyedLevel = 1.0;
|
||||
repairRate = 0;
|
||||
maxDamage = SentinelVehicle.maxDamage;
|
||||
destroyedLevel = SentinelVehicle.destroyedLevel;
|
||||
rechargeRate = 0.15;
|
||||
|
||||
thetaMin = 90;
|
||||
thetaMax = 180;
|
||||
thetaNull = 90;
|
||||
|
||||
rechargeRate = 0.15;
|
||||
|
||||
isShielded = false;
|
||||
energyPerDamagePoint = 110;
|
||||
maxEnergy = 60;
|
||||
renderWhenDestroyed = true;
|
||||
barrel = SentinelTurretBarrel;
|
||||
heatSignature = 0;
|
||||
|
||||
canControl = false;
|
||||
cmdCategory = "DTactical";
|
||||
cmdIcon = CMDTurretIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_turret_grey";
|
||||
targetNameTag = 'Sentinel';
|
||||
targetTypeTag = 'Turret';
|
||||
|
||||
firstPersonOnly = true;
|
||||
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = TurretDebrisSmall;
|
||||
};
|
||||
|
||||
datablock TurretImageData(SentinelTurretBarrel)
|
||||
{
|
||||
shapeFile = "turret_muzzlepoint.dts";
|
||||
mountPoint = 0;
|
||||
|
||||
projectile = SentinelBullet;
|
||||
projectileType = TracerProjectile;
|
||||
|
||||
usesEnergy = true;
|
||||
fireEnergy = 0.0;
|
||||
minEnergy = 10.0;
|
||||
emap = true;
|
||||
|
||||
activationMS = 700;
|
||||
deactivateDelayMS = 1500;
|
||||
thinkTimeMS = 120;
|
||||
degPerSecTheta = 2000;
|
||||
degPerSecPhi = 2000;
|
||||
attackRadius = 100;
|
||||
|
||||
casing = ShellDebris;
|
||||
shellExitDir = "0.0 -0.5 -0.5";
|
||||
shellExitOffset = "0.0 0.0 0.0";
|
||||
shellExitVariance = 20.0;
|
||||
shellVelocity = 5.0;
|
||||
|
||||
projectileSpread = 2.0 / 1000.0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnNotLoaded[0] = "Dead";
|
||||
stateTransitionOnLoaded[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateSequence[1] = "Activate";
|
||||
stateSound[1] = SentinelActivateSound;
|
||||
stateTimeoutValue[1] = 1;
|
||||
stateTransitionOnTimeout[1] = "Ready";
|
||||
stateTransitionOnNotLoaded[1] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNotLoaded[2] = "Deactivate";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateSequence[3] = "Fire";
|
||||
stateSequenceRandomFlash[3] = true;
|
||||
stateSound[3] = ChaingunFireSound;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateEmitter[3] = "GunFireEffectEmitter";
|
||||
stateEmitterNode[3] = "muzzlepoint1";
|
||||
stateEmitterTime[3] = 0.1;
|
||||
stateScript[3] = "onFire";
|
||||
stateFire[3] = true;
|
||||
stateEjectShell[3] = true;
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateTransitionOnTimeout[3] = "Fire";
|
||||
stateTransitionOnTriggerUp[3] = "Reload";
|
||||
stateTransitionOnNoAmmo[3] = "noAmmo";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTimeoutValue[4] = 0.01;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateWaitForTimeout[4] = true;
|
||||
stateSequence[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTransitionOnNotLoaded[4] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
|
||||
stateName[5] = "Deactivate";
|
||||
stateSequence[5] = "Activate";
|
||||
stateSound[5] = SentinelDeactivateSound;
|
||||
stateEmitter[5] = "GunFireEffectEmitter";
|
||||
stateEmitterNode[5] = "muzzlepoint1";
|
||||
stateEmitterTime[5] = 0.2;
|
||||
stateDirection[5] = false;
|
||||
stateTimeoutValue[5] = 1;
|
||||
stateTransitionOnLoaded[5] = "ActivateReady";
|
||||
stateTransitionOnTimeout[5] = "Dead";
|
||||
|
||||
stateName[6] = "Dead";
|
||||
stateTransitionOnLoaded[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "NoAmmo";
|
||||
stateTransitionOnAmmo[7] = "Reload";
|
||||
stateSequence[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Vehicle Functions
|
||||
//==============================================================================
|
||||
// Sentinel Functions:
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function SentinelVehicle::deleteAllMounted(%data, %obj) {
|
||||
$HostGamePlayerCount = ClientGroup.GetCount();
|
||||
%turret = %obj.getMountNodeObject(10);
|
||||
if (!%turret)
|
||||
return;
|
||||
|
||||
%turret.altTrigger = 0;
|
||||
%turret.fireTrigger = 0;
|
||||
|
||||
if (%client = %turret.getControllingClient()) {
|
||||
%client.player.setControlObject(%client.player);
|
||||
%client.player.mountImage(%client.player.lastWeapon, $WeaponSlot);
|
||||
%client.player.mountVehicle = false;
|
||||
|
||||
%client.player.bomber = false;
|
||||
%client.player.isBomber = false;
|
||||
}
|
||||
%turret.schedule(0, delete);
|
||||
}
|
||||
|
||||
function SentinelVehicle::onAdd(%this, %obj)
|
||||
{
|
||||
Parent::onAdd(%this, %obj);
|
||||
if (%obj.clientControl)
|
||||
serverCmdResetControlObject(%obj.clientControl);
|
||||
|
||||
%obj.mountImage(BodyImage, 1);
|
||||
%obj.mountImage(RightWing, 2);
|
||||
%obj.mountImage(LeftWing, 3);
|
||||
%obj.mountImage(Eye, 4);
|
||||
|
||||
%turret = TurretData::create(SentinelTurret);
|
||||
%turret.scale = "0.45 0.45 0.45";
|
||||
MissionCleanup.add(%turret);
|
||||
%turret.team = 1;
|
||||
%turret.selectedWeapon = 1;
|
||||
%turret.setSelfPowered();
|
||||
%obj.mountObject(%turret, 10);
|
||||
%turret.mountImage(SentinelTurretBarrel, 0);
|
||||
%obj.turretObject = %turret;
|
||||
%turret.setCapacitorRechargeRate( %turret.getDataBlock().capacitorRechargeRate );
|
||||
%turret.vehicleMounted = %obj;
|
||||
%turret.setAutoFire(true);
|
||||
%turret.mountImage(AIAimingTurretBarrel, 1);
|
||||
|
||||
setTargetSensorGroup(%turret.getTarget(), %turret.team);
|
||||
setTargetNeverVisMask(%turret.getTarget(), 0xffffffff);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
// Monitor Functions:
|
||||
//==============================================================================
|
||||
|
||||
function SentinelMonitor::onAdd(%this, %obj)
|
||||
{
|
||||
Parent::onAdd(%this, %obj);
|
||||
if (%obj.clientControl)
|
||||
serverCmdResetControlObject(%obj.clientControl);
|
||||
|
||||
%obj.mountImage(Front, 1);
|
||||
%obj.mountImage(Rear, 2);
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,43 +0,0 @@
|
|||
|
||||
datablock TSShapeConstructor(TR2MediumMaleDts)
|
||||
{
|
||||
baseShape = "TR2medium_male.dts";
|
||||
sequence0 = "TR2medium_male_root.dsq root";
|
||||
sequence1 = "TR2medium_male_forward.dsq run";
|
||||
sequence2 = "TR2medium_male_back.dsq back";
|
||||
sequence3 = "TR2medium_male_side.dsq side";
|
||||
sequence4 = "medium_male_lookde.dsq look";
|
||||
sequence5 = "medium_male_head.dsq head";
|
||||
sequence6 = "TR2medium_male_fall.dsq fall";
|
||||
sequence7 = "TR2medium_male_jet.dsq jet";
|
||||
sequence8 = "TR2medium_male_land.dsq land";
|
||||
sequence9 = "TR2medium_male_jump.dsq jump";
|
||||
sequence10 = "medium_male_recoilde.dsq light_recoil";
|
||||
sequence11 = "medium_male_headside.dsq headside";
|
||||
sequence12 = "medium_male_looksn.dsq looksn";
|
||||
sequence13 = "medium_male_lookms.dsq lookms";
|
||||
sequence14 = "TR2medium_male_sitting.dsq sitting";
|
||||
sequence15 = "TR2medium_male_diehead.dsq death1";
|
||||
sequence16 = "TR2medium_male_diechest.dsq death2";
|
||||
sequence17 = "TR2medium_male_dieback.dsq death3";
|
||||
sequence18 = "TR2medium_male_diesidelf.dsq death4";
|
||||
sequence19 = "TR2medium_male_diesidert.dsq death5";
|
||||
sequence20 = "TR2medium_male_dieleglf.dsq death6";
|
||||
sequence21 = "TR2medium_male_diechest.dsq death7"; // medium_male_dielegrt
|
||||
sequence22 = "TR2medium_male_dieback.dsq death8";
|
||||
sequence23 = "TR2medium_male_dieknees.dsq death9";
|
||||
sequence24 = "TR2medium_male_dieforward.dsq death10";
|
||||
sequence25 = "TR2medium_male_diespin.dsq death11";
|
||||
sequence26 = "medium_male_idlepda.dsq pda";
|
||||
sequence27 = "TR2medium_male_celsalute.dsq cel1";
|
||||
sequence28 = "TR2medium_male_celwave.dsq cel2";
|
||||
sequence29 = "TR2medium_male_tauntbest.dsq cel3";
|
||||
sequence30 = "TR2medium_male_tauntimp.dsq cel4";
|
||||
sequence31 = "TR2medium_male_celdance.dsq cel5";
|
||||
sequence32 = "TR2medium_male_celflex.dsq cel6";
|
||||
sequence33 = "TR2medium_male_celtaunt.dsq cel7";
|
||||
sequence34 = "TR2medium_male_celrocky.dsq cel8";
|
||||
sequence35 = "TR2medium_male_ski.dsq ski";
|
||||
sequence36 = "TR2medium_male_standjump.dsq standjump";
|
||||
sequence37 = "medium_male_looknw.dsq looknw";
|
||||
};
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
|
||||
// Tribes 2 Arena [Rev2] 1.0 Final
|
||||
// Written By Teribaen (teribaen@planettribes.com)
|
||||
// http://www.planettribes.com/t2arena/
|
||||
|
||||
$Arena::AI::Version = 1.0;
|
||||
|
||||
|
||||
// ========================================================================== //
|
||||
// | | //
|
||||
// | AI TASKS | //
|
||||
// | | //
|
||||
// ========================================================================== //
|
||||
|
||||
// ------------------------------------------------------------------ //
|
||||
// ArenaGame::onAIRespawn()
|
||||
// Gives the bots their objectives
|
||||
|
||||
function ArenaGame::onAIRespawn( %game, %client )
|
||||
{
|
||||
// Setup AI tasks
|
||||
if ( !%client.defaultTasksAdded )
|
||||
{
|
||||
%client.defaultTasksAdded = true;
|
||||
%client.addTask(AIEngageTask);
|
||||
%client.addTask(AIPickupItemTask);
|
||||
// %client.addTask(AITauntCorpseTask); // Heh, this makes the bots sitting ducks while they taunt
|
||||
%client.addTask(AIUseInventoryTask);
|
||||
// %client.addtask(AIEngageTurretTask);
|
||||
%client.addtask(AIDetectMineTask);
|
||||
%client.addTask(AIPatrolTask);
|
||||
}
|
||||
|
||||
// Use an inv whenever we spawn?
|
||||
%client.spawnUseInv = true;
|
||||
|
||||
// Mark the bot as alive (they just spawned)
|
||||
arenaSetClientAlive( %client );
|
||||
}
|
||||
|
||||
|
||||
// ========================================================================== //
|
||||
// | | //
|
||||
// | AI CALLBACK HANDLERS | //
|
||||
// | | //
|
||||
// ========================================================================== //
|
||||
|
||||
function ArenaGame::AIInit( %game )
|
||||
{
|
||||
// Call the default AIInit() function
|
||||
AIInit();
|
||||
}
|
||||
|
||||
function ArenaGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType, %implement )
|
||||
{
|
||||
if ( %clAttacker && %clAttacker != %clVictim && %clAttacker.team == %clVictim.team )
|
||||
{
|
||||
// Clear the "lastDamageClient" tag so we don't turn on teammates
|
||||
%clVictim.lastDamageClient = -1;
|
||||
}
|
||||
}
|
||||
|
||||
function ArenaGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType, %implement)
|
||||
{
|
||||
if ( %clVictim.team != %clAttacker.team )
|
||||
DefaultGame::onAIKilledClient( %game, %clVictim, %clAttacker, %damageType, %implement );
|
||||
}
|
||||
|
||||
function ArenaGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement)
|
||||
{
|
||||
// if ( %clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim )
|
||||
// AIMessageThread("ChatSorry", %clAttacker, %clVictim);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,236 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// chatMenuHud.cs
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
if ( isFile( "prefs/customVoiceBinds.cs" ) )
|
||||
$defaultVoiceBinds = false;
|
||||
else
|
||||
$defaultVoiceBinds = true;
|
||||
|
||||
// Load in all of the installed chat items:
|
||||
exec( "scripts/cannedChatItems.cs" );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Chat menu loading function:
|
||||
new SimSet( ChatMenuList ); // Store all of the chat menu maps here so that we can delete them later:
|
||||
function activateChatMenu( %filename )
|
||||
{
|
||||
if ( isFile( %filename ) || isFile( %filename @ ".dso" ) )
|
||||
{
|
||||
// Clear the old chat menu:
|
||||
ChatMenuList.clear();
|
||||
|
||||
// Create the root of the new menu:
|
||||
$RootChatMenu = new ActionMap();
|
||||
ChatMenuList.add( $RootChatMenu );
|
||||
$CurrentChatMenu = $RootChatMenu;
|
||||
$CurrentChatMenu.optionCount = 0;
|
||||
$CurrentChatMenu.bindCmd(keyboard, escape, "cancelChatMenu();", "");
|
||||
|
||||
// Build the new chat menu:
|
||||
exec( %filename );
|
||||
}
|
||||
else
|
||||
error( "Chat menu file \"" @ %filename @ "\" not found!" );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Chat menu building functions:
|
||||
function startChatMenu(%heading)
|
||||
{
|
||||
%key = firstWord(%heading);
|
||||
%text = restWords(%heading);
|
||||
%menu = new ActionMap();
|
||||
ChatMenuList.add( %menu );
|
||||
%cm = $CurrentChatMenu;
|
||||
%cm.bindCmd(keyboard, %key, "setChatMenu(\"" @ %text @ "\", " @ %menu @ ");", "");
|
||||
%cm.option[%cm.optionCount] = %key @ ": " @ %text;
|
||||
%cm.command[%cm.optionCount] = %menu; // Save this off here for later...
|
||||
%cm.isMenu[%cm.optionCount] = 1;
|
||||
%cm.optionCount++;
|
||||
%menu.parent = %cm;
|
||||
%menu.bindCmd(keyboard, escape, "cancelChatMenu();", "");
|
||||
%menu.optionCount = 0;
|
||||
$CurrentChatMenu = %menu;
|
||||
}
|
||||
|
||||
function endChatMenu()
|
||||
{
|
||||
$CurrentChatMenu = $CurrentChatMenu.parent;
|
||||
}
|
||||
|
||||
function addChat(%keyDesc, %command)
|
||||
{
|
||||
%key = firstWord(%keyDesc);
|
||||
%text = restWords(%keyDesc);
|
||||
%cm = $CurrentChatMenu;
|
||||
%cm.bindCmd(keyboard, %key, "issueChatCmd(" @ %cm @ "," @ %cm.optionCount @ ");", "");
|
||||
%cm.option[%cm.optionCount] = %key @ ": " @ %text;
|
||||
%cm.command[%cm.optionCount] = %command;
|
||||
%cm.isMenu[%cm.optionCount] = 0;
|
||||
%cm.optionCount++;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Chat menu hud functions:
|
||||
$ChatMenuHudLineCount = 0;
|
||||
function activateChatMenuHud( %make )
|
||||
{
|
||||
if(%make && !TaskHudDlg.isVisible())
|
||||
showChatMenuHud();
|
||||
}
|
||||
|
||||
function showChatMenuHud()
|
||||
{
|
||||
Canvas.pushDialog(ChatMenuHudDlg);
|
||||
ChatMenuHudDlg.setVisible(true);
|
||||
setChatMenu(Root, $RootChatMenu);
|
||||
}
|
||||
|
||||
function cancelChatMenu()
|
||||
{
|
||||
$CurrentChatMenu.pop();
|
||||
$CurrentChatMenu = $RootChatMenu;
|
||||
Canvas.popDialog(ChatMenuHudDlg);
|
||||
ChatMenuHudDlg.setVisible(false);
|
||||
}
|
||||
|
||||
function setChatMenu( %name, %menu )
|
||||
{
|
||||
for ( %i = 0; %i < $ChatMenuHudLineCount; %i++ )
|
||||
chatMenuHud.remove( $ChatMenuHudText[%i] );
|
||||
|
||||
$ChatMenuHudLineCount = %menu.optionCount + 1;
|
||||
chatMenuHud.extent = "170" SPC ( $ChatMenuHudLineCount * 15 ) + 8;
|
||||
|
||||
// First add the menu title line:
|
||||
$ChatMenuHudText[0] = new GuiTextCtrl()
|
||||
{
|
||||
profile = "GuiHudVoiceMenuProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "5 3";
|
||||
extent = "165 20";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
text = "\c2" @ %name @ " Menu:";
|
||||
};
|
||||
chatMenuHud.add( $ChatMenuHudText[0] );
|
||||
|
||||
// Now add all of the menu options:
|
||||
for ( %option = 0; %option < %menu.optionCount; %option++ )
|
||||
{
|
||||
%yOffset = ( %option * 15 ) + 18;
|
||||
|
||||
if ( %menu.isMenu[%option] == 1 )
|
||||
{
|
||||
$ChatMenuHudText[%option + 1] = new GuiTextCtrl()
|
||||
{
|
||||
profile = "GuiHudVoiceMenuProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "5 " @ %yOffset;
|
||||
extent = "165 20";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
text = " " @ %menu.option[%option];
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
$ChatMenuHudText[%option + 1] = new GuiTextCtrl()
|
||||
{
|
||||
profile = "GuiHudVoiceCommandProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "5 " @ %yOffset;
|
||||
extent = "165 20";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
text = " " @ %menu.option[%option];
|
||||
};
|
||||
}
|
||||
|
||||
chatMenuHud.add( $ChatMenuHudText[%option + 1] );
|
||||
}
|
||||
|
||||
//bind "anykey" to closing the chat menu, so if you press an invalid entry, you don't accidently
|
||||
//open the commander map or something...
|
||||
%menu.bindCmd(keyboard, "anykey", "cancelChatMenu();", "");
|
||||
|
||||
// Pop the old menu map and push the new menu's map:
|
||||
$CurrentChatMenu.pop();
|
||||
$CurrentChatMenu = %menu;
|
||||
%menu.push();
|
||||
}
|
||||
|
||||
function issueChatCmd( %menu, %index )
|
||||
{
|
||||
processChatItemCallbacks( %menu.command[%index] );
|
||||
commandToServer( 'CannedChat', %menu.command[%index], false );
|
||||
cancelChatMenu();
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Canned chat handler:
|
||||
function serverCmdCannedChat( %client, %command, %fromAI )
|
||||
{
|
||||
if(%client.isSilenced)
|
||||
return;
|
||||
|
||||
%cmdCode = getWord( %command, 0 );
|
||||
%cmdId = getSubStr( %cmdCode, 1, strlen( %command ) - 1 );
|
||||
%cmdString = getWord( %command, 1 );
|
||||
if ( %cmdString $= "" )
|
||||
%cmdString = getTaggedString( %cmdCode );
|
||||
|
||||
if ( !isObject( $ChatTable[%cmdId] ) )
|
||||
{
|
||||
error( %cmdString @ " is not a recognized canned chat command." );
|
||||
return;
|
||||
}
|
||||
|
||||
%chatItem = $ChatTable[%cmdId];
|
||||
|
||||
//if there is text
|
||||
if (%chatItem.text !$= "" || !%chatItem.play3D)
|
||||
{
|
||||
%message = %chatItem.text @ "~w" @ %chatItem.audioFile;
|
||||
|
||||
if ( %chatItem.teamOnly )
|
||||
cannedChatMessageTeam( %client, %client.team, '\c3%1: %2', %client.name, %message, %chatItem.defaultKeys );
|
||||
else
|
||||
cannedChatMessageAll( %client, '\c4%1: %2', %client.name, %message, %chatItem.defaultKeys );
|
||||
}
|
||||
|
||||
//if no text, see if the audio is to be played in 3D...
|
||||
else if ( %chatItem.play3D && %client.player )
|
||||
playTargetAudio(%client.target, addTaggedString(%chatItem.audioFile), AudioClosest3d, true);
|
||||
|
||||
if ( %chatItem.animation !$= "" )
|
||||
serverCmdPlayAnim(%client, %chatItem.animation);
|
||||
|
||||
// Let the AI respond to the canned chat messages (from humans only)
|
||||
if (!%fromAI)
|
||||
CreateVoiceServerTask(%client, %cmdCode);
|
||||
}
|
||||
|
||||
if ( $defaultVoiceBinds )
|
||||
activateChatMenu( "scripts/voiceBinds.cs" );
|
||||
else
|
||||
activateChatMenu( "prefs/customVoiceBinds.cs" );
|
||||
|
||||
2439
Scripts/client.cs
2439
Scripts/client.cs
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,144 +0,0 @@
|
|||
function LaunchCredits()
|
||||
{
|
||||
Canvas.setContent(CreditsGui);
|
||||
}
|
||||
|
||||
function cancelCredits()
|
||||
{
|
||||
//delete the action map
|
||||
CreditsActionMap.pop();
|
||||
|
||||
//kill the schedules
|
||||
cancel($CreditsScrollSchedule);
|
||||
cancel($CreditsSlideShow);
|
||||
|
||||
//kill the music
|
||||
MusicPlayer.stop();
|
||||
|
||||
//load the launch gui back...
|
||||
Canvas.setContent(LaunchGui);
|
||||
|
||||
//delete the contents of the ML ctrl so as to free up memory...
|
||||
Credits_Text.setText("");
|
||||
}
|
||||
|
||||
function CreditsGui::onWake(%this)
|
||||
{
|
||||
//create an action map to use "esc" to exit the credits screen...
|
||||
if (!isObject(CreditsActionMap))
|
||||
{
|
||||
new ActionMap(CreditsActionMap);
|
||||
CreditsActionMap.bindCmd(keyboard, anykey, "cancelCredits();", "");
|
||||
CreditsActionMap.bindCmd(keyboard, space, "cancelCredits();", "");
|
||||
CreditsActionMap.bindCmd(keyboard, escape, "cancelCredits();", "");
|
||||
CreditsActionMap.bindCmd(mouse, button0, "$CreditsPaused = true;", "$CreditsPaused = false;");
|
||||
CreditsActionMap.bindCmd(mouse, button1, "$CreditsSpeedUp = true;", "$CreditsSpeedUp = false;");
|
||||
if (!isDemo())
|
||||
CreditsActionMap.bindCmd(mouse, button2, "creditsNextPic();", "");
|
||||
}
|
||||
CreditsActionMap.push();
|
||||
|
||||
//build the ML text ctrl...
|
||||
exec("scripts/creditsText.cs");
|
||||
if (!isDemo())
|
||||
{
|
||||
$CreditsPicIndex = 1;
|
||||
CREDITS_Pic.setBitmap("gui/ACCM_" @ $CreditsPicIndex @ ".png");
|
||||
}
|
||||
else
|
||||
CREDITS_Pic.setBitmap("gui/ACCM_1.png");
|
||||
|
||||
//music array
|
||||
if (!isDemo())
|
||||
{
|
||||
$CreditsMusic[0] = "ACCM_Warrior";
|
||||
$CreditsMusic[1] = "ACCM_Warrior";
|
||||
$CreditsMusic[2] = "ACCM_Warrior";
|
||||
$CreditsMusic[3] = "ACCM_Warrior";
|
||||
$CreditsMusic[4] = "ACCM_Warrior";
|
||||
}
|
||||
else
|
||||
{
|
||||
$CreditsMusic[0] = "lush";
|
||||
$CreditsMusic[1] = "desert";
|
||||
$CreditsMusic[2] = "desert";
|
||||
$CreditsMusic[3] = "lush";
|
||||
$CreditsMusic[4] = "desert";
|
||||
}
|
||||
|
||||
//start the credits from the beginning
|
||||
$CreditsOffset = 0.0;
|
||||
%screenHeight = getWord(getResolution(), 1);
|
||||
Credits_Text.resize(getWord(Credits_Text.position, 0),
|
||||
mFloor(%screenHeight / 2) - 125,
|
||||
getWord(Credits_Text.extent, 0),
|
||||
getWord(Credits_Text.extent, 1));
|
||||
|
||||
//start the scrolling
|
||||
$CreditsPaused = false;
|
||||
$CreditsSpeedUp = false;
|
||||
$CreditsScrollSchedule = schedule(3000, 0, scrollTheCredits);
|
||||
|
||||
//start cycling the bitmaps
|
||||
if (!isDemo())
|
||||
$CreditsSlideShow = schedule(5000, 0, creditsNextPic);
|
||||
|
||||
//start some music
|
||||
%chooseTrack = mFloor(getRandom() * 4.99);
|
||||
MusicPlayer.playTrack($CreditsMusic[%chooseTrack]);
|
||||
}
|
||||
|
||||
function addCreditsLine(%text, %lastLine)
|
||||
{
|
||||
CREDITS_Text.addText(%text @ "\n", %lastline);
|
||||
}
|
||||
|
||||
function scrollTheCredits()
|
||||
{
|
||||
//make sure we're not paused
|
||||
if (!$CreditsPaused)
|
||||
{
|
||||
//if we've scrolled off the top, set the position back down to the bottom
|
||||
%parentCtrl = CREDITS_Text.getGroup();
|
||||
if (getWord(Credits_Text.position, 1) + getWord(Credits_Text.extent, 1) < 0)
|
||||
{
|
||||
Credits_Text.position = getWord(Credits_Text.position, 0) SPC getWord(%parentCtrl.extent, 1);
|
||||
$CreditsOffset = getWord(Credits_Text.position, 1);
|
||||
}
|
||||
|
||||
if ($CreditsSpeedUp)
|
||||
%valueToScroll = 10;
|
||||
else
|
||||
%valueToScroll = 1;
|
||||
|
||||
//scroll the control up a bit
|
||||
Credits_Text.resize(getWord(Credits_Text.position, 0),
|
||||
getWord(Credits_Text.position, 1) - %valueToScroll,
|
||||
getWord(Credits_Text.extent, 0),
|
||||
getWord(Credits_Text.extent, 1));
|
||||
}
|
||||
|
||||
//schedule the next scroll...
|
||||
$CreditsScrollSchedule = schedule(30, 0, scrollTheCredits);
|
||||
}
|
||||
|
||||
function creditsNextPic()
|
||||
{
|
||||
//no slide show in the demo...
|
||||
if (isDemo())
|
||||
return;
|
||||
|
||||
cancel($CreditsSlideShow);
|
||||
if (!$CreditsPaused)
|
||||
{
|
||||
$CreditsPicIndex += 1;
|
||||
if ($CreditsPicIndex > 10)
|
||||
$CreditsPicindex = 1;
|
||||
|
||||
//set the bitmap
|
||||
CREDITS_Pic.setBitmap("gui/ACCM_" @ $CreditsPicIndex @ ".png");
|
||||
}
|
||||
|
||||
//schedule the next bitmap
|
||||
$CreditsSlideShow = schedule(5000, 0, creditsNextPic);
|
||||
}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
//
|
||||
// Copyright (c) 2001 GarageGames.Com
|
||||
// Portions Copyright (c) 2001 by Sierra Online, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Hard coded images referenced from C++ code
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// editor/SelectHandle.png
|
||||
// editor/DefaultHandle.png
|
||||
// editor/LockedHandle.png
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Functions
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Mission Editor
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function Editor::create()
|
||||
{
|
||||
// Not much to do here, build it and they will come...
|
||||
// Only one thing... the editor is a gui control which
|
||||
// expect the Canvas to exist, so it must be constructed
|
||||
// before the editor.
|
||||
new EditManager(Editor)
|
||||
{
|
||||
profile = "GuiContentProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "top";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
open = false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function Editor::onAdd(%this)
|
||||
{
|
||||
// Basic stuff
|
||||
exec("scripts/cursors.cs");
|
||||
exec("scripts/EditorProfiles.cs");
|
||||
|
||||
// Tools
|
||||
exec("scripts/editor.bind.cs");
|
||||
exec("gui/ObjectBuilderGui.gui");
|
||||
|
||||
// New World Editor
|
||||
exec("gui/EditorGui.gui");
|
||||
exec("scripts/EditorGui.cs");
|
||||
exec("gui/AIEWorkingDlg.gui");
|
||||
|
||||
// World Editor
|
||||
exec("gui/WorldEditorSettingsDlg.gui");
|
||||
|
||||
// Terrain Editor
|
||||
exec("gui/TerrainEditorVSettingsGui.gui");
|
||||
exec("gui/HelpDlg.gui");
|
||||
exec("scripts/help.cs");
|
||||
|
||||
// do gui initialization...
|
||||
EditorGui.init();
|
||||
|
||||
//
|
||||
exec("scripts/editorRender.cs");
|
||||
}
|
||||
|
||||
function Editor::checkActiveLoadDone()
|
||||
{
|
||||
if(isObject(EditorGui) && EditorGui.loadingMission)
|
||||
{
|
||||
Canvas.setContent(EditorGui);
|
||||
EditorGui.loadingMission = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function toggleEditor(%make)
|
||||
{
|
||||
if (%make)
|
||||
{
|
||||
if (!$missionRunning)
|
||||
{
|
||||
MessageBoxOK("Mission Required", "You must load a mission before starting the Mission Editor.", "");
|
||||
return;
|
||||
}
|
||||
|
||||
// $testcheats = 1;
|
||||
if (!isObject(Editor))
|
||||
{
|
||||
Editor::create();
|
||||
MissionCleanup.add(Editor);
|
||||
}
|
||||
if (Canvas.getContent() == EditorGui.getId())
|
||||
Editor.close();
|
||||
else
|
||||
Editor.open();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
|
||||
function GameBaseData::onAdd(%data, %obj)
|
||||
{
|
||||
if(%data.targetTypeTag !$= "")
|
||||
{
|
||||
// use the name given to the object in the mission file
|
||||
if(%obj.nameTag !$= "")
|
||||
{
|
||||
%obj.nameTag = addTaggedString(%obj.nameTag);
|
||||
%nameTag = %obj.nameTag;
|
||||
}
|
||||
else
|
||||
%nameTag = %data.targetNameTag;
|
||||
|
||||
%obj.target = createTarget(%obj, %nameTag, "", "", %data.targetTypeTag, 0, 0);
|
||||
}
|
||||
else
|
||||
%obj.target = -1;
|
||||
}
|
||||
|
||||
function GameBaseData::onRemove(%data, %obj)
|
||||
{
|
||||
%target = %obj.getTarget();
|
||||
|
||||
// first 32 targets are team targets
|
||||
if(%target >= 32)
|
||||
{
|
||||
if(%obj.nameTag !$= "")
|
||||
removeTaggedString(%obj.nameTag);
|
||||
freeTarget(%target);
|
||||
}
|
||||
}
|
||||
|
||||
function InteriorInstance::damage()
|
||||
{
|
||||
}
|
||||
|
||||
function TerrainBlock::damage()
|
||||
{
|
||||
}
|
||||
|
||||
function WaterBlock::damage() {
|
||||
}
|
||||
|
||||
function ForceFieldBare::damage(%this, %sourceObject, %position, %amount, %damageType) {
|
||||
%this.getDataBlock().damageObject(%this, %sourceObject, %position, %amount, %damageType);
|
||||
}
|
||||
|
||||
function ForceFieldBareData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) {
|
||||
StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType);
|
||||
}
|
||||
|
||||
function ForceFieldBare::applyDamage(%obj,%amount,%sourceObject,%position,%damageType) {
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (getSubStr(%dataBlockName,0,18) $= "DeployedForceField" || getSubStr(%dataBlockName,0,20) $= "DeployedGravityField") {
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord($PowerList,%i);
|
||||
if (genPoweringObj(%powerObj,%obj))
|
||||
%powerList = %powerList SPC %powerObj;
|
||||
}
|
||||
%powerList = trim(%powerList);
|
||||
%genDamage = (%amount * 1) / getWordCount(%powerList);
|
||||
%count = getWordCount(%powerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord(%powerList,%i);
|
||||
%mult = (1 - 0.05) + (getRandom() * 0.10);
|
||||
%powerObj.damage(%sourceObject,%position,%genDamage * %mult,%damageType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ForceFieldBare::isEnabled() {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function GameBaseData::shouldApplyImpulse(%data, %obj)
|
||||
{
|
||||
return %data.shouldApplyImpulse;
|
||||
}
|
||||
|
||||
|
||||
function ShapeBaseData::onAdd(%data, %obj)
|
||||
{
|
||||
Parent::onAdd(%data, %obj);
|
||||
// if it's a deployed object, schedule the ambient thread to play in a little while
|
||||
if(%data.deployAmbientThread)
|
||||
%obj.schedule(750, "playThread", $AmbientThread, "ambient");
|
||||
// check for ambient animation that should always be played
|
||||
if(%data.alwaysAmbient)
|
||||
%obj.playThread($AmbientThread, "ambient");
|
||||
}
|
||||
|
||||
function SimObject::setOwnerClient(%obj, %cl)
|
||||
{
|
||||
%obj.client = %cl;
|
||||
}
|
||||
|
||||
function SimObject::getOwnerClient(%obj)
|
||||
{
|
||||
if(isObject(%obj))
|
||||
return %obj.client;
|
||||
return 0;
|
||||
}
|
||||
// recursive objective init functions for mission group
|
||||
|
||||
function SimGroup::objectiveInit(%this)
|
||||
{
|
||||
for (%i = 0; %i < %this.getCount(); %i++)
|
||||
%this.getObject(%i).objectiveInit();
|
||||
}
|
||||
|
||||
function SimObject::objectiveInit(%this)
|
||||
{
|
||||
}
|
||||
|
||||
function GameBase::objectiveInit(%this)
|
||||
{
|
||||
//error("Initializing object " @ %this @ ", " @ %this.getDataBlock().getName());
|
||||
%this.getDataBlock().objectiveInit(%this);
|
||||
}
|
||||
|
||||
// tag strings are ignored if they start with an underscore
|
||||
function GameBase::getGameName(%this)
|
||||
{
|
||||
%name = "";
|
||||
|
||||
if(%this.nameTag !$= "")
|
||||
%name = %this.nameTag;
|
||||
else
|
||||
{
|
||||
%name = getTaggedString(%this.getDataBlock().targetNameTag);
|
||||
if((%name !$= "") && (getSubStr(%name, 0, 1) $= "_"))
|
||||
%name = "";
|
||||
}
|
||||
|
||||
%type = getTaggedString(%this.getDataBlock().targetTypeTag);
|
||||
if((%type !$= "") && (getSubStr(%type, 0, 1) !$= "_"))
|
||||
{
|
||||
if(%name !$= "")
|
||||
return(%name @ " " @ %type);
|
||||
else
|
||||
return(%type);
|
||||
}
|
||||
|
||||
return(%name);
|
||||
}
|
||||
|
|
@ -1,373 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// Object control
|
||||
//------------------------------------------------------------------------------
|
||||
function getControlObjectType(%obj,%user)
|
||||
{
|
||||
// turrets (camera is a turret)
|
||||
if (%obj.getType() & $TypeMasks::TurretObjectType)
|
||||
{
|
||||
%barrel = %obj.getMountedImage(0);
|
||||
if (isObject(%barrel))
|
||||
return(addTaggedString(%barrel.getName()));
|
||||
}
|
||||
|
||||
// unknown
|
||||
return('Unknown');
|
||||
}
|
||||
|
||||
function serverCmdControlObject(%client, %targetId)
|
||||
{
|
||||
// match started:
|
||||
if (!$MatchStarted)
|
||||
{
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "mission has not started.");
|
||||
return;
|
||||
}
|
||||
|
||||
// object:
|
||||
%obj = getTargetObject(%targetId);
|
||||
if (%obj == -1)
|
||||
{
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "failed to find target object.");
|
||||
return;
|
||||
}
|
||||
|
||||
// shapebase:
|
||||
if (!(%obj.getType() & $TypeMasks::ShapeBaseObjectType))
|
||||
{
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "object cannot be controlled.");
|
||||
return;
|
||||
}
|
||||
|
||||
// can control:
|
||||
if (!%obj.getDataBlock().canControl)
|
||||
{
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "object cannot be controlled.");
|
||||
return;
|
||||
}
|
||||
|
||||
// check damage:
|
||||
if (%obj.getDamageState() !$= "Enabled")
|
||||
{
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "object is " @ %obj.getDamageState());
|
||||
return;
|
||||
}
|
||||
|
||||
// powered:
|
||||
if (!%obj.isPowered())
|
||||
{
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "object is not powered.");
|
||||
return;
|
||||
}
|
||||
|
||||
// controlled already:
|
||||
%control = %obj.getControllingClient();
|
||||
if (%control)
|
||||
{
|
||||
if (%control == %client)
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "you are already controlling that object.");
|
||||
else
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "someone is already controlling that object.");
|
||||
return;
|
||||
}
|
||||
|
||||
// same team?
|
||||
if (getTargetSensorGroup(%targetId) != %client.getSensorGroup())
|
||||
{
|
||||
commandToClient(%client, 'ControlObjectResonse', false, "cannot control enemy objects.");
|
||||
return;
|
||||
}
|
||||
|
||||
// dead?
|
||||
if (%client.player == 0 && getTargetDataBlock(%targetId).getName() !$= "TurretPrisonCamera") {
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "dead people cannot control objects.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%client.isJailed) {
|
||||
return;
|
||||
}
|
||||
|
||||
// turret in purebuild mode?
|
||||
if ((%obj.getType() & $TypeMasks::TurretObjectType)
|
||||
&& $Host::Purebuild == 1
|
||||
&& !(%client.isAdmin || %client.isSuperAdmin)
|
||||
&& %obj.getDataBlock().getName() !$= "TurretDeployedCamera"
|
||||
&& %obj.getDataBlock().getName() !$= "TurretPrisonCamera") {
|
||||
commandToClient(%client, 'ControlObjectResponse', false, "cannot control turrets in purebuild mode.");
|
||||
return;
|
||||
}
|
||||
|
||||
//[[CHANGE]]Make sure you can command a bomber... and ride it the same time ;)
|
||||
|
||||
//mounted in a vehicle?
|
||||
//if (%client.player.isMounted())
|
||||
//{
|
||||
// commandToClient(%client, 'ControlObjectResponse', false, "can't control objects while mounted in a vehicle.");
|
||||
// return;
|
||||
//}
|
||||
|
||||
%client.setControlObject(%obj);
|
||||
commandToClient(%client, 'ControlObjectResponse', true, getControlObjectType(%obj,%client.player));
|
||||
%objName = getTaggedString(getTargetName(%obj.target)) SPC getTaggedString(getTargetType(%obj.target));
|
||||
if (%obj $= "")
|
||||
%objName = %obj.getDataBlock().getName();
|
||||
if ($Host::Purebuild == 1)
|
||||
messageAll('msgClient','\c2%1 is now controlling %2.',%client.name,%objName);
|
||||
else
|
||||
messageTeam(%client.team,'msgClient','\c2%1 is now controlling %2.',%client.name,%objName);
|
||||
|
||||
//[[CHANGE]] Make sure the controlled object knows how is controlling it.
|
||||
%obj.clientControl = %client;
|
||||
|
||||
///[[CHANGE]] Includes the remote station functionality.
|
||||
|
||||
if (%obj.getType() & $TypeMasks::StationObjectType)
|
||||
{
|
||||
//Lost of commented stuff... should not be nessesary.
|
||||
%colObj = %client.player;
|
||||
//%colObj.inStation = true;
|
||||
|
||||
//commandToClient(%colObj.client,'setStationKeys', true);
|
||||
messageClient(%colObj.client, 'CloseHud', "", 'inventoryScreen');
|
||||
//commandToClient(%colObj.client, 'TogglePlayHuds', true);
|
||||
%obj.triggeredBy = %colObj;
|
||||
//%obj.getDataBlock().stationTriggered(%obj, 1);
|
||||
%colObj.station = %obj;
|
||||
//%colObj.lastWeapon = ( %colObj.getMountedImage($WeaponSlot) == 0 ) ? "" : %colObj.getMountedImage($WeaponSlot).getName().item;
|
||||
//%colObj.unmountImage($WeaponSlot);
|
||||
// Make sure none of the other popup huds are active:
|
||||
//messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'scoreScreen' );
|
||||
//messageClient( %obj.triggeredBy.client, 'CloseHud', "", 'inventoryScreen' );
|
||||
//Make sure the client doesn't transport.. but does get command.
|
||||
%client.telebuy = 1;
|
||||
|
||||
|
||||
//Stuff from observing
|
||||
%data = %obj.getDataBlock();
|
||||
|
||||
%obsData = %data.observeParameters;
|
||||
%obsX = firstWord(%obsData);
|
||||
%obsY = getWord(%obsData, 1);
|
||||
%obsZ = getWord(%obsData, 2);
|
||||
|
||||
// don't set the camera mode so that it does not interfere with spawning
|
||||
%transform = %obj.getTransform();
|
||||
|
||||
// create a fresh camera to observe through... (could add to a list on
|
||||
// the observed camera to be removed when that object dies/...)
|
||||
|
||||
if ( !isObject( %client.comCam ) )
|
||||
{
|
||||
%client.comCam = new Camera()
|
||||
{
|
||||
dataBlock = CommanderCamera;
|
||||
};
|
||||
MissionCleanup.add(%client.comCam);
|
||||
}
|
||||
|
||||
%client.comCam.setTransform(%transform);
|
||||
%client.comCam.setOrbitMode(%obj, %transform, %obsX, %obsY, %obsZ);
|
||||
|
||||
%client.setControlObject(%client.comCam);
|
||||
commandToClient(%client, 'CameraAttachResponse', true);
|
||||
|
||||
//Display the Vehicle Station GUI
|
||||
//%client.player.AttachBeacon();
|
||||
//%client.player.schedule(20000,"RemoveBeacon");
|
||||
//%client.player.scheduel(1000,RemoveBeacon());
|
||||
|
||||
commandToClient(%obj.triggeredBy.client, 'StationVehicleShowHud');
|
||||
}
|
||||
if (isObject(%client.player)) {
|
||||
%client.player.RemoveBeacon();
|
||||
%client.player.AttachBeacon();
|
||||
}
|
||||
//[[End CHANGE]]
|
||||
}
|
||||
|
||||
//[[CHANGE]] Pretty straigh forward functions.
|
||||
function Player::AttachBeacon(%obj)
|
||||
{
|
||||
%beacon = new BeaconObject(){
|
||||
datablock = BomberBeacon;
|
||||
};
|
||||
if (%obj.team == 1)
|
||||
%team = 2;
|
||||
else
|
||||
%team = 1;
|
||||
%beacon.team = %team;
|
||||
%beacon.owner = %obj;
|
||||
%beacon.setTarget(%team);
|
||||
%obj.mountObject(%beacon, 4);
|
||||
%obj.enemyBeacon = %beacon;
|
||||
MissionCleanup.add(%beacon);
|
||||
%beacon.setBeaconType(enemy);
|
||||
}
|
||||
function Player::RemoveBeacon(%obj)
|
||||
{
|
||||
if (%obj.enemybeacon)
|
||||
%obj.enemyBeacon.delete();
|
||||
%obj.enemyBeacon = "";
|
||||
}
|
||||
//[[End CHANGE]]
|
||||
//------------------------------------------------------------------------------
|
||||
// TV Functions
|
||||
//------------------------------------------------------------------------------
|
||||
function resetControlObject(%client) {
|
||||
if ( isObject( %client.comCam ) )
|
||||
%client.comCam.delete();
|
||||
if (isObject(%client.player) && !%client.player.isDestroyed() && $MatchStarted)
|
||||
%client.setControlObject(%client.player);
|
||||
else
|
||||
%client.setControlObject(%client.camera);
|
||||
|
||||
// [[CHANGE]] make sure all is reset.
|
||||
if (isObject(%client.player)) {
|
||||
%client.player.station.triggeredBy = "";
|
||||
%client.player.station = "";
|
||||
%client.player.RemoveBeacon();
|
||||
}
|
||||
}
|
||||
|
||||
function serverCmdResetControlObject(%client) {
|
||||
resetControlObject(%client);
|
||||
commandToClient(%client, 'ControlObjectReset');
|
||||
// --------------------------------------------------------
|
||||
// z0dd - ZOD 4/18/02. Vehicle reticle disappearance fix.
|
||||
// commandToClient(%client, 'RemoveReticle');
|
||||
//if(isObject(%client.player))
|
||||
//{
|
||||
// %weapon = %client.player.getMountedImage($WeaponSlot);
|
||||
// %client.setWeaponsHudActive(%weapon.item);
|
||||
//}
|
||||
if(isObject(%client.player))
|
||||
{
|
||||
if(%client.player.isPilot() || %client.player.isWeaponOperator())
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
commandToClient(%client, 'RemoveReticle');
|
||||
%weapon = %client.player.getMountedImage($WeaponSlot);
|
||||
%client.setWeaponsHudActive(%weapon.item);
|
||||
}
|
||||
}
|
||||
// End z0dd - ZOD
|
||||
// --------------------------------------------------------
|
||||
|
||||
// [[CHANGE]] make sure all is reset.
|
||||
if (isObject(%client.player)) {
|
||||
%client.player.station.triggeredBy = "";
|
||||
%client.player.station = "";
|
||||
%client.player.RemoveBeacon();
|
||||
}
|
||||
}
|
||||
|
||||
function serverCmdAttachCommanderCamera(%client, %target)
|
||||
{
|
||||
// dont allow observing until match has started
|
||||
if (!$MatchStarted)
|
||||
{
|
||||
commandToClient(%client, 'CameraAttachResponse', false);
|
||||
return;
|
||||
}
|
||||
|
||||
%obj = getTargetObject(%target);
|
||||
if ((%obj == -1) || (%target == -1))
|
||||
{
|
||||
commandToClient(%client, 'CameraAttachResponse', false);
|
||||
return;
|
||||
}
|
||||
|
||||
// shape base object?
|
||||
if (!(%obj.getType() & $TypeMasks::ShapeBaseObjectType))
|
||||
{
|
||||
commandToClient(%client, 'CameraAttachResponse', false);
|
||||
return;
|
||||
}
|
||||
|
||||
// can be observed?
|
||||
if (!%obj.getDataBlock() || !%obj.getDataBlock().canObserve)
|
||||
{
|
||||
commandToClient(%client, 'CameraAttachResponse', false);
|
||||
return;
|
||||
}
|
||||
|
||||
// same team?
|
||||
if (getTargetSensorGroup(%target) != %client.getSensorGroup())
|
||||
{
|
||||
commandToClient(%client, 'CameraAttachResponse', false);
|
||||
return;
|
||||
}
|
||||
|
||||
// powered?
|
||||
if (!%obj.isPowered())
|
||||
{
|
||||
commandToClient(%client, 'CameraAttachResponse', false);
|
||||
return;
|
||||
}
|
||||
|
||||
// client connection?
|
||||
if (%obj.getClassName() $= "GameConnection")
|
||||
{
|
||||
%player = %obj.player;
|
||||
if (%obj == %client)
|
||||
{
|
||||
if (isObject(%player) && !%player.isDestroyed())
|
||||
{
|
||||
|
||||
%client.setControlObject(%player);
|
||||
commandToClient(%client, 'CameraAttachResponse', true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
%obj = %player;
|
||||
}
|
||||
|
||||
if (!isObject(%obj) || %obj.isDestroyed())
|
||||
{
|
||||
commandToClient(%client, 'CameraAttachResponse', false);
|
||||
return;
|
||||
}
|
||||
|
||||
%data = %obj.getDataBlock();
|
||||
|
||||
%obsData = %data.observeParameters;
|
||||
%obsX = firstWord(%obsData);
|
||||
%obsY = getWord(%obsData, 1);
|
||||
%obsZ = getWord(%obsData, 2);
|
||||
|
||||
// don't set the camera mode so that it does not interfere with spawning
|
||||
%transform = %obj.getTransform();
|
||||
|
||||
// create a fresh camera to observe through... (could add to a list on
|
||||
// the observed camera to be removed when that object dies/...)
|
||||
if ( !isObject( %client.comCam ) )
|
||||
{
|
||||
%client.comCam = new Camera()
|
||||
{
|
||||
dataBlock = CommanderCamera;
|
||||
};
|
||||
MissionCleanup.add(%client.comCam);
|
||||
}
|
||||
|
||||
%client.comCam.setTransform(%transform);
|
||||
%client.comCam.setOrbitMode(%obj, %transform, %obsX, %obsY, %obsZ);
|
||||
|
||||
%client.setControlObject(%client.comCam);
|
||||
commandToClient(%client, 'CameraAttachResponse', true);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Scoping
|
||||
function serverCmdScopeCommanderMap(%client, %scope)
|
||||
{
|
||||
if (%scope)
|
||||
resetControlObject(%client);
|
||||
%client.scopeCommanderMap(%scope);
|
||||
|
||||
commandToClient(%client, 'ScopeCommanderMap', %scope);
|
||||
}
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
$Host::teamskin[0] = "base";
|
||||
$Host::teamskin[1] = "basebbot";
|
||||
$Host::teamskin[2] = "basebot";
|
||||
$Host::teamskin[3] = "beagle";
|
||||
$Host::teamskin[4] = "dsword";
|
||||
$Host::teamskin[5] = "cotp";
|
||||
$Host::teamskin[6] = "swolf";
|
||||
|
||||
$Host::teamname[0] = "Outcasts";
|
||||
$Host::teamname[1] = "Constructors";
|
||||
$Host::teamname[2] = "Builders";
|
||||
$Host::teamname[3] = "Admins";
|
||||
$Host::teamname[4] = "Rebels";
|
||||
$Host::teamname[5] = "Rouges";
|
||||
$Host::teamname[6] = "Zombies";
|
||||
|
||||
$Host::holoName[0] = "";
|
||||
$Host::holoName[1] = "Storm";
|
||||
$Host::holoName[2] = "Inferno";
|
||||
$Host::holoName[3] = "Starwolf";
|
||||
$Host::holoName[4] = "DSword";
|
||||
$Host::holoName[5] = "BloodEagle";
|
||||
$Host::holoName[6] = "Harbinger";
|
||||
|
||||
// Demo-specific preferences:
|
||||
if ( isDemo() )
|
||||
{
|
||||
$Host::GameName = "Tribes 2 Demo Server";
|
||||
$Host::Info = "This is a Tribes 2 Demo Server.";
|
||||
$Host::Map = "SlapDash";
|
||||
$Host::MaxPlayers = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
$Host::GameName = "ACCM Server";
|
||||
$Host::Info = "<Color:ffffff>This is an ACCM server.";
|
||||
$Host::Map = "Lost World";
|
||||
$Host::MaxPlayers = 20;
|
||||
}
|
||||
|
||||
$Host::AdminList = "";
|
||||
$Host::SuperAdminList = "";
|
||||
$Host::BindAddress = "";
|
||||
$Host::Port = 28000;
|
||||
$Host::Password = "";
|
||||
$Host::AdminPassword = "";
|
||||
$Host::PureServer = 1;
|
||||
$Host::Dedicated = 0;
|
||||
$Host::MissionType = "Infection";
|
||||
$Host::TimeLimit = 30;
|
||||
$Host::BotCount = 2;
|
||||
$Host::BotsEnabled = 0;
|
||||
$Host::MinBotDifficulty = 0.5;
|
||||
$Host::MaxBotDifficulty = 0.75;
|
||||
$Host::NoSmurfs = 0;
|
||||
$Host::VoteTime = 30; // amount of time before votes are calculated
|
||||
$Host::VotePassPercent = 60; // percent needed to pass a vote
|
||||
$Host::KickBanTime = 60; // specified in seconds
|
||||
$Host::BanTime = 1800; // specified in seconds
|
||||
$Host::PlayerRespawnTimeout = 60; // time before a dead player is forced into observer mode
|
||||
$Host::warmupTime = 20;
|
||||
$Host::TournamentMode = 0;
|
||||
$Host::allowAdminPlayerVotes = 0;
|
||||
$Host::FloodProtectionEnabled = 0;
|
||||
$Host::MaxMessageLen = 120;
|
||||
$Host::VoteSpread = 20;
|
||||
$Host::TeamDamageOn = 0;
|
||||
$Host::Siege::Halftime = 20000;
|
||||
$Host::CRCTextures = 0;
|
||||
|
||||
// Construction-specific defaults.
|
||||
$Host::ACCMChatLogging = 1;
|
||||
$Host::ACCMEchoChat = 1;
|
||||
$Host::AdminOnlyFadeObject = 0;
|
||||
$Host::AllowKeeperPlayerVotes = 1;
|
||||
$Host::AntidoteStationMaxAntidotes = 20;
|
||||
$Host::Cascade = 0;
|
||||
$Host::ExpertMode = 1;
|
||||
$Host::Hazard::Enabled = 0;
|
||||
$Host::InvincibleArmors = 0;
|
||||
$Host::InvincibleDeployables = 1;
|
||||
$Host::KeepersGetMakerAbility = 1;
|
||||
$Host::LockedTeams = "0";
|
||||
$Host::NoAnnoyingVoiceChatSpam = 0;
|
||||
$Host::NoInfection = 0;
|
||||
$Host::NoPulseSCG = 0;
|
||||
$Host::ObserversCannotChat = 1;
|
||||
$Host::OnlyOwnerCascade = 1;
|
||||
$Host::OnlyOwnerCubicReplace = 1;
|
||||
$Host::OnlyOwnerDeconstruct = 1;
|
||||
$Host::OnlyOwnerRotate = 1;
|
||||
$Host::Prison::DeploySpam = 0;
|
||||
$Host::Prison::DeploySpamCheckTimeMS = 1000;
|
||||
$Host::Prison::DeploySpamMaxTime = 300;
|
||||
$Host::Prison::DeploySpamMultiply = 1;
|
||||
$Host::Prison::DeploySpamRemoveRecentMS = 15000;
|
||||
$Host::Prison::DeploySpamResetWarnCountTime = 30;
|
||||
$Host::Prison::DeploySpamTime = 60;
|
||||
$Host::Prison::DeploySpamWarnings = 10;
|
||||
$Host::Prison::Enabled = 0;
|
||||
$Host::Prison::JailMode = 0;
|
||||
$Host::Prison::Kill = 0;
|
||||
$Host::Prison::KillTime = 120;
|
||||
$Host::Prison::ReleaseMode = 1;
|
||||
$Host::Prison::TeamKill = 0;
|
||||
$Host::Purebuild = 0;
|
||||
$Host::SADProtection = 1;
|
||||
$Host::StationHoldTime = 1600; // Specified in seconds.
|
||||
$Host::SuperAdminPassword = "";
|
||||
$Host::Vehicles = 1;
|
||||
|
||||
// 0: .v12 (1.2 kbits/sec), 1: .v24 (2.4 kbits/sec), 2: .v29 (2.9kbits/sec)
|
||||
// 3: GSM (6.6 kbits/sec)
|
||||
$Audio::maxEncodingLevel = 3;
|
||||
$Audio::maxVoiceChannels = 2;
|
||||
|
||||
$Host::MapPlayerLimits["Abominable", "CnH"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["AgentsOfFortune", "TeamHunters"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Alcatraz", "Siege"] = "-1 48";
|
||||
$Host::MapPlayerLimits["Archipelago", "CTF"] = "16 -1";
|
||||
$Host::MapPlayerLimits["AshesToAshes", "CnH"] = "16 -1";
|
||||
$Host::MapPlayerLimits["BeggarsRun", "CTF"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Caldera", "Siege"] = "-1 48";
|
||||
$Host::MapPlayerLimits["CasernCavite", "Hunters"] = "-1 32";
|
||||
$Host::MapPlayerLimits["CasernCavite", "DM"] = "-1 32";
|
||||
$Host::MapPlayerLimits["CasernCavite", "Bounty"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Damnation", "CTF"] = "-1 32";
|
||||
$Host::MapPlayerLimits["DeathBirdsFly", "CTF"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Desiccator", "CTF"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["DustToDust", "CTF"] = "-1 32";
|
||||
$Host::MapPlayerLimits["DustToDust", "Hunters"] = "-1 32";
|
||||
$Host::MapPlayerLimits["DustToDust", "TeamHunters"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Equinox", "CnH"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Equinox", "DM"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Escalade", "Hunters"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Escalade", "TeamHunters"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Escalade", "DM"] = "16 -1";
|
||||
$Host::MapPlayerLimits["Escalade", "Bounty"] = "16 32";
|
||||
$Host::MapPlayerLimits["Escalade", "Rabbit"] = "16 -1";
|
||||
$Host::MapPlayerLimits["Firestorm", "CTF"] = "-1 24";
|
||||
$Host::MapPlayerLimits["Firestorm", "CnH"] = "-1 24";
|
||||
$Host::MapPlayerLimits["Flashpoint", "CnH"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Gauntlet", "Siege"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Gehenna", "Hunters"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Gehenna", "TeamHunters"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Icebound", "Siege"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Insalubria", "CnH"] = "-1 32";
|
||||
$Host::MapPlayerLimits["JacobsLadder", "CnH"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Katabatic", "CTF"] = "-1 48";
|
||||
$Host::MapPlayerLimits["Masada", "Siege"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Minotaur", "CTF"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Myrkwood", "Hunters"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Myrkwood", "DM"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Myrkwood", "Rabbit"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Oasis", "DM"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Overreach", "CnH"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Quagmire", "CTF"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Rasp", "TeamHunters"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Rasp", "Bounty"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Recalescence", "CTF"] = "16 -1";
|
||||
$Host::MapPlayerLimits["Respite", "Siege"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Reversion", "CTF"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Rimehold", "Hunters"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Rimehold", "Hunters"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Riverdance", "CTF"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Sanctuary", "CTF"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Sirocco", "CnH"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Slapdash", "CTF"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["SunDried", "DM"] = "8 -1";
|
||||
$Host::MapPlayerLimits["SunDried", "Bounty"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Talus", "Bounty"] = "-1 32";
|
||||
$Host::MapPlayerLimits["ThinIce", "CTF"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Tombstone", "CTF"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["UltimaThule", "Siege"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Underhill", "DM"] = "-1 -1";
|
||||
$Host::MapPlayerLimits["Underhill", "Bounty"] = "-1 32";
|
||||
$Host::MapPlayerLimits["Whiteout", "DM"] = "8 -1";
|
||||
$Host::MapPlayerLimits["Whiteout", "Bounty"] = "8 -1";
|
||||
58
scripts/modscripts/player.cs
Normal file
58
scripts/modscripts/player.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
// -------------------------------------------
|
||||
// player.cs
|
||||
// ACCM Player-bound commands
|
||||
// ===========================================
|
||||
|
||||
function Player::setSkin(%self, %skin)
|
||||
{
|
||||
freeTarget(%self.getTarget());
|
||||
|
||||
%self.skin = %skin;
|
||||
// Zombitch
|
||||
if (!isObject(%self.client))
|
||||
{
|
||||
%self.target = createTarget(%self, %self.name, %skin, "Derm3", '', 6, PlayerSensor);
|
||||
setTargetSensorGroup(%self.target, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
%self.target = createTarget(%self, %self.client.name, %skin, %self.client.voice, '', 0, PlayerSensor);
|
||||
setTargetSensorGroup(%self.target, %self.client.team);
|
||||
setTargetName(%obj.target, %self.client.name);
|
||||
%self.client.skin = addTaggedString(%skin);
|
||||
%self.client.target = %self.target;
|
||||
}
|
||||
setTargetSkin(%self.target, addTaggedString(%skin));
|
||||
setTargetDataBlock(%self.target, %self.getDatablock());
|
||||
setTargetSensorData(%self.target, PlayerSensor);
|
||||
%self.setTarget(%self.target);
|
||||
return true;
|
||||
}
|
||||
|
||||
function Player::setName(%self, %name)
|
||||
{
|
||||
|
||||
%self.name = %name;
|
||||
if (!isObject(%self.client))
|
||||
{
|
||||
freeTarget(%self.getTarget());
|
||||
%self.target = createTarget(%self, %self.name, %skin, "Derm3", '', 6, PlayerSensor);
|
||||
setTargetSensorGroup(%self.target, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
%ptarget = %self.target;
|
||||
%skin = getTaggedString(getTargetSkin(%self.getTarget()));
|
||||
%self.target = createTarget(%self, %name, %skin, %self.client.voice, '', 0, PlayerSensor);
|
||||
freeTarget(%ptarget);
|
||||
setTargetSensorGroup(%self.target, %self.client.team);
|
||||
setTargetName(%self.target, %name);
|
||||
%self.client.target = %self.target;
|
||||
}
|
||||
setTargetSkin(%self.target, addTaggedString(%self.skin));
|
||||
setTargetDataBlock(%self.target, %self.getDatablock());
|
||||
setTargetSensorData(%self.target, PlayerSensor);
|
||||
%self.setTarget(%self.target);
|
||||
return true;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue