v24834 - skipped v24763 and v24822 due to not being available (09/13/01):

Map Editor
===================================
Several editor crashes have been resolved and this tool should be more stable for the MOD community now.

VCR Mode
===================================
The VCR Mode has been implemented.

F3 starts recording.  F4 stops the current recording.  Multiple recordings can be made from the same mission.

Other controls can be used while playing back a recording. They include:

   -- ESCAPE will stop the playback
   -- TAB will pop up the playback controls window in the upper part of the screen
   -- SPACEBAR will pause/unpause the playback
   -- Numpad + will increase the time step so that the playback accelerates (maximum of 16X speed)
   -- Numpad - will decrease the time step so that the playback slows down (minimum of 1/16X speed)

***If you Alt-Tab to windows to rename a demo file and then return to Tribes instead of using the rename file feature of the demo recorder you will crash after you exit the recorder. It is a windows issue and so we can't fix it.

Satchel Charge Icon Glow
===================================
When the satchel charge is deployed and ready to explode, the icon now glows. The icon disappears completely when the satchel is destroyed (either through activation or destruction). This allows players to more readily keep track of satchel charge status.

"Visibility" option for Server Admins
=====================================
Allows an Advanced Server option to indicate whether the server will use the "Speed" or "Distance" versions of the maps when hosting games. The "Distance" setting will use world versions with much less fog and more visible distance. The "Speed" setting will use the current foggier map settings. These settings will be displayed as a new column on the Master Server List titled "VISIBILITY" and the settings will be "Speed" or "Distance".

NOTE: This visibility change won't be apparent on all maps. A map you can use as a test to show the differences is "Dessicator".

World Skins Default to Main Tribes
==========================================
The missions are now set up so they have default skins other than "Storm" vs. "Inferno". This occurs whenever a player has "Show Individual Skins" toggled OFF. In otherwords, some maps will have "Diamond Skin" vs. "StarWolf", while others will have different combinations. (NOTE: If a player has "Show Individual Skins" toggled ON, then he will see the regular individual skins for players.) New voice samples have been added to allow Victory messages indicate these new team skins. Also note: Bioderms are bioderms, regardless of the team they are on...we're not changing models or voice packages.

Teams now use skins for CTF games relative to the planet - as follows:
Terrain 	Team 1 		Team 2
Ice  		Starwolf 	Blood Eagle
Lush  		Blood Eagle 	Diamond Sword
Badlands 	Starwolf 	Diamond Sword
Desert  	Phoenix 	Blood Eagle
Lava  		Diamond Sword 	Phoenix

If the server admin wishes to specify team skins, set the variable
$host:: useCustomSkins = true;  in serverPrefs.cs

if this variable is set true the skins and names used are
$Host::TeamName1 and $Host::TeamName2  and
$Host::TeamSkin1 and $Host::TeamSkin2  also set in serverPrefs.cs.
These team and skin names are always used for non-CTF games.

NOTE: In "Tournament" mode games, the skins will always default to Storm and Inferno rather than world-specific skins. This is to make it easier for League and Ladder players to assign teams to sides.

Cheat Fixes
===================================
Significant cheat prevention code has been implemented to eliminate known cheats, as well as to make it much more difficult for future cheating of a similar nature to occur.

NOTE: If you have any troubles running a server now, you may have altered or removed something from the build on your server. The code is checking almost everything now (shapes, textures, etc.), so you should ensure that you have all files present from a normal build on your server. (Additional files, like MODs and extra art files won't be a problem...but all original files must be there as well.)

Siege Halftime Improved
===================================
The Siege halftime now gets a screen listing the winning team instead of simply "Switching Sides".

CTF Individual Scoring
===================================
No change was made whatsoever to the team CTF scoring. But the individual scoring now takes into account vehicle kills, more repair/destroy stuff, and makes it nice and robust for statistical tracking later. NOTE: The scores are dramatically inflated compared to previous individual scores so that we had more "granularity" in the system and didn't have to use decimal points. Thus, you will appear to be racking up a huge amount of points, but it's all relative when compared to other players in the game.
Scoring Details
----------------------
Kill: 10 pts
Flag Capture: 30 pts
Flag Grab (if subsequently captured): 20  [A one player grab-and-cap you get both for a total of 50]
Carrier Escort: 3
Sniper Headshot: 1
Turret kill:  manned: 10  automated: 3
Flag Defend: 5
Flag Carrier Kill: 5
Flag Return: 0 - 10 pts [Points are scaled by distance: no points for a short return. 10 pts if the flag carrier gets all the way to the flag. 1 point per 10% (Halfway is 5 pts.)]  15 points if the return breaks a stalemate (both teams have had each others flags for 60 seconds or longer.)
Generator Defend: 5 pts
Object			Destroy				Repair
Generator		10				8
Sensor			4				1
Base Turret		5				4
Inv Station		2				2
Vehicle Station		5				4
Solar Panel		5				4
Sentry Turret		4				2
Deployed sensor		1				0
Deployed inv station	2				0
Deployed turret		3				3
Shrike			5
Bomber			8
Havoc			5
Wildcat			5
Tank			8
MPB			12
*vehicles destroyed by mines are double points, vehicles destroyed by the Shrike are triple points
**vehicles destroyed also score 2 points per passenger (after any multiplier)
***points accumulated in a vehicle are earned by everyone in the vehicle

Heat Lock vs. Target Laser Lock
===================================
Heat Locking now supercedes Targeting Laser Locking so that heat locks can be attained on objects that are being lazed by friends. Keep in mind that when the target is out of range for the ML, it will still lock onto the targeting laser giving the appearance that its locking onto the laser first. If the target is in range the ML will always look for heated targets first.

Objective HUD Visible on Vehicles
===================================
The objective HUD is now visible while flying/driving vehicles.

Client-Side Toggle on Vehicle Tport
===================================
The player now has the ability to toggle Vehicle Tport ability on/off (defaults to ON) as a client-side option in SETTINGS/GAME.

EAX Sound Improvements
===================================
EAX environmental sound reverbs have been included for underwater and interiors. Those sounds will only be heard when using EAX or EAX2 drivers. (We recommend EAX for best results.)

IFeel Force Feedback Mouse
===================================
The IFeel force feedback mouse vibrations should now work correctly again. They have also been enhanced beyond what was previously available.

Vehicles Parking on Flags
===================================
"Anti-Parking" code has been added to flags similar to the "anti-camping" code around a Nexus in Hunters. This results in vehicles taking damage over time when they are parked near a flag, eventually resulting in their destruction if left there too long.

Aiming Up and Down
===================================
The restrictions on aiming up and down have been virtually removed for all armors. NOTE: This will result in situations where your weapon can clip through the leg of your armor when looking straight down. If this bothers you, then change your graphics setting to "Items Only" so that your body is not drawn when in first-person perspective.

Jetpower for Suits
===================================
Scout jetpower (power of thrust) was reduced to previous levels, but their maximum speed velocity was increased somewhat. This removes the "butterfly" effect, but allows slightly faster skiing than previously allowed. Additionally, air resistance was reduced by 33% on all armors to further reduce the "floaty" feel. This also allows slightly faster speeds across the board.

Splash Damage
===================================
Splash damage on shots was reduced slightly. It is still much more powerful than when the game was released, but this change makes mortars and grenades more playable.

Shrike Speed
===================================
The Shrike thrust was returned to normal, making the Shrike very responsive again. A new maximum speed cap has been added to prevent it from going too fast, but the performance improvement on this vehicle is significant.

Mine Damage
===================================
Mine damage was reduced slightly to prevent Lights from being one-shotted by stepping on a mine. They will still be severely harmed, but won't go from 100% health to dead in one shot.

Missile Launcher
===================================
The Missile Launcher range had been inadvertently reduced during the reticule improvements a few patches back. It has now been increased back to its original design. Range is now 400m.

Heat Signature Fall Off
===================================
Heat reduces *very slightly* slower than it did previously. Players can still easily manage their heat signatures, but must be a bit more paranoid of missile launchers now (thus making it a bit easier for high-ping players to use this weapon).

Suit Mortars vs. Tanks
===================================
The strength of hand-held mortars versus Tanks was incorrectly weak. It has now been increased so that it is much more useful.

Shrike Gun Changes
===================================
The Shrike blasters have been moved out to the wing joints to allow easier strafing of objects. Additionally, there is some (very minor...one degree of spread) projectile spread on the blasters now to make strafing easier. (For comparison purposes, the chaingun has eight degrees of spread.)The range of the blasters was incorrectly enormous and has been reduced to a balanced distance (slightly outside the range of hand-held missile launchers).

Water Movement
===================================
Speeds in water have been greatly increased so as to make water a more viable playing environment.

Whiteout Grenades
===================================
A maximum saturation has been defined for the Whiteout grenades to keep your "whiteout" time to no more than two seconds.

OOB Grid
===================================
The mission boundary is now visually defined. As you approach a mission boundary, and "out of bounds grid" will fade into existence. If you go past the boundary, the grid will not fade out until you return inside the mission area. This is done to make it easier to avoid getting a flag stripped or getting damaged due to OOB damage. This visual option can be toggled OFF in your Game Settings area (option button is called "Show Out of Bounds Grid").

Wildcat Grav Bike
===================================
"Suspension" has been added to the Wildcat making it easier to control over rough terrain.

Air Drag
===================================
Air Drag has been reduced making the game feel "faster".

Panther XL Support Added
===================================
Players will now be able to satisfactorily map the roller ball of the Panther XL. The Z axis or throttle is not configurable with T2 because of a Panther XL driver issue.

Flight Ceiling limited for Shrike
===================================
If you fly past the flight ceiling then you will lose your jetting and thrusting ability. Angle your nose down (when you are above the flight ceiling) and thrust will function normally.

"Unassigned" Team
===================================
This bug allowed a person to join as "unassigned" and view all friend/foe triangles as grey. It has been fixed.

<Null> and random string issues
===================================
There is a finite number of network strings available, the single quote strings. This problem occurs when all strings have been allocated. This is particularly common with mod servers, which appear to be allocating too many net strings. Mod and script developers need to be cautious when creating new strings. Don't create dynamic net strings unless you have a firm understanding of the implications. If a string is added using "AddTaggedString" make sure that there is a corresponding "RemoveTaggedSting" call when the string is no longer needed. Also be sure to limit the number of imbedded strings in your scripts.
This commit is contained in:
Robert MacGregor 2017-07-17 23:27:34 -04:00
parent 7f1fccfdff
commit 669c607190
204 changed files with 16193 additions and 6841 deletions

View file

@ -176,6 +176,7 @@ function BountyGame::equip(%game, %player)
{
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
//%player.setArmor("Light");
%player.setInventory(EnergyPack, 1);

File diff suppressed because it is too large Load diff

View file

@ -7,13 +7,16 @@
$CHANNEL_STATUS = "STATUS";
$VERSION_STRING = "Dynamix IRC Chat 1.2.0";
$ESCAPE_SEQ = "_-_";
$IRCClient::serverList = GetIRCServerList(0);
$IRCClient::serverCount = getRecordCount($IRCClient::serverList);
$IRCClient::retries = 0;
if ($IRCClient::serverCount > 1)
$IRCClient::serverIndex = getRandom($IRCClient::serverCount-1)-1;
else
$IRCClient::serverIndex = -1;
$IRCClient::serverAttempt = 0;
$AWAY_TIMEOUT = 5 * 60 * 1000;
@ -135,9 +138,7 @@ function ChatGui::onAdd(%this)
function ChatGui::onWake(%this)
{
Canvas.pushDialog(LaunchToolbarDlg);
ChatTabView.addSet(1,"gui/shll_horztabbuttonB","5 5 5","50 50 0","5 5 5");
// ChatTabView.addSet(1,"gui/shll_horztabbuttonB","5 5 5","50 50 0","5 5 5");
ChatGui.awake = true;
ChatTabView.setSelected($IRCClient::currentChannel);
ChatGuiScroll.scrollToBottom();
@ -152,19 +153,69 @@ function ChatGui::setKey(%this,%ignore)
//------------------------------------------------------------------------------
function ChatTabView::onAdd(%this)
{
if ($LaunchMode $= "Normal")
%this.addTab($IRCClient::channels.getObject(0),"STATUS");
// Don't Forget, it needs to be on add unless you have a VERY GOOD REASON, right Brad?.
ChatTabView.addSet(1,"gui/shll_horztabbuttonB","5 5 5","50 50 0","5 5 5");
if ($LaunchMode $= "Normal")
// %this.addTab(0,"WELCOME");
%this.addTab($IRCClient::channels.getObject(0),"WELCOME");
}
//------------------------------------------------------------------------------
function ChatTabView::onSelect(%this,%obj,%name)
{
if (%name $= "WELCOME")
{
%indentSpace = "";
WelcomeHeadlines.clear();
WelcomeText.clear();
%obj.topic = "Welcome to the Tribes 2 Chat Area!";
%topic[0] = "Welcome To Tribes 2 Chat";
%topic[1] = "Public Channels";
%topic[2] = "Private Channels";
%topic[3] = "Chat Options";
%topic[4] = "ShazBot";
%topic[5] = "Channel Ops";
%topic[6] = "Private Channel Conduct";
%topic[7] = "Right Click Mute";
%topic[8] = "/me, /action, channels";
%topic[9] = "Tab Complete";
%atxt[0] = "Welcome to the Tribes 2 Chat. Tribes has the distinction of having the largest and most devoted player base of any massivly multi-player game. To support this base we have included the Chat area to make it easier to recruit, get help, meet other players and organize games. Tribes 2 Chat is a secure IRC based chat network that requires an authenticated Tribes 2 game client to join, this means that third party IRC clients like mIRC cannot be used.";
%atxt[1] = "When you access the CHANNELS list, you are seeing a listing of all the available chat rooms. The chat rooms colored \"white\" are general rooms that anyone can access. These are usually the most populated rooms and are \"Tribes 2\" where general gameplay is discussed, \"Recruiting\" where people go to try and find teams, or to recruit players onto their teams, and \"Help\" which is an area to go and speak with other players about technical issues you're having with your system.";
%atxt[2] = "There are also Private Chat channels that you will see IF you are a member of a Tribe. If that's the case, then there will be a private chat channel visible for each tribe you belong to and you can enter those rooms to speak with other Tribe members. Players that do not belong to those tribes will not be able to enter that room.";
%atxt[3] = "There are CHAT OPTIONS (use the button at the top of this page to access those options) that allow you to customize your \"away\" message and a few other messages.";
%atxt[4] = "When you're in a chat channel, beware the Mighty and Powerful SHAZBOT. Shazbot is an automated spam and cursing filter that runs in the general rooms. If you curse a lot, or repeat the same messages too often, or even if you just spam a whole bunch of different nonsense lines in a row, the Mighty and Powerful SHAZBOT will throw you out of the room to think about your transgressions. These kicks are temporary and you can come back later, but if you get kicked enough times, you may be banned entirely, so think before you type and the world will be rosy. (Shazbot doesn't like all-caps messages either...so be careful. No shouting around him...he's sensitive.)";
%atxt[5] = "There are human Operators (Ops) in each channel also. These Ops are not automated. They are people. If you respect them, then they will be kind and considerate in return. However, if you badmouth them or otherwise annoy them, they may kick or ban you from a channel. Just be civil and all things will be good. (NOTE: In Private channels, the Ops are all Tribe members and there are no cursing or spamming rules...unless those Ops make those rules.)";
%atxt[6] = "Private channels are completely deregulated. Dynamix/Sierra/Vivendi-Universal neither care, nor want to know, what you talk about in those channels. They are yours. Warning to anyone who goes to those channels: If you go there, and you do not like what you hear, then leave. Don't expect Dynamix/Sierra/Vivendi-Universal to do anything about private channels. We only review the public channels.";
%atxt[7] = "When in a public channel, if someone is being annoying, then simply use the MUTE functionality to ignore him completely. This is much easier than trying to get an Op to kick him and is usually easier and faster.";
%atxt[8] = "If you see someone typing in a different color, they are probably using a \"/me\" or \"/action\" command. This allows you to emote an action in chat. For instance, if you type /me is away from the keyboard right now, then you'll see \"<playername> is away from the keyboard right now\" and it will be a different color than normal chat. Channel links are usually green and are created by putting a pound sign \"#\" before the channel name.";
%atxt[9] = "There is a nifty Tab Complete feature that makes it easier to type names. If there is a player named \"MrMyxlpytlk\" in the room, you may have a tough time typing that out normally. But if you type \"MrMy\" and then hit TAB, the name will auto-complete instantly, allowing you to respond quickly to screwy names.";
for (%i = 0; %i < 10; %i++)
{
%text = %text @ "<lmargin:10><color:ADFFFA><font:Univers:22><tag:" @ %i @ ">" @ %topic[%i] @
"\n\n<lmargin:30><rmargin%:80><font:Univers:16><color:82BEB9>" @ %atxt[%i] @ "<sbreak>\n\n\n<rmargin%:100>";
WelcomeHeadlines.addRow( %i, %topic[%i] );
}
ChatPanel.setVisible(false);
WelcomePanel.setVisible(true);
WelcomeText.setValue(%text);
WelcomeHeadlines.setSelectedRow(0);
}
else
{
ChatPanel.setVisible(true);
WelcomePanel.setVisible(false);
}
ChatTabFrame.setAltColor(%obj.private);
%i = %obj.findMember($IRCClient::people.getObject(0));
ChatEditChannelBtn.setVisible(%obj.getFlags(%i) & $PERSON_OPERATOR);
//is this the status window? do we need the options button
%vis = (%name $= "STATUS" ? true : false);
%vis = (%name $= "WELCOME" ? true : false);
ChatEditOptionsBtn.setVisible(%vis);
ChatChannelTopic.setValue(%obj.topic);
@ -172,6 +223,7 @@ function ChatTabView::onSelect(%this,%obj,%name)
{
if ($IRCClient::currentChannel == $IRCClient::attachedChannel)
ChatGuiMessageVector.detach();
ChatGuiMessageVector.attach(%obj);
//ChatGuiMessageVector.scrollToBottom();
$IRCClient::attachedChannel = %obj;
@ -469,6 +521,7 @@ function ChatRoomMemberList::onRightMouseDown(%this,%column,%row,%mousePos)
ChatMemberPopup.add("Mute",6);
ChatMemberPopup.add( "--------------------",-1);
// ChatMemberPopup.add( "Instant Message", 9 );
ChatMemberPopup.add( "TMail", 10 );
ChatMemberPopup.add( "Add To Buddylist",11);
@ -526,6 +579,8 @@ function ChatMemberPopup::onSelect(%this,%id,%text)
IRCClient::ignore(ChatMemberPopup.member,!(ChatMemberPopup.member.flags & $PERSON_IGNORE));
case 7: // go to webbrowser page
LinkBrowser(%member,"warrior");
// case 9: // Instant Message
// IRCClient::instant(ChatMemberPopup.member,0);
case 10: // TMail
LinkEMail(%member);
case 11: // Add To Buddylist
@ -828,9 +883,11 @@ function IRCClient::notify(%event)
{
switch$ ( $IRCClient::channelNames[%i] )
{
case "#Tribes2": %temp = 3;
case "#Tribes2-recruiting": %temp = 2;
case "#Help": %temp = 1;
case "#Tribes2": %temp = 5;
case "#Tribes2-Recruiting": %temp = 4;
case "#Help": %temp = 3;
case "#Scripting": %temp = 2;
case "#Mapping": %temp = 1;
default: %temp = 0;
}
JoinChatList.addRow(%i, IRCClient::displayChannel( $IRCClient::channelNames[%i]) TAB $IRCClient::channelUsers[%i] TAB %temp );
@ -870,6 +927,8 @@ function IRCClient::notify(%event)
$IRCClient::nextChannel = 0;
}
ChatTabView.removeTab($IRCClient::deletedChannel);
// case IDIRC_INSTANT:
// MessageBoxOK("Message", "You have been instant Messaged by " @ $IRCClient::inviteperson);
case IDIRC_INVITED: //invited to join existing channel.
//MessageBoxOKCancel("Invite", "You have been invited to channel " @ IRCClient::displayChannel($IRCClient::invitechannel) @ " by " @ $IRCClient::inviteperson @ ".", "IRCClient::join($IRCClient::invitechannel);");
IRCClient::newMessage($IRCClient::CurrentChannel, "You have been invited to channel " @ $IRCClient::invitechannel @ " by " @ $IRCClient::inviteperson @ ".");
@ -1562,6 +1621,8 @@ function IRCClient::dispatch(%prefix,%command,%params)
IRCClient::onVersion(%prefix,%params);
case "ACTION":
IRCClient::onAction(%prefix,%params);
case "INSTANT":
IRCClient::onInstantMsg(%prefix,%params);
case "INVITE":
IRCClient::onInvite(%prefix,%params);
case "301":
@ -3005,7 +3066,30 @@ function IRCClient::nickHighLight(%message)
}
return %message;
}
//------------------------------------------------------------------------------
function IRCClient::onInstantMsg(%prefix,%params)
{
// Find or create the person (should never be NULL)
%p = IRCClient::findPerson2(%prefix,true);
if (%p)
{
%params = nextToken(%params,channel,":");
%channel = %params;
// Only bother the user if they aren't ignoring this person
if (!(%person.flags & $PERSON_IGNORE))
{
// Set vars and notify the responder
$IRCClient::inviteperson = IRCClient::displayNick(%p);
IRCClient::notify(IDIRC_INSTANT);
}
}
}
//------------------------------------------------------------------------------
function IRCClient::instant(%p,%c)
{
IRCClient::send("INSTANT" SPC %p.displayName SPC 0);
}
//------------------------------------------------------------------------------
function IRCClient::part(%params)
{
@ -3180,6 +3264,10 @@ function IRCClient::ignore(%p,%tf)
}
IRCClient::notify(IDIRC_SORT);
}
else
{
echo("not P:" @ %p TAB %tf);
}
}
//------------------------------------------------------------------------------
@ -3282,8 +3370,11 @@ function IRCClient::onJoinServer(%mission,%server,%address,%mayprequire,%prequir
}
//------------------------------------------------------------------------------
function IRCClient::onJoinGame(%address, %desc)
function IRCClient::onJoinGame(%address, %desc)
{
if(!isObject($IRCClient::tcp))
return;
//error("IRCClient::onJoinGame( "@ %address @", "@ %desc @" )");
//IRCClient::away("joined a game.");
@ -3326,3 +3417,9 @@ if ($LaunchMode $= "Normal")
IRCClient::init();
IRCClient::connect();
}
//------------------------------------------------------------------------------
function WelcomeHeadlines::onSelect( %this, %id, %text )
{
WelcomeText.scrollToTag( %id );
}

View file

@ -216,6 +216,7 @@ function CnHGame::equip(%game, %player)
{
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
//%player.setArmor("Light");
%player.setInventory(Blaster,1);
@ -314,7 +315,7 @@ function CnHGame::awardScorePlayerFFDefend(%game, %cl, %flipflop)
if (%game.SCORE_PER_FLIPFLOP_DEFEND != 0)
{
messageClient(%cl, 'msgFFDef', '\c0You received a %1 point bonus for defending %2.', %game.SCORE_PER_FLIPFLOP_DEFEND, %game.cleanWord(%flipflop.name));
messageTeamExcept(%cl, 'msgFFDef', '\c0Teammate %1 received a %2 point bonus for defending %3', %cl.name, %game.SCORE_PER_FLIPFLOP_DEFEND, %game.cleanWord(%flipflop.name));
// messageTeamExcept(%cl, 'msgFFDef', '\c0Teammate %1 received a %2 point bonus for defending %3', %cl.name, %game.SCORE_PER_FLIPFLOP_DEFEND, %game.cleanWord(%flipflop.name));
}
%game.recalcScore(%cl);
}
@ -328,7 +329,7 @@ function CnHGame::awardScorePlayerFFCap(%game, %cl, %this)
if (%game.SCORE_PER_PLYR_FLIPFLOP_CAP != 0)
{
messageClient(%cl, 'msgFFDef', '\c0You received a %1 point bonus for holding the %2.', %game.SCORE_PER_PLYR_FLIPFLOP_CAP, %game.cleanWord(%this.name));
messageTeamExcept(%cl, 'msgFFDef', '\c0Teammate %1 received a %2 point bonus for holding the %3', %cl.name, %game.SCORE_PER_PLYR_FLIPFLOP_CAP, %game.cleanWord(%this.name));
// messageTeamExcept(%cl, 'msgFFDef', '\c0Teammate %1 received a %2 point bonus for holding the %3', %cl.name, %game.SCORE_PER_PLYR_FLIPFLOP_CAP, %game.cleanWord(%this.name));
}
%game.recalcScore(%cl);
}

View file

@ -87,6 +87,7 @@ function DMGame::equip(%game, %player)
{
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
//%player.setArmor("Light");
%player.setInventory(RepairKit, 1);

View file

@ -0,0 +1,29 @@
$DemoCycleDelay = 6000;
function DemoEndGui::onWake(%this)
{
%this.index = 1;
new ActionMap( DemoEndMap );
DemoEndMap.bindCmd( mouse, button0, "DemoEndGui.forceBitmapCycle();", "" );
DemoEndMap.bindCmd( keyboard, space, "DemoEndGui.forceBitmapCycle();", "" );
DemoEndMap.push();
%this.cycleTimer = %this.schedule($DemoCycleDelay, cycleBitmaps);
}
function DemoEndGui::cycleBitmaps(%this)
{
if (%this.index == 3)
quit();
else
{
%this.index++;
%this.setBitmap("gui/bg_DemoEnd" @ %this.index);
%this.cycleTimer = %this.schedule( $DemoCycleDelay, cycleBitmaps );
}
}
function DemoEndGui::forceBitmapCycle( %this )
{
cancel( %this.cycleTimer );
%this.cycleBitmaps();
}

View file

@ -18,7 +18,7 @@ function GameGui::onWake( %this )
{
Canvas.pushDialog( LaunchToolbarDlg );
if ( isDemo() || isDemoServer() || $PlayingOnline )
if ( isDemo() || $PlayingOnline )
GM_Frame.setTitle( "GAME" );
else
GM_Frame.setTitle( "LAN GAME" );
@ -29,12 +29,8 @@ function GameGui::onWake( %this )
if ( isDemo() )
{
GM_TabView.addTab( 1, "JOIN" );
%this.pane = "Join";
}
else if ( isDemoServer() )
{
GM_TabView.addTab( 2, "HOST" );
%this.pane = "Host";
%this.pane = "Join";
}
else
{
@ -125,7 +121,7 @@ function GM_JoinPane::onActivate( %this )
GMJ_StopBtn.setActive( false );
%this.onceOnly = 1;
if ( isDemo() || isDemoServer() )
if ( isDemo() )
GMJ_Browser.lastQuery = "Demo";
else
GMJ_Browser.lastQuery = $PlayingOnline ? "Master" : "LanServers";
@ -207,6 +203,9 @@ if ( !isDemo() )
$BrowserColumnRange[10] = "25 200";
$BrowserColumnCount++;
}
$BrowserColumnName[11] = "Visibility";
$BrowserColumnRange[11] = "25 120";
$BrowserColumnCount++;
//------------------------------------------------------------------------------
function GMJ_Browser::onAdd( %this )
@ -747,13 +746,16 @@ function GM_HostPane::onActivate( %this )
$HostGameType = $PlayingOnline ? "Online" : "LAN";
buildMissionTypePopup( GMH_MissionType );
GMH_BotMinSlider.setValue( $Host::MinBotDifficulty );
GMH_BotMaxSlider.setValue( $Host::MaxBotDifficulty );
GMH_BotsEnabledTgl.setValue( $Host::BotsEnabled );
GMH_BotsEnabledTgl.onAction();
if ( !isDemo() )
{
GMH_BotMinSlider.setValue( $Host::MinBotDifficulty );
GMH_BotMaxSlider.setValue( $Host::MaxBotDifficulty );
GMH_BotsEnabledTgl.setValue( $Host::BotsEnabled );
GMH_BotsEnabledTgl.onAction();
//clamp and set the bot count slider
setBotCountSlider();
//clamp and set the bot count slider
setBotCountSlider();
}
// Select the saved-off prefs:
if ( $Host::MissionType !$= "" )
@ -992,22 +994,25 @@ function GMH_MissionType::onSelect( %this, %id, %text )
GMH_MissionList.setSelectedById( %lastAdded );
$Host::MissionType = $HostTypeName[%id];
// Disable all non bot-enabled maps if bots are enabled:
if ( GMH_BotsEnabledTgl.getValue() )
GMH_BotsEnabledTgl.onAction();
if ( !isDemo() )
{
// Disable all non bot-enabled maps if bots are enabled:
if ( GMH_BotsEnabledTgl.getValue() )
GMH_BotsEnabledTgl.onAction();
}
}
//------------------------------------------------------------------------------
function GMH_MissionList::onSelect( %this, %id, %text )
{
if ( GMH_BotsEnabledTgl.getValue() )
if ( !isDemo() && GMH_BotsEnabledTgl.getValue() )
GMH_StartGameBtn.setActive( $BotEnabled[%id] );
}
//------------------------------------------------------------------------------
function tryToStartHostedGame()
{
if ( GMH_BotsEnabledTgl.getValue() )
if ( !isDemo() && GMH_BotsEnabledTgl.getValue() )
{
%selId = GMH_MissionList.getSelectedId();
if ( !$BotEnabled[%selId] )
@ -1023,7 +1028,7 @@ function StartHostedGame()
%selId = GMH_MissionList.getSelectedId();
%misFile = $HostMissionFile[%selId];
if ( $Host::BotsEnabled )
if ( !isDemo() && $Host::BotsEnabled )
{
validateMaxPlayers();
$HostGameBotCount = $Host::BotCount;
@ -1071,7 +1076,10 @@ function StartHostedGame()
//------------------------------------------------------------------------------
function tryToLaunchDedicatedServer( %pure )
{
%numBots = $Host::BotsEnabled ? $Host::BotCount : 0;
if ( isDemo() )
%numBots = 0;
else
%numBots = $Host::BotsEnabled ? $Host::BotCount : 0;
if ( launchDedicatedServer( $Host::MissionType, $Host::Map, %numBots, %pure ) )
quit();
else
@ -1170,8 +1178,11 @@ function validateMaxPlayers()
//reset the value back into the TE
GMH_MaxPlayersTE.setValue(%maxPlayers);
//and make sure the bot sliders reflect the changes..
setBotCountSlider();
if ( !isDemo() )
{
//and make sure the bot sliders reflect the changes..
setBotCountSlider();
}
}
function setBotCountSlider()
@ -1207,8 +1218,13 @@ function AdvancedHostDlg::onWake( %this )
{
// Set all of the controls to the current pref states:
AH_HostPort.setText( $Host::Port );
if ( $Host::HiVisibility )
AH_HiVisibilityRdo.setValue( true );
else
AH_HiFPSRdo.setValue( true );
AH_DedicatedTgl.setValue( $Host::Dedicated );
AH_DedicatedTgl.onAction();
AH_TeamDamageTgl.setValue( $Host::TeamDamageOn );
AH_TournamentTgl.setValue( $Host::TournamentMode );
AH_AdminVoteTgl.setValue( $Host::allowAdminPlayerVotes );
AH_AllowSmurfTgl.setValue( !$Host::NoSmurfs );
@ -1226,9 +1242,11 @@ function AdvancedHostDlg::accept( %this )
{
// Apply all of the changes:
$Host::Port = AH_HostPort.getValue();
$Host::HiVisibility = AH_HiVisibilityRdo.getValue();
$Host::Dedicated = AH_DedicatedTgl.getValue();
if ( $Host::Dedicated )
$Host::PureServer = AH_PureServerTgl.getValue();
$Host::TeamDamageOn = AH_TeamDamageTgl.getValue();
$Host::TournamentMode = AH_TournamentTgl.getValue();
$Host::allowAdminPlayerVotes = AH_AdminVoteTgl.getValue();
$Host::NoSmurfs = !AH_AllowSmurfTgl.getValue();
@ -1326,8 +1344,9 @@ function GM_WarriorPane::onActivate( %this )
}
}
// Fill the race/gender list:
// Fill the static menus:
GMW_RaceGenderPopup.fillList();
GMW_SkinPrefPopup.fillList();
// Select the current player:
GMW_WarriorPopup.setSelected( $pref::Player::Current );
@ -1450,11 +1469,14 @@ function GMW_WarriorPopup::onSelect( %this, %id, %text )
%selId = 0;
GMW_RaceGenderPopup.setSelected( %selId );
GMW_SkinPopup.fillList( %selId );
GMW_VoicePopup.fillList( %selId );
// Select the skin:
%skin = getField( $pref::Player[%id], 2 );
%baseSkin = isDynamixSkin( %skin );
GMW_SkinPrefPopup.setSelected( !%baseSkin );
GMW_SkinPopup.fillList( %selId );
%selId = -1;
for ( %i = 0; %i < GMW_SkinPopup.size(); %i++ )
{
@ -1489,7 +1511,9 @@ function GMW_WarriorPopup::onSelect( %this, %id, %text )
//------------------------------------------------------------------------------
function GMW_RaceGenderPopup::fillList( %this )
{
%this.clear();
if ( %this.size() )
return;
%this.add( "Human Male", 0 );
%this.add( "Human Female", 1 );
%this.add( "Bioderm", 2 );
@ -1521,6 +1545,32 @@ function GMW_RaceGenderPopup::onSelect( %this, %id, %text )
GMW_VoicePopup.onSelect( %selId, "" );
}
//------------------------------------------------------------------------------
function GMW_SkinPrefPopup::fillList( %this )
{
if ( %this.size() )
return;
%this.add( "Dynamix Skins", 0 );
%this.add( "Custom Skins", 1 );
}
//------------------------------------------------------------------------------
function GMW_SkinPrefPopup::onSelect( %this, %id, %text )
{
%curSkin = GMW_SkinPopup.getText();
GMW_SkinPopup.fillList( GMW_RaceGenderPopup.getSelected() );
%selId = GMW_SkinPopup.findText( %curSkin );
if ( %selId == -1 )
%selId = 0;
if ( GMW_SkinPopup.size() )
{
GMW_SkinPopup.setSelected( %selId );
GMW_SkinPopup.onSelect( %selId, GMW_SkinPopup.getTextById( %selId ) );
}
}
//------------------------------------------------------------------------------
$SkinCount = 0;
$Skin[$SkinCount, name] = "Blood Eagle";
@ -1545,6 +1595,18 @@ $Skin[$SkinCount, name] = "Horde";
$Skin[$SkinCount, code] = "horde";
$SkinCount++;
//------------------------------------------------------------------------------
function isDynamixSkin( %skin )
{
for ( %i = 0; %i < $SkinCount; %i++ )
{
if ( %skin $= $Skin[%i, code] )
return( true );
}
return( false );
}
//------------------------------------------------------------------------------
function GMW_SkinPopup::fillList( %this, %raceGender )
{
@ -1563,6 +1625,7 @@ function GMW_SkinPopup::fillList( %this, %raceGender )
%pattern = ".lbioderm.png";
}
%customSkins = GMW_SkinPrefPopup.getSelected();
%count = 0;
for ( %file = findFirstFile( %path @ "*" @ %pattern ); %file !$= ""; %file = findNextFile( %path @ "*" @ %pattern ) )
{
@ -1572,18 +1635,24 @@ function GMW_SkinPopup::fillList( %this, %raceGender )
if ( %skin !$= "basebot" && %skin !$= "basebbot" )
{
// See if this skin has an alias:
%baseSkin = false;
for ( %i = 0; %i < $SkinCount; %i++ )
{
if ( %skin $= $Skin[%i, code] )
{
%baseSkin = true;
%skin = $Skin[%i, name];
%this.realSkin[%count] = $Skin[%i, code];
break;
}
}
%this.add( %skin, %count );
%count++;
if ( %customSkins != %baseSkin )
{
if ( %baseSkin )
%this.realSkin[%count] = $Skin[%i, code];
%this.add( %skin, %count );
%count++;
}
}
}

View file

@ -48,13 +48,22 @@ $InvBanList[Hunters, "AABarrelPack"] = 1;
$InvBanList[Hunters, "MissileBarrelPack"] = 1;
$InvBanList[Hunters, "Mine"] = 1;
datablock EffectProfile(HuntersFlagPickupEffect)
{
effectname = "misc/hunters_flag_snatch";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(HuntersFlagPickupSound)
{
filename = "fx/misc/hunters_flag_snatch.wav";
description = AudioClose3d;
effect = HuntersFlagPickupEffect;
preload = true;
};
//exec the AI script
exec("scripts/aiHunters.cs");
@ -84,13 +93,13 @@ function HuntersGame::initGameVars(%game)
%game.teamMode = false;
if (!isDemo() && !isDemoServer())
if (!isDemo())
%game.greedMode = $Host::HuntersGreedMode;
else
%game.greedMode = false;
%game.greedMinFlags = 8; //min number of flags you must have before you can cap
if (!isDemo() && !isDemoServer())
if (!isDemo())
%game.hoardMode = $Host::HuntersHoardMode;
else
%game.hoardMode = false;
@ -473,6 +482,7 @@ function HuntersGame::equip(%game, %player)
{
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
//%player.setArmor("Light");
%player.setInventory(RepairKit,1);
@ -1056,7 +1066,7 @@ function HuntersGame::sendGameVoteMenu( %game, %client, %key )
// First send the common options:
DefaultGame::sendGameVoteMenu( %game, %client, %key );
if (!isDemo() && !isDemoServer())
if (!isDemo())
{
if(!%client.isAdmin)
{

View file

@ -62,10 +62,11 @@ function LaunchToolbarMenu::onSelect(%this, %id, %text)
LaunchBrowser();
case 7: // Options
Canvas.pushDialog(OptionsDlg);
//case 8: // Play Recording
// Canvas.pushDialog(RecordingsDlg);
case 8: // Play Recording
Canvas.pushDialog(RecordingsDlg);
case 9: // Quit
IRCClient::quit();
if(isObject($IRCClient.tcp))
IRCClient::quit();
LaunchTabView.closeAllTabs();
if (!isDemo())
quit();
@ -86,8 +87,8 @@ function LaunchToolbarMenu::onSelect(%this, %id, %text)
function LaunchToolbarDlg::onWake(%this)
{
// Play the shell hum:
if ( $HudHandle['shellScreen'] $= "" )
$HudHandle['shellScreen'] = alxPlay( ShellScreenHumSound, 0, 0, 0 );
if ( $HudHandle[shellScreen] $= "" )
$HudHandle[shellScreen] = alxPlay( ShellScreenHumSound, 0, 0, 0 );
LaunchToolbarMenu.clear();
@ -97,10 +98,6 @@ function LaunchToolbarDlg::onWake(%this)
LaunchToolbarMenu.add( 0, "GAME" );
LaunchToolbarMenu.add( 2, "NEWS" );
}
else if ( isDemoServer() )
{
LaunchToolbarMenu.add( 0, "GAME" );
}
else if ( $PlayingOnline )
{
LaunchToolbarMenu.add( 0, "GAME" );
@ -118,15 +115,11 @@ function LaunchToolbarDlg::onWake(%this)
LaunchToolbarMenu.addSeparator();
LaunchToolbarMenu.add( 7, "SETTINGS" );
// LaunchToolbarMenu.add( 8, "RECORDINGS" );
if ( !isDemo() )
LaunchToolbarMenu.add( 8, "RECORDINGS" );
LaunchToolbarMenu.add( 12, "CREDITS" );
LaunchToolbarMenu.addSeparator();
// if ( $PlayingOnline )
// LaunchToolbarMenu.add( 10, "LOG OFF" );
// else
// LaunchToolbarMenu.add( 11, "LOG ON" );
LaunchToolbarMenu.add( 9, "QUIT" );
%on = false;
@ -162,12 +155,7 @@ function OpenLaunchTabs( %gotoWarriorSetup )
LaunchTabView.addLaunchTab( "EMAIL", "", true );
LaunchTabView.addLaunchTab( "CHAT", "", true );
LaunchTabView.addLaunchTab( "BROWSER", "", true );
%launchGui = GameGui;
}
else if ( isDemoServer() )
{
LaunchTabView.addLaunchTab( "GAME", GameGui );
%launchGui = GameGui;
%launchGui = NewsGui;
}
else if ( $PlayingOnline )
{
@ -199,6 +187,12 @@ function OpenLaunchTabs( %gotoWarriorSetup )
LaunchGame( "WARRIOR" );
else
LaunchTabView.viewTab( "", %launchGui, 0 );
if ( $IssueVoodooWarning && !$pref::SawVoodooWarning )
{
$pref::SawVoodooWarning = 1;
schedule( 0, 0, MessageBoxOK, "WARNING", "A Voodoo card has been detected. If you experience any graphical oddities, you should try the WickedGl drivers available at www.wicked3d.com" );
}
}
//--------------------------------------------------------
@ -328,7 +322,7 @@ function LaunchGui::onWake(%this)
if ( !$FirstLaunch )
LaunchTabView.viewLastTab();
if ( !isDemo() && !isDemoServer() )
if ( !isDemo() )
checkNamesAndAliases();
else
OpenLaunchTabs();

View file

@ -526,8 +526,9 @@ function lobbyVote()
return;
case "ChooseTeam":
fillLobbyTeamMenu();
return;
commandToServer( 'ClientJoinTeam', -1, true );
schedule( 100, 0, lobbyReturnToGame );
return;
case "VoteTournamentMode":
LobbyVoteMenu.tourneyChoose = 1;

View file

@ -11,9 +11,6 @@ $max_TSDetailAdjust = 1.0;
//------------------------------------------------------------------------------
function OptionsDlg::onWake( %this )
{
$enableDirectInput = "1";
activateDirectInput();
OP_VideoPane.setVisible( false );
OP_GraphicsPane.setVisible( false );
OP_TexturesPane.setVisible( false );
@ -59,6 +56,8 @@ function OptionsDlg::onWake( %this )
OP_BPPMenu.setActive( false );
OP_GammaSlider.setValue( $pref::OpenGL::gammaCorrection );
OP_GammaSlider.setActive( $Video::setGammaCorrectionSupported );
OP_TerrainSlider.setValue( $max_screenerror - $pref::Terrain::screenError );
OP_ShapeSlider.setValue( ( $max_TSScreenError - $pref::TS::screenError ) / ( $max_TSScreenError - $min_TSScreenError ) );
OP_ShadowSlider.setValue( $pref::Shadows );
@ -92,7 +91,9 @@ function OptionsDlg::onWake( %this )
OP_ShapeTexSlider.setValue( (5 - $pref::OpenGL::mipReduction) / %mipRange );
OP_BuildingTexSlider.setValue( (5 - $pref::OpenGL::interiorMipReduction) / %mipRange );
OP_SkyTexSlider.setValue( (5 - $pref::OpenGL::skyMipReduction) / %mipRange );
if ( !isDemo() )
OP_HiResSkinTgl.setValue( $pref::use512PlayerSkins );
// Initialize the Sound Options controls:
// provider menu
%count = alxGetContexti(ALC_PROVIDER_COUNT);
@ -102,8 +103,12 @@ function OptionsDlg::onWake( %this )
OP_AudioProviderMenu.setSelected(%selId);
OP_AudioResetProvider.setActive(false);
%active = audioIsEnvironmentProvider(alxGetContextstr(ALC_PROVIDER_NAME, %selId));
OP_AudioEnvironmentTgl.setActive(%active);
// environment provider: disable and uncheck if not an environment provider
%envProvider = audioIsEnvironmentProvider(alxGetContextstr(ALC_PROVIDER_NAME, %selId));
if(!%envProvider)
OP_AudioEnvironmentTgl.setValue(false);
OP_AudioEnvironmentTgl.setActive(%envProvider);
// speaker menu
%count = alxGetContexti(ALC_SPEAKER_COUNT);
@ -121,16 +126,23 @@ function OptionsDlg::onWake( %this )
%active = !isObject(ServerConnection);
OP_AudioFrequencyMenu.setActive(%active);
// Changing these audio settings doesn't help Linux performance
if ( $platform $= "linux" ) {
if ( $platform $= "linux" )
{
OP_AudioBitRateMenu.setActive(false);
OP_AudioChannelsMenu.setActive(false);
} else {
}
else
{
OP_AudioBitRateMenu.setActive(%active);
OP_AudioChannelsMenu.setActive(%active);
}
OP_AudioProviderMenu.setActive(%active);
// only allow for disable
if(!%active)
OP_AudioEnvironmentTgl.setActive(%active);
OP_AudioSpeakerMenu.setActive(%active);
OP_AudioProviderMenu.setActive(%active);
OP_AudioSpeakerMenu.setActive(%active);
OP_MasterVolumeSlider.setValue( $pref::Audio::masterVolume );
OP_EffectsVolumeSlider.setValue( $pref::Audio::effectsVolume );
@ -150,8 +162,7 @@ function OptionsDlg::onWake( %this )
// Initialize the Control Options controls:
OP_ControlGroupMenu.init();
// JOYSTICK SUPPORT WILL BE RE-ENABLED IN THE PATCH
if ( isJoystickDetected() )
{
OP_JoystickTgl.setValue( $pref::Input::JoystickEnabled );
@ -222,17 +233,25 @@ function OptionsDlg::deviceDependent( %this )
OP_VSyncTgl.setActive( false );
}
OP_TexQualityMenu.init();
if ( $pref::OpenGL::forcePalettedTexture )
if ( isDemo() )
{
$pref::OpenGL::force16bittexture = false;
%selId = 1;
OP_TexQualityMenu.setText( "Palletized" );
OP_TexQualityMenu.setActive( false );
}
else if ( $pref::OpenGL::force16bittexture )
%selId = 2;
else
%selId = 3;
OP_TexQualityMenu.setSelected( %selId );
{
OP_TexQualityMenu.init();
if ( $pref::OpenGL::forcePalettedTexture )
{
$pref::OpenGL::force16bittexture = false;
%selId = 1;
}
else if ( $pref::OpenGL::force16bittexture )
%selId = 2;
else
%selId = 3;
OP_TexQualityMenu.setSelected( %selId );
}
OP_CompressMenu.init();
if ( $TextureCompressionSupported && !$pref::OpenGL::disableARBTextureCompression )
@ -286,9 +305,6 @@ function OptionsDlg::deviceDependent( %this )
//------------------------------------------------------------------------------
function OptionsDlg::onSleep( %this )
{
$enableDirectInput = "0";
deactivateDirectInput();
OP_VideoDriverMenu.clear();
OP_ResMenu.clear();
OP_BPPMenu.clear();
@ -304,10 +320,10 @@ function OptionsDlg::onSleep( %this )
%this.resetAudio = "";
// Play the shell hum: (all sources are gone)
if($HudHandle['shellScreen'] $= "")
alxStop($HudHandle['shellScreen']);
if($HudHandle[shellScreen] $= "")
alxStop($HudHandle[shellScreen]);
$HudHandle['shellScreen'] = alxPlay(ShellScreenHumSound, 0, 0, 0);
$HudHandle[shellScreen] = alxPlay(ShellScreenHumSound, 0, 0, 0);
}
if ( isObject( ServerConnection ) && isTextureFlushRequired() )
@ -342,19 +358,22 @@ function isTextureFlushRequired()
if ( $AnisotropySupported && $pref::OpenGL::anisotropy != OP_AnisotropySlider.getValue() )
return( true );
%id = OP_TexQualityMenu.getSelected();
if ( $pref::OpenGL::forcePalettedTexture )
if ( !isDemo() )
{
if ( %id != 1 )
%id = OP_TexQualityMenu.getSelected();
if ( $pref::OpenGL::forcePalettedTexture )
{
if ( %id != 1 )
return( true );
}
else if ( $pref::OpenGL::force16bittexture )
{
if ( %id != 2 )
return( true );
}
else if ( %id != 3 )
return( true );
}
else if ( $pref::OpenGL::force16bittexture )
{
if ( %id != 2 )
return( true );
}
else if ( %id != 3 )
return( true );
}
if ( $TextureCompressionSupported && !$pref::OpenGL::disableARBTextureCompression )
{
@ -423,31 +442,34 @@ function OptionsDlg::saveSettings( %this )
$pref::Player::renderMyPlayer = %temp & 1;
$pref::Player::renderMyItems = %temp & 2;
switch ( OP_TexQualityMenu.getSelected() )
if ( !isDemo() )
{
case 1: // 8-bit
if ( !$pref::OpenGL::forcePalettedTexture || $pref::OpenGL::force16bittexture )
{
$pref::OpenGL::forcePalettedTexture = true;
$pref::OpenGL::force16bittexture = false;
%flushTextures = true;
}
case 2: // 16-bit
if ( $pref::OpenGL::forcePalettedTexture || !$pref::OpenGL::force16bittexture )
{
$pref::OpenGL::forcePalettedTexture = false;
$pref::OpenGL::force16bittexture = true;
%flushTextures = true;
}
case 3: // 32-bit
if ( $pref::OpenGL::forcePalettedTexture || $pref::OpenGL::force16bittexture )
{
$pref::OpenGL::forcePalettedTexture = false;
$pref::OpenGL::force16bittexture = false;
%flushTextures = true;
}
switch ( OP_TexQualityMenu.getSelected() )
{
case 1: // 8-bit
if ( !$pref::OpenGL::forcePalettedTexture || $pref::OpenGL::force16bittexture )
{
$pref::OpenGL::forcePalettedTexture = true;
$pref::OpenGL::force16bittexture = false;
%flushTextures = true;
}
case 2: // 16-bit
if ( $pref::OpenGL::forcePalettedTexture || !$pref::OpenGL::force16bittexture )
{
$pref::OpenGL::forcePalettedTexture = false;
$pref::OpenGL::force16bittexture = true;
%flushTextures = true;
}
case 3: // 32-bit
if ( $pref::OpenGL::forcePalettedTexture || $pref::OpenGL::force16bittexture )
{
$pref::OpenGL::forcePalettedTexture = false;
$pref::OpenGL::force16bittexture = false;
%flushTextures = true;
}
}
OP_TexQualityMenu.clear();
}
OP_TexQualityMenu.clear();
$pref::Terrain::texDetail = 6 - mFloor( OP_TerrainTexSlider.getValue() );
@ -532,6 +554,16 @@ function OptionsDlg::saveSettings( %this )
%flushTextures = true;
}
}
if ( !isDemo() )
{
if ( OP_HiResSkinTgl.getValue() != $pref::use512PlayerSkins )
{
$pref::use512PlayerSkins = OP_HiResSkinTgl.getValue();
if ( Canvas.getContent() == GameGui.getId() && GM_WarriorPane.isVisible() )
GMW_PlayerModel.update();
}
}
$pref::Terrain::screenError = $max_screenerror - mFloor( OP_TerrainSlider.getValue() );
$pref::TS::screenError = $max_TSScreenError - mFloor( OP_ShapeSlider.getValue() * ( $max_TSScreenError - $min_TSScreenError ) );
@ -929,6 +961,10 @@ function setAudioProvider(%idx)
$pref::Audio::provider = alxGetContextstr(ALC_PROVIDER_NAME, %idx);
%active = audioIsEnvironmentProvider($pref::Audio::provider);
// unset tgl if cannot be environment provider
if(!%active)
OP_AudioEnvironmentTgl.setValue(false);
OP_AudioEnvironmentTgl.setActive(%active);
audioUpdateProvider($pref::Audio::provider);
@ -1566,12 +1602,15 @@ $RemapCount++;
$RemapName[$RemapCount] = "Toggle Commands";
$RemapCmd[$RemapCount] = "toggleHudCommands";
$RemapCount++;
// $RemapName[$RemapCount] = "Start Demo Record";
// $RemapCmd[$RemapCount] = "startRecordingDemo";
// $RemapCount++;
// $RemapName[$RemapCount] = "Stop Demo Record";
// $RemapCmd[$RemapCount] = "stopRecordingDemo";
// $RemapCount++;
if ( !isDemo() )
{
$RemapName[$RemapCount] = "Start Demo Record";
$RemapCmd[$RemapCount] = "startRecordingDemo";
$RemapCount++;
$RemapName[$RemapCount] = "Stop Demo Record";
$RemapCmd[$RemapCount] = "stopRecordingDemo";
$RemapCount++;
}
$RemapName[$RemapCount] = "Chat Page Up";
$RemapCmd[$RemapCount] = "pageMessageHudUp";
$RemapCount++;
@ -1632,7 +1671,11 @@ function isMapFile( %file )
//------------------------------------------------------------------------------
function isValidMapFileSaveName( %file )
{
if ( !isWriteableFileName( "base/" @ %file ) )
if (isDemo())
%basePath = "demo_base/";
else
%basePath = "base/";
if ( !isWriteableFileName( %basePath @ %file ) )
return( false );
if ( isFile( %file ) )
@ -1661,8 +1704,19 @@ function saveActiveMapFile()
//------------------------------------------------------------------------------
function saveMapFile( %filename )
{
if ( strcspn( %filename, "\\/?*\"\'<>|" ) < strlen( %filename ) )
{
MessageBoxOK( "SAVE FAILED", "Filenames may not contain any of the following characters:" NL "\\ / ? * < > \" \' |",
"ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );" );
return;
}
if (isDemo())
%basePath = "demo_base/";
else
%basePath = "base/";
%mapFile = "prefs/" @ %filename @ ".cs";
if ( !isWriteableFileName( "base/" @ %mapFile ) )
if ( !isWriteableFileName( %basePath @ %mapFile ) )
{
MessageBoxOK( "SAVE FAILED", "That is not a writeable file name. Please choose another file name.",
"ShellGetSaveFilename( \"SAVE CONTROL CONFIG\", \"prefs/*.cs\", \"isMapFile\", \"saveMapFile\", $pref::Input::ActiveConfig );" );
@ -1685,8 +1739,11 @@ function saveMapFile( %filename )
if ( %fObject.openForAppend( %mapFile ) )
{
%bind = GlobalActionMap.getBinding( "toggleConsole" );
%fObject.writeLine( "GlobalActionMap.bind(keyboard, \"" @ getField( %bind, 1 ) @ "\", toggleConsole);" );
%fObject.close();
if ( %bind !$= "" )
{
%fObject.writeLine( "GlobalActionMap.bind(keyboard, \"" @ getField( %bind, 1 ) @ "\", toggleConsole);" );
%fObject.close();
}
}
%fObject.delete();
@ -1860,12 +1917,22 @@ function OP_ConsoleKeyBtn::doRemap( %this )
//------------------------------------------------------------------------------
function RemapDlg::onWake( %this )
{
$enableDirectInput = "1";
activateDirectInput();
if ( RemapInputCtrl.mode $= "consoleKey" )
RemapText.setText( "<just:center>Press a key to assign it to this action" NL "or Esc to cancel..." );
else
RemapText.setText( "<just:center>Press a key or button to assign it to this action" NL "or Esc to cancel..." );
}
//------------------------------------------------------------------------------
function RemapDlg::onSleep( %this )
{
$enableDirectInput = "1";
deactivateDirectInput();
}
//------------------------------------------------------------------------------
function findRemapCmdIndex( %command )
{
@ -2144,6 +2211,7 @@ function JoystickConfigDlg::onWake( %this )
case "U": %tabName = "U Axis"; %tabType = "ryaxis";
case "V": %tabName = "V Axis"; %tabType = "rzaxis";
case "S": %tabName = "Slider"; %tabType = "slider";
case "L": %tabName = "Slider 2"; %tabType = "slider2";
default: %tabName = "";
}
@ -2233,7 +2301,7 @@ function JoystickConfigDlg::setPane( %this, %pane )
else
DeadZoneSlider.setValue( abs( firstWord( %deadZone ) ) / %scale );
InvertJoyAxisTgl.setValue( moveMap.isInverted( "joystick", %axisType ) );
JoyAxisRelativeTgl.setValue( moveMap.isRelativeAxis( "joystick", %axisType ) );
//JoyAxisRelativeTgl.setValue( moveMap.isRelativeAxis( "joystick", %axisType ) );
}
else
{
@ -2242,7 +2310,7 @@ function JoystickConfigDlg::setPane( %this, %pane )
JoyAxisSlider.setValue( 0.5 );
DeadZoneSlider.setValue( 0.0 );
InvertJoyAxisTgl.setValue( false );
JoyAxisRelativeTgl.setValue( %axisType $= "slider" );
//JoyAxisRelativeTgl.setValue( %axisType $= "slider" );
}
}
@ -2255,7 +2323,7 @@ function JoyAxisActionMenu::onSelect( %this, %id, %text )
DeadZoneSlider.setActive( %on );
DeadZoneText.setVisible( %on );
InvertJoyAxisTgl.setActive( %on );
JoyAxisRelativeTgl.setActive( %on );
//JoyAxisRelativeTgl.setActive( %on );
}
//------------------------------------------------------------------------------
@ -2293,8 +2361,8 @@ function bindJoystickAxis( %axisIndex, %cmdIndex )
%flags = "S";
if ( InvertJoyAxisTgl.getValue() )
%flags = %flags @ "I";
if ( JoyAxisRelativeTgl.getValue() )
%flags = %flags @ "L";
// if ( JoyAxisRelativeTgl.getValue() )
// %flags = %flags @ "L";
if ( %delta > 0 )
{
%deadZone = "-" @ %delta SPC %delta;
@ -2544,9 +2612,35 @@ function OP_LaunchScreenMenu::init( %this )
%this.add( "Browser", 6 );
}
//------------------------------------------------------------------------------
function toggleInvertYAxis()
{
// Catch the case where this is toggled in-game while in a vehicle:
if ( isObject( passengerKeys ) )
{
%bind = passengerKeys.getBinding( pitch );
if ( %bind !$= "" )
{
%device = getField( %bind, 0 );
%action = getField( %bind, 1 );
%flags = $pref::Vehicle::InvertYAxis ? "SDI" : "SD";
%deadZone = passengerKeys.getDeadZone( %device, %action );
%scale = passengerKeys.getScale( %device, %action );
passengerKeys.bind( %device, %action, %flags, %deadZone, %scale, pitch );
}
}
}
//------------------------------------------------------------------------------
function toggleImmersion()
{
MessageBoxOK( "Force Feedback", "This will take effect the next time you start Tribes 2." );
}
//------------------------------------------------------------------------------
function toggleVehicleTeleportPref()
{
// If we are in a game, let the server know we've changed;
if ( isObject( ServerConnection ) )
commandToServer( 'EnableVehicleTeleport', $pref::Vehicle::pilotTeleport );
}

View file

@ -53,7 +53,8 @@ function FlipFlop::playerTouch(%data, %flipflop, %player)
if(%player.team != Game.offenseTeam)
return;
%defTeam = %game.offenseTeam == 1 ? 2 : 1;
%defTeam = Game.offenseTeam == 1 ? 2 : 1;
Game.capPlayer[Game.offenseTeam] = stripChars( getTaggedString( %player.client.name ), "\cp\co\c6\c7\c8\c9" );
// Let the observers know:
messageTeam( 0, 'MsgSiegeTouchFlipFlop', '\c2%1 captured the %2 base!~wfx/misc/flipflop_taken.wav', %player.client.name, $TeamName[%defTeam] );
@ -108,6 +109,9 @@ function SiegeGame::claimFlipflopResources(%game, %flipflop, %team)
function SiegeGame::missionLoadDone(%game)
{
if( $Host::timeLimit == 0 )
$Host::timeLimit = 999;
//default version sets up teams - must be called first...
DefaultGame::missionLoadDone(%game);
@ -128,7 +132,7 @@ function SiegeGame::missionLoadDone(%game)
}
//send the message
messageAll('MsgSiegeStart', '\c2%1 is starting on offense', $teamName[%game.offenseTeam]);
messageAll('MsgSiegeStart', '\c2Team %1 is starting on offense', $teamName[%game.offenseTeam]);
//if the first offense team is team2, switch the object team designation
if (%game.offenseTeam == 2)
@ -153,6 +157,8 @@ function SiegeGame::missionLoadDone(%game)
%game.firstHalf = true;
%game.timeLimitMS = $Host::TimeLimit * 60 * 1000;
%game.secondHalfCountDown = false;
%game.capPlayer[1] = "";
%game.capPlayer[2] = "";
// save off turret bases' original barrels
%game.checkTurretBases();
@ -222,6 +228,16 @@ function SiegeGame::startMatch(%game)
%game.timeThread = %game.schedule( %game.timeLimitMS, "timeLimitReached");
//updateClientTimes(%game.timeLimitMS);
messageAll('MsgSystemClock', "", $Host::TimeLimit, %game.timeLimitMS);
// %count = ClientGroup.getCount();
// for ( %i = 0; %i < %count; %i++ )
// {
// %cl = ClientGroup.getObject( %i );
// if ( %cl.team == %game.offenseTeam )
// centerPrint( %cl, "\nTouch the enemy control switch to capture their base!", 5, 3 );
// else
// centerPrint( %cl, "\nPrevent the enemy from touching your control switch!", 5, 3 );
// }
//make sure the AI is started
AISystemEnabled(true);
@ -235,7 +251,7 @@ function SiegeGame::allObjectivesCompleted(%game)
//store the elapsed time in the teamScore array...
$teamScore[%game.offenseTeam] = getSimTime() - %game.startTimeMS;
messageAll('MsgSiegeCaptured', '\c2%1 captured the base in %2!', $teamName[%game.offenseTeam], %game.formatTime($teamScore[%game.offenseTeam], true));
messageAll('MsgSiegeCaptured', '\c2Team %1 captured the base in %2!', $teamName[%game.offenseTeam], %game.formatTime($teamScore[%game.offenseTeam], true));
//set the new timelimit
%game.timeLimitMS = $teamScore[%game.offenseTeam];
@ -243,8 +259,7 @@ function SiegeGame::allObjectivesCompleted(%game)
if (%game.firstHalf)
{
// it's halftime, let everyone know
messageAll('MsgSiegeSwitchSides', "");
CenterPrintAll( "Switching Sides", 3 );
messageAll( 'MsgSiegeHalftime' );
}
else
{
@ -265,18 +280,19 @@ function SiegeGame::timeLimitReached(%game)
// if time has run out, the offense team gets no score (note, %game.timeLimitMS doesn't change)
$teamScore[%game.offenseTeam] = 0;
messageAll('MsgSiegeFailed', '\c2%1 failed to capture the base.', $teamName[%game.offenseTeam]);
messageAll('MsgSiegeFailed', '\c2Team %1 failed to capture the base.', $teamName[%game.offenseTeam]);
if (%game.firstHalf)
{
// it's halftime, let everyone know
CenterPrintAll( "Switching Sides", 3 );
messageAll( 'MsgSiegeHalftime' );
}
else
{
// game is over
messageAll('MsgSiegeMisDone', '\c2Mission complete.');
}
logEcho("time limit reached");
%game.halftime('time');
}
@ -342,6 +358,10 @@ function SiegeGame::startSecondHalf(%game)
%cl.observerMode = "";
%cl.setControlObject( %cl.player );
commandToClient(%cl, 'setHudMode', 'Standard');
// if ( %client.team == %game.offenseTeam )
// centerPrint( %cl, "\nTouch the enemy control switch to capture their base!", 5, 3 );
// else
// centerPrint( %cl, "\nPrevent the enemy from touching your control switch!", 5, 3 );
}
}
@ -362,13 +382,14 @@ function SiegeGame::halftime(%game, %reason)
{
//switch the game variables
%game.firstHalf = false;
%oldOffenseTeam = %game.offenseTeam;
if (%game.offenseTeam == 1)
%game.offenseTeam = 2;
else
%game.offenseTeam = 1;
//send the message
messageAll('MsgSiegeRolesSwitched', '\c2%1 is now on offense.', $teamName[%game.offenseTeam], %game.offenseTeam);
messageAll('MsgSiegeRolesSwitched', '\c2Team %1 is now on offense.', $teamName[%game.offenseTeam], %game.offenseTeam);
//reset stations and vehicles that players were using
%game.resetPlayers();
@ -398,22 +419,62 @@ function SiegeGame::halftime(%game, %reason)
%client = ClientGroup.getObject(%cl);
if( !%client.isAIControlled() )
{
// Put everybody in observer mode:
%client.camera.getDataBlock().setMode( %client.camera, "observerStaticNoNext" );
%client.setControlObject( %client.camera );
// Send the halftime result info:
if ( %client.team == %oldOffenseTeam )
{
if ( $teamScore[%oldOffenseTeam] > 0 )
messageClient( %client, 'MsgSiegeResult', "", '%1 captured the %2 base in %3!', %game.capPlayer[%oldOffenseTeam], $teamName[%game.offenseTeam], %game.formatTime( $teamScore[%oldOffenseTeam], true ) );
else
messageClient( %client, 'MsgSiegeResult', "", 'Your team failed to capture the %1 base.', $teamName[%game.offenseTeam] );
}
else if ( $teamScore[%oldOffenseTeam] > 0 )
messageClient( %client, 'MsgSiegeResult', "", '%1 captured your base in %3!', %game.capPlayer[%oldOffenseTeam], %game.formatTime( $teamScore[%oldOffenseTeam], true ) );
else
messageClient( %client, 'MsgSiegeResult', "", 'Your team successfully held off team %1!', $teamName[%oldOffenseTeam] );
// List out the team rosters:
messageClient( %client, 'MsgSiegeAddLine', "", '<spush><color:00dc00><font:univers condensed:18><clip%%:50>%1</clip><lmargin%%:50><clip%%:50>%2</clip><spop>', $TeamName[1], $TeamName[2] );
%max = $TeamRank[1, count] > $TeamRank[2, count] ? $TeamRank[1, count] : $TeamRank[2, count];
for ( %line = 0; %line < %max; %line++ )
{
%plyr1 = $TeamRank[1, %line] $= "" ? "" : $TeamRank[1, %line].name;
%plyr2 = $TeamRank[2, %line] $= "" ? "" : $TeamRank[2, %line].name;
messageClient( %client, 'MsgSiegeAddLine', "", '<lmargin:0><clip%%:50> %1</clip><lmargin%%:50><clip%%:50> %2</clip>', %plyr1, %plyr2 );
}
// Show observers:
%header = false;
for ( %i = 0; %i < %count; %i++ )
{
%obs = ClientGroup.getObject( %i );
if ( %obs.team <= 0 )
{
if ( !%header )
{
messageClient( %client, 'MsgSiegeAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>OBSERVERS<spop>' );
%header = true;
}
messageClient( %client, 'MsgSiegeAddLine', "", ' %1', %obs.name );
}
}
commandToClient( %client, 'SetHalftimeClock', $Host::Siege::Halftime / 60000 );
// Get the HUDs right:
commandToClient( %client, 'setHudMode', 'SiegeHalftime' );
commandToClient( %client, 'ControlObjectReset' );
clientResetTargets(%client, true);
%client.notReady = true;
}
}
// drop all players into mission
%game.dropPlayers();
//setup the AI for the second half
%game.aiHalfTime();
// start the mission again (release players)
%game.halfTimeCountDown($Host::warmupTime);
//redo the objective waypoints
%game.findObjectiveWaypoints();
%game.schedule( $Host::Siege::Halftime, halftimeOver );
}
else
{
@ -423,6 +484,21 @@ function SiegeGame::halftime(%game, %reason)
}
}
function SiegeGame::halftimeOver( %game )
{
// drop all players into mission
%game.dropPlayers();
//setup the AI for the second half
%game.aiHalfTime();
// start the mission again (release players)
%game.halfTimeCountDown( $Host::warmupTime );
//redo the objective waypoints
%game.findObjectiveWaypoints();
}
function SiegeGame::dropPlayers( %game )
{
%count = ClientGroup.getCount();
@ -709,8 +785,13 @@ function siegeGame::findObjectiveWaypoints(%game, %group)
function siegeGame::initializeWaypointAtObjective(%game, %object)
{
// out with the old...jic
if(%object.waypoint)
%object.waypoint.delete();
if ( %object.waypoint )
{
if ( isObject( %object.waypoint ) )
%object.waypoint.delete();
else
%object.waypoint = "";
}
if(%object.team == %game.offenseTeam)
%team = %game.offenseTeam;
@ -731,7 +812,7 @@ function siegeGame::initializeWaypointAtObjective(%game, %object)
scale = "1 1 1";
dataBlock = "WayPointMarker";
team = %team;
name = %object.nameTag SPC %append;
name = getTaggedString(%object.nameTag) SPC %append;
};
MissionCleanup.add(%object.waypoint);
}
@ -745,7 +826,6 @@ function siegeGame::switchWaypoint(%game, %waypoint)
}
function SiegeGame::gameOver(%game)
{
//call the default
@ -795,21 +875,21 @@ function SiegeGame::sendDebriefing( %game, %client )
if (%winner == 1)
{
if ($teamScore[2] == 0)
messageClient(%client, 'MsgDebriefResult', "", '<just:center>%1 wins!', $TeamName[1]);
messageClient(%client, 'MsgDebriefResult', "", '<just:center>Team %1 wins!', $TeamName[1]);
else
{
%timeDiffMS = $teamScore[2] - $teamScore[1];
messageClient(%client, 'MsgDebriefResult', "", '<just:center>%1 won by capturing the base %2 faster!', $TeamName[1], %game.formatTime(%timeDiffMS, true));
messageClient(%client, 'MsgDebriefResult', "", '<just:center>Team %1 won by capturing the base %2 faster!', $TeamName[1], %game.formatTime(%timeDiffMS, true));
}
}
else
{
if ($teamScore[1] == 0)
messageClient(%client, 'MsgDebriefResult', "", '<just:center>%1 wins!', $TeamName[2]);
messageClient(%client, 'MsgDebriefResult', "", '<just:center>Team %1 wins!', $TeamName[2]);
else
{
%timeDiffMS = $teamScore[1] - $teamScore[2];
messageClient(%client, 'MsgDebriefResult', "", '<just:center>%1 won by capturing the base %2 faster!', $TeamName[2], %game.formatTime(%timeDiffMS, true));
messageClient(%client, 'MsgDebriefResult', "", '<just:center>Team %1 won by capturing the base %2 faster!', $TeamName[2], %game.formatTime(%timeDiffMS, true));
}
}
}
@ -818,24 +898,26 @@ function SiegeGame::sendDebriefing( %game, %client )
// Game summary:
messageClient( %client, 'MsgDebriefAddLine', "", '<spush><color:00dc00><font:univers condensed:18>SUMMARY:<spop>' );
if ( $teamScore[1] > 0 )
%team1 = %game.offenseTeam == 1 ? 2 : 1;
%team2 = %game.offenseTeam;
if ( $teamScore[%team1] > 0 )
{
%timeStr = %game.formatTime($teamScore[1], true);
messageClient( %client, 'MsgDebriefAddLine', "", ' %1 captured the base in %2.', $TeamName[1], %timeStr);
%timeStr = %game.formatTime($teamScore[%team1], true);
messageClient( %client, 'MsgDebriefAddLine', "", '<bitmap:bullet_2><lmargin:24>%1 captured the %2 base for Team %3 in %4.<lmargin:0>', %game.capPlayer[%team1], $TeamName[%team2], $TeamName[%team1], %timeStr);
}
else
messageClient( %client, 'MsgDebriefAddLine', "", ' %1 failed to capture the base.', $TeamName[1]);
messageClient( %client, 'MsgDebriefAddLine', "", '<bitmap:bullet_2><lmargin:24>Team %1 failed to capture the base.<lmargin:0>', $TeamName[%team1]);
if ( $teamScore[2] > 0 )
if ( $teamScore[%team2] > 0 )
{
%timeStr = %game.formatTime($teamScore[2], true);
messageClient( %client, 'MsgDebriefAddLine', "", ' %1 captured the base in %2.', $TeamName[2], %timeStr);
%timeStr = %game.formatTime($teamScore[%team2], true);
messageClient( %client, 'MsgDebriefAddLine', "", '<bitmap:bullet_2><lmargin:24>%1 captured the %2 base for Team %3 in %4.<lmargin:0>', %game.capPlayer[%team2], $TeamName[%team1], $TeamName[%team2], %timeStr);
}
else
messageClient( %client, 'MsgDebriefAddLine', "", ' %1 failed to capture the base.', $TeamName[2]);
messageClient( %client, 'MsgDebriefAddLine', "", '<bitmap:bullet_2><lmargin:24>Team %1 failed to capture the base.<lmargin:0>', $TeamName[%team2]);
// List out the team rosters:
messageClient( %client, 'MsgDebriefAddLine', "", '\n<spush><color:00dc00><font:univers condensed:18>%1<lmargin%%:50>%2<spop>', $TeamName[1], $TeamName[2] );
messageClient( %client, 'MsgDebriefAddLine', "", '\n<spush><color:00dc00><font:univers condensed:18><clip%%:50>%1</clip><lmargin%%:50><clip%%:50>%2</clip><spop>', $TeamName[1], $TeamName[2] );
%max = $TeamRank[1, count] > $TeamRank[2, count] ? $TeamRank[1, count] : $TeamRank[2, count];
for ( %line = 0; %line < %max; %line++ )
{
@ -880,6 +962,7 @@ function SiegeGame::clientMissionDropReady(%game, %client)
function SiegeGame::assignClientTeam(%game, %client, %respawn)
{
DefaultGame::assignClientTeam(%game, %client, %respawn);
// if player's team is not on top of objective hud, switch lines
messageClient(%client, 'MsgCheckTeamLines', "", %client.team);
}
@ -1038,10 +1121,10 @@ function SiegeGame::updateScoreHud(%game, %client, %tag)
// Send header:
if (%game.firstHalf)
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>%1 has %2 to capture the base.',
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Team %1 has %2 to capture the base.',
$teamName[%game.offenseTeam], %curTimeLeftStr );
else
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>%1 must capture the base within %2 to win.',
messageClient( %client, 'SetScoreHudHeader', "", '<just:center>Team %1 must capture the base within %2 to win.',
$teamName[%game.offenseTeam], %curTimeLeftStr );
// Send subheader:
@ -1127,4 +1210,4 @@ function SiegeGame::updateScoreHud(%game, %client, %tag)
//clear the rest of Hud so we don't get old lines hanging around...
messageClient( %client, 'ClearHud', "", %tag, %index );
}
}

View file

@ -1,10 +1,17 @@
// Training Script
//echo("Running Training Script");
datablock EffectProfile(TrainingHudUpdateEffect)
{
effectname = "gui/objective_notification";
minDistance = 10;
};
datablock AudioProfile(TrainingHudUpdateSound)
{
filename = "gui/objective_notification.wav";
description = AudioDefault3d;
effect = TrainingHudUpdateEffect;
preload = true;
};
@ -289,9 +296,9 @@ function spawnWaveTimer(%wave, %reset)
if(%reset)
{
cancel(game.spawnWaveTimer);
%timeForAction = 60000 * 5; //5 min
%timeForAction = 60000 * 2; //2 min
}
else %timeForAction = 60000 * 5; //5 min
else %timeForAction = 60000 * 4; //4 min
game.spawnWaveTimer = schedule(%timeForAction, game, destroyWave, %wave);
}
@ -451,6 +458,7 @@ function SinglePlayerGame::clientMissionDropReady(%game, %client)
$player.team = $playerTeam;
$player.setTeam($playerTeam);
setTargetSkin($teammate[%i].target, $teamSkin[$playerTeam]);
$player.clearBackpackIcon();
createText($player);
HUDMessageVector.clear();
@ -522,7 +530,6 @@ function setFlipFlopSkins(%group)
function singlePlayerGame::gameOver(%game)
{
moveMap.push();
ServerConnection.setBlackOut(false, 0);
@ -532,8 +539,9 @@ function singlePlayerGame::gameOver(%game)
game.missionOver = true;
// clear the inventory and weapons hud
error("clearing Inv HUD");
$player.SetInventoryHudClearAll();
// BH: This doesn't actually DO anything...
//error("clearing Inv HUD for client " @ $player);
//$player.SetInventoryHudClearAll();
// im gonna try dropping all the clients
%count = clientGroup.getCount();
@ -598,7 +606,7 @@ function doText(%name, %extraTime, %priority)
else addToQueueEnd(%name);
$player.text[%name, extraTime] = %extraTime;
processText();
processText(false);
}
function processText(%cont)
@ -606,7 +614,7 @@ function processText(%cont)
//we may need to fudge everysound to get it timed right
%universalSoundFudgingConstant = 400;
if($currentlyPlaying && !%cont)
if(isEventPending($currentlyPlaying) && !%cont)
return;
%name = $player.Textque0;
@ -615,7 +623,12 @@ function processText(%cont)
//echo("processing: "@%name);
if($player.Text[%name, eval] !$= "")
eval($player.text[%name, eval]);
{
if (!isPureServer())
eval($player.text[%name, eval]);
else
processTextEval($player.text[%name, eval]);
}
if($player.Text[%name, text] !$= "") {
// the old way: messageClient($player, 0, '\c2%1: %2',$trainerName, $player.Text[%name, line]);
messageClient($player, 0, "\c5"@$player.Text[%name, text]);
@ -630,16 +643,131 @@ function processText(%cont)
removeFromQueue();
%wavLen = alxGetWaveLen($player.text[%name, wav]);
//echo("got wave length of: "@%wavLen);
//if(%wavLen < 400)
// %wavLen = 400; // you cant go back in time, vge
%time = %wavLen + $player.text[%name, extraTime] + %universalSoundFudgingConstant;
//echo("total delay time of"@%time);
$currentlyPlaying = schedule(%time , $player.player, processText, true);
schedule(%time, 0, eval, "$currentlyPlaying = false;");
%time = %wavLen + $player.text[%name, extraTime] + %universalSoundFudgingConstant;
//echo("total delay time of"@%time);
$currentlyPlaying = schedule(%time, $player.player, processText, true);
//if (!isPureServer())
// schedule(%time, 0, eval, "$currentlyPlaying = false;");
//else
// schedule(%time, 0, SPUnsetCurrentlyPlaying);
}
function SPUnsetCurrentlyPlaying()
{
$currentlyPlaying = "";
error(getSimTime() SPC "DEBUG setting currentlyPlaying null");
}
function processTextEval(%evalStmt)
{
switch$ (%evalStmt)
{
case "singlePlayerPlayGuiCheck();":
singlePlayerPlayGuiCheck();
case "schedule(3000, 0, disconnect);":
schedule(3000, 0, disconnect);
case "lockArmorHack();autoToggleHelpHud(true);":
lockArmorHack();autoToggleHelpHud(true);
case "flashMessage();":
flashMessage();
case "flashObjective();":
flashObjective();
case "flashCompass();":
flashCompass();
case "flashHealth();":
flashHealth();
case "flashEnergy();":
flashEnergy();
case "flashInventory();":
flashInventory();
case "flashSensor();":
flashSensor();
case "autoToggleHelpHud(false);":
autoToggleHelpHud(false);
case "setWaypointAt(\"-287.5 393.1 76.2\", \"Health Patches\");movemap.push();$player.player.setMoveState(false);":
setWaypointAt("-287.5 393.1 76.2", "Health Patches");movemap.push();$player.player.setMoveState(false);
case "$player.hurryUp = schedule(40000, 0, hurryPlayerUp); endOpeningSpiel(); updateTrainingObjectiveHud(obj8);":
$player.hurryUp = schedule(40000, 0, hurryPlayerUp); endOpeningSpiel(); updateTrainingObjectiveHud(obj8);
case "updateTrainingObjectiveHud(obj7);":
updateTrainingObjectiveHud(obj7);
case "flashWeapon(0);":
flashWeapon(0);
case "flashWeapon(2);":
flashWeapon(2);
case "flashWeapon(3); ":
flashWeapon(3);
case "flashWeaponsHud();":
flashWeaponsHud();
case "use(Blaster);":
use(Blaster);
case "queEnemySet(0); activatePackage(singlePlayerMissionAreaEnforce);":
queEnemySet(0); activatePackage(singlePlayerMissionAreaEnforce);
case "setWaypointat(nameToId(Tower).position, \"BE Tower\"); updateTrainingObjectiveHud(obj4);":
setWaypointat(nameToId(Tower).position, "BE Tower"); updateTrainingObjectiveHud(obj4);
case "flashPack();":
flashPack();
case "updateTrainingObjectiveHud(obj3);":
updateTrainingObjectiveHud(obj3);
case "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Control Switch\");":
setWaypointAt("-8.82616 -131.779 119.756", "Control Switch");
case "setWaypointAt(nameToId(InitialPulseSensor).position, \"Sensor\");":
setWaypointAt(nameToId(InitialPulseSensor).position, "Sensor");
case "setWaypointAt(\"-8.82616 -131.779 119.756\", \"Tower\");":
setWaypointAt("-8.82616 -131.779 119.756", "Tower");
case "setWaypointAt(\"380.262 -298.625 98.9719\", \"Tower\");":
setWaypointAt("380.262 -298.625 98.9719", "Tower");
case "firstPersonQuickPan();":
firstPersonQuickPan();
case "ThreeAEval();":
ThreeAEval();
case "game.ExpectiongSupportButton = true;":
game.ExpectiongSupportButton = true;
case "game.expectingRepairOrder = true;":
game.expectingRepairOrder = true;
case "$random = getRandom(20,40);schedule($random, 0, doText, T4_TipDefense06);":
$random = getRandom(20,40);schedule($random, 0, doText, T4_TipDefense06);
case "training5addSafeDistance();":
training5addSafeDistance();
}
}
function removeFromQueue()
{
%i = 1;
@ -716,7 +844,11 @@ function updateTrainingObjectiveHud( %objectiveNum )
//sound
objectiveHud.setVisible(false);
schedule(400, game, eval, "objectiveHud.setVisible(true);");
if (!isPureServer())
schedule(400, game, eval, "objectiveHud.setVisible(true);");
else
schedule(400, game, setObjHudVisible);
serverPlay2d(TrainingHudUpdateSound);
//clear old text
@ -735,6 +867,11 @@ function updateTrainingObjectiveHud( %objectiveNum )
messageClient($player, 'MsgSPCurrentObjective2', "", %newObjectiveLine2);
}
function setObjHudVisible()
{
objectiveHud.setVisible(true);
}
// Misc/Overwrites
//=======================================================================================
@ -867,6 +1004,8 @@ function missionFailed(%text)
MessageBoxYesNo("Failure", %text, "reloadMission();", "forceFinish();");
//AI stop
cancel($Player.T1OpeningSpielSchedule);
cancel($Player.distanceCheckSchedule);
clearQueue();
AIMissionEnd();
$objectiveQ[$enemyTeam].clear();
@ -876,6 +1015,7 @@ function reloadMission()
{
cancel($player.endMission);
Game.gameOver();
Canvas.setContent( LoadingGui );
loadMission($currentMission, singlePlayer);
debriefContinue();
}

View file

@ -277,12 +277,6 @@ function TeamHuntersGame::onClientKilled(%game, %clVictim, %clKiller, %damageTyp
messageClient(%clVictim, 'MsgHuntYouHaveFlags', "", 0);
}
function TeamHuntersGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement)
{
if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim)
AIMessageThread("Sorry", %clAttacker, %clVictim);
}
function TeamHuntersGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement)
{
if (%game.testKill(%clVictim, %clKiller)) //verify victim was an enemy

View file

@ -11,12 +11,19 @@ activatePackage(Training1);
addMessageCallback('MsgWeaponMount', playerMountWeapon);
datablock EffectProfile(HudFlashEffect)
{
effectname = "gui/buttonOver";
minDistance = 10;
};
// additional mission Audio
datablock AudioProfile(HudFlashSound)
{
filename = "gui/buttonover.wav";
description = AudioDefault3d;
preload = true;
effect = HudFlashEffect;
};
// additional mission Audio
@ -37,9 +44,6 @@ $missionBotSkill[1] = 0.0;
$missionBotSkill[2] = 0.4;
$missionBotSkill[3] = 0.7;
game.pilotName = "McWatt";
game.bombardierName = "Yossarian";
//------------------------------------------------------------------------------
function getTeammateGlobals()
{
@ -56,9 +60,6 @@ function getTeammateGlobals()
$teammateGender1 = Male;
}
game.tower = nameToId("Tower");
game.tower.threshold1 = 330;
game.tower.threshold2 = 80;
$victimSet[1] = "0 7 10 11";
$victimSet[2] = "1 8 12";
@ -69,6 +70,17 @@ package Training1 {
//------------------------------------------------------------------------------
function SinglePlayerGame::initGameVars(%game)
{
echo("initializing training1 game vars");
%game.pilotName = "McWatt";
%game.bombardierName = "Yossarian";
%game.tower = nameToId("Tower");
%game.tower.threshold1 = 330;
%game.tower.threshold2 = 80;
}
//scriptlet
//we have to jump through a lot of hoops to get those dead bodies in training1
function deadArmor::onAdd(%this, %obj)
@ -104,7 +116,29 @@ function toggleScoreScreen(%val)
function toggleCommanderMap(%val)
{
if ( %val )
messageClient($player, 0, $player.miscMsg[noCC]);
messageClient($player, 0, $player.miscMsg[noCC]);
}
function toggleTaskListDlg( %val )
{
if ( %val )
messageClient( $player, 0, $player.miscMsg[noTaskListDlg] );
}
function toggleInventoryHud( %val )
{
if ( %val )
messageClient( $player, 0, $player.miscMsg[noInventoryHUD] );
}
function toggleNetDisplayHud( %val )
{
// Hello, McFly? This is training! There's no net in training!
}
function voiceCapture( %val )
{
// Uh, who do you think you are talking to?
}
function giveall()
@ -145,6 +179,7 @@ function SinglePlayerGame::equip(%game, %player)
%player.clearInventory();
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
%set = %player.client.equipment;
//error("equping Player "@%player@" with set"@%set);
@ -153,9 +188,6 @@ function SinglePlayerGame::equip(%game, %player)
case 0:
echo("using default equipment");
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.setArmor("Light");
%player.setInventory(RepairKit,1);
%player.setInventory(Blaster,1);
@ -163,16 +195,13 @@ function SinglePlayerGame::equip(%game, %player)
%player.setInventory(Chaingun, 1);
%player.setInventory(ChaingunAmmo, 100);
%player.setInventory(DiscAmmo, 20);
%player.weaponCount = 3;
%player.use(Disc);
%player.weaponCount = 3;
case 1:
echo("using case 1 equipment");
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.setArmor("Light");
%player.setInventory(RepairKit,1);
%player.setInventory(Blaster,1);
@ -181,7 +210,6 @@ function SinglePlayerGame::equip(%game, %player)
%player.setInventory(ChaingunAmmo, 100);
%player.setInventory(DiscAmmo, 20);
%player.setInventory(EnergyPack, 1);
%player.weaponCount = 3;
case 2:
@ -201,6 +229,7 @@ function SinglePlayerGame::equip(%game, %player)
%player.setInventory(MissileLauncherAmmo, 10);
%player.setInventory(TargetingLaser, 1);
%player.weaponCount = 4;
%player.use(Disc);
}
}
@ -417,7 +446,6 @@ function singlePlayerGame::onAIRespawn(%game, %client)
function missionClientKilled(%victim, %killer)
{
// this is just a bit messy as I added the training difficulty stuff late
%skill = $pref::trainingDifficulty;
if(%victim == $player) {
@ -513,6 +541,7 @@ function findVictimSet(%victim)
}
}
}
return 0;
}
// hokay...we have gone away from the default ai so we have to keep our forced-task
@ -538,7 +567,16 @@ function singlePlayerGame::playerSpawned(%game, %player)
//------------------------------------------------------------------------------
function singlePlayerGame::gameOver(%game)
{
//enable the voice chat menu again...
if (isObject(training1BlockMap))
{
training1BlockMap.pop();
training1BlockMap.delete();
}
//moveMap.bindCmd( keyboard, "backspace", "", game.returnBinding );
//allow the observer cam to move again...
$Camera::movementSpeed = 40;
$AIDisableChatResponse = "";
cancel($Training1Blackout);
cancel($Training1HitGround);
@ -711,134 +749,266 @@ function flashEnergy()
{
%time = 1000;
%num = 6;
for(%i=0; %i<%num; %i++) {
schedule(%time*%i, $player.player, "eval", "energyHud.setVisible(false);" );
schedule(%time*%i + %time/2, $player.player, "eval", "energyHud.setVisible(true);" );
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule(%time*%i, $player.player, "eval", "energyHud.setVisible(false);" );
schedule(%time*%i + %time/2, $player.player, "eval", "energyHud.setVisible(true);" );
}
else
{
schedule(%time*%i, $player.player, toggleEnergyHudVis, false);
schedule(%time*%i + %time/2, $player.player, toggleEnergyHudVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleEnergyHudVis(%value)
{
energyHud.setVisible(%value);
}
//------------------------------------------------------------------------------
function flashHealth()
{
%time = 900;
%num = 5;
for(%i=0; %i<%num; %i++) {
schedule( %time*%i, $player.player, "eval", "damageHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "damageHud.setVisible(true);");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule( %time*%i, $player.player, "eval", "damageHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "damageHud.setVisible(true);");
}
else
{
schedule( %time*%i, $player.player, toggleDamageHudVis, false);
schedule(%time*%i + %time/2, $player.player, toggleDamageHudVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleDamageHudVis(%value)
{
damageHud.setVisible(%value);
}
//------------------------------------------------------------------------------
function flashWeapon(%slot)
{
schedule(300, $player.player, use, $WeaponNames[%slot]);
%time = 1000;
%num = 6;
for(%i=0; %i<%num; %i++) {
schedule(%time*%i, $player.player, "eval", "weaponsHud.setActiveWeapon(-1);");
schedule(%time*%i + %time/2, $player.player, "eval", "weaponsHud.setActiveWeapon("@%slot@");");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule(%time*%i, $player.player, "eval", "weaponsHud.setActiveWeapon(-1);");
schedule(%time*%i + %time/2, $player.player, "eval", "weaponsHud.setActiveWeapon("@%slot@");");
}
else
{
schedule(%time*%i, $player.player, toggleWeaponSlot, -1);
schedule(%time*%i + %time/2, $player.player, toggleWeaponSlot, %slot);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleWeaponSlot(%slot)
{
weaponsHud.setActiveWeapon(%slot);
}
//------------------------------------------------------------------------------
function flashWeaponsHud()
{
%time = 1000;
%num = 6;
for(%i=0; %i<%num; %i++) {
schedule( %time*%i, $player.player, "eval", "weaponsHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "weaponsHud.setVisible(true);");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule( %time*%i, $player.player, "eval", "weaponsHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "weaponsHud.setVisible(true);");
}
else
{
schedule( %time*%i, $player.player, toggleWeaponHudVis, false);
schedule(%time*%i + %time/2, $player.player, toggleWeaponHudVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleWeaponHudVis(%value)
{
weaponsHud.setVisible(%value);
}
//------------------------------------------------------------------------------
function flashCompass()
{
%time = 900;
%num = 5;
for(%i=0; %i<%num; %i++) {
schedule(%time*%i, $player.player, "eval", "HudCompassBack.setVisible(false);");
schedule(%time*%i, $player.player, "eval", "compass.setVisible(false);");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule(%time*%i, $player.player, "eval", "HudCompassBack.setVisible(false);");
schedule(%time*%i, $player.player, "eval", "compass.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "HudCompassBack.setVisible(true);");
schedule(%time*%i + %time/2, $player.player, "eval", "compass.setVisible(true);");
schedule(%time*%i + %time/2, $player.player, "eval", "HudCompassBack.setVisible(true);");
schedule(%time*%i + %time/2, $player.player, "eval", "compass.setVisible(true);");
}
else
{
schedule(%time*%i, $player.player, toggleCompassVis, false);
schedule(%time*%i + %time/2, $player.player, toggleCompassVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleCompassVis(%value)
{
HudCompassBack.setVisible(%value);
compass.setVisible(%value);
}
//------------------------------------------------------------------------------
function flashInventory()
{
%time = 1000;
%num = 6;
for(%i=0; %i<%num; %i++) {
schedule(%time*%i, $player.player, "eval", "inventoryHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "inventoryHud.setVisible(true);");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule(%time*%i, $player.player, "eval", "inventoryHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "inventoryHud.setVisible(true);");
}
else
{
schedule(%time*%i, $player.player, toggleInvVis, false);
schedule(%time*%i + %time/2, $player.player, toggleInvVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleInvVis(%value)
{
inventoryHud.setVisible(%value);
}
//------------------------------------------------------------------------------
function flashPack()
{
%time = 1000;
%num = 6;
for(%i=0; %i<%num; %i++) {
schedule(%time*%i, $player.player, "eval", "backPackFrame.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "backPackFrame.setVisible(true);");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule(%time*%i, $player.player, "eval", "backPackFrame.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "backPackFrame.setVisible(true);");
}
else
{
schedule(%time*%i, $player.player, togglePackVis, false);
schedule(%time*%i + %time/2, $player.player, togglePackVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function togglePackVis(%value)
{
backPackFrame.setVisible(%value);
}
//------------------------------------------------------------------------------
function flashSensor()
{
%time = 1000;
%num = 6;
for(%i=0; %i<%num; %i++) {
schedule(%time*%i, $player.player, "eval", "sensorHudBack.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "sensorHudBack.setVisible(true);");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule(%time*%i, $player.player, "eval", "sensorHudBack.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "sensorHudBack.setVisible(true);");
}
else
{
schedule(%time*%i, $player.player, toggleSensorVis, false);
schedule(%time*%i + %time/2, $player.player, toggleSensorVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleSensorVis(%value)
{
sensorHudBack.setVisible(%value);
}
//------------------------------------------------------------------------------
function flashMessage()
{
%time = 1000;
%num = 6;
for(%i=0; %i<%num; %i++) {
schedule(%time*%i, $player.player, "eval", "outerChatHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "outerChatHud.setVisible(true);");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule(%time*%i, $player.player, "eval", "outerChatHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "outerChatHud.setVisible(true);");
}
else
{
schedule(%time*%i, $player.player, toggleMessageVis, false);
schedule(%time*%i + %time/2, $player.player, toggleMessageVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleMessageVis(%value)
{
outerChatHud.setVisible(%value);
}
//------------------------------------------------------------------------------
function flashObjective()
{
%time = 1000;
%num = 6;
for(%i=0; %i<%num; %i++) {
schedule(%time*%i, $player.player, "eval", "objectiveHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "objectiveHud.setVisible(true);");
for(%i=0; %i<%num; %i++)
{
if (!isPureServer())
{
schedule(%time*%i, $player.player, "eval", "objectiveHud.setVisible(false);");
schedule(%time*%i + %time/2, $player.player, "eval", "objectiveHud.setVisible(true);");
}
else
{
schedule(%time*%i, $player.player, toggleObjectiveHudVis, false);
schedule(%time*%i + %time/2, $player.player, toggleObjectiveHudVis, true);
}
$player.schedule(%time*%i, "play2d", HudFlashSound);
}
}
function toggleObjectiveHudVis(%value)
{
objectiveHud.setVisible(%value);
}
//------------------------------------------------------------------------------
// function playCinematicSound(%sound)
// {
@ -885,7 +1055,6 @@ function setTeammatesCMapInvisible(%on)
setTargetNeverVisMask(nameToId(MPB).getTarget(), %arg);
setTargetNeverVisMask($teammate0.player.getTarget(), %arg);
setTargetNeverVisMask($teammate1.player.getTarget(), %arg);
}
@ -897,7 +1066,17 @@ function beginTraining1Intro()
//messageClient($player, 0, $player.miscMsg[skip]);
//moveMap.bindCmd( keyboard, "backspace", "", "skipIntroCinematic();" );
//block the voice chat
if (isObject(training1BlockMap))
training1BlockMap.delete();
new ActionMap(training1BlockMap);
training1BlockMap.blockBind(moveMap, toggleMessageHud);
training1BlockMap.blockBind(moveMap, TeamMessageHud);
training1BlockMap.blockBind(moveMap, activateChatMenuHud);
training1BlockMap.push();
//set the intro started bools
$Camera::movementSpeed = 0;
$AIDisableChatResponse = true;
game.playedIntro = true;
game.trainingIntro = true;
@ -982,11 +1161,20 @@ function beginTraining1Intro()
//------------------------------------------------------------------------------
function trainingIntroFlightEnd()
{
//enable the voice chat menu again...
if (isObject(training1BlockMap))
{
training1BlockMap.pop();
training1BlockMap.delete();
}
//put the player back in his body, give him control back,
//a little dramatic flash, start the rest of the mission
$Camera::movementSpeed = 40;
$AIDisableChatResponse = "";
game.trainingIntro = false;
$player.player.invincible = false;
$player.player.setDamageLevel(0.3);
serverConnection.setBlackout(false, 5000);
$player.player.setActionThread(cel1);
$player.player.schedule(2000, use, Disc);
@ -999,11 +1187,12 @@ function trainingIntroFlightEnd()
if(!$firstPerson)
toggleFirstPerson($player);
$player.player.setMoveState( false );
$player.player.setVelocity("0 0 0");
$player.player.setTransform(nameToId(DP).getTransform());
moveMap.push();
//$player.player.setDamageLevel(0.3);
schedule(10000, game, openingspiel);
$player.T1OpeningSpielSchedule = schedule(10000, game, openingspiel);
objectiveDistanceChecks();
//moveMap.bindCmd( keyboard, "backspace", "", "skipFlashingHud();" );
@ -1016,7 +1205,6 @@ function trainingIntroFlightEnd()
function ClientCmdSetHudMode(%mode, %type, %node)
{
parent::ClientCmdSetHudMode(%mode, %type, %node);
//TrainingMap.push();
getTrainingPacifistMap();
if(game.trainingIntro)
trainingPacifistMap.push();
@ -1042,7 +1230,6 @@ function checkForTraining1Intro()
beginTraining1Intro();
else
{
error("DEBUG checkForTraining1Intro() failed!!!");
schedule(50, game, checkForTraining1Intro);
}
}
@ -1163,10 +1350,10 @@ function forcedCinematicPlayerDismount()
%velX = getWord(%velocity, 0);
%velY = getWord(%velocity, 1);
$player.player.setVelocity(%velX SPC %velY SPC "20");
$player.player.setMoveState( true );
$player.player.schedule(300, setDamageFlash, 0.3);
playTargetAudio( $player.target, 'avo.deathCry_01', AudioClose3d, false );
$player.player.setActionThread(Death1, true);
$player.player.setDamageLevel(0.3);
//$player.flyer.pilot.player.setActionThread(Death10, true);
//$player.flyer.bombardier.player.setActionThread(Death11, true);
@ -1176,7 +1363,7 @@ function forcedCinematicPlayerDismount()
LightMaleHumanArmor.minImpactSpeed = 10000;
trainingPlayerHitGround();
Game.playGrunt = true;
game.expectingImpact = true;
//game.expectingImpact = true;
}
function MissileDudeAimAtTarget(%client, %percent)
@ -1210,10 +1397,13 @@ function MissileDudeFireMissile(%Client)
%client.clearStep();
%client.setEngageTarget(-1);
%client.setTargetObject($player.flyer, 300, "Missile");
if (isDemo())
%wav = "fx/misc/derm2.woohoo.WAV";
else
%wav = "voice/derm2/gbl.woohoo.WAV";
%audio = alxCreateSource( AudioChat, %wav );
alxPlay( %audio );
%audio = alxCreateSource( AudioChat, %wav );
alxPlay( %audio );
schedule(4000, 0, cinematicEvent, 7);

View file

@ -62,25 +62,28 @@ addMessageCallback('msgEnterInvStation', StationInvEnter);
//addMessageCallback('MsgShieldPackOn', playerTurnsOnShield);
// for many of the objectives we are going to periodically
// check the players distance vs some object
// you could do this much prettier but its going to be very specific
// so a cut and paste eyesore will be fine
game.sensor = nameToID("MissionGroup/Teams/team2/base1/initialPulseSensor");
game.base1 = nameToID("MissionGroup/Teams/team2/base1/base");
game.base1.threshold1 = 240;
game.base1.threshold2 = 190;
game.base2 = nameToID("MissionGroup/Teams/team2/base2/base");
game.base2.threshold1 = 300;
game.base2.threshold2 = 250;
game.base3 = nameToID("MissionGroup/Teams/team2/base3/base");
game.base3.threshold1 = 330;
game.base3.threshold2 = 130;
package training2 {
//--Training2 package begin -----------------------------------------------------------------
function SinglePlayerGame::initGameVars(%game)
{
// for many of the objectives we are going to periodically
// check the players distance vs some object
// you could do this much prettier but its going to be very specific
// so a cut and paste eyesore will be fine
echo("initializing training2 game vars");
%game.sensor = nameToID("MissionGroup/Teams/team2/base1/initialPulseSensor");
%game.base1 = nameToID("MissionGroup/Teams/team2/base1/base");
%game.base1.threshold1 = 240;
%game.base1.threshold2 = 190;
%game.base2 = nameToID("MissionGroup/Teams/team2/base2/base");
%game.base2.threshold1 = 300;
%game.base2.threshold2 = 250;
%game.base3 = nameToID("MissionGroup/Teams/team2/base3/base");
%game.base3.threshold1 = 330;
%game.base3.threshold2 = 130;
}
function toggleScoreScreen(%val)
{
if ( %val )
@ -94,6 +97,22 @@ function toggleCommanderMap(%val)
messageClient($player, 0, $player.miscMsg[noCC]);
}
function toggleTaskListDlg( %val )
{
if ( %val )
messageClient( $player, 0, $player.miscMsg[noTaskListDlg] );
}
function toggleNetDisplayHud( %val )
{
// Hello, McFly? This is training! There's no net in training!
}
function voiceCapture( %val )
{
// Uh, who do you think you are talking to?
}
function MP3Audio::play(%this)
{
//too bad...no mp3 in training
@ -206,7 +225,10 @@ function getTeammateGlobals()
{
$TeammateWarnom0 = "Dogkiller";
$teammateskill0 = 0.7;
$teammateVoice0 = Male5;
if ( isDemo() )
$teammateVoice0 = Male1;
else
$teammateVoice0 = Male5;
$teammateEquipment0 = 2;
$teammateGender0 = Male;
}
@ -228,6 +250,7 @@ function SinglePlayerGame::equip(%game, %player)
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
%set = %player.client.equipment;
//error("equping Player "@%player@" with set"@%set);

View file

@ -29,19 +29,25 @@ $Shrike = nameToId("Ride");
$Shrike.playThread($ActivateThread, "activate");
// for the distance checking
game.base = nameToId("Shield");
game.baseLocation = game.base.getTransform();
game.base.threshold = 400;
game.end = nameToId("PlayerDropPoint");
game.endLocation = game.end.getTransform();
addMessageCallback('MsgWeaponMount', playerMountWeapon);
package training3 {
//===============================================begin the training 3 package stuff====
function SinglePlayerGame::initGameVars(%game)
{
// for many of the objectives we are going to periodically
// check the players distance vs some object
// you could do this much prettier but its going to be very specific
// so a cut and paste eyesore will be fine
echo("initializing training3 game vars");
%game.base = nameToId("Shield");
%game.baseLocation = game.base.getTransform();
%game.base.threshold = 400;
%game.end = nameToId("PlayerDropPoint");
%game.endLocation = game.end.getTransform();
}
function MP3Audio::play(%this)
{
//too bad...no mp3 in training
@ -65,7 +71,6 @@ function singlePlayerGame::onAIRespawn(%game, %client)
}
}
// error("Forcing AI Scope!!!!!!!!!!!!!");
// %client.player.scopeToClient($player);
@ -90,6 +95,22 @@ function toggleCommanderMap(%val)
messageClient($player, 0, $player.miscMsg[noCC]);
}
function toggleTaskListDlg( %val )
{
if ( %val )
messageClient( $player, 0, $player.miscMsg[noTaskListDlg] );
}
function toggleNetDisplayHud( %val )
{
// Hello, McFly? This is training! There's no net in training!
}
function voiceCapture( %val )
{
// Uh, who do you think you are talking to?
}
function giveall()
{
error("When the going gets tough...wussies like you start cheating!");
@ -161,27 +182,27 @@ function SinglePlayerGame::equip(%game, %player)
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
//echo("Light Assassin Config");
//echo("Light Assassin Config");
%player.setArmor("Light");
%player.setInventory(CloakingPack, 1);
%player.setInventory(RepairKit,1);
%player.setInventory(FlashGrenade,5);
%player.setInventory(Mine,3);
%player.setArmor("Light");
%player.setInventory(CloakingPack, 1);
%player.setInventory(RepairKit,1);
%player.setInventory(FlashGrenade,5);
%player.setInventory(Mine,3);
%player.setInventory(Plasma, 1);
%player.setInventory(PlasmaAmmo, 20);
%player.setInventory(Disc,1);
%player.setInventory(DiscAmmo, 15);
%player.setInventory(TargetingLaser, 1);
%player.setInventory(ShockLance,1);
%player.setInventory(Plasma, 1);
%player.setInventory(PlasmaAmmo, 20);
%player.setInventory(Disc,1);
%player.setInventory(DiscAmmo, 15);
%player.setInventory(TargetingLaser, 1);
%player.setInventory(ShockLance,1);
%player.weaponCount = 3;
%player.use("Disc");
%player.weaponCount = 3;
%player.use("Disc");
}
// ============================================================================

View file

@ -145,6 +145,16 @@ function toggleScoreScreen(%val)
messageClient($player, 0, $player.miscMsg[noScoreScreen]);
}
function toggleNetDisplayHud( %val )
{
// Hello, McFly? This is training! There's no net in training!
}
function voiceCapture( %val )
{
// Uh, who do you think you are talking to?
}
function singlePlayerGame::pickTeamSpawn(%game, %client)
{
if(%client.team == $player.team)
@ -560,6 +570,7 @@ function SinglePlayerGame::equip(%game, %player, %set)
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
//error("equping Player "@%player@" with set"@%set);
switch (%set)

View file

@ -37,21 +37,27 @@ $bridgeTime[1] = 30;
$bridgeTime[2] = 20;
$bridgeTime[3] = 5;
game.targetObject1 = nameToId("ObjectiveGen1");
game.targetObject2 = nameToId("ObjectiveGen2");
game.tower = nameToId("MissionGroup/Teams/Team2/tower/tower");
game.base = nameToId("DBase2");
game.minimumSafeDistance = 500;
game.West = nameToId(WestBridgeGen);
game.East = nameToId(EastBridgeGen);
game.North = nameToId(NorthBridgeGen);
game.South = nameToId(SouthBridgeGen);
package Training5 {
//Training5 package functions begin=======================================================
function SinglePlayerGame::initGameVars(%game)
{
// for many of the objectives we are going to periodically
// check the players distance vs some object
// you could do this much prettier but its going to be very specific
// so a cut and paste eyesore will be fine
echo("initializing training5 game vars");
%game.targetObject1 = nameToId("ObjectiveGen1");
%game.targetObject2 = nameToId("ObjectiveGen2");
%game.tower = nameToId("MissionGroup/Teams/Team2/tower/tower");
%game.base = nameToId("DBase2");
%game.minimumSafeDistance = 500;
%game.West = nameToId(WestBridgeGen);
%game.East = nameToId(EastBridgeGen);
%game.North = nameToId(NorthBridgeGen);
%game.South = nameToId(SouthBridgeGen);
}
function MP3Audio::play(%this)
{
//too bad...no mp3 in training
@ -65,6 +71,16 @@ function toggleScoreScreen(%val)
messageClient($player, 0, $player.miscMsg[noScoreScreen]);
}
function toggleNetDisplayHud( %val )
{
// Hello, McFly? This is training! There's no net in training!
}
function voiceCapture( %val )
{
// Uh, who do you think you are talking to?
}
function ClientCmdSetHudMode(%mode, %type, %node)
{
parent::ClientCmdSetHudMode(%mode, %type, %node);
@ -322,7 +338,7 @@ function SinglePlayerGame::equip(%game, %player, %set)
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
%player.setArmor("Medium");
@ -345,7 +361,6 @@ function SinglePlayerGame::equip(%game, %player, %set)
%player.use("Disc");
%player.weaponCount = 4;
}

View file

@ -158,7 +158,7 @@ function TrainingMissionList::onSelect( %this, %id, %text )
else
error( "Failed to open Single Player mission file " @ %fileName @ "!" );
if (!isDemo() && !isDemoServer())
if (!isDemo())
%bmp = "gui/" @ %briefPic @ ".png";
else
%bmp = "gui/" @ %briefPic @ ".bm8";

View file

@ -17,7 +17,7 @@ $VoteMessage["VoteHoardMode", 1] = "disable Greed Mode";
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %playerVote)
{
//DEMO VERSION - only voteKickPlayer is allowed
if ((isDemo() || isDemoServer()) && %typeName !$= "VoteKickPlayer")
if ((isDemo()) && %typeName !$= "VoteKickPlayer")
{
messageClient(%client, '', "All voting options except to kick a player are disabled in the DEMO VERSION.");
return;

View file

@ -272,7 +272,7 @@ $BotProfile[10, name] = "HexaBOTic";
$BotProfile[10, skill] = 0.99;
$BotProfile[10, offense] = true;
$BotProfile[10, voicePitch] = 0.895;
$BotProfile[11, name] = "Sne/\kBOT";
$BotProfile[11, name] = "Sne/\\kBOT";
$BotProfile[11, skill] = 0.99;
$BotProfile[11, offense] = true;
$BotProfile[11, voicePitch] = 0.885;

View file

@ -88,6 +88,10 @@ function CTFGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implem
function CTFGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement)
{
if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim)
AIMessageThread("Sorry", %clAttacker, %clVictim);
if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim && !%clVictim.isAIControlled())
{
// The Bot is only a little sorry:
if ( getRandom() > 0.9 )
AIMessageThread("ChatSorry", %clAttacker, %clVictim);
}
}

View file

@ -39,7 +39,9 @@ function AIProcessMessageTable(%threadId)
else
{
//play the msg, schedule the next msg, and increment the index
serverCmdCannedChat(%speaker, addTaggedString(%msg), true);
%tag = addTaggedString( %msg );
serverCmdCannedChat(%speaker, %tag, true);
removeTaggedString( %tag );
schedule(%delay, 0, "AIProcessMessageTable", %threadId);
$AIMsgThreadDelay = %delay;
$AIMsgThreadIndex++;
@ -93,7 +95,7 @@ function AIMessageThreadTemplate(%type, %msg, %clSpeaker, %clListener)
else if (%randNum < 0.66)
$AIMsgThreadTable[%index++] = %clListener @ " ChatCmdDefendReinforce " @ 1500;
else
$AIMsgThreadTable[%index++] = %clListener @ " ChatCmdDefend " @ 1250;
$AIMsgThreadTable[%index++] = %clListener @ " ChatCmdDefendEntrances " @ 1250;
//do we acknowledge the command first?
if (getRandom() < 0.5)
@ -354,8 +356,10 @@ function AIMessageThread(%msg, %clSpeaker, %clListener, %force, %index, %threadI
// schedule("AIEndMessageThread(" @ $AIMsgThreadId @ ");", 1000);
default:
serverCmdCannedChat(%clSpeaker, addTaggedString(%msg), true);
schedule(1500, 0, "AIEndMessageThread", $AIMsgThreadId);
%tag = addTaggedString( %msg );
serverCmdCannedChat( %clSpeaker, %tag, true );
removeTaggedString( %tag ); // Don't keep incrementing the string ref count...
schedule( 1500, 0, "AIEndMessageThread", $AIMsgThreadId );
}
}

View file

@ -63,8 +63,12 @@ function CnHGame::onAIKilled(%game, %clVictim, %clAttacker, %damageType, %implem
function CnHGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement)
{
if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim)
AIMessageThread("Sorry", %clAttacker, %clVictim);
if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim && !%clVictim.isAIControlled())
{
// The Bot is only a little sorry:
if ( getRandom() > 0.9 )
AIMessageThread("ChatSorry", %clAttacker, %clVictim);
}
}
function CnHGame::AIplayerCaptureFlipFlop(%game, %player, %flipFlop)

View file

@ -80,6 +80,10 @@ function SiegeGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageType,
function SiegeGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement)
{
if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim)
AIMessageThread("Sorry", %clAttacker, %clVictim);
if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim && !%clVictim.isAIControlled())
{
// The Bot is only a little sorry:
if ( getRandom() > 0.9 )
AIMessageThread("ChatSorry", %clAttacker, %clVictim);
}
}

View file

@ -38,4 +38,14 @@ function TeamHuntersGame::onAIDamaged(%game, %clVictim, %clAttacker, %damageType
}
}
function TeamHuntersGame::onAIFriendlyFire(%game, %clVictim, %clAttacker, %damageType, %implement)
{
if (%clAttacker && %clAttacker.team == %clVictim.team && %clAttacker != %clVictim && !%clVictim.isAIControlled())
{
// The Bot is only a little sorry:
if ( getRandom() > 0.9 )
AIMessageThread("ChatSorry", %clAttacker, %clVictim);
}
}

View file

@ -0,0 +1,17 @@
//-------------------------------------- Desert interior texture property mapping
addMaterialMapping("badlands/bd_ichute01", "environment: special/chuteTexture 0.25");
addMaterialMapping("badlands/bd_ichute02a", "environment: special/chuteTexture 0.25");
//"Color: red green blue startAlpha endAlpha"
//Soft sound = 0
//Hard sound = 1
//Metal sound = 2
//Snow sound = 3
addMaterialMapping("terrain/BadLands.DirtBumpy", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/BadLands.DirtChipped", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/BadLands.DirtYellow", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/BadLands.DirtYellowCracked", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/BadLands.RockBrown", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/BadLands.RockChipped", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/BadLands.RockCracked", "color: 0.5 0.36 0.16 0.4 0.0", "sound: 0");

View file

@ -39,9 +39,9 @@ function Observer::onTrigger(%data,%obj,%trigger,%state)
switch$ (%obj.mode)
{
case "justJoined":
if ( isDemoServer() )
clearCenterPrint( %client );
if (isDemo())
clearCenterPrint(%client);
//press FIRE
if (%trigger == 0)
{
@ -190,6 +190,9 @@ function Observer::onTrigger(%data,%obj,%trigger,%state)
%transform = %markerObj.getTransform();
%obj.setTransform(%transform);
%obj.setFlyMode();
case "observerStaticNoNext":
// Non-moving, non-cycling observer camera
case "observerTimeout":
// Player didn't respawn quickly enough
@ -376,7 +379,7 @@ function Observer::setMode(%data, %obj, %mode, %targetObj)
%obj.setTransform(%transform);
%obj.setFlyMode();
case "observerStatic":
case "observerStatic" or "observerStaticNoNext":
// Non-moving observer camera
%markerObj = Game.pickObserverSpawn(%client, true);
%transform = %markerObj.getTransform();

View file

@ -34,6 +34,8 @@ function clientCmdSetPlayContent()
{
if ( $LaunchMode $= "InteriorView" )
Canvas.setContent( interiorPreviewGui );
else if ( $LaunchMode $= "TSShow" )
Canvas.setContent( TSShowGui );
else
Canvas.setContent( Playgui );
}
@ -41,8 +43,8 @@ function clientCmdSetPlayContent()
function clientCmdPickTeamMenu( %teamA, %teamB )
{
ClientCmdSetHudMode("PickTeam");
PickTeamAButton.text = %teamA;
PickTeamBButton.text = %teamB;
PickTeamAButton.text = getTaggedString( %teamA );
PickTeamBButton.text = getTaggedString( %teamB );
PickTeamFrame.setTitle( "Pick Team" );
Canvas.pushDialog( PickTeamDlg );
@ -220,10 +222,10 @@ function toggleNetDisplayHud(%val)
function PlayGui::onWake(%this)
{
// Make sure the shell hum is off:
if ( $HudHandle['shellScreen'] !$= "" )
if ( $HudHandle[shellScreen] !$= "" )
{
alxStop( $HudHandle['shellScreen'] );
$HudHandle['shellScreen'] = "";
alxStop( $HudHandle[shellScreen] );
$HudHandle[shellScreen] = "";
}
$enableDirectInput = "1";
@ -1404,7 +1406,7 @@ function clientCmdShowVehicleGauges(%vehType, %node)
profile = "GuiDashBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "10 11";
position = "40 11";
extent = "80 44";
minExtent = "8 8";
visible = "1";
@ -1415,7 +1417,7 @@ function clientCmdShowVehicleGauges(%vehType, %node)
profile = "GuiDashBoxProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "103 11";
position = "118 11";
extent = "80 44";
minExtent = "8 8";
visible = "0";
@ -1695,6 +1697,13 @@ addMessageCallback( 'msgPackIconOff', clientPackIconOff );
addMessageCallback( 'MsgForceObserver', HandleForceObserver );
addMessageCallback( 'MsgPlayerMuted', handlePlayerMuted );
//------------------------------------------------------------------------------
// Siege-specific callbacks:
addMessageCallback( 'MsgSiegeHalftime', handleSiegeHalftimeMessage );
addMessageCallback( 'MsgSiegeResult', handleSiegeResultMessage );
addMessageCallback( 'MsgSiegeAddLine', handleSiegeLineMessage );
//------------------------------------------------------------------------------
function HandleForceObserver( %msgType, %msgString )
{
@ -1931,6 +1940,7 @@ function sceneLightingComplete()
clientCmdResetHud();
commandToServer('SetVoiceInfo', $pref::Audio::voiceChannels, $pref::Audio::decodingMask, $pref::Audio::encodingLevel);
commandToServer('EnableVehicleTeleport', $pref::Vehicle::pilotTeleport );
commandToServer('MissionStartPhase3Done', $MSeq);
}
@ -2034,6 +2044,12 @@ function GameConnection::initialControlSet(%this)
return;
}
if( $LaunchMode $= "TSShow" )
{
Canvas.setContent( TSShowGui );
return;
}
if( Canvas.getContent() != PlayGui.getId() )
{
Canvas.setContent( PlayGui );
@ -2042,4 +2058,50 @@ function GameConnection::initialControlSet(%this)
}
}
//------------------------------------------------------------------------------
// Siege-specific client functions:
//------------------------------------------------------------------------------
function handleSiegeHalftimeMessage( %msgType, %msgString )
{
alxPlay( SiegeSwitchSides, 0, 0, 0 );
showTaskHudDlg( false );
SiegeHalftimeText.setText( "" );
}
//------------------------------------------------------------------------------
function handleSiegeResultMessage( %msgType, %msgString, %result )
{
SiegeHalftimeHeaderText.setText( "<just:center>" @ detag( %result ) );
}
//------------------------------------------------------------------------------
function handleSiegeLineMessage( %msgType, %msgString, %line )
{
%text = SiegeHalftimeText.getText();
if ( %text $= "" )
%newText = detag( %line );
else
%newText = %text NL detag( %line );
SiegeHalftimeText.setText( %newText );
}
//------------------------------------------------------------------------------
function clientCmdSetHalftimeClock( %time )
{
SiegeHalftimeClock.setTime( %time );
}
//------------------------------------------------------------------------------
function SiegeHalftimeHeaderText::onResize( %this, %width, %height )
{
%w = firstWord( SiegeHalftimeHeader.getExtent() );
SiegeHalftimeHeader.setExtent( %w, %height + 6 );
%paneHeight = getWord( siegeHalftimeHud.getExtent(), 1 );
%x = firstWord( SiegeHalftimeScroll.getPosition() );
%y = %height + 40;
%w = firstWord( SiegeHalftimeScroll.getExtent() );
%h = %paneHeight - %height - 59;
SiegeHalftimeScroll.resize( %x, %y, %w, %h );
}

View file

@ -4,6 +4,13 @@
//
//--------------------------------------------------------------------------
datablock EffectProfile(BountyBellEffect)
{
effectname = "misc/bounty_bonus";
minDistance = 2.5;
maxDistance = 5.0;
};
// ordered list of providers
$AudioProviders[0, name] = "Creative Labs EAX 2 (TM)";
$AudioProviders[0, isHardware] = true;
@ -54,7 +61,7 @@ function audioUpdateProvider(%provider)
if($AudioProviders[%i, isHardware])
{
alxDisableOuterFalloffs(true);
alxSetInnerFalloffScale($Audio::innerFalloffScale);
alxSetInnerFalloffScale(0.4);
}
// environment
@ -124,6 +131,9 @@ function MP3Audio::stop(%this)
function getRandomTrack()
{
if ( isDemo() )
return( "desert" );
%val = mFloor(getRandom(0, 4));
switch(%val)
{
@ -151,7 +161,12 @@ function MP3Audio::playTrack(%this, %trackName)
{
%this.currentTrack = %trackName;
if($pref::Audio::musicEnabled)
alxPlayMusic("base\\music\\" @ %trackName @ ".mp3");
{
if ( isDemo() )
alxPlayMusic("demo_base\\music\\" @ %trackName @ ".mp3");
else
alxPlayMusic("base\\music\\" @ %trackName @ ".mp3");
}
}
function finishedMusicStream(%stopped)
@ -177,6 +192,19 @@ function clientCmdStopMusic()
//--------------------------------------
// Audio Profiles
//
new EffectProfile(eButtonDown)
{
effectname = "gui/buttonDown";
minDistance = 10;
};
new EffectProfile(eButtonOver)
{
effectname = "gui/buttonOver";
minDistance = 10;
};
new AudioDescription(AudioGui)
{
volume = 1.0;
@ -205,14 +233,16 @@ new AudioProfile(sButtonDown)
{
filename = "gui/buttonDown.wav";
description = "audioGui";
preload = true;
preload = true;
effect = eButtonDown;
};
new AudioProfile(sButtonOver)
{
filename = "gui/buttonOver.wav";
description = "audioGui";
preload = true;
preload = true;
effect = eButtonOver;
};
new AudioProfile(sGotMail)
@ -222,18 +252,26 @@ new AudioProfile(sGotMail)
preload = true;
};
new EffectProfile(eLaunchMenuOpen)
{
effectname = "gui/launchMenuOpen";
minDistance = 10;
};
new AudioProfile(sLaunchMenuOpen)
{
filename = "gui/launchMenuOpen.wav";
description = "audioGui";
preload = true;
preload = true;
effect = eLaunchMenuOpen;
};
new AudioProfile(sLaunchMenuOver)
{
filename = "gui/buttonOver.wav";
description = "audioGui";
preload = true;
preload = true;
effect = eButtonOver;
};
new AudioProfile(VoteForSound)
@ -319,25 +357,40 @@ new AudioProfile(sMissileHomingWarningTone)
};
//--------------------------------------------------------------------------
new AudioProfile(HudInventoryHumSound)
{
filename = "gui/inventory_hum.wav";
description = "AudioGuiLoop";
preload = true;
preload = true;
};
new EffectProfile(HudInventoryActivateEffect)
{
effectname = "gui/inventory_on";
minDistance = 10;
};
new AudioProfile(HudInventoryActivateSound)
{
filename = "gui/inventory_on.wav";
description = "AudioGui";
preload = true;
preload = true;
effect = HudInventoryActivateEffect;
};
new EffectProfile(HudInventoryDeactivateEffect)
{
effectname = "gui/inventory_off";
minDistance = 10;
};
new AudioProfile(HudInventoryDeactivateSound)
{
filename = "gui/inventory_off.wav";
description = "AudioGui";
preload = true;
preload = true;
effect = HudInventoryDeactivateEffect;
};
new AudioProfile(CommandMapHumSound)
@ -347,18 +400,32 @@ new AudioProfile(CommandMapHumSound)
preload = true;
};
new EffectProfile(CommandMapActivateEffect)
{
effectname = "gui/command_on";
minDistance = 10;
};
new AudioProfile(CommandMapActivateSound)
{
filename = "gui/command_on.wav";
description = "AudioGui";
preload = true;
effect = CommandMapActivateEffect;
preload = true;
};
new EffectProfile(CommandMapDeactivateEffect)
{
effectname = "gui/command_off";
minDistance = 10;
};
new AudioProfile(CommandMapDeactivateSound)
{
filename = "gui/command_off.wav";
description = "AudioGui";
preload = true;
preload = true;
effect = CommandMapDeactivateEffect;
};
new AudioProfile(ShellScreenHumSound)
@ -386,21 +453,21 @@ new AudioProfile(VoteNotPassSound)
{
filename = "fx/misc/vote_fails.wav";
description = "AudioGui";
preload = true;
preload = true;
};
new AudioProfile(AdminForceSound)
{
filename = "fx/misc/bounty_completed.wav";
description = "AudioGui";
preload = true;
preload = true;
};
new AudioProfile(VoteInitiatedSound)
{
filename = "fx/misc/vote_initiated.wav";
description = "AudioGui";
preload = true;
preload = true;
};
// Tinman - not being used anymore...
@ -415,20 +482,27 @@ new AudioProfile(BountyBellSound)
{
filename = "fx/misc/bounty_bonus.wav";
description = "AudioGui";
preload = true;
preload = true;
};
new AudioProfile(SiegeSwitchSides)
{
filename = "fx/misc/siege_switching.wav";
description = "AudioGui";
preload = true;
preload = true;
};
new EffectProfile(ObjectiveCompletedEffect)
{
effectname = "misc/bounty_bonus";
minDistance = 10;
};
new AudioProfile(ObjectiveCompleted)
{
filename = "fx/misc/bounty_bonus.wav";
description = "AudioGui";
preload = true;
effect = ObjectiveCompletedEffect;
preload = true;
};

View file

@ -37,8 +37,8 @@ $pref::Email::ComposeWindowExtent = "500 408";
$pref::Email::SortColumnKey = 3;
$pref::Email::SortInc = 1;
$pref::EnableBadWordFilter = 1;
$pref::FavNames0 = "SCOUT ASSASSIN";
$pref::FavNames1 = "SCOUT SNIPER";
$pref::FavNames0 = "SCOUT SNIPER";
$pref::FavNames1 = "SCOUT ASSASSIN";
$pref::FavNames2 = "SCOUT DEFENSE";
$pref::FavNames3 = "ASSAULT OFFENSE";
$pref::FavNames4 = "ASSAULT DEPLOYER";
@ -57,8 +57,8 @@ $pref::FavNames16 = "DECOY";
$pref::FavNames17 = "HEAVY LOVE";
$pref::FavNames18 = "FLAG DEFENDER";
$pref::FavNames19 = "INFILTRATOR";
$pref::Favorite0 = "armor\tScout\tweapon\tPlasma Rifle\tweapon\tChaingun\tweapon\tShocklance\tpack\tCloak Pack\tGrenade\tWhiteout Grenade\tMine\tMine";
$pref::Favorite1 = "armor\tScout\tweapon\tLaser Rifle\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tpack\tEnergy Pack\tGrenade\tFlare Grenade\tMine\tMine";
$pref::Favorite0 = "armor\tScout\tweapon\tLaser Rifle\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tpack\tEnergy Pack\tGrenade\tFlare Grenade\tMine\tMine";
$pref::Favorite1 = "armor\tScout\tweapon\tPlasma Rifle\tweapon\tChaingun\tweapon\tShocklance\tpack\tCloak Pack\tGrenade\tWhiteout Grenade\tMine\tMine";
$pref::Favorite2 = "armor\tScout\tweapon\tBlaster\tweapon\tSpinfusor\tweapon\tPlasma Rifle\tpack\tShield Pack\tGrenade\tGrenade\tMine\tMine";
$pref::Favorite3 = "armor\tAssault\tweapon\tPlasma Rifle\tweapon\tSpinfusor\tweapon\tGrenade Launcher\tweapon\tChaingun\tpack\tShield Pack\tGrenade\tGrenade\tMine\tMine";
$pref::Favorite4 = "armor\tAssault\tweapon\tPlasma Rifle\tweapon\tBlaster\tweapon\tSpinfusor\tweapon\tMissile Launcher\tpack\tInventory Station\tGrenade\tDeployable Camera\tMine\tMine";
@ -127,24 +127,27 @@ $pref::sceneLighting::cacheLighting = 1;
$pref::sceneLighting::terrainGenerateLevel = 1;
$pref::ServerBrowser::activeFilter = 0;
$pref::ServerBrowser::Column0 = "0 183";
$pref::ServerBrowser::Column1 = "1 30";
$pref::ServerBrowser::Column1 = "1 60";
$pref::ServerBrowser::Column2 = "2 30";
$pref::ServerBrowser::Column3 = "3 45";
$pref::ServerBrowser::Column4 = "5 143";
$pref::ServerBrowser::Column5 = "7 56";
$pref::ServerBrowser::Column6 = "8 56";
$pref::ServerBrowser::Column7 = "9 155";
$pref::ServerBrowser::Column8 = "4 89";
$pref::ServerBrowser::Column9 = "6 74";
$pref::ServerBrowser::Column4 = "4 120";
$pref::ServerBrowser::Column5 = "5 140";
$pref::ServerBrowser::Column6 = "7 80";
$pref::ServerBrowser::Column7 = "8 80";
$pref::ServerBrowser::Column8 = "9 170";
if ( !isDemo() )
{
$pref::ServerBrowser::Column9 = "6 74";
$pref::ServerBrowser::Column10 = "10 70";
$pref::ServerBrowser::Column11 = "11 100";
}
$pref::ServerBrowser::FavoriteCount = 0;
$pref::ServerBrowser::SortColumnKey = 0;
$pref::ServerBrowser::SortColumnKey = 3;
$pref::ServerBrowser::SortInc = 1;
$pref::ServerBrowser::InfoWindowOpen = 0;
$pref::ServerBrowser::InfoWindowPos = "145 105";
$pref::ServerBrowser::InfoWindowExtent = "350 270";
$pref::ServerBrowser::IgnoreCase = "1";
$pref::ServerBrowser::IgnoreCase = 1;
$pref::Shell::lastBackground = 0;
$pref::Terrain::DynamicLights = 1;
$pref::toggleVehicleView = 0;
@ -157,15 +160,15 @@ $pref::Topics::SortInc = 0;
$pref::Video::displayDevice = "OpenGL";
$pref::chatHudLength = 1;
$pref::useImmersion = 1;
if ( isDemo() )
$pref::Video::fullScreen = 1;
$pref::Video::fullScreen = 1;
$pref::Video::allowOpenGL = 1;
$pref::Video::allowD3D = 1;
$pref::Video::preferOpenGL = 1;
$pref::Video::appliedPref = 0;
$pref::Video::disableVerticalSync = 1;
$pref::VisibleDistanceMod = 1.0;
$pref::OpenGL::force16BitTexture = "0";
$pref::OpenGL::forcePalettedTexture = "1";
$pref::OpenGL::force16BitTexture = 0;
$pref::OpenGL::forcePalettedTexture = 1;
$pref::OpenGL::maxHardwareLights = 3;
$pref::OpenGL::allowTexGen = "1";
$pref::OpenGL::allowTexGen = 1;
$pref::Vehicle::pilotTeleport = 1;

View file

@ -66,7 +66,7 @@ function createCommanderKeyMap()
CommanderKeyMap.copyBind( moveMap, startRecordingDemo );
CommanderKeyMap.copyBind( moveMap, stopRecordingDemo );
CommanderKeyMap.copyBind( moveMap, voiceCapture );
CommanderKeyMap.bindCmd( keyboard, escape, "", "escapeFromGame();" );
CommanderKeyMap.bindCmd( keyboard, escape, "", "toggleCommanderMap( true );" );
// grab help key from movemap
if(!bindAction( moveMap, toggleHelpGui, false, toggleCmdMapHelpGui ))
@ -157,7 +157,21 @@ function clientCmdResetCommandMap()
{
CommanderMapGui.reset();
}
function clientCmdScopeCommanderMap(%scope)
{
if(!isPlayingDemo())
return;
if(%scope)
{
CommanderMap.openAllCategories();
CommanderMapGui.open();
}
else
CommanderMapGui.close();
}
function CommanderMapGui::onWake(%this)
{
clientCmdControlObjectReset();
@ -167,10 +181,10 @@ function CommanderMapGui::onWake(%this)
createCommanderKeyMap();
CommanderKeyMap.push();
if ( $HudHandle['CommandScreen'] )
alxStop( $HudHandle['CommandScreen'] );
if ( $HudHandle[CommandScreen] )
alxStop( $HudHandle[CommandScreen] );
alxPlay(CommandMapActivateSound, 0, 0, 0);
$HudHandle['CommandScreen'] = alxPlay(CommandMapHumSound, 0, 0, 0);
$HudHandle[CommandScreen] = alxPlay(CommandMapHumSound, 0, 0, 0);
CMDTextButton.setValue(CommanderMap.renderText);
@ -204,9 +218,9 @@ function CommanderMapGui::onSleep(%this)
CommanderKeyMap.pop();
Canvas.popDialog(MainChatHud);
alxStop($HudHandle['CommandScreen']);
alxStop($HudHandle[CommandScreen]);
alxPlay(CommandMapDeactivateSound, 0, 0, 0);
$HudHandle['CommandScreen'] = "";
$HudHandle[CommandScreen] = "";
// will reset the control object on this client.. should only be sent
// if this gui is being removed outside of CommanderMapGui::close()
@ -299,9 +313,13 @@ function CommanderMapGui::reset(%this)
// reset waypoints
if(isObject($ClientWaypoints))
$ClientWaypoints.delete();
$ClientWaypoints = new SimGroup();
ServerConnection.add($ClientWaypoints);
// this can be called when not connected to a server
if(isObject(ServerConnection))
{
$ClientWaypoints = new SimGroup();
ServerConnection.add($ClientWaypoints);
}
%this.firstWake = true;
CommanderTree.currentWaypointID = 0;

View file

@ -11,7 +11,8 @@ function MessageBoxOK( %title, %message, %callback )
{
MBOKFrame.setTitle( %title );
MBOKText.setText( "<just:center>" @ %message );
MessageBoxOKDlg.callback = %callback;
//MessageBoxOKDlg.callback = %callback;
MBOKButton.command = %callback SPC "Canvas.popDialog(MessageBoxOKDlg);";
Canvas.pushDialog( MessageBoxOKDlg );
}
@ -33,8 +34,11 @@ function MessageBoxOKCancel( %title, %message, %callback, %cancelCallback )
{
MBOKCancelFrame.setTitle( %title );
MBOKCancelText.setText( "<just:center>" @ %message );
MessageBoxOKCancelDlg.callback = %callback;
MessageBoxOKCancelDlg.cancelCallback = %cancelCallback;
//MessageBoxOKCancelDlg.callback = %callback;
//MessageBoxOKCancelDlg.cancelCallback = %cancelCallback;
MBOKCancelButtonOK.command = %callback SPC "Canvas.popDialog(MessageBoxOKCancelDlg);";
MBOKCancelButtonCancel.command = %cancelCallback SPC "Canvas.popDialog(MessageBoxOKCancelDlg);";
Canvas.pushDialog( MessageBoxOKCancelDlg );
}
@ -56,8 +60,11 @@ function MessageBoxYesNo( %title, %message, %yesCallback, %noCallback )
{
MBYesNoFrame.setTitle( %title );
MBYesNoText.setText( "<just:center>" @ %message );
MessageBoxYesNoDlg.yesCallBack = %yesCallback;
MessageBoxYesNoDlg.noCallback = %noCallBack;
//MessageBoxYesNoDlg.yesCallBack = %yesCallback;
//MessageBoxYesNoDlg.noCallback = %noCallBack;
MBYesNoButtonYes.command = %yesCallback SPC "Canvas.popDialog(MessageBoxYesNoDlg);";
MBYesNoButtonNo.command = %noCallback SPC "Canvas.popDialog(MessageBoxYesNoDlg);";
Canvas.pushDialog( MessageBoxYesNoDlg );
}
@ -112,6 +119,9 @@ function PickTeamDlg::onSleep( %this )
function ShellGetLoadFilename( %title, %fileSpec, %validate, %callback )
{
$loadFileCommand = %callback @ "( getField( LOAD_FileList.getValue(), 0 ) );";
LOAD_FileList.altCommand = $loadFileCommand SPC "Canvas.popDialog(ShellLoadFileDlg);";
LOAD_LoadBtn.command = $loadFileCommand SPC "Canvas.popDialog(ShellLoadFileDlg);";
if ( %title $= "" )
LOAD_Title.setTitle( "LOAD FILE" );
else
@ -157,6 +167,9 @@ function ShellGetSaveFilename( %title, %fileSpec, %validate, %callback, %current
{
SAVE_FileName.setValue( %current );
$saveFileCommand = "if ( SAVE_FileName.getValue() !$= \"\" ) " @ %callback @ "( SAVE_FileName.getValue() );";
SAVE_FileName.altCommand = $saveFileCommand SPC "Canvas.popDialog(ShellSaveFileDlg);";
SAVE_SaveBtn.command = $saveFileCommand SPC "Canvas.popDialog(ShellSaveFileDlg);";
if ( %title $= "" )
SAVE_Title.setTitle( "SAVE FILE" );
else
@ -181,6 +194,7 @@ function SAVE_FileList::onDoubleClick( %this )
%id = %this.getSelectedId();
if ( %this.isRowActive( %id ) )
{
error("D'oh - double clicking is broken for PURE/DEMO executables");
eval( $saveFileCommand );
Canvas.popDialog( ShellSaveFileDlg );
}

View file

@ -914,20 +914,21 @@ moveMap.bind( keyboard, F2, toggleScoreScreen );
// DEMO RECORD FUNCTIONS:
function startRecordingDemo( %val )
{
// if ( %val )
// beginDemoRecord();
error( "** This function has temporarily been disabled! **" );
if ( %val )
beginDemoRecord();
}
function stopRecordingDemo( %val )
{
// if ( %val )
// stopRecord();
error( "** This function has temporarily been disabled! **" );
if ( %val )
stopDemoRecord();
}
//moveMap.bind( keyboard, F3, startRecordingDemo );
//moveMap.bind( keyboard, F4, stopRecordingDemo );
if ( !isDemo() )
{
moveMap.bind( keyboard, F3, startRecordingDemo );
moveMap.bind( keyboard, F4, stopRecordingDemo );
}
//------------------------------------------------------------------------------
// NAV HUD DISPLAY FUNCTIONS:
@ -1033,6 +1034,11 @@ observerMap.bind( keyboard, space, jump );
observerMap.bind( mouse, button0, mouseFire );
observerMap.bind( mouse, button1, mouseJet );
if(!isDemo())
{
observerMap.copyBind(moveMap, startRecordingDemo);
observerMap.copyBind(moveMap, stopRecordingDemo);
}
///////////////////////
// Vehicle Keys
@ -1170,6 +1176,10 @@ function clientCmdSetDefaultVehicleKeys(%inVehicle)
passengerKeys.copyBind( moveMap, fnDeclineTask );
passengerKeys.copyBind( moveMap, fnTaskCompleted );
passengerKeys.copyBind( moveMap, fnResetTaskList );
// grab the demo recorder binds
passengerKeys.copyBind( moveMap, startRecordingDemo );
passengerKeys.copyBind( moveMap, stopRecordingDemo );
}
else if ( isObject( passengerKeys ) )
{

View file

@ -40,7 +40,7 @@ function CreditsGui::onWake(%this)
//build the ML text ctrl...
exec("scripts/creditsText.cs");
if (!isDemo() && !isDemoServer())
if (!isDemo())
{
$CreditsPicIndex = 1;
CREDITS_Pic.setBitmap("gui/Cred_" @ $CreditsPicIndex @ ".png");

View file

@ -338,6 +338,7 @@ addCreditsLine("Bart \"=DB=Seven\" Smith");
addCreditsLine("Ben \"Diox\" May");
addCreditsLine("Ben \"Hypn0tik\" Tamler");
addCreditsLine("Ben \"Stan\" Gray");
addCreditsLine("Bobby \"Mogart\" Rider");
addCreditsLine("Bodhi \"Heliometus Max\" Daher");
addCreditsLine("Brad \"Bort\" Klann");
addCreditsLine("Bret D. \"Bacchus\" Wilson");
@ -1563,116 +1564,11 @@ addCreditsLine("Greg \"Satan\" Romaszka");
addCreditsLine("Steve \"Cpt.Wussie!!!\" Snow");
addCreditsLine("");
addCreditsLine("");
addCreditsLine("<spush><font:Univers condensed:22><spush><color:18A27B>Credits Screen By<spop><spop>");
addCreditsLine("Kidney Thief :)", true);
addCreditsLine("");
addCreditsLine("");
addCreditsLine("");
addCreditsLine("");
addCreditsLine("");
addCreditsLine("<just:center><bitmap:twb/twb_lineup><sbreak>");
addCreditsLine("<spush><font:Univers condensed:26><spush><color:18A27B>So Long, and Thanks For All The Fish.<spop><spop>");
addCreditsLine("<spush><font:Univers condensed:22><spush><color:c0c0c0>Tribes2 Development Team<spop><spop>", true);

View file

@ -372,11 +372,11 @@ datablock SimDataBlock(TankDamageProfile)
shieldDamageScale[$DamageType::Grenade] = 0.8;
shieldDamageScale[$DamageType::Mine] = 3.25;
shieldDamageScale[$DamageType::Missile] = 2.0;
shieldDamageScale[$DamageType::Mortar] = 0.8;
shieldDamageScale[$DamageType::Mortar] = 1.7;
shieldDamageScale[$DamageType::Plasma] = 1.0;
shieldDamageScale[$DamageType::BomberBombs] = 1.5;
shieldDamageScale[$DamageType::TankChaingun] = 1.5;
shieldDamageScale[$DamageType::TankMortar] = 1.4;
shieldDamageScale[$DamageType::TankMortar] = 1.8;
shieldDamageScale[$DamageType::MissileTurret] = 1.25;
shieldDamageScale[$DamageType::MortarTurret] = 1.0;
shieldDamageScale[$DamageType::PlasmaTurret] = 1.25;
@ -401,11 +401,11 @@ datablock SimDataBlock(TankDamageProfile)
damageScale[$DamageType::Grenade] = 1.0;
damageScale[$DamageType::Mine] = 2.25;
damageScale[$DamageType::Missile] = 1.25;
damageScale[$DamageType::Mortar] = 1.0;
damageScale[$DamageType::Mortar] = 1.4;
damageScale[$DamageType::Plasma] = 0.5;
damageScale[$DamageType::BomberBombs] = 1.0;
damageScale[$DamageType::TankChaingun] = 0.75;
damageScale[$DamageType::TankMortar] = 1.0;
damageScale[$DamageType::TankMortar] = 1.6;
damageScale[$DamageType::MissileTurret] = 1.25;
damageScale[$DamageType::MortarTurret] = 1.0;
damageScale[$DamageType::PlasmaTurret] = 1.0;
@ -633,7 +633,7 @@ datablock SimDataBlock(LightPlayerDamageProfile)
damageScale[$DamageType::SentryTurret] = 1.0;
damageScale[$DamageType::Disc] = 1.0;
damageScale[$DamageType::Grenade] = 1.2;
damageScale[$DamageType::Mine] = 1.2;
damageScale[$DamageType::Mine] = 1.0;
damageScale[$DamageType::Missile] = 1.0;
damageScale[$DamageType::Mortar] = 1.3;
damageScale[$DamageType::Plasma] = 1.0;
@ -647,7 +647,7 @@ datablock SimDataBlock(LightPlayerDamageProfile)
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.2;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 1.2;
damageScale[$DamageType::Explosion] = 1.0;
damageScale[$DamageType::Lightning] = 1.0;
};
@ -666,7 +666,7 @@ datablock SimDataBlock(MediumPlayerDamageProfile)
damageScale[$DamageType::SentryTurret] = 1.0;
damageScale[$DamageType::Disc] = 0.8;
damageScale[$DamageType::Grenade] = 1.0;
damageScale[$DamageType::Mine] = 1.0;
damageScale[$DamageType::Mine] = 0.9;
damageScale[$DamageType::Missile] = 0.8;
damageScale[$DamageType::Mortar] = 1.0;
damageScale[$DamageType::Plasma] = 0.65;
@ -680,7 +680,7 @@ datablock SimDataBlock(MediumPlayerDamageProfile)
damageScale[$DamageType::Default] = 1.0;
damageScale[$DamageType::Impact] = 1.0;
damageScale[$DamageType::Ground] = 1.0;
damageScale[$DamageType::Explosion] = 1.0;
damageScale[$DamageType::Explosion] = 0.8;
damageScale[$DamageType::Lightning] = 1.2;
};

View file

@ -208,6 +208,18 @@ $DeathMessageVehicle[2] = '\c0%4 transforms %1 into tribal roadkill.';
$DeathMessageVehicle[3] = '\c0%1 makes a painfully close examination of %4\'s front bumper.';
$DeathMessageVehicle[4] = '\c0%1\'s messy death leaves a mark on %4\'s vehicle finish.';
$DeathMessageVehicleCrashCount = 5;
$DeathMessageVehicleCrash[ $DamageType::Crash, 0 ] = '\c0%1 fails to eject in time.';
$DeathMessageVehicleCrash[ $DamageType::Crash, 1 ] = '\c0%1 becomes one with his vehicle dashboard.';
$DeathMessageVehicleCrash[ $DamageType::Crash, 2 ] = '\c0%1 drives under the influence of death.';
$DeathMessageVehicleCrash[ $DamageType::Crash, 3 ] = '\c0%1 makes a perfect three hundred point landing.';
$DeathMessageVehicleCrash[ $DamageType::Crash, 4 ] = '\c0%1 heroically pilots his vehicle into something really, really hard.';
$DeathMessageVehicleFriendlyCount = 3;
$DeathMessageVehicleFriendly[0] = '\c0%1 gets in the way of a friendly vehicle.';
$DeathMessageVehicleFriendly[1] = '\c0Sadly, a friendly vehicle turns %1 into roadkill.';
$DeathMessageVehicleFriendly[2] = '\c0%1 becomes an unsightly ornament on a team vehicle\'s hood.';
$DeathMessageVehicleUnmannedCount = 3;
$DeathMessageVehicleUnmanned[0] = '\c0%1 gets in the way of a runaway vehicle.';
$DeathMessageVehicleUnmanned[1] = '\c0An unmanned vehicle kills the pathetic %1.';

View file

@ -72,18 +72,19 @@ function FlipFlop::playerTouch(%data, %flipflop, %player)
if(%flipTeam == %client.team)
return false;
%teamName = game.getTeamName(%client.team);
// Let the observers know:
messageTeam( 0, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_taken.wav', %client.name, Game.cleanWord( %flipflop.name ), $TeamName[%client.team] );
messageTeam( 0, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_taken.wav', %client.name, Game.cleanWord( %flipflop.name ), %teamName );
// Let the teammates know:
messageTeam( %client.team, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_taken.wav', %client.name, Game.cleanWord( %flipflop.name ), $TeamName[%client.team] );
messageTeam( %client.team, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_taken.wav', %client.name, Game.cleanWord( %flipflop.name ), %teamName );
// Let the other team know:
%losers = %client.team == 1 ? 2 : 1;
messageTeam( %losers, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_lost.wav', %client.name, Game.cleanWord( %flipflop.name ), $TeamName[%client.team] );
messageTeam( %losers, 'MsgClaimFlipFlop', '\c2%1 claimed %2 for %3.~wfx/misc/flipflop_lost.wav', %client.name, Game.cleanWord( %flipflop.name ), %teamName );
logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") claimed flipflop "@%flipflop@" for team "@%client.team);
//change the skin on the switch to claiming team's logo
setTargetSkin(%flipflop.getTarget(), $teamSkin[%player.team]);
setTargetSkin(%flipflop.getTarget(), game.getTeamSkin(%player.team));
setTargetSensorGroup(%flipflop.getTarget(), %player.team);
// if there is a "projector" associated with this flipflop, put the claiming team's logo there
@ -93,7 +94,8 @@ function FlipFlop::playerTouch(%data, %flipflop, %player)
// axe the old projected holo, if one exists
if(%projector.holo > 0)
%projector.holo.delete();
%newHolo = $holoName[%client.team] @ "Logo";
%newHolo = getTaggedString(game.getTeamSkin(%client.team)) @ "Logo";
%projTransform = %projector.getTransform();
// below two functions are from deployables.cs
@ -387,6 +389,7 @@ function DefaultGame::equip(%game, %player)
{
for(%i =0; %i<$InventoryHudCount; %i++)
%player.client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
%player.client.clearBackpackIcon();
//%player.setArmor("Light");
%player.setInventory(RepairKit,1);
@ -583,6 +586,10 @@ function DefaultGame::gameOver( %game )
messageClient( %client, 'SetScoreHudHeader', "", "" );
messageClient( %client, 'SetScoreHudSubheader', "", "");
messageClient( %client, 'ClearHud', "", 'scoreScreen', 0 );
// clean up the players' HUDs:
%client.setWeaponsHudClearAll();
%client.setInventoryHudClearAll();
}
}
@ -640,9 +647,9 @@ function DefaultGame::sendDebriefing( %game, %client )
// Mission result:
if ( %topCount == 1 )
messageClient( %client, 'MsgDebriefResult', "", '<just:center>Team %1 wins!', $TeamName[%firstTeam] );
messageClient( %client, 'MsgDebriefResult', "", '<just:center>Team %1 wins!', %game.getTeamName(%firstTeam) );
else if ( %topCount == 2 )
messageClient( %client, 'MsgDebriefResult', "", '<just:center>Team %1 and Team %2 tie!', $TeamName[%firstTeam], $TeamName[%secondTeam] );
messageClient( %client, 'MsgDebriefResult', "", '<just:center>Team %1 and Team %2 tie!', %game.getTeamName(%firstTeam), %game.getTeamName(%secondTeam) );
else
messageClient( %client, 'MsgDebriefResult', "", '<just:center>The mission ended in a tie.' );
@ -654,7 +661,7 @@ function DefaultGame::sendDebriefing( %game, %client )
%score = 0;
else
%score = $TeamScore[%team];
messageClient( %client, 'MsgDebriefAddLine', "", '<lmargin:0><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip>', $TeamName[%team], %score );
messageClient( %client, 'MsgDebriefAddLine', "", '<lmargin:0><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip>', %game.getTeamName(%team), %score );
}
// Player scores:
@ -680,7 +687,7 @@ function DefaultGame::sendDebriefing( %game, %client )
%cl = $TeamRank[%highTeam, %count[%highTeam]];
%score = %cl.score $= "" ? 0 : %cl.score;
%kills = %cl.kills $= "" ? 0 : %cl.kills;
messageClient( %client, 'MsgDebriefAddLine', "", '<lmargin:0><clip%%:40> %1</clip><lmargin%%:40><clip%%:30> %2</clip><lmargin%%:70><clip%%:17> %3</clip><lmargin%%:87><clip%%:13> %4</clip>', %cl.name, $TeamName[%cl.team], %score, %kills );
messageClient( %client, 'MsgDebriefAddLine', "", '<lmargin:0><clip%%:40> %1</clip><lmargin%%:40><clip%%:30> %2</clip><lmargin%%:70><clip%%:17> %3</clip><lmargin%%:87><clip%%:13> %4</clip>', %cl.name, %game.getTeamName(%cl.team), %score, %kills );
%count[%highTeam]++;
%notDone = false;
@ -983,13 +990,13 @@ function DefaultGame::forceObserver( %game, %client, %reason )
{
case "playerChoose":
%client.camera.getDataBlock().setMode( %client.camera, "observerFly" );
messageClient(%client, 'MsgClientJoinTeam', '\c2You have become an observer.', %client.name, $teamName[0], %client, 0 );
messageClient(%client, 'MsgClientJoinTeam', '\c2You have become an observer.', %client.name, %game.getTeamName(0), %client, 0 );
logEcho(%client.nameBase@" (cl "@%client@") entered observer mode");
%client.lastTeam = %client.team;
case "AdminForce":
%client.camera.getDataBlock().setMode( %client.camera, "observerFly" );
messageClient(%client, 'MsgClientJoinTeam', '\c2You have been forced into observer mode by the admin.', %client.name, $teamName[0], %client, 0 );
messageClient(%client, 'MsgClientJoinTeam', '\c2You have been forced into observer mode by the admin.', %client.name, %game.getTeamName(0), %client, 0 );
logEcho(%client.nameBase@" (cl "@%client@") was forced into observer mode by admin");
%client.lastTeam = %client.team;
%adminForce = 1;
@ -1013,7 +1020,7 @@ function DefaultGame::forceObserver( %game, %client, %reason )
case "spawnTimeout":
%client.camera.getDataBlock().setMode( %client.camera, "observerTimeout" );
messageClient(%client, 'MsgClientJoinTeam', '\c2You have been placed in observer mode due to delay in respawning.', %client.name, $teamName[0], %client, 0 );
messageClient(%client, 'MsgClientJoinTeam', '\c2You have been placed in observer mode due to delay in respawning.', %client.name, %game.getTeamName(0), %client, 0 );
logEcho(%client.nameBase@" (cl "@%client@") was placed in observer mode due to spawn delay");
// save the team the player was on - only if this was a delay in respawning
%client.lastTeam = %client.team;
@ -1036,9 +1043,9 @@ function DefaultGame::forceObserver( %game, %client, %reason )
// message everyone about this event
if( !%adminForce )
messageAllExcept(%client, -1, 'MsgClientJoinTeam', '\c2%1 has become an observer.', %client.name, $teamName[0], %client, 0 );
messageAllExcept(%client, -1, 'MsgClientJoinTeam', '\c2%1 has become an observer.', %client.name, %game.getTeamName(0), %client, 0 );
else
messageAllExcept(%client, -1, 'MsgClientJoinTeam', '\c2The admin has forced %1 to become an observer.', %client.name, $teamName[0], %client, 0 );
messageAllExcept(%client, -1, 'MsgClientJoinTeam', '\c2The admin has forced %1 to become an observer.', %client.name, %game.getTeamName(0), %client, 0 );
updateCanListenState( %client );
@ -1192,6 +1199,7 @@ function DefaultGame::displayDeathMessages(%game, %clVictim, %clKiller, %damageT
function DefaultGame::assignClientTeam(%game, %client, %respawn )
{
//error("DefaultGame::assignClientTeam");
// this function is overwritten in non-team mission types (e.g. DM)
// so these lines won't do anything
//if(!%game.numTeams)
@ -1246,22 +1254,39 @@ function DefaultGame::assignClientTeam(%game, %client, %respawn )
}
}
else
setTargetSkin( %client.target, $teamSkin[%client.team] );
setTargetSkin( %client.target, %game.getTeamSkin(%client.team) );
//setTargetSkin( %client.target, %client.skin );
// might as well standardize the messages
//messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, $teamName[%leastTeam], %client, %leastTeam );
//messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', $client.name, $teamName[%client.team], %client, %client.team );
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, $teamName[%client.team], %client, %client.team );
messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', %client.name, $teamName[%client.team], %client, %client.team );
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, %game.getTeamName(%client.team), %client, %client.team );
messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', %client.name, %game.getTeamName(%client.team), %client, %client.team );
updateCanListenState( %client );
logEcho(%client.nameBase@" (cl "@%client@") joined team "@%client.team);
}
function DefaultGame::getTeamSkin(%game, %team)
{
//error("DefaultGame::getTeamSkin");
%skin = $teamSkin[%team];
//error("%skin = " SPC getTaggedString(%skin));
return %skin;
}
function DefaultGame::getTeamName(%game, %team)
{
//error("DefaultGame::getTeamName");
%name = $teamName[%team];
//error("name = " SPC getTaggedString(%name));
return %name;
}
function DefaultGame::clientJoinTeam( %game, %client, %team, %respawn )
{
//error("DefaultGame::clientJoinTeam");
if ( %team < 1 || %team > %game.numTeams )
return;
@ -1270,15 +1295,15 @@ function DefaultGame::clientJoinTeam( %game, %client, %team, %respawn )
%client.team = %team;
%client.lastTeam = %team;
setTargetSkin( %client.target, $teamSkin[%team] );
setTargetSkin( %client.target, %game.getTeamSkin(%team) );
setTargetSensorGroup( %client.target, %team );
%client.setSensorGroup( %team );
// Spawn the player:
%game.spawnPlayer( %client, %respawn );
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, $teamName[%team], %client, %team );
messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', $client.name, $teamName[%client.team], %client, %client.team );
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined %2.', %client.name, %game.getTeamName(%team), %client, %team );
messageClient( %client, 'MsgClientJoinTeam', '\c1You joined the %2 team.', $client.name, %game.getTeamName(%client.team), %client, %client.team );
updateCanListenState( %client );
@ -1334,11 +1359,12 @@ function DefaultGame::AIChangeTeam(%game, %client, %newTeam)
}
}
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1bot %1 has switched to team %2.', %client.name, $teamName[%client.team], %client, %client.team );
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1bot %1 has switched to team %2.', %client.name, %game.getTeamName(%client.team), %client, %client.team );
}
function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs)
{
//error("DefaultGame::clientChangeTeam");
//first, remove the client from the team rank array
//the player will be added to the new team array as soon as he respawns...
%game.removeFromTeamRankArray(%client);
@ -1367,7 +1393,7 @@ function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs)
// Set the client's skin:
if (!%client.isAIControlled())
setTargetSkin( %client.target, $teamSkin[%client.team] );
setTargetSkin( %client.target, %game.getTeamSkin(%client.team) );
setTargetSensorGroup( %client.target, %client.team );
%client.setSensorGroup( %client.team );
@ -1389,13 +1415,13 @@ function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs)
if(%fromObs $= "" || !%fromObs)
{
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 switched to team %2.', %client.name, $teamName[%client.team], %client, %client.team );
messageClient( %client, 'MsgClientJoinTeam', '\c1You switched to team %2.', $client.name, $teamName[%client.team], %client, %client.team );
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 switched to team %2.', %client.name, %game.getTeamName(%client.team), %client, %client.team );
messageClient( %client, 'MsgClientJoinTeam', '\c1You switched to team %2.', $client.name, %game.getTeamName(%client.team), %client, %client.team );
}
else
{
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined team %2.', %client.name, $teamName[%team], %client, %team );
messageClient( %client, 'MsgClientJoinTeam', '\c1You joined team %2.', $client.name, $teamName[%client.team], %client, %client.team );
messageAllExcept( %client, -1, 'MsgClientJoinTeam', '\c1%1 joined team %2.', %client.name, %game.getTeamName(%client.team), %client, %team );
messageClient( %client, 'MsgClientJoinTeam', '\c1You joined team %2.', $client.name, %game.getTeamName(%client.team), %client, %client.team );
}
updateCanListenState( %client );
@ -1565,7 +1591,7 @@ function DefaultGame::clientMissionDropReady(%game, %client)
%client.matchStartReady = true;
echo("Client" SPC %client SPC "is ready.");
if ( isDemoServer() )
if ( isDemo() )
{
if ( %client.demoJustJoined )
{
@ -1584,7 +1610,7 @@ function DefaultGame::sendClientTeamList(%game, %client)
if ( %i > 0 )
%teamList = %teamList @ "\n";
%teamList = %teamList @ detag( getTaggedString( $teamName[%i + 1] ) );
%teamList = %teamList @ detag( getTaggedString( %game.getTeamName(%i + 1) ) );
}
messageClient( %client, 'MsgTeamList', "", %teamCount, %teamList );
}
@ -1595,7 +1621,11 @@ function DefaultGame::setupClientHuds(%game, %client)
for(%i =0; %i<$WeaponsHudCount; %i++)
%client.setWeaponsHudBitmap(%i, $WeaponsHudData[%i, itemDataName], $WeaponsHudData[%i, bitmapName]);
for(%i =0; %i<$InventoryHudCount; %i++)
%client.setInventoryHudBitmap($InventoryHudData[%i, slot], $InventoryHudData[%i, itemDataName], $InventoryHudData[%i, bitmapName]);
{
if ( $InventoryHudData[%i, slot] != 0 )
%client.setInventoryHudBitmap($InventoryHudData[%i, slot], $InventoryHudData[%i, itemDataName], $InventoryHudData[%i, bitmapName]);
}
%client.setInventoryHudBitmap( 0, "", "gui/hud_handgren" );
%client.setWeaponsHudBackGroundBmp("gui/hud_new_panel");
%client.setWeaponsHudHighLightBmp("gui/hud_new_weaponselect");
@ -1792,8 +1822,12 @@ function SimGroup::setTeam(%this, %team)
{
// eeck.. please go away when scripts get cleaned...
if(%obj.getDataBlock().getName() $= "StationVehiclePad")
{
%team = %obj.team;
%obj = %obj.station;
%obj.team = %team;
//%obj.teleporter.team = %team;
}
%target = %obj.getTarget();
if(%target != -1)
setTargetSensorGroup(%target, %team);
@ -1967,12 +2001,6 @@ function listplayers()
}
}
function logEcho(%msg)
{
if($LogEchoEnabled)
echo("LOG: " @ %msg);
}
function DefaultGame::clearTeamRankArray(%game, %team)
{
%count = $TeamRank[%team, count];
@ -2041,8 +2069,9 @@ function DefaultGame::removeFromTeamRankArray(%game, %client)
$TeamRank[%team, %j - 1] = %cl;
messageClient(%cl, 'MsgYourRankIs', "", %j);
}
$TeamRank[%team, %count - 1] = "";
//now decriment the team rank array count, and break
//now decrement the team rank array count, and break
$TeamRank[%team, count] = $TeamRank[%team, count] - 1;
break;
}
@ -2412,7 +2441,7 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
else if ( %client.isAdmin )
%outrankTarget = !%targetClient.isAdmin;
if( %client.isSuperAdmin && %targetClient.guid != 0 && !isDemo() && !isDemoServer())
if( %client.isSuperAdmin && %targetClient.guid != 0 && !isDemo() )
{
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "addAdmin", "", 'Add to Server Admin List', 10);
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "addSuperAdmin", "", 'Add to Server SuperAdmin List', 11);
@ -2441,7 +2470,7 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
// regular vote options on players
if ( %game.scheduleVote $= "" && !%isAdmin && !%isTargetAdmin )
{
if ( $Host::allowAdminPlayerVotes && !%isTargetBot && !isDemo() && !isDemoServer())
if ( $Host::allowAdminPlayerVotes && !%isTargetBot && !isDemo() )
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "AdminPlayer", "", 'Vote to Make Admin', 2 );
if ( !%isTargetSelf )
@ -2452,7 +2481,7 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
// Admin only options on players:
else if ( %isAdmin && !isDemo() && !isDemoServer())
else if ( %isAdmin && !isDemo() )
{
if ( !%isTargetBot && !%isTargetAdmin )
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "AdminPlayer", "", 'Make Admin', 2 );
@ -2479,8 +2508,8 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
if ( %isTargetObserver )
{
%action = %isTargetSelf ? "Join " : "Change to ";
%str1 = %action @ getTaggedString( $TeamName[1] );
%str2 = %action @ getTaggedString( $TeamName[2] );
%str1 = %action @ getTaggedString( %game.getTeamName(1) );
%str2 = %action @ getTaggedString( %game.getTeamName(2) );
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ChangeTeam", "", %str1, 6 );
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ChangeTeam", "", %str2, 7 );
@ -2488,7 +2517,7 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
else
{
%changeTo = %targetClient.team == 1 ? 2 : 1;
%str = "Switch to " @ getTaggedString( $TeamName[%changeTo] );
%str = "Switch to " @ getTaggedString( %game.getTeamName(%changeTo) );
%caseId = 5 + %changeTo;
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ChangeTeam", "", %str, %caseId );
@ -2534,7 +2563,7 @@ function DefaultGame::sendGameVoteMenu( %game, %client, %key )
if( !%client.canVote && !%isAdmin )
return;
if (isDemo() || isDemoServer())
if (isDemo())
return;
if ( %game.scheduleVote $= "" )
@ -2612,7 +2641,7 @@ function DefaultGame::sendGameTeamList( %game, %client, %key )
}
for ( %team = 1; %team - 1 < %teamCount; %team++ )
messageClient( %client, 'MsgVoteItem', "", %key, %team, "", detag( getTaggedString( $teamName[%team] ) ) );
messageClient( %client, 'MsgVoteItem', "", %key, %team, "", detag( getTaggedString( %game.getTeamName(%team) ) ) );
}
//------------------------------------------------------------------------------
@ -2625,7 +2654,7 @@ function DefaultGame::sendTimeLimitList( %game, %client, %key )
messageClient( %client, 'MsgVoteItem', "", %key, 30, "", '30 minutes' );
messageClient( %client, 'MsgVoteItem', "", %key, 45, "", '45 minutes' );
messageClient( %client, 'MsgVoteItem', "", %key, 60, "", '60 minutes' );
messageClient( %client, 'MsgVoteItem', "", %key, 999, "", 'No time limit' );
messageClient( %client, 'MsgVoteItem', "", %key, 200, "", 'No time limit' );
}
//------------------------------------------------------------------------------
@ -2874,10 +2903,15 @@ function DefaultGame::voteFFAMode( %game, %admin, %client )
//------------------------------------------------------------------------------
function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit )
{
if( %newLimit == 999 )
%display = "unlimited";
else
%display = %newLimit;
%cause = "";
if ( %admin )
{
messageAll( 'MsgAdminForce', '\c2The Admin changed the mission time limit to %1 minutes.', %newLimit );
messageAll( 'MsgAdminForce', '\c2The Admin changed the mission time limit to %1 minutes.', %display );
$Host::TimeLimit = %newLimit;
%cause = "(admin)";
}
@ -2886,7 +2920,7 @@ function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit )
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100))
{
messageAll('MsgVotePassed', '\c2The mission time limit was set to %1 minutes by vote.', %newLimit);
messageAll('MsgVotePassed', '\c2The mission time limit was set to %1 minutes by vote.', %display);
$Host::TimeLimit = %newLimit;
%cause = "(vote)";
}
@ -2897,7 +2931,7 @@ function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit )
//if the time limit was actually changed...
if(%cause !$= "")
{
logEcho("time limit set to "@%newLimit SPC %cause);
logEcho("time limit set to "@%display SPC %cause);
//if the match has been started, reset the end of match countdown
if ($matchStarted)
@ -2905,9 +2939,10 @@ function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit )
//schedule the end of match countdown
%elapsedTimeMS = getSimTime() - $missionStartTime;
%curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) - %elapsedTimeMS;
//error("time limit="@$Host::TimeLimit@", elapsed="@(%elapsedTimeMS / 60000)@", curtimeleftms="@%curTimeLeftMS);
error("time limit="@$Host::TimeLimit@", elapsed="@(%elapsedTimeMS / 60000)@", curtimeleftms="@%curTimeLeftMS);
CancelEndCountdown();
EndCountdown(%curTimeLeftMS);
cancel(%game.timeSync);
%game.checkTimeLimit(true);
}
}
@ -2952,7 +2987,7 @@ function DefaultGame::voteKickPlayer(%game, %admin, %client)
}
else
{
//%team = %client.team;
%team = %client.team;
%totalVotes = %game.votesFor[%game.kickTeam] + %game.votesAgainst[%game.kickTeam];
if(%totalVotes > 0 && (%game.votesFor[%game.kickTeam] / %totalVotes) > ($Host::VotePasspercent / 100))
{
@ -2960,7 +2995,15 @@ function DefaultGame::voteKickPlayer(%game, %admin, %client)
%cause = "(vote)";
}
else
messageAll('MsgVoteFailed', '\c2Kick player vote did not pass');
{
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
{
%cl = ClientGroup.getObject( %idx );
if (%cl.team == %game.kickTeam && !%cl.isAIControlled())
messageClient( %cl, 'MsgVoteFailed', '\c2Kick player vote did not pass' );
}
}
}
%game.kickTeam = "";
@ -3021,8 +3064,13 @@ function DefaultGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4
if ((%client.team == 0) && isObject(%targetClient) && (%targetClient.team != 0))
{
%prevObsClient = %client.observeClient;
// update the observer list for this client
observerFollowUpdate( %client, %targetClient, %prevObsClient !$= "" );
serverCmdObserveClient(%client, %targetClient);
displayObserverHud(%client, %targetClient);
if (%targetClient != %prevObsClient)
{
messageClient(%targetClient, 'Observer', '\c1%1 is now observing you.', %client.name);
@ -3039,7 +3087,7 @@ function DefaultGame::updateScoreHud(%game, %client, %tag)
{
// Send header:
messageClient( %client, 'SetScoreHudHeader', "", '<tab:15,315>\t%1<rmargin:260><just:right>%2<rmargin:560><just:left>\t%3<just:right>%4',
$TeamName[1], $TeamScore[1], $TeamName[2], $TeamScore[2] );
%game.getTeamName(1), $TeamScore[1], %game.getTeamName(2), $TeamScore[2] );
// Send subheader:
messageClient( %client, 'SetScoreHudSubheader', "", '<tab:15,315>\tPLAYERS (%1)<rmargin:260><just:right>SCORE<rmargin:560><just:left>\tPLAYERS (%2)<just:right>SCORE',
@ -3048,27 +3096,46 @@ function DefaultGame::updateScoreHud(%game, %client, %tag)
%index = 0;
while ( true )
{
if ( %index >= $TeamRank[1, count] && %index >= $TeamRank[2, count] )
if ( %index >= $TeamRank[1, count]+2 && %index >= $TeamRank[2, count]+2 )
break;
//get the team1 client info
%team1Client = "";
%team1ClientScore = "";
%col1Style = "";
if ( %index < $TeamRank[1, count] )
{
%team1Client = $TeamRank[1, %index];
%team1ClientScore = %team1Client.score $= "" ? 0 : %team1Client.score;
%col1Style = %team1Client == %client ? "<color:dcdcdc>" : "";
%team1playersTotalScore += %team1Client.score;
}
else if( %index == $teamRank[1, count] && $teamRank[1, count] != 0 && !isDemo() && %game.class $= "CTFGame")
{
%team1ClientScore = "--------------";
}
else if( %index == $teamRank[1, count]+1 && $teamRank[1, count] != 0 && !isDemo() && %game.class $= "CTFGame")
{
%team1ClientScore = %team1playersTotalScore != 0 ? %team1playersTotalScore : 0;
}
//get the team2 client info
%team2Client = "";
%team2ClientScore = "";
%col2Style = "";
if ( %index < $TeamRank[2, count] )
{
%team2Client = $TeamRank[2, %index];
%team2ClientScore = %team2Client.score $= "" ? 0 : %team2Client.score;
%col2Style = %team2Client == %client ? "<color:dcdcdc>" : "";
%team2playersTotalScore += %team2Client.score;
}
else if( %index == $teamRank[2, count] && $teamRank[2, count] != 0 && !isDemo() && %game.class $= "CTFGame")
{
%team2ClientScore = "--------------";
}
else if( %index == $teamRank[2, count]+1 && $teamRank[2, count] != 0 && !isDemo() && %game.class $= "CTFGame")
{
%team2ClientScore = %team2playersTotalScore != 0 ? %team2playersTotalScore : 0;
}
//if the client is not an observer, send the message
@ -3276,7 +3343,7 @@ function DefaultGame::getServerStatusString(%game)
for ( %team = 1; %team - 1 < %game.numTeams; %team++ )
{
%score = isObject( $teamScore[%team] ) ? $teamScore[%team] : 0;
%teamStr = getTaggedString( $teamName[%team] ) TAB %score;
%teamStr = getTaggedString( %game.getTeamName(%team) ) TAB %score;
%status = %status NL %teamStr;
}
@ -3285,7 +3352,7 @@ function DefaultGame::getServerStatusString(%game)
{
%cl = ClientGroup.getObject( %i );
%score = %cl.score $= "" ? 0 : %cl.score;
%playerStr = getTaggedString( %cl.name ) TAB getTaggedString( $teamName[%cl.team] ) TAB %score;
%playerStr = getTaggedString( %cl.name ) TAB getTaggedString( %game.getTeamName(%cl.team) ) TAB %score;
%status = %status NL %playerStr;
}
return( %status );
@ -3297,3 +3364,7 @@ function DefaultGame::OptionsDlgSleep( %game )
// ignore in the default game...
}
//------------------------------------------------------------------------------
function DefaultGame::endMission( %game )
{
}

View file

@ -38,6 +38,37 @@ $NotDeployableReason::InventoryTooClose = 11;
$MinDeployableDistance = 2.5;
$MaxDeployableDistance = 5.0; //meters from body
// --------------------------------------------
// effect datablocks
// --------------------------------------------
datablock EffectProfile(TurretDeployEffect)
{
effectname = "packs/generic_deploy";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(SensorDeployEffect)
{
effectname = "powered/sensor_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(MotionSensorDeployEffect)
{
effectname = "powered/motion_sensor_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(StationDeployEffect)
{
effectname = "packs/inventory_deploy";
minDistance = 2.5;
maxDistance = 5.0;
};
// --------------------------------------------
// sound datablocks
@ -48,6 +79,7 @@ datablock AudioProfile(TurretDeploySound)
fileName = "fx/packs/turret_place.wav";
description = AudioClose3d;
preload = true;
effect = TurretDeployEffect;
};
datablock AudioProfile(SensorDeploySound)
@ -55,6 +87,8 @@ datablock AudioProfile(SensorDeploySound)
fileName = "fx/powered/sensor_activate.wav";
description = AudioClose3d;
preload = true;
effect = SensorDeployEffect;
effect = MotionSensorDeployEffect;
};
datablock AudioProfile(MotionSensorDeploySound)
@ -69,6 +103,7 @@ datablock AudioProfile(StationDeploySound)
fileName = "fx/packs/inventory_deploy.wav";
description = AudioClose3d;
preload = true;
effect = StationDeployEffect;
};
// --------------------------------------------
@ -562,12 +597,13 @@ function ShapeBaseImageData::testSelfTooClose(%item, %plyr)
//-------------------------------------------------
function ShapeBaseImageData::testObjectTooClose(%item)
{
InitContainerRadiusSearch( %item.surfacePt, $MinDeployDistance,
$TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType |
$TypeMasks::StaticShapeObjectType | $TypeMasks::StaticTSObjectType |
%mask = ($TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType |
$TypeMasks::StaticShapeObjectType |
$TypeMasks::ForceFieldObjectType | $TypeMasks::ItemObjectType |
$TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType);
InitContainerRadiusSearch( %item.surfacePt, $MinDeployDistance, %mask );
%test = containerSearchNext();
return %test;
}

View file

@ -0,0 +1,17 @@
//-------------------------------------- Desert interior texture property mapping
addMaterialMapping("desert/cp_ichute01", "environment: special/chuteTexture 0.25");
addMaterialMapping("desert/cp_ichute02", "environment: special/chuteTexture 0.25");
//"Color: red green blue startAlpha endAlpha"
//Soft sound = 0
//Hard sound = 1
//Metal sound = 2
//Snow sound = 3
addMaterialMapping("terrain/DesertWorld.RockFractured", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/DesertWorld.RockSmooth", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/DesertWorld.Sand", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/DesertWorld.SandBrun", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/DesertWorld.SandDark", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/DesertWorld.SandOrange", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/DesertWorld.SandOxidized", "color: 0.35 0.2 0.05 0.7 0.0", "sound: 0");

View file

@ -2,7 +2,18 @@
function GameBaseData::onAdd(%data, %obj)
{
if(%data.targetTypeTag !$= "")
%obj.target = createTarget(%obj, %data.targetNameTag, "", "", %data.targetTypeTag, 0, 0);
{
// 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;
}
@ -13,7 +24,11 @@ function GameBaseData::onRemove(%data, %obj)
// first 32 targets are team targets
if(%target >= 32)
{
if(%obj.nameTag !$= "")
removeTaggedString(%obj.nameTag);
freeTarget(%target);
}
}
function InteriorInstance::damage()

View file

@ -1,84 +1,3 @@
// function createObserverMoveMap()
// {
// if ( isObject( flyingCameraMove ) )
// flyingCameraMove.delete();
//
// new ActionMap( flyingCameraMove );
// flyingCameraMove.bind( keyboard, s, moveleft );
// flyingCameraMove.bind( keyboard, f, moveright );
// flyingCameraMove.bind( keyboard, e, moveforward );
// flyingCameraMove.bind( keyboard, d, movebackward );
// flyingCameraMove.bind( keyboard, t, moveup );
// flyingCameraMove.bind( keyboard, b, movedown );
//
// // allow hud activation
// flyingCameraMove.copyBind( moveMap, toggleScoreScreen );
// flyingCameraMove.copyBind( moveMap, toggleCommanderMap );
// flyingCameraMove.copyBind( moveMap, TeamMessageHud );
// flyingCameraMove.copyBind( moveMap, toggleMessageHud );
// flyingCameraMove.copyBind( moveMap, toggleInventoryHud );
// flyingCameraMove.copyBind( moveMap, voteYes );
// flyingCameraMove.copyBind( moveMap, voteNo );
// flyingCameraMove.copyBind( moveMap, activateChatMenuHud );
//
// // Bind the command assignment/response keys as well:
// flyingCameraMove.copyBind( moveMap, toggleTaskListDlg );
// flyingCameraMove.copyBind( moveMap, fnAcceptTask );
// flyingCameraMove.copyBind( moveMap, fnDeclineTask );
// flyingCameraMove.copyBind( moveMap, fnTaskCompleted );
// flyingCameraMove.copyBind( moveMap, fnResetTaskList );
//
// // misc
// flyingCameraMove.copyBind( moveMap, voiceCapture );
//
// // inventory binds
// flyingCameraMove.copyBind( moveMap, toggleInventoryHud );
// flyingCameraMove.copyBind( moveMap, selectFavorite1 );
// flyingCameraMove.copyBind( moveMap, selectFavorite2 );
// flyingCameraMove.copyBind( moveMap, selectFavorite3 );
// flyingCameraMove.copyBind( moveMap, selectFavorite4 );
// flyingCameraMove.copyBind( moveMap, selectFavorite5 );
// flyingCameraMove.copyBind( moveMap, selectFavorite6 );
// flyingCameraMove.copyBind( moveMap, selectFavorite7 );
// flyingCameraMove.copyBind( moveMap, selectFavorite8 );
// flyingCameraMove.copyBind( moveMap, selectFavorite9 );
// flyingCameraMove.copyBind( moveMap, selectFavorite10 );
//
// flyingCameraMove.copyBind( moveMap, selectFavorite11 );
// flyingCameraMove.copyBind( moveMap, selectFavorite12 );
// flyingCameraMove.copyBind( moveMap, selectFavorite13 );
// flyingCameraMove.copyBind( moveMap, selectFavorite14 );
// flyingCameraMove.copyBind( moveMap, selectFavorite15 );
// flyingCameraMove.copyBind( moveMap, selectFavorite16 );
// flyingCameraMove.copyBind( moveMap, selectFavorite17 );
// flyingCameraMove.copyBind( moveMap, selectFavorite18 );
// flyingCameraMove.copyBind( moveMap, selectFavorite19 );
// flyingCameraMove.copyBind( moveMap, selectFavorite20 );
//
// flyingCameraMove.copyBind( moveMap, quickPackEnergyPack );
// flyingCameraMove.copyBind( moveMap, quickPackRepairPack );
// flyingCameraMove.copyBind( moveMap, quickPackShieldPack );
// flyingCameraMove.copyBind( moveMap, quickPackCloakPack );
// flyingCameraMove.copyBind( moveMap, quickPackJammerPack );
// flyingCameraMove.copyBind( moveMap, quickPackAmmoPack );
// flyingCameraMove.copyBind( moveMap, quickPackSatchelCharge );
// flyingCameraMove.copyBind( moveMap, quickPackDeployableStation );
// flyingCameraMove.copyBind( moveMap, quickPackIndoorTurret );
// flyingCameraMove.copyBind( moveMap, quickPackOutdoorTurret );
// flyingCameraMove.copyBind( moveMap, quickPackMotionSensor );
// flyingCameraMove.copyBind( moveMap, quickPackPulse );
//
// //preserve the fire, jump, and jet buttons
// flyingCameraMove.copyBind( moveMap, mouseFire );
// flyingCameraMove.copyBind( moveMap, mouseJet );
// flyingCameraMove.copyBind( moveMap, jump );
// flyingCameraMove.copyBind( moveMap, yaw );
// flyingCameraMove.copyBind( moveMap, pitch );
//
// flyingCameraMove.bindCmd( keyboard, escape, "", "escapeFromGame();" );
// }
// createObserverMoveMap();
//--------------------------------------------------------------------------
function GameConnection::sensorPing(%this, %ping)
{
@ -121,17 +40,6 @@ function clientCmdResetHud()
sensorHud.update();
}
//--------------------------------------------------------------------------
function GameConnection::syncHudClock(%client, %time)
{
commandToClient(%client, 'syncHudClock', %time);
}
function clientCmdSyncHudClock(%time)
{
clockHud.setTime(%time);
}
//--------------------------------------------------------------------------
$vehicleReticle[AssaultVehicle, 1, bitmap] = "gui/hud_ret_tankchaingun";
$vehicleReticle[AssaultVehicle, 1, frame] = true;
@ -377,11 +285,6 @@ function clientCmdSetWeaponsHudClearAll()
weaponsHud.clearAll();
}
function GameConnection::clearBackpackIcon(%client)
{
commandToClient(%client, 'setBackpackHudItem', 0, 0);
}
//----------------------------------------------------------------------------
// Ammo Hud
//----------------------------------------------------------------------------
@ -439,8 +342,15 @@ $BackpackHudData[16, itemDataName] = "ELFBarrelPack";
$BackpackHudData[16, bitmapName] = "gui/hud_new_packturret";
$BackpackHudData[17, itemDataName] = "MortarBarrelPack";
$BackpackHudData[17, bitmapName] = "gui/hud_new_packturret";
$BackpackHudData[18, itemDataName] = "SatchelUnarmed";
$BackpackHudData[18, bitmapName] = "gui/hud_satchel_unarmed";
$BackpackHudCount = 18;
$BackpackHudCount = 20;
function GameConnection::clearBackpackIcon(%client)
{
commandToClient(%client, 'setBackpackHudItem', 0, 0);
}
function GameConnection::setBackpackHudItem(%client, %name, %addItem)
{
@ -456,7 +366,7 @@ function clientCmdSetBackpackHudItem(%num, %addItem)
backpackIcon.setBitmap($BackpackHudData[%num, bitmapName]);
backpackFrame.setVisible(true);
backpackIcon.setVisible(true);
backpackFrame.pack = true;
backpackFrame.pack = true;
}
else
{
@ -464,7 +374,7 @@ function clientCmdSetBackpackHudItem(%num, %addItem)
backpackFrame.setVisible(false);
backpackText.setValue("");
backpackText.setVisible(false);
backpackFrame.pack = false;
backpackFrame.pack = false;
}
}
@ -482,6 +392,53 @@ function clientCmdUpdatePackText(%num)
backpackText.setVisible(true);
}
// Pack Icons Activate / Deactivate
function clientCmdSetSatchelArmed()
{
backpackIcon.setBitmap( "gui/hud_satchel_armed" );
}
function clientCmdsetCloakIconOn()
{
backpackIcon.setBitmap( "gui/hud_new_packcloak_armed" );
}
function clientCmdsetCloakIconOff()
{
backpackIcon.setBitmap( "gui/hud_new_packcloak" );
}
function clientCmdsetRepairPackIconOn()
{
backpackIcon.setBitmap( "gui/hud_new_packrepair_armed" );
}
function clientCmdsetRepairPackIconOff()
{
backpackIcon.setBitmap( "gui/hud_new_packrepair" );
}
function clientCmdsetShieldIconOn()
{
backpackIcon.setBitmap( "gui/hud_new_packshield_armed" );
}
function clientCmdsetShieldIconOff()
{
backpackIcon.setBitmap( "gui/hud_new_packshield" );
}
function clientCmdsetSenJamIconOn()
{
backpackIcon.setBitmap( "gui/hud_new_packsensjam_armed" );
}
function clientCmdsetSenJamIconOff()
{
backpackIcon.setBitmap( "gui/hud_new_packsensjam" );
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
$InventoryHudData[0, bitmapName] = "gui/hud_handgren";
@ -496,11 +453,11 @@ $InventoryHudData[2, bitmapName] = "gui/hud_medpack";
$InventoryHudData[2, itemDataName] = RepairKit;
$InventoryHudData[2, ammoDataName] = RepairKit;
$InventoryHudData[2, slot] = 3;
$InventoryHudData[3, bitmapName] = "gui/hud_handgren";
$InventoryHudData[3, bitmapName] = "gui/hud_whiteout_gren";
$InventoryHudData[3, itemDataName] = FlashGrenade;
$InventoryHudData[3, ammoDataName] = FlashGrenade;
$InventoryHudData[3, slot] = 0;
$InventoryHudData[4, bitmapName] = "gui/hud_handgren";
$InventoryHudData[4, bitmapName] = "gui/hud_concuss_gren";
$InventoryHudData[4, itemDataName] = ConcussionGrenade;
$InventoryHudData[4, ammoDataName] = ConcussionGrenade;
$InventoryHudData[4, slot] = 0;
@ -519,6 +476,7 @@ $InventoryHudData[7, slot] = 2;
$InventoryHudCount = 8;
//----------------------------------------------------------------------------
// Inventory Hud
//----------------------------------------------------------------------------
@ -596,11 +554,13 @@ function GameConnection::setInventoryHudClearAll(%client)
function clientCmdSetInventoryHudClearAll()
{
inventoryHud.clearAll();
backpackIcon.setBitmap("");
backpackFrame.setVisible(false);
backpackIcon.setBitmap( "" );
backpackFrame.setVisible( false );
backpackText.setValue( "" );
backpackText.setVisible(false);
backpackFrame.pack = false;
}
//----------------------------------------------------------------------------
// MessageHud
function MessageHud::open(%this)
@ -924,9 +884,9 @@ function setControlObjectReticle(%type)
function updateActionMaps()
{
//pop the action maps...
if (isObject(moveMap))
if ( isObject( moveMap ) )
moveMap.pop();
if (isObject(passengerKeys))
if ( isObject( passengerKeys ) )
passengerKeys.pop();
if ( isObject( observerBlockMap ) )
observerBlockMap.pop();
@ -934,6 +894,8 @@ function updateActionMaps()
observerMap.pop();
if ( isObject( pickTeamMap ) )
pickTeamMap.pop();
if ( isObject( halftimeMap ) )
halftimeMap.delete();
//if (isObject(flyingCameraMove))
// flyingCameraMove.pop();
@ -978,6 +940,18 @@ function updateActionMaps()
new ActionMap( pickTeamMap );
pickTeamMap.copyBind( moveMap, toggleMessageHud );
pickTeamMap.push();
case "SiegeHalftime":
new ActionMap( halftimeMap );
halftimeMap.bindCmd( keyboard, escape, "", "escapeFromGame();" );
halftimeMap.copyBind( moveMap, toggleMessageHud );
halftimeMap.copyBind( moveMap, teamMessageHud );
halftimeMap.copyBind( moveMap, activateChatMenuHud );
halftimeMap.copyBind( moveMap, resizeChatHud );
halftimeMap.copyBind( moveMap, pageMessageHudUp );
halftimeMap.copyBind( moveMap, pageMessageHudDown );
halftimeMap.copyBind( moveMap, voiceCapture );
halftimeMap.push();
//case 'Standard':
default:
@ -993,10 +967,10 @@ function ClientCmdDisplayHuds()
// only update action maps if playGui is current content
%content = Canvas.getContent();
if(isObject(%content) && (%content.getName() $= "PlayGui"))
{
%PlayGuiActive = isObject(%content) && ( %content.getName() $= "PlayGui" );
if ( %PlayGuiActive )
updateActionMaps();
}
ammoHud.setVisible(false);
objectiveHud.setVisible(false);
inventoryHud.setVisible(false);
@ -1007,13 +981,17 @@ function ClientCmdDisplayHuds()
outerChatHud.setVisible(false);
clockHud.setVisible(false);
controlObjectText.setVisible(false);
siegeHalftimeHud.setVisible(false);
clientCmdToggleDashHud(false);
%hideCursor = true;
switch$ ($HudMode)
{
case "Pilot":
clientCmdShowVehicleGauges($HudModeType, $HudModeNode);
clientCmdToggleDashHud(true);
objectiveHud.setVisible(true);
dashBoardHud.setposition(0, 0);
retCenterHud.setVisible(true);
HudClusterBack.setVisible(true);
outerChatHud.setVisible(true);
@ -1022,6 +1000,8 @@ function ClientCmdDisplayHuds()
case "Passenger":
clientCmdShowVehicleGauges($HudModeType, $HudModeNode);
clientCmdToggleDashHud(true);
objectiveHud.setVisible(true);
dashBoardHud.setPosition(0, 0);
ammoHud.setVisible(true);
objectiveHud.setVisible(true);
inventoryHud.setVisible(true);
@ -1048,6 +1028,15 @@ function ClientCmdDisplayHuds()
outerChatHud.setVisible(true);
clockHud.setVisible(true);
case "SiegeHalftime":
closeHud( "", "", 'scoreScreen' );
closeHud( "", "", 'inventoryScreen' );
closeHud( "", "", 'vehicleHud' );
objectiveHud.setVisible(true);
outerChatHud.setVisible(true);
siegeHalftimeHud.setVisible(true);
%hideCursor = false;
case "PickTeam":
ammoHud.setVisible(false);
objectiveHud.setVisible(false);
@ -1079,6 +1068,53 @@ function ClientCmdDisplayHuds()
mainVoteHud.setVisible(0);
}
if ( PlayGui.hideCursor != %hideCursor )
{
PlayGui.hideCursor = %hideCursor;
if ( %PlayGuiActive )
Canvas.updateCursorState();
}
}
function dashboardHud::onResize(%this, %width, %height)
{
%currentWidth = getWord(dashboardHud.getPosition(), 0);
%currentHeight = getWord(dashboardHud.getPosition(), 1);
%screenWidth = getWord(getResolution(), 0);
%screenHeight = getWord(getResolution(), 1);
switch$ ($HudMode)
{
case "Pilot":
if(%screenHeight <= 480)
{
if($HudModeNode == 0)
{ %xVal = 0; %yVal = 339; }
else
{ %xVal = 0; %yVal = 320; }
}
else if(%screenHeight <= 600)
{
if($HudModeNode == 0)
{ %xVal = 80; %yVal = 455; }
else
{ %xVal = 80; %yVal = 440; }
}
else
{
%xVal = (%screenWidth - 640) / 2;
%yVal = (%screenheight - 480) + 360;
}
case "Passenger":
%xVal = (%screenWidth - 640) / 2;
%yVal = (%screenheight - 480) + 360;
}
if(%currentWidth != %xVal || %currentHeight != %yVal)
dashBoardHud.setPosition(%xVal, %yVal);
}
function clientcmdTogglePlayHuds(%val)
@ -1232,16 +1268,19 @@ function clearHud(%msgType, %msgString, %tag, %a0)
%height = 0;
%guiCtrl = $Hud[%tag].childGui;
//set the new extent to be the position + extent of the last element...
%height = 0;
if (%guiCtrl.getCount() > 0)
if(isObject(%guiCtrl))
{
%lastCtrl = %guiCtrl.getObject(%guiCtrl.getCount() - 1);
%height = getWord(%lastCtrl.position, 1) + getWord(%lastCtrl.extent, 1);
}
//set the new extent to be the position + extent of the last element...
%height = 0;
if (%guiCtrl.getCount() > 0)
{
%lastCtrl = %guiCtrl.getObject(%guiCtrl.getCount() - 1);
%height = getWord(%lastCtrl.position, 1) + getWord(%lastCtrl.extent, 1);
}
//now reset the extent
%guiCtrl.resize(getWord(%guiCtrl.position, 0), getWord(%guiCtrl.position, 1), getWord(%guiCtrl.extent, 0), %height);
//now reset the extent
%guiCtrl.resize(getWord(%guiCtrl.position, 0), getWord(%guiCtrl.position, 1), getWord(%guiCtrl.extent, 0), %height);
}
}
}

View file

@ -0,0 +1,15 @@
//-------------------------------------- Desert interior texture property mapping
addMaterialMapping("ice/sw_ichute01", "environment: special/chuteTexture 0.25");
addMaterialMapping("ice/sw_ichute02", "environment: special/chuteTexture 0.25");
//"Color: red green blue startAlpha endAlpha"
//Soft sound = 0
//Hard sound = 1
//Metal sound = 2
//Snow sound = 3
addMaterialMapping("terrain/IceWorld.Ice", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3");
addMaterialMapping("terrain/IceWorld.RockBlue", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3");
addMaterialMapping("terrain/IceWorld.Snow", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3");
addMaterialMapping("terrain/IceWorld.SnowIce", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3");
addMaterialMapping("terrain/IceWorld.SnowRock", "color: 0.9 0.9 0.9 0.4 0.0", "sound: 3");

View file

@ -125,6 +125,9 @@ function ShapeBase::throwPack(%this)
function ShapeBase::throw(%this,%data)
{
if(!isObject(%data))
return false;
if (%this.inv[%data.getName()] > 0) {
// save off the ammo count on this item

View file

@ -507,6 +507,7 @@ function buyFavorites(%client)
%client.player.setDamageLevel(%curDmgPct * %newArmor.maxDamage);
%weaponCount = 0;
// weapons
for(%i = 0; %i < getFieldCount( %client.weaponIndex ); %i++)
{
@ -565,7 +566,12 @@ function buyFavorites(%client)
// grenades
for ( %i = 0; %i < getFieldCount( %client.grenadeIndex ); %i++ )
%client.player.setInventory( $NameToInv[%client.favorites[getField( %client.grenadeIndex,%i )]], 30 );
{
if ( !($InvBanList[%cmt, $NameToInv[%client.favorites[getField( %client.grenadeIndex, %i )]]]) )
%client.player.setInventory( $NameToInv[%client.favorites[getField( %client.grenadeIndex,%i )]], 30 );
}
%client.player.lastGrenade = $NameToInv[%client.favorites[getField( %client.grenadeIndex,%i )]];
// if player is buying cameras, show how many are already deployed
if(%client.favorites[%client.grenadeIndex] $= "Deployable Camera")
@ -640,8 +646,10 @@ function buyDeployableFavorites(%client)
for ( %i = 0; %i < getFieldCount( %client.grenadeIndex ); %i++)
{
%GInv = $NameToInv[%client.favorites[getField( %client.grenadeIndex, %i )]];
%client.player.lastGrenade = %GInv;
if ( !($InvBanList[DeployInv, %GInv]) )
%player.setInventory( %GInv, 30 );
}
// if player is buying cameras, show how many are already deployed
@ -706,6 +714,81 @@ function buyDeployableFavorites(%client)
invAmmoPackPass(%client);
}
//-------------------------------------------------------------------------------------
function getAmmoStationLovin(%client)
{
//error("Much ammo station lovin applied");
%cmt = $CurrentMissionType;
// weapons
for(%i = 0; %i < %client.player.weaponSlotCount; %i++)
{
%weapon = %client.player.weaponSlot[%i];
switch$ ( %weapon )
{
case Plasma:
%client.player.setInventory( PlasmaAmmo, 400 );
case Disc:
%client.player.setInventory( DiscAmmo, 400 );
case GrenadeLauncher:
%client.player.setInventory( GrenadeLauncherAmmo, 400 );
case Mortar:
%client.player.setInventory( MortarAmmo, 400 );
case MissileLauncher:
%client.player.setInventory( MissileLauncherAmmo, 400 );
case Chaingun:
%client.player.setInventory( ChaingunAmmo, 400 );
}
}
// miscellaneous stuff -- Repair Kit, Beacons, Targeting Laser
if ( !($InvBanList[%cmt, RepairKit]) )
%client.player.setInventory( RepairKit, 1 );
if ( !($InvBanList[%cmt, Beacon]) )
%client.player.setInventory( Beacon, 400 );
if ( !($InvBanList[%cmt, TargetingLaser]) )
%client.player.setInventory( TargetingLaser, 1 );
// Do we want to allow mines? Ammo stations in T1 didnt dispense mines.
// if ( !($InvBanList[%cmt, Mine]) )
// %client.player.setInventory( Mine, 400 );
// grenades
// we need to get rid of any grenades the player may have picked up
%client.player.setInventory( Grenade, 0 );
%client.player.setInventory( ConcussionGrenade, 0 );
%client.player.setInventory( CameraGrenade, 0 );
%client.player.setInventory( FlashGrenade, 0 );
%client.player.setInventory( FlareGrenade, 0 );
// player should get the last type they purchased
%grenType = %client.player.lastGrenade;
// if the player hasnt been to a station they get regular grenades
if(%grenType $= "")
{
//error("no gren type, using default...");
%grenType = Grenade;
}
if ( !($InvBanList[%cmt, %grenType]) )
%client.player.setInventory( %grenType, 30 );
// if player is buying cameras, show how many are already deployed
if(%grenType $= "Deployable Camera")
{
%maxDep = $TeamDeployableMax[DeployedCamera];
%depSoFar = $TeamDeployedCount[%client.player.team, DeployedCamera];
if(Game.numTeams > 1)
%msTxt = "Your team has "@%depSoFar@" of "@%maxDep@" Deployable Cameras placed.";
else
%msTxt = "You have placed "@%depSoFar@" of "@%maxDep@" Deployable Cameras.";
messageClient(%client, 'MsgTeamDepObjCount', %msTxt);
}
if( %client.player.getMountedImage($BackpackSlot) $= "AmmoPack" )
invAmmoPackPass(%client);
}
function invAmmoPackPass(%client)
{
// "normal" ammo stuff (everything but mines and grenades)
@ -944,10 +1027,10 @@ function getArmorDatablock(%client, %size)
//------------------------------------------------------------------------------
function InventoryScreen::onWake(%this)
{
if ( $HudHandle['inventoryScreen'] !$= "" )
alxStop( $HudHandle['inventoryScreen'] );
if ( $HudHandle[inventoryScreen] !$= "" )
alxStop( $HudHandle[inventoryScreen] );
alxPlay(HudInventoryActivateSound, 0, 0, 0);
$HudHandle['inventoryScreen'] = alxPlay(HudInventoryHumSound, 0, 0, 0);
$HudHandle[inventoryScreen] = alxPlay(HudInventoryHumSound, 0, 0, 0);
if ( isObject( hudMap ) )
{
@ -966,9 +1049,9 @@ function InventoryScreen::onSleep()
{
hudMap.pop();
hudMap.delete();
alxStop($HudHandle['inventoryScreen']);
alxStop($HudHandle[inventoryScreen]);
alxPlay(HudInventoryDeactivateSound, 0, 0, 0);
$HudHandle['inventoryScreen'] = "";
$HudHandle[inventoryScreen] = "";
}
//------------------------------------------------------------------------------

View file

@ -79,10 +79,18 @@ datablock AudioProfile(ItemPickupSound)
preload = true;
};
datablock EffectProfile(ItemThrowEffect)
{
effectname = "packs/packs.throwpack";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(ItemThrowSound)
{
filename = "fx/packs/packs.throwpack.wav";
description = AudioClosest3d;
effect = ItemThrowEffect;
preload = true;
};
@ -540,21 +548,6 @@ function getVector(%string, %num)
// explosion datablock
// --------------------------------------------
datablock EffectProfile(DeployableExplosionEffect)
{
effectname = "explosions/explosion.xpl10";
minDistance = 10;
maxDistance = 50;
};
datablock AudioProfile(DeployablesExplosionSound)
{
filename = "fx/explosions/deployables_explosion.wav";
description = AudioExplosion3d;
preload = true;
effect = DeployableExplosionEffect;
};
datablock ExplosionData(DeployablesExplosion)
{
soundProfile = DeployablesExplosionSound;
@ -590,7 +583,6 @@ datablock StaticShapeData(DeployedBeacon) : StaticShapeDamageProfile
maxDamage = 0.45;
disabledLevel = 0.45;
destroyedLevel = 0.45;
beacon = true;
targetNameTag = 'beacon';
deployedObject = true;
@ -603,7 +595,7 @@ datablock StaticShapeData(DeployedBeacon) : StaticShapeDamageProfile
function DeployedBeacon::onDestroyed(%data, %obj, %prevState)
{
if(%obj.isBeaconType(friend))
if(%obj.getBeaconType() $= "friend")
%bType = "MarkerBeacon";
else
%bType = "TargetBeacon";
@ -668,7 +660,7 @@ function Beacon::onUse(%data, %obj)
%rotation = %rotAxis @ " " @ %intAngle;
%obj.decInventory(%data, 1);
%depBeac = new ScopeAlwaysShape() {
%depBeac = new BeaconObject() {
dataBlock = "DeployedBeacon";
position = VectorAdd(%terrPt, VectorScale(%terrNrm, 0.05));
rotation = %rotation;
@ -686,7 +678,7 @@ function Beacon::onUse(%data, %obj)
function switchBeaconType(%beacon)
{
if(%beacon.isBeaconType(friend))
if(%beacon.getBeaconType() $= "friend")
{
// switch from marker beacon to target beacon
if($TeamDeployedCount[%beacon.team, TargetBeacon] >= $TeamDeployableMax[TargetBeacon])

View file

@ -0,0 +1,16 @@
//-------------------------------------- Desert interior texture property mapping
addMaterialMapping("lava/ds_ichute01", "environment: special/chuteTexture 0.25");
addMaterialMapping("lava/ds_ichute02", "environment: special/chuteTexture 0.25");
addMaterialMapping("lava/ds_jet01", "environment: special/lavareflect 0.3");
addMaterialMapping("lava/ds_jet02", "environment: special/lavareflect 0.3");
//"Color: red green blue startAlpha endAlpha"
//Soft sound = 0
//Hard sound = 1
//Metal sound = 2
//Snow sound = 3
addMaterialMapping("terrain/LavaWorld.Crust", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/LavaWorld.LavaRockHot", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/LavaWorld.MuddyAsh", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0");
addMaterialMapping("terrain/LavaWorld.RockBlack", "color: 0.0 0.0 0.0 0.7 0.0", "sound: 0");

View file

@ -13,12 +13,12 @@ function LoadingGui::onAdd(%this)
//------------------------------------------------------------------------------
function LoadingGui::onWake(%this)
{
if ( $HudHandle['shellScreen'] !$= "" )
if ( $HudHandle[shellScreen] !$= "" )
{
alxStop($HudHandle['shellScreen']);
$HudHandle['shellScreen'] = "";
alxStop($HudHandle[shellScreen]);
$HudHandle[shellScreen] = "";
}
$HudHandle['loadingScreen'] = alxPlay(LoadingScreenSound, 0, 0, 0);
$HudHandle[loadingScreen] = alxPlay(LoadingScreenSound, 0, 0, 0);
CloseMessagePopup();
}
@ -41,7 +41,7 @@ function LoadingGui::onSleep(%this)
LOAD_GameText.setText( "" );
LoadingProgress.setValue( 0 );
alxStop($HudHandle['loadingScreen']);
alxStop($HudHandle[loadingScreen]);
}
//------------------------------------------------------------------------------
@ -279,7 +279,7 @@ function handleLoadInfoMessage( %msgType, %msgString, %bitmapName, %mapName, %mi
LobbyGui.objLine[%line] = "";
LobbyGui.objLineCount = 0;
if (!isDemo() && !isDemoServer())
if (!isDemo())
%loadBmp = "gui/load_" @ %bitmapName @ ".png";
else
%loadBmp = "gui/load_" @ %bitmapName @ ".bm8";

View file

@ -0,0 +1,17 @@
//-------------------------------------- Desert interior texture property mapping
addMaterialMapping("lush/be_ichute01", "environment: special/chuteTexture 0.25");
addMaterialMapping("lush/be_ichute02", "environment: special/chuteTexture 0.25");
//"Color: red green blue startAlpha endAlpha"
//Soft sound = 0
//Hard sound = 1
//Metal sound = 2
//Snow sound = 3
addMaterialMapping("terrain/LushWorld.DirtMossy", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/LushWorld.GrassDark", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/LushWorld.GrassLight", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/LushWorld.GrassMixed", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/LushWorld.LakeBed", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/LushWorld.RockLight", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");
addMaterialMapping("terrain/LushWorld.RockMossy", "color: 0.46 0.36 0.26 0.4 0.0", "sound: 0");

View file

@ -294,7 +294,7 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7,
else
{
// message sender is an observer -- only send message to other observers
if(%obj.team == %sender.team)
if(%obj.team == %sender.team || %obj.isAdmin || %obj.isSuperAdmin)
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
}
}
@ -362,41 +362,24 @@ function messageAllExcept(%client, %team, %msgtype, %msgString, %a1, %a2, %a3, %
}
}
//#####################################################
////---------------------------------------------------------------------------
//// Command Message
////---------------------------------------------------------------------------
//
//function clientCmdServerCommandMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
//{
// commandMsgHud.addLine(detag(%msgString));
//}
//
//function commandMessageClient(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
//{
// commandToClient(%client, 'ServerCommandMessage', %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
//}
//
//function commandMessageTeam(%team, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
//{
// %count = ClientGroup.getCount();
// for(%cl= 0; %cl < %count; %cl++)
// {
// %recipient = ClientGroup.getObject(%cl);
// if(%recipient.team == %team)
// commandMessageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
// }
//}
//
//function commandMessageTeamExcept(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
//{
// %team = %client.team;
// %count = ClientGroup.getCount();
// for(%cl= 0; %cl < %count; %cl++)
// {
// %recipient = ClientGroup.getObject(%cl);
// if((%recipient.team == %team) && (%recipient != %client))
// commandMessageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
// }
//}
//#####################################################
//---------------------------------------------------------------------------
// functions to support repair messaging
//---------------------------------------------------------------------------
function clientCmdTeamRepairMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
{
if(!$pref::ignoreTeamRepairMessages)
clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6);
}
function teamRepairMessage(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
{
%team = %client.team;
%count = ClientGroup.getCount();
for(%i = 0; %i < %count; %i++)
{
%recipient = ClientGroup.getObject(%cl);
if((%recipient.team == %team) && (%recipient != %client))
commandToClient(%client, 'TeamRepairMessage', %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6);
}
}

View file

@ -25,6 +25,7 @@ function clearObjHudMSG(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
function setupObjHud(%gameType)
{
objectiveHud.gameType = %gameType;
switch$ (%gameType)
{
case BountyGame:
@ -162,7 +163,7 @@ function setupObjHud(%gameType)
case CTFGame:
// set separators
objectiveHud.setSeparators("72 97 130");
objectiveHud.setSeparators("75 100 133");
objectiveHud.enableHorzSeparator();
// Team names
@ -171,7 +172,7 @@ function setupObjHud(%gameType)
horizSizing = "right";
vertSizing = "bottom";
position = "4 3";
extent = "65 16";
extent = "68 16";
visible = "1";
};
objectiveHud.teamName[2] = new GuiTextCtrl() {
@ -179,7 +180,7 @@ function setupObjHud(%gameType)
horizSizing = "right";
vertSizing = "bottom";
position = "4 19";
extent = "65 16";
extent = "68 16";
visible = "1";
};
// Team scores
@ -187,16 +188,16 @@ function setupObjHud(%gameType)
profile = "GuiTextObjGreenCenterProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "75 3";
extent = "20 16";
position = "78 3";
extent = "22 16";
visible = "1";
};
objectiveHud.teamScore[2] = new GuiTextCtrl() {
profile = "GuiTextObjHudCenterProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "75 19";
extent = "20 16";
position = "78 19";
extent = "22 16";
visible = "1";
};
// Flag label ("FLAG")
@ -204,7 +205,7 @@ function setupObjHud(%gameType)
profile = "GuiTextObjGreenCenterProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "100 3";
position = "103 3";
extent = "30 16";
visible = "1";
text = "FLAG";
@ -213,7 +214,7 @@ function setupObjHud(%gameType)
profile = "GuiTextObjHudCenterProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "100 19";
position = "103 19";
extent = "30 16";
visible = "1";
text = "FLAG";
@ -223,16 +224,16 @@ function setupObjHud(%gameType)
profile = "GuiTextObjGreenLeftProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "135 3";
extent = "105 16";
position = "138 3";
extent = "102 16";
visible = "1";
};
objectiveHud.flagLocation[2] = new GuiTextCtrl() {
profile = "GuiTextObjHudLeftProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "135 19";
extent = "105 16";
position = "138 19";
extent = "102 16";
visible = "1";
};
@ -991,13 +992,6 @@ function siegeRolesSwitched(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
//objectiveHud.objectives[%newOff].setValue("0");
}
addMessageCallback('MsgSiegeSwitchSides', siegeSwitchSides);
function siegeSwitchSides(%msgType, %msgString, %a1, %a2)
{
alxPlay( SiegeSwitchSides, 0, 0, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
// DnD - Hud Messages
/////////////////////////////////////////////////////////////////////////////////////////

View file

@ -1,15 +1,32 @@
//----------------------------------------------------------------------------
datablock EffectProfile(TurretPackActivateEffect)
{
effectname = "packs/generic_deploy";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(TurretPackActivateSound)
{
filename = "fx/packs/turret_place.wav";
description = AudioClose3D;
preload = true;
effect = TurretPackActivateEffect;
};
//----------------------------------------------------------------------------
function Pack::onCollision(%data, %obj, %col)
{
// Don't pick up a new pack if you have a satchel charge deployed:
if ( %col.thrownChargeId > 0 )
return;
ItemData::onCollision(%data, %obj, %col);
}
function Pack::onUse(%data,%obj)
{
if (%obj.getMountedImage($BackpackSlot) != %data.image.getId())
@ -43,8 +60,13 @@ function Pack::onInventory(%data,%obj,%amount)
%obj.mountImage(%data.image,$BackpackSlot);
%obj.client.setBackpackHudItem(%data.getName(), 1);
}
if(%amount == 0)
%obj.client.setBackpackHudItem(%data.getName(), 0);
if(%amount == 0 )
{
if ( %data.getName() $= "SatchelCharge" )
%obj.client.setBackpackHudItem( "SatchelUnarmed", 1 );
else
%obj.client.setBackpackHudItem(%data.getName(), 0);
}
ItemData::onInventory(%data,%obj,%amount);
}

View file

@ -62,7 +62,8 @@ datablock ItemData(AmmoPack)
max[ConcussionGrenade] = 10;
max[FlashGrenade] = 10;
max[FlareGrenade] = 10;
max[Mine] = 5;
max[CameraGrenade] = 0;
max[Mine] = 5;
max[RepairKit] = 1;
};

View file

@ -11,12 +11,19 @@
//
//Only light armors may equip with this item.
datablock EffectProfile(CloakingPackActivateEffect)
{
effectname = "packs/cloak_on";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(CloakingPackActivateSound)
{
filename = "fx/packs/cloak_on.wav";
description = CloseLooping3d;
preload = true;
effect = CloakingPackActivateEffect;
};
datablock ShapeBaseImageData(CloakingPackImage)
@ -91,6 +98,8 @@ function CloakingPackImage::onActivate(%data, %obj, %slot)
{
messageClient(%obj.client, 'MsgCloakingPackOn', '\c2Cloaking pack on.');
%obj.setCloaked(true);
if ( !isDemo() )
commandToClient( %obj.client, 'setCloakIconOn' );
}
else
{
@ -121,6 +130,8 @@ function CloakingPackImage::onDeactivate(%data, %obj, %slot)
%obj.setCloaked(false);
%obj.setImageTrigger(%slot, false);
if ( !isDemo() )
commandToClient( %obj.client, 'setCloakIconOff' );
}
function CloakingPack::onPickup(%this, %obj, %shape, %amount)

View file

@ -6,13 +6,28 @@
// range for the repair gun, the user is repaired.
//--------------------------------------------------------------------------
// Sounds
// Sounds & feedback effects
datablock EffectProfile(RepairPackActivateEffect)
{
effectname = "packs/packs.repairPackOn";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(RepairPackFireEffect)
{
effectname = "packs/repair_use";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(RepairPackActivateSound)
{
filename = "fx/packs/packs.repairPackOn.wav";
description = AudioClosest3d;
preload = true;
effect = RepairPackActivateEffect;
};
datablock AudioProfile(RepairPackFireSound)
@ -20,6 +35,7 @@ datablock AudioProfile(RepairPackFireSound)
filename = "fx/packs/repair_use.wav";
description = CloseLooping3d;
preload = true;
effect = RepairPackFireEffect;
};
//--------------------------------------------------------------------------
@ -205,6 +221,8 @@ function RepairPackImage::onDeactivate(%data, %obj, %slot)
function RepairGunImage::onMount(%this,%obj,%slot)
{
%obj.setImageAmmo(%slot,true);
if ( !isDemo() )
commandToClient( %obj.client, 'setRepairPackIconOn' );
}
function RepairGunImage::onUnmount(%this,%obj,%slot)
@ -219,6 +237,8 @@ function RepairGunImage::onUnmount(%this,%obj,%slot)
// "turn off" the repair pack -- player needs to hit the "pack" key to
// activate the repair gun again
%obj.setImageTrigger($BackpackSlot, false);
if ( !isDemo() )
commandToClient( %obj.client, 'setRepairPackIconOff' );
}
function RepairGunImage::onActivateReady(%this,%obj,%slot)
@ -263,7 +283,20 @@ function RepairGunImage::onValidate(%this,%obj,%slot)
// a target in range was found
%repTgt = firstWord(%scanTarg);
// is the prospective target damaged?
if(%repTgt.getDamageLevel())
if(%repTgt.notRepairable)
{
// this is an object that cant be repaired at all
// -- mission specific flag set on the object
if(!%obj.errMsgSent)
{
messageClient(%obj.client, 'MsgRepairPackIrrepairable', '\c2Target is not repairable.', %repTgt);
%obj.errMsgSent = true;
}
// if player was repairing something, stop the repairs -- we're done
if(%obj.repairing)
stopRepairing(%obj);
}
else if(%repTgt.getDamageLevel())
{
// yes, it's damaged
if(%repTgt != %obj.repairing)

View file

@ -7,11 +7,33 @@
//--------------------------------------------------------------------------
// Sounds
datablock EffectProfile(SatchelChargeActivateEffect)
{
effectname = "packs/satchel_pack_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(SatchelChargeExplosionEffect)
{
effectname = "packs/satchel_pack_detonate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(SatchelChargePreExplosionEffect)
{
effectname = "explosions/explosion.xpl03";
minDistance = 10.0;
maxDistance = 30.0;
};
datablock AudioProfile(SatchelChargeActivateSound)
{
filename = "fx/packs/satchel_pack_activate.wav";
description = AudioClose3d;
preload = true;
effect = SatchelChargeActivateEffect;
};
datablock AudioProfile(SatchelChargeExplosionSound)
@ -19,6 +41,7 @@ datablock AudioProfile(SatchelChargeExplosionSound)
filename = "fx/packs/satchel_pack_detonate.wav";
description = AudioBIGExplosion3d;
preload = true;
effect = SatchelChargeExplosionEffect;
};
datablock AudioProfile(SatchelChargePreExplosionSound)
@ -26,6 +49,7 @@ datablock AudioProfile(SatchelChargePreExplosionSound)
filename = "fx/explosions/explosion.xpl03.wav";
description = AudioBIGExplosion3d;
preload = true;
effect = SatchelChargePreExplosionEffect;
};
datablock AudioProfile(UnderwaterSatchelChargeExplosionSound)
@ -33,9 +57,9 @@ datablock AudioProfile(UnderwaterSatchelChargeExplosionSound)
filename = "fx/weapons/mortar_explode_UW.wav";
description = AudioBIGExplosion3d;
preload = true;
effect = SatchelChargeExplosionEffect;
};
//----------------------------------------------------------------------------
// Satchel Debris
//----------------------------------------------------------------------------
@ -121,6 +145,7 @@ datablock ParticleData(SatchelBubbleParticle)
times[1] = 0.8;
times[2] = 1.0;
};
datablock ParticleEmitterData(SatchelBubbleEmitter)
{
ejectionPeriodMS = 10;
@ -165,7 +190,6 @@ datablock ParticleData(SatchelExplosionSmoke)
times[0] = 0.0;
times[1] = 0.4;
times[2] = 1.0;
};
datablock ParticleEmitterData(SatchelExplosionSmokeEmitter)
@ -212,7 +236,6 @@ datablock ParticleData(UnderwaterSatchelExplosionSmoke)
times[0] = 0.0;
times[1] = 0.2;
times[2] = 1.0;
};
datablock ParticleEmitterData(UnderwaterSatchelExplosionSmokeEmitter)
@ -588,6 +611,7 @@ function initArmSatchelCharge(%satchel)
function armSatchelCharge(%satchel)
{
%satchel.armed = true;
commandToClient( %satchel.sourceObject.client, 'setSatchelArmed' );
}
function detonateSatchelCharge(%player)
@ -600,10 +624,16 @@ function detonateSatchelCharge(%player)
//error("Detonating satchel charge #" @ %satchelCharge @ " for player #" @ %player);
if(%satchelCharge.getDamageState() !$= Destroyed)
{
%satchelCharge.setDamageState(Destroyed);
%satchelCharge.blowup();
}
if(isObject(%player))
%player.thrownChargeId = 0;
// Clear the player's HUD:
%player.client.clearBackpackIcon();
}
function SatchelChargeThrown::onEnterLiquid(%data, %obj, %coverage, %type)
@ -648,6 +678,7 @@ function SatchelChargeThrown::onDestroyed(%this, %object, %lastState)
// than detonated. A less damaging explosion, but visually the same scale.
if(%object.thwart)
{
messageClient(%object.sourceObject.client, 'msgSatchelChargeDetonate', "\c2Satchel charge destroyed.");
%dmgRadius = 10;
%dmgMod = 0.3;
%expImpulse = 1000;
@ -665,12 +696,13 @@ function SatchelChargeThrown::onDestroyed(%this, %object, %lastState)
%object.blowingUp = true;
RadiusExplosion(%object, %object.getPosition(), %dmgRadius, %dmgMod, %expImpulse, %object.sourceObject, %dmgType);
%object.schedule(500, "delete");
%object.schedule(1000, "delete");
}
}
function SatchelChargeThrown::onCollision(%data,%obj,%col)
{
// Do nothing...
}
function SatchelChargeThrown::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
@ -681,9 +713,13 @@ function SatchelChargeThrown::damageObject(%data, %targetObject, %sourceObject,
if(%targetObject.damaged >= %targetObject.getDataBlock().maxDamage &&
%targetObject.getDamageState() !$= Destroyed)
{
{
%targetObject.thwart = true;
%targetObject.setDamageState(Destroyed);
%targetObject.blowup();
// clear the player's HUD:
%targetObject.sourceObject.client.clearBackPackIcon();
}
}
}

View file

@ -7,13 +7,19 @@
//
// When not activated, the pack has no effect.
//
datablock EffectProfile(SensorJammerPackActivateEffect)
{
effectname = "packs/cloak_on";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(SensorJammerActivateSound)
{
filename = "fx/packs/sensorjammerpack_on.wav";
description = ClosestLooping3d;
preload = true;
preload = true;
effect = SensorJammerPackActivateEffect;
};
datablock ShapeBaseImageData(SensorJammerPackImage)
@ -58,7 +64,25 @@ datablock ItemData(SensorJammerPack)
computeCRC = true;
};
datablock SensorData(JammerSensorObject)
// datablock SensorData(JammerSensorObjectPassive)
// {
// // same detection info as 'PlayerObject' sensorData
// detects = true;
// detectsUsingLOS = true;
// detectsPassiveJammed = true;
// detectRadius = 2000;
// detectionPings = false;
// detectsFOVOnly = true;
// detectFOVPercent = 1.3;
// useObjectFOV = true;
//
// jams = true;
// jamsOnlyGroup = true;
// jamsUsingLOS = true;
// jamRadius = 0;
// };
datablock SensorData(JammerSensorObjectActive)
{
// same detection info as 'PlayerObject' sensorData
detects = true;
@ -78,21 +102,29 @@ datablock SensorData(JammerSensorObject)
function SensorJammerPackImage::onUnmount(%data, %obj, %slot)
{
setTargetSensorData(%obj.client.target, PlayerSensor);
%obj.setImageTrigger(%slot, false);
setTargetSensorData(%obj.client.target, PlayerSensor);
%obj.setImageTrigger(%slot, false);
}
function SensorJammerPackImage::onActivate(%data, %obj, %slot)
{
messageClient(%obj.client, 'MsgSensorJammerPackOn', '\c2Sensor jammer pack on.');
setTargetSensorData(%obj.client.target, JammerSensorObject);
setTargetSensorData(%obj.client.target, JammerSensorObjectActive);
if ( !isDemo() )
commandToClient( %obj.client, 'setSenJamIconOn' );
%obj.setJammerFX( true );
}
function SensorJammerPackImage::onDeactivate(%data, %obj, %slot)
{
messageClient(%obj.client, 'MsgSensorJammerPackOff', '\c2Sensor jammer pack off.');
setTargetSensorData(%obj.client.target, PlayerSensor);
%obj.setImageTrigger(%slot, false);
setTargetSensorData(%obj.client.target, PlayerSensor);
if ( !isDemo() )
commandToClient( %obj.client, 'setSenJamIconOff' );
%obj.setJammerFX( false );
}
function SensorJammerPack::onPickup(%this, %obj, %shape, %amount)

View file

@ -3,11 +3,19 @@
// can be used by any armor type
// while activated, absorbs damage at cost of energy
datablock EffectProfile(ShieldPackActivateEffect)
{
effectname = "packs/shield_on";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(ShieldPackActivateSound)
{
filename = "fx/packs/shield_on.wav";
description = ClosestLooping3d;
preload = true;
preload = true;
effect = ShieldPackActivateEffect;
};
datablock ShapeBaseImageData(ShieldPackImage)
@ -66,6 +74,8 @@ function ShieldPackImage::onActivate(%data, %obj, %slot)
{
messageClient(%obj.client, 'MsgShieldPackOn', '\c2Shield pack on.');
%obj.isShielded = true;
if ( !isDemo() )
commandToClient( %obj.client, 'setShieldIconOn' );
}
function ShieldPackImage::onDeactivate(%data, %obj, %slot)
@ -73,6 +83,8 @@ function ShieldPackImage::onDeactivate(%data, %obj, %slot)
messageClient(%obj.client, 'MsgShieldPackOff', '\c2Shield pack off.');
%obj.setImageTrigger(%slot,false);
%obj.isShielded = "";
if ( !isDemo() )
commandToClient( %obj.client, 'setShieldIconOff' );
}
function ShieldPack::onPickup(%this, %obj, %shape, %amount)

View file

@ -84,35 +84,72 @@ datablock EffectProfile(CorpseLootingEffect)
{
effectname = "weapons/generic_switch";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(MountVehicleEffect)
{
effectname = "vehicles/mount_dis";
minDistance = 20;
minDistance = 5;
maxDistance = 20;
};
datablock EffectProfile(UnmountVehicleEffect)
{
effectname = "weapons/generic_switch";
minDistance = 20;
minDistance = 5;
maxDistance = 20;
};
datablock EffectProfile(GenericPainEffect)
{
effectname = "misc/generic_pain";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(GenericDeathEffect)
{
effectname = "misc/generic_death";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ImpactHeavyWaterEasyEffect)
{
effectname = "armor/general_water_smallsplash";
minDistance = 5;
maxDistance = 15;
};
datablock EffectProfile(ImpactHeavyMediumWaterEffect)
{
effectname = "armor/general_water_medsplash";
minDistance = 5;
maxDistance = 15;
};
datablock EffectProfile(ImpactHeavyWaterHardEffect)
{
effectname = "armor/general_water_bigsplash";
minDistance = 5;
maxDistance = 15;
};
//----------------------------------------------------------------------------
datablock AudioProfile( DeathCrySound )
{
fileName = "";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile( PainCrySound )
{
fileName = "";
description = AudioClose3d;
preload = true;
};
//datablock AudioProfile( DeathCrySound )
//{
// fileName = "";
// description = AudioClose3d;
// preload = true;
//};
//
//datablock AudioProfile( PainCrySound )
//{
// fileName = "";
// description = AudioClose3d;
// preload = true;
//};
datablock AudioProfile(ArmorJetSound)
{
@ -1202,12 +1239,12 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
aiAvoidThis = true;
minLookAngle = -1.4;
maxLookAngle = 1.4;
minLookAngle = -1.5;
maxLookAngle = 1.5;
maxFreelookAngle = 3.0;
mass = 90;
drag = 0.3;
drag = 0.275;
maxdrag = 0.4;
density = 10;
maxDamage = 0.66;
@ -1216,24 +1253,24 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
energyPerDamagePoint = 75.0; // shield energy required to block one point of damage
rechargeRate = 0.256;
jetForce = 27.51 * 90;
underwaterJetForce = 27.51 * 90 * 2.0;
jetForce = 26.21 * 90;
underwaterJetForce = 26.21 * 90 * 1.5;
underwaterVertJetFactor = 1.5;
jetEnergyDrain = 0.8;
underwaterJetEnergyDrain = 0.5;
underwaterJetEnergyDrain = 0.6;
minJetEnergy = 1;
maxJetHorizontalPercentage = 0.8;
runForce = 55.20 * 90;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 14;
maxForwardSpeed = 15;
maxBackwardSpeed = 13;
maxSideSpeed = 13;
maxUnderwaterForwardSpeed = 8.4;
maxUnderwaterBackwardSpeed = 7.8;
maxUnderwaterSideSpeed = 7.8;
maxUnderwaterForwardSpeed = 11;
maxUnderwaterBackwardSpeed = 10;
maxUnderwaterSideSpeed = 10;
jumpForce = 8.3 * 90;
@ -1304,7 +1341,7 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
upResistFactor = 0.3;
// heat inc'ers and dec'ers
heatDecayPerSec = 1.0 / 3.0; // takes 3 seconds to clear heat sig.
heatDecayPerSec = 1.0 / 4.0; // takes 4 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig.
footstepSplashHeight = 0.35;
@ -1379,9 +1416,6 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
max[RepairPack] = 1;
max[ShieldPack] = 1;
max[AmmoPack] = 1;
//max[ReflectionPack] = 1;
//max[RepulsorPack] = 1;
//max[EnvironmentPack] = 1;
max[SatchelCharge] = 1;
max[MortarBarrelPack] = 0;
max[MissileBarrelPack] = 0;
@ -1389,23 +1423,18 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
max[PlasmaBarrelPack] = 0;
max[ELFBarrelPack] = 0;
max[InventoryDeployable]= 0;
//max[AmmoDeployable] = 0;
max[MotionSensorDeployable] = 1;
max[PulseSensorDeployable] = 1;
max[TurretOutdoorDeployable] = 0;
max[TurretIndoorDeployable] = 0;
//max[MineAir] = 3;
//max[MineLand] = 3;
//max[MineSticky] = 3;
max[FlashGrenade] = 5;
max[ConcussionGrenade] = 5;
max[FlareGrenade] = 5;
max[TargetingLaser] = 1;
max[ELFGun] = 1;
max[ShockLance] = 1;
max[CameraGrenade] = 5;
max[CameraGrenade] = 2;
max[Beacon] = 3;
//max[Rock] = 1;
observeParameters = "0.5 4.5 4.5";
@ -1460,12 +1489,12 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
aiAvoidThis = true;
minLookAngle = -1.4;
maxLookAngle = 1.4;
minLookAngle = -1.5;
maxLookAngle = 1.5;
maxFreelookAngle = 3.0;
mass = 130;
drag = 0.4;
drag = 0.3;
maxdrag = 0.5;
density = 10;
maxDamage = 1.1;
@ -1474,30 +1503,30 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
energyPerDamagePoint = 75.0; // shield energy required to block one point of damage
rechargeRate = 0.256;
jetForce = 25.83 * 130;
underwaterJetForce = 25.83 * 130 * 2.0;
jetForce = 25.22 * 130;
underwaterJetForce = 25.22 * 130 * 1.5;
underwaterVertJetFactor = 1.5;
jetEnergyDrain = 1.0;
underwaterJetEnergyDrain = 0.5;
underwaterJetEnergyDrain = 0.6;
minJetEnergy = 1;
maxJetHorizontalPercentage = 0.8;
runForce = 46 * 130;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 11;
maxForwardSpeed = 12;
maxBackwardSpeed = 10;
maxSideSpeed = 10;
maxUnderwaterForwardSpeed = 6.6;
maxUnderwaterBackwardSpeed = 6;
maxUnderwaterSideSpeed = 6;
maxUnderwaterForwardSpeed = 8.5;
maxUnderwaterBackwardSpeed = 7.5;
maxUnderwaterSideSpeed = 7.5;
recoverDelay = 9;
recoverRunForceScale = 1.2;
// heat inc'ers and dec'ers
heatDecayPerSec = 1.0 / 3.0; // takes 3 seconds to clear heat sig.
heatDecayPerSec = 1.0 / 4.0; // takes 4 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig.
jumpForce = 8.3 * 130;
@ -1637,9 +1666,6 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
max[RepairPack] = 1;
max[ShieldPack] = 1;
max[AmmoPack] = 1;
//max[ReflectionPack] = 1;
//max[RepulsorPack] = 1;
//max[EnvironmentPack] = 1;
max[SatchelCharge] = 1;
max[MortarBarrelPack] = 1;
max[MissileBarrelPack] = 1;
@ -1647,23 +1673,18 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
max[PlasmaBarrelPack] = 1;
max[ELFBarrelPack] = 1;
max[InventoryDeployable]= 1;
//max[AmmoDeployable] = 1;
max[MotionSensorDeployable] = 1;
max[PulseSensorDeployable] = 1;
max[TurretOutdoorDeployable] = 1;
max[TurretIndoorDeployable] = 1;
//max[MineAir] = 3;
//max[MineLand] = 3;
//max[MineSticky] = 3;
max[FlashGrenade] = 6;
max[ConcussionGrenade] = 6;
max[FlareGrenade] = 6;
max[TargetingLaser] = 1;
max[ELFGun] = 1;
max[ShockLance] = 1;
max[CameraGrenade] = 6;
max[CameraGrenade] = 3;
max[Beacon] = 3;
//max[Rock] = 1;
observeParameters = "0.5 4.5 4.5";
@ -1716,12 +1737,12 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
aiAvoidThis = true;
minLookAngle = -1.4;
maxLookAngle = 1.4;
minLookAngle = -1.5;
maxLookAngle = 1.5;
maxFreelookAngle = 3.0;
mass = 180;
drag = 0.5;
drag = 0.33;
maxdrag = 0.6;
density = 10;
maxDamage = 1.32;
@ -1731,21 +1752,21 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
rechargeRate = 0.256;
jetForce = 22.47 * 180;
underwaterJetForce = 22.47 * 180 * 2.0;
underwaterJetForce = 22.47 * 180 * 1.5;
underwaterVertJetFactor = 1.5;
jetEnergyDrain = 1.1;
underwaterJetEnergyDrain = 0.55;
underwaterJetEnergyDrain = 0.65;
minJetEnergy = 1;
maxJetHorizontalPercentage = 0.8;
runForce = 40.25 * 180;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 6.5;
maxForwardSpeed = 7;
maxBackwardSpeed = 5;
maxSideSpeed = 5;
maxUnderwaterForwardSpeed = 3.9;
maxUnderwaterForwardSpeed = 4.5;
maxUnderwaterBackwardSpeed = 3;
maxUnderwaterSideSpeed = 3;
@ -1758,7 +1779,7 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
jumpDelay = 0;
// heat inc'ers and dec'ers
heatDecayPerSec = 1.0 / 3.0; // takes 3 seconds to clear heat sig.
heatDecayPerSec = 1.0 / 4.0; // takes 4 seconds to clear heat sig.
heatIncreasePerSec = 1.0 / 3.0; // takes 3.0 seconds of constant jet to get full heat sig.
// Controls over slope of runnable/jumpable surfaces
@ -1890,9 +1911,6 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
max[RepairPack] = 1;
max[ShieldPack] = 1;
max[AmmoPack] = 1;
//max[ReflectionPack] = 1;
//max[RepulsorPack] = 1;
//max[EnvironmentPack] = 1;
max[SatchelCharge] = 1;
max[MortarBarrelPack] = 1;
max[MissileBarrelPack] = 1;
@ -1900,23 +1918,18 @@ datablock PlayerData(HeavyMaleHumanArmor) : HeavyPlayerDamageProfile
max[PlasmaBarrelPack] = 1;
max[ELFBarrelPack] = 1;
max[InventoryDeployable]= 1;
//max[AmmoDeployable] = 1;
max[MotionSensorDeployable] = 1;
max[PulseSensorDeployable] = 1;
max[TurretOutdoorDeployable] = 1;
max[TurretIndoorDeployable] = 1;
//max[MineAir] = 3;
//max[MineLand] = 3;
//max[MineSticky] = 3;
max[FlashGrenade] = 8;
max[ConcussionGrenade] = 8;
max[FlareGrenade] = 8;
max[TargetingLaser] = 1;
max[ELFGun] = 1;
max[ShockLance] = 1;
max[CameraGrenade] = 8;
max[CameraGrenade] = 3;
max[Beacon] = 3;
//max[Rock] = 1;
observeParameters = "0.5 4.5 4.5";
@ -2101,7 +2114,11 @@ function Armor::onMount(%this,%obj,%vehicle,%node)
// update the vehicle's team
if((%vehicle.getTarget() != -1) && %vehicle.getDatablock().cantTeamSwitch $= "")
{
setTargetSensorGroup(%vehicle.getTarget(), %obj.client.getSensorGroup());
if( %vehicle.turretObject > 0 )
setTargetSensorGroup(%vehicle.turretObject.getTarget(), %obj.client.getSensorGroup());
}
// Send a message to the client so they can decide if they want to change view or not:
commandToClient( %obj.client, 'VehicleMount' );

View file

@ -62,6 +62,12 @@ function ShapeBaseImageData::onFire(%data, %obj, %slot)
}
}
}
if( %obj.client > 0 )
{
%obj.setInvincibleMode(0 ,0.00);
%obj.setInvincible( false ); // fire your weapon and your invincibility goes away.
}
%vehicle = 0;
if(%data.usesEnergy)
@ -391,9 +397,6 @@ function ELFProjectileData::zapTarget(%data, %projectile, %target, %targeter)
%target.teamDamageStateOnZap = $teamDamage;
%teammates = %target.client.team == %targeter.client.team;
echo("targeter team: " @ %targeter.team );
echo("target team: " @ %target.team );
if( %target.teamDamageStateOnZap || !%teammates )
%target.setRechargeRate(%oldERate - %data.drainEnergy);
else
@ -528,7 +531,7 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse
continue;
//if ( $splashTest )
%amount = (1.0 - ((%dist / %radius) * 0.75)) * %coverage * %damage;
%amount = (1.0 - ((%dist / %radius) * 0.88)) * %coverage * %damage;
//else
//%amount = (1.0 - (%dist / %radius)) * %coverage * %damage;

View file

@ -1,53 +1,623 @@
function RecordingsDlg::onWake(%gui)
{
%gui.fillRecordingsList();
updateRecordingButtons();
}
function msToMinSec(%time)
{
%sec = mFloor(%time / 1000);
%min = mFloor(%sec / 60);
%sec -= %min * 60;
// pad it
if(%min < 10)
%min = "0" @ %min;
if(%sec < 10)
%sec = "0" @ %sec;
return(%min @ ":" @ %sec);
}
function RecordingsDlg::fillRecordingsList(%gui)
{
// setup the ctrl
if(!%gui.initialized)
{
RecordingsDlgList.setSortColumn(0);
RecordingsDlgList.setSortIncreasing(true);
RecordingsDlgList.addStyle(1, $ShellFont, $ShellFontSize, "80 220 200", "30 255 225", "10 60 40" );
RecordingsDlgList.addStyle(2, $ShellFont, $ShellFontSize, "120 120 120", "120 120 120", "120 120 120" );
// add the columns
RecordingsDlgList.addColumn(0, "Recording", 200, 100, 300);
RecordingsDlgList.addColumn(1, "Time", 140, 60, 180, "filetime center");
RecordingsDlgList.addColumn(2, "Length (min:sec)", 40, 40, 80, "center");
%gui.initialized = true;
}
RecordingsDlgList.clear();
RecordingsDlgList.clearList();
// process all the recordings
%search = "recordings/*.rec";
%ct = 0;
%demoVersion = getDemoVersion();
for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search))
{
%fileName = fileBase(%file);
RecordingsDlgList.addRow(%ct++, %fileName);
}
RecordingsDlgList.sort(0);
if ( RecordingsDlgList.rowCount() == 0 )
{
PR_StartDemoBtn.setActive( false );
PR_CancelBtn.makeFirstResponder( 1 );
}
else
{
RecordingsDlgList.setSelectedById( 1 );
PR_StartDemoBtn.setActive( true );
PR_StartDemoBtn.makeFirstResponder( 1 );
}
// query the version/length of the recording
%val = getDemoVersionLength(%file);
%version = getField(%val, 0);
// unknown version
if(%version == -1)
{
%version = "???";
%length = "???";
}
else
%length = msToMinSec(getField(%val, 1));
%fileTime = getFileModifyTime(%file);
RecordingsDlgList.addRow(%ct, %fileName TAB %fileTime TAB %length);
RecordingsDlgList.setRowStyle(%ct, (%version == %demoVersion) ? 1 : 2);
%ct++;
}
RecordingsDlgList.sort(0, true);
RecordingsDlgList.setSelectedRow(0);
}
function updateRecordingButtons()
{
%active = RecordingsDlgList.rowCount() != 0;
PR_StartDemoBtn.setActive(%active);
PR_DeleteDemoBtn.setActive(%active);
PR_RenameDemoBtn.setActive(%active);
if(%active)
PR_StartDemoBtn.makeFirstResponder(1);
else
PR_CancelBtn.makeFirstResponder(1);
}
//-------------------------------------------------------------------------
// functions to handle the progress bar for loading demo
function DemoLoadProgressDlg::onWake(%this)
{
DemoLoadProgressCtrl.setValue(0.0);
}
function demoUpdateDatablockProgress(%count, %total)
{
DemoLoadProgressCtrl.setValue(%count / %total);
}
//-------------------------------------------------------------------------
// sequential variables named $DemoValue[?] will be stored in the demo stream
// and accessable right after the demo has been loaded
function saveDemoSettings()
{
$DemoValueIdx = 0;
getState(MISC);
// store the playergroup
getState(PLAYERLIST);
// get the states for all the gui's of interest
getState(RETICLE);
getState(BACKPACK);
getState(WEAPON);
getState(INVENTORY);
getState(SCORE);
getState(CLOCK);
getState(CHAT);
}
function resetGameState()
{
$timeScale = 1;
// reset some state
HudMessageVector.clear();
if(isObject(PlayerListGroup))
PlayerListGroup.delete();
// stop all sound
alxStopAll();
// clean up voting
voteHud.voting = false;
mainVoteHud.setvisible(0);
// clear all print messages
clientCmdclearBottomPrint();
clientCmdClearCenterPrint();
clientCmdResetCommandMap();
// clear the inventory and weapons hud
weaponsHud.reset();
inventoryHud.reset();
// reset the objective hud
objectiveHud.setSeparators("");
objectiveHud.disableHorzSeparator();
while(objectiveHud.getCount() > 0)
objectiveHud.getObject(0).delete();
}
function loadDemoSettings()
{
$DemoValueIdx = 0;
setState(MISC);
// restore the playergroup
setState(PLAYERLIST);
// set the states for all the gui's of interest
setState(RETICLE);
setState(BACKPACK);
setState(WEAPON);
setState(INVENTORY);
setState(SCORE);
setState(CLOCK);
setState(CHAT);
}
function addDemoValue(%val)
{
// make sure variables get saved
if(%val $= "")
%val = "<BLANK>";
$DemoValue[$DemoValueIdx] = %val;
$DemoValueIdx++;
}
function getDemoValue()
{
%val = $DemoValue[$DemoValueIdx];
$DemoValueIdx++;
if(%val $= "<BLANK>")
%val = "";
return(%val);
}
//-------------------------------------------------------------------------
// get/setState
// - strings max of 255 chars
function getState(%type)
{
switch$(%type)
{
case MISC:
addDemoValue( $HudMode TAB $HudModeType TAB $HudModeNode TAB voteHud.voting TAB isObject(passengerKeys) TAB musicPlayer.currentTrack );
case PLAYERLIST:
%count = PlayerListGroup.getCount();
addDemoValue(%count);
for(%i = 0; %i < %count; %i++)
{
%obj = PlayerListGroup.getObject(%i);
addDemoValue( %obj.name TAB
%obj.guid TAB
%obj.clientId TAB
%obj.targetId TAB
%obj.teamId TAB
%obj.score TAB
%obj.ping TAB
%obj.packetLoss TAB
%obj.chatMuted TAB
%obj.canListen TAB
%obj.voiceEnabled TAB
%obj.isListening TAB
%obj.isBot TAB
%obj.isAdmin TAB
%obj.isSuperAdmin TAB
%obj.isSmurf );
}
case RETICLE:
addDemoValue( reticleHud.bitmap TAB
reticleHud.isVisible() TAB
retCenterHud.isVisible() TAB
ammoHud.isVisible() TAB
ammoHud.getValue() TAB
deploySensor.isVisible() TAB
reticleFrameHud.isVisible() );
case BACKPACK:
addDemoValue( backpackIcon.bitmap TAB backpackFrame.isVisible() TAB backpackText.getValue() TAB backpackText.isVisible TAB backpackFrame.pack );
case WEAPON:
%count = weaponsHud.getNumItems();
%slotCount = weaponsHud.getNumSlots();
%active = weaponsHud.getActiveItem();
// visible/bitmaps(3)/count/slotcount/active
addDemoValue( weaponsHud.isVisible() TAB weaponsHud.getBackgroundBitmap() TAB weaponsHud.getHighLightBitmap() TAB weaponsHud.getInfiniteBitmap() TAB %count TAB %slotCount TAB %active );
// images
for(%i = 0; %i < %count; %i++)
addDemoValue( $WeaponNames[%i] TAB weaponsHud.getItemBitmap(%i) );
// items
for(%i = 0; %i < %slotCount; %i++)
addDemoValue( weaponsHud.getSlotId(%i) TAB weaponsHud.getSlotCount(%i) );
case INVENTORY:
// count/active
%count = inventoryHud.getNumItems();
%slotCount = inventoryHud.getNumSlots();
%active = inventoryHud.getActiveItem();
// visible/bitmaps(3)/count/slotCount/active
addDemoValue( inventoryHud.isVisible() TAB inventoryHud.getBackgroundBitmap() TAB inventoryHud.getHighLightBitmap() TAB inventoryHud.getInfiniteBitmap() TAB %count TAB %slotCount TAB %active );
// images
for(%i = 0; %i < %count; %i++)
addDemoValue( inventoryHud.getItemBitmap(%i) );
// items
for(%i = 0; %i < %slotCount; %i++)
addDemoValue( inventoryHud.getSlotId(%i) TAB inventoryHud.getSlotCount(%i) );
case SCORE:
%objCount = objectiveHud.getCount();
// visible/gametype/numobjects
addDemoValue( objectiveHud.isVisible() TAB objectiveHud.gameType TAB %objCount );
// only text ctrls exist in this thing.. so just dump the strings
for(%i = 0; %i < %objCount; %i++)
addDemoValue(objectiveHud.getObject(%i).getValue());
case CLOCK:
addDemoValue( clockHud.isVisible() TAB clockHud.getTime() );
case CHAT:
// store last 10 messages
%numLines = HudMessageVector.getNumLines();
for(%i = (%numLines - 10); %i < %numLines; %i++)
{
if(%i < 0)
addDemoValue("");
else
addDemoValue(HudMessageVector.getLineText(%i));
}
}
}
function setState(%type)
{
switch$(%type)
{
case MISC:
%val = getDemoValue();
$HudMode = getField(%val, 0);
$HudModeType = getField(%val, 1);
$HudModeNode = getField(%val, 2);
voteHud.voting = getField(%val, 3);
clientCmdSetDefaultVehicleKeys(getField(%val, 4));
clientCmdPlayMusic(getField(%val, 5));
ClientCmdDisplayHuds();
case PLAYERLIST:
new SimGroup("PlayerListGroup");
%count = getDemoValue();
for(%i = 0; %i < %count; %i++)
{
%val = getDemoValue();
%player = new ScriptObject()
{
className = "PlayerRep";
name = getField(%val, 0);
guid = getField(%val, 1);
clientId = getField(%val, 2);
targetId = getField(%val, 3);
teamId = getField(%val, 4);
score = getField(%val, 5);
ping = getField(%val, 6);
packetLoss = getField(%val, 7);
chatMuted = getField(%val, 8);
canListen = getField(%val, 9);
voiceEnabled = getField(%val, 10);
isListening = getField(%val, 11);
isBot = getField(%val, 12);
isAdmin = getField(%val, 13);
isSuperAdmin = getField(%val, 14);
isSmurf = getField(%val, 15);
};
PlayerListGroup.add(%player);
$PlayerList[%player.clientId] = %player;
lobbyUpdatePlayer(%player.clientId);
}
case RETICLE:
%val = getDemoValue();
reticleHud.setBitmap(getField(%val, 0));
reticleHud.setVisible(getField(%val, 1));
retCenterHud.setVisible(getField(%val, 2));
ammoHud.setVisible(getField(%val, 3));
ammoHud.setValue(getField(%val, 4));
deploySensor.setVisible(getField(%val, 5));
reticleFrameHud.setVisible(getField(%val, 6));
case BACKPACK:
%val = getDemoValue();
backpackIcon.setBitmap(getField(%val, 0));
backpackFrame.setVisible(getField(%val, 1));
backpackText.setValue(getField(%val, 2));
backpackText.setVisible(getField(%val, 3));
backpackFrame.pack = getField(%val, 4);
case WEAPON:
%val = getDemoValue();
// visible
weaponsHud.reset();
weaponsHud.setVisible(getField(%val, 0));
// bitmaps
weaponsHud.setBackgroundBitmap(getField(%val, 1));
weaponsHud.setHighLightBitmap(getField(%val, 2));
weaponsHud.setInfiniteAmmoBitmap(getField(%val, 3));
// count/slotCount/active
%count = getField(%val, 4);
%slotCount = getField(%val, 5);
%active = getField(%val, 6);
// bitmaps
for(%i = 0; %i < %count; %i++)
{
%val = getDemoValue();
$WeaponNames[%i] = getField(%val, 0);
weaponsHud.setWeaponBitmap(%i, getField(%val, 1));
}
// items
for(%i = 0; %i < %slotCount; %i++)
{
%val = getDemoValue();
weaponsHud.addWeapon(getField(%val, 0), getField(%val, 1));
}
// active
weaponsHud.setActiveWeapon(%active);
case INVENTORY:
%val = getDemoValue();
// visible
inventoryHud.reset();
inventoryHud.setVisible(getField(%val, 0));
// bitmaps
inventoryHud.setBackgroundBitmap(getField(%val, 1));
inventoryHud.setHighLightBitmap(getField(%val, 2));
inventoryHud.setInfiniteAmountBitmap(getField(%val, 3));
// count/slotCount/active
%count = getField(%val, 4);
%slotCount = getField(%val, 5);
%active = getField(%val, 6);
// images
for(%i = 0; %i < %count; %i++)
{
%val = getDemoValue();
inventoryHud.setInventoryBitmap(%i, %val);
}
// items
for(%i = 0; %i < %slotCount; %i++)
{
%val = getDemoValue();
inventoryHud.addInventory(getField(%val, 0), getField(%val, 1));
}
// active
inventoryHud.setActiveInventory(%active);
case SCORE:
%val = getDemoValue();
objectiveHud.setVisible(getField(%val, 0));
setupObjHud(getField(%val, 1));
%objCount = getField(%val, 2);
// must read in all values even if not used
for(%i = 0; %i < %objCount; %i++)
{
%val = getDemoValue();
if(%i < objectiveHud.getCount())
objectiveHud.getObject(%i).setValue(%val);
}
case CLOCK:
%val = getDemoValue();
clockHud.setVisible(getField(%val, 0));
clockHud.setTime(getField(%val, 1));
case CHAT:
HudMessageVector.clear();
for(%i = 0; %i < 10; %i++)
{
%val = getDemoValue();
if(%val !$= "")
HudMessageVector.pushBackLine(%val);
}
}
}
//-------------------------------------------------------------------------
function doRecordingDelete(%file)
{
// delete it
if(deleteFile("recordings/" @ %file @ ".rec"))
{
%sel = RecordingsDlgList.getSelectedId();
RecordingsDlgList.removeRowById(%sel);
RecordingsDlgList.setSelectedRow(0);
updateRecordingButtons();
}
else
messageBoxOK("Failed", "Failed to remove file '" @ %file @ "'.");
}
function DeleteSelectedDemo()
{
%sel = RecordingsDlgList.getSelectedId();
%file = getField(RecordingsDlgList.getRowTextById(%sel), 0);
messageBoxOkCancel("Delete Recording?", "Are you sure you wish to delete recording file '" @ %file @ "'?", "doRecordingDelete(\"" @ %file @ "\");");
}
function StartSelectedDemo()
{
// first unit is filename
%sel = RecordingsDlgList.getSelectedId();
%file = RecordingsDlgList.getRowTextById(%sel);
playDemo("recordings/" @ %file @ ".rec");
Canvas.setContent(PlayGui);
%rowText = RecordingsDlgList.getRowTextById(%sel);
%file = "recordings/" @ getField(%rowText, 0) @ ".rec";
%verLen = getDemoVersionLength(%file);
Canvas.pushDialog(DemoLoadProgressDlg);
if(playDemo(%file))
{
// do not allow new sources to have a force feedback effect
alxEnableForceFeedback(false);
resetGameState();
Canvas.popDialog(DemoLoadProgressDlg);
Canvas.popDialog(RecordingsDlg);
Canvas.setContent(PlayGui);
loadDemoSettings();
$DemoPlaybackIndex = 5;
$DemoPlaybackLastIndex = 5;
// setup the global action map
GlobalActionMap.bindCmd(keyboard, "escape", "", "stopDemoPlayback();");
GlobalActionMap.bindCmd(keyboard, "tab", "", "toggleDemoPlaybackHud();");
GlobalActionMap.bindCmd(keyboard, "space", "", "toggleDemoPause();");
GlobalActionMap.bindCmd(keyboard, "numpadadd", "", "stepDemoPlaybackSpeed(1);");
GlobalActionMap.bindCmd(keyboard, "numpadminus", "", "stepDemoPlaybackSpeed(-1);");
$globalActionMapOnly = true;
$DemoPlaybackProgress = 0;
$DemoPlaybackLength = getField(%verLen, 1);
// playback length may be 0 if recording was not clean (just set to 1min)
if($DemoPlaybackLength == 0)
$DemoPlaybackLength = 60000;
DemoPlayback_EndTime.setValue(msToMinSec($DemoPlaybackLength));
$DemoPlaybackIndex = 5;
$DemoPlaybackLastIndex = 5;
$DemoPlaybackProgress = 0;
demoPlaybackUpdate(0);
updateDemoPlaybackStatus();
}
else
MessageBoxOK("Playback Failed", "Demo playback failed for file '" @ %file @ "'.");
Canvas.popDialog(DemoLoadProgressDlg);
}
function LoopDemos()
function demoPlaybackComplete()
{
$demoCount = 0;
alxStopAll();
for($demoFile[$demoCount] = findFirstFile("recordings/*.rec"); $demoFile[$demoCount] !$= ""; $demoFile[$demoCount++] = findNextFile("recordings/*.rec") )
{
}
$currentDemo = $demoCount - 1;
if($demoCount == 0)
// allow new sources to have a force feedback effect
alxEnableForceFeedback(true);
// remove the playback dialog
if(DemoPlaybackDlg.isAwake())
Canvas.popDialog(DemoPlaybackDlg);
Canvas.setContent("LaunchGui");
Canvas.pushDialog(RecordingsDlg);
// cleanup
resetGameState();
purgeResources();
// clean the globalActionMap
GlobalActionMap.unbind(keyboard, escape);
GlobalActionMap.unbind(keyboard, tab);
GlobalActionMap.unbind(keyboard, space);
GlobalActionMap.unbind(keyboard, numpadadd);
GlobalActionMap.unbind(keyboard, numpadminus);
$globalActionMapOnly = false;
}
//-------------------------------------------------------------------------
function doDemoFileRename()
{
// first unit is filename
%sel = RecordingsDlgList.getSelectedId();
%file = getField(RecordingsDlgList.getRowTextById(%sel), 0);
%newFile = DemoRenameFile_Edit.getValue();
if(%file $= %newFile)
return;
demoPlaybackComplete();
if(%newFile !$= "")
{
if(renameFile("recordings/" @ %file @ ".rec", "recordings/" @ %newFile @ ".rec"))
{
rebuildModPaths();
RecordingsDlg.fillRecordingsList();
return;
}
}
MessageBoxOK("Rename Failed", "Failed to rename file '" @ %file @ "' to '" @ %newFile @ "'.");
}
function RenameSelectedDemo()
{
// first unit is filename
%sel = RecordingsDlgList.getSelectedId();
%file = getField(RecordingsDlgList.getRowTextById(%sel), 0);
DemoRenameFile_Edit.setValue(%file);
Canvas.pushDialog(DemoRenameFileDlg);
}
//--------------------------------------------------------------------------
function beginDemoRecord()
{
stopRecord();
if(isDemo())
return;
// make sure that current recording stream is stopped
stopDemoRecord();
for(%i = 0; %i < 1000; %i++)
{
%num = %i;
@ -61,13 +631,104 @@ function beginDemoRecord()
}
if(%i == 1000)
return;
echo("Recording demo: "@ %file);
$DemoFile = %file;
addMessageHudLine( "\c4Recording to file [\c2" @ $DemoFile @ "\cr].");
saveDemoSettings();
startRecord(%file);
// make sure start worked
if(!isRecordingDemo())
{
deleteFile("recordings/" @ $DemoFile @ ".rec");
addMessageHudLine( "\c3 *** Failed to record to file [\c2" @ $DemoFile @ "\cr].");
$DemoFile = "";
}
}
function demoPlaybackComplete()
function stopDemoRecord()
{
Canvas.setContent("LaunchGui");
Canvas.pushDialog(RecordingsDlg);
purgeResources();
if(isDemo())
return;
// make sure we are recording (and have a valid file)
if(isRecordingDemo())
stopRecord();
}
function demoRecordComplete()
{
// tell the user
if($DemoFile !$= "")
{
addMessageHudLine( "\c4Stopped recording to file [\c2" @ $DemoFile @ "\cr].");
$DemoFile = "";
}
}
//-------------------------------------------------------------------------
function toggleDemoPlaybackHud()
{
if(DemoPlaybackDlg.isAwake())
Canvas.popDialog(DemoPlaybackDlg);
else
Canvas.pushDialog(DemoPlaybackDlg, 99);
}
$DemoPlaybackText[0] = "Paused"; $DemoPlaybackSpeed[0] = 0;
$DemoPlaybackText[1] = "Play 1/16X"; $DemoPlaybackSpeed[1] = 0.0625;
$DemoPlaybackText[2] = "Play 1/8X"; $DemoPlaybackSpeed[2] = 0.125;
$DemoPlaybackText[3] = "Play 1/4X"; $DemoPlaybackSpeed[3] = 0.25;
$DemoPlaybackText[4] = "Play 1/2X"; $DemoPlaybackSpeed[4] = 0.5;
$DemoPlaybackText[5] = "Play 1X"; $DemoPlaybackSpeed[5] = 1;
$DemoPlaybackText[6] = "Play 2X"; $DemoPlaybackSpeed[6] = 2;
$DemoPlaybackText[7] = "Play 4X"; $DemoPlaybackSpeed[7] = 4;
$DemoPlaybackText[8] = "Play 8X"; $DemoPlaybackSpeed[8] = 8;
$DemoPlaybackText[9] = "Play 16X"; $DemoPlaybackSpeed[9] = 16;
// called after each processTime
function demoPlaybackUpdate(%curTime)
{
DemoPlayback_CurTime.setValue(msToMinSec(%curTime));
$DemoPlaybackProgress = %curTime / $DemoPlaybackLength;
}
function updateDemoPlaybackStatus()
{
// clamp the speed
if($DemoPlaybackIndex < 0)
$DemoPlaybackIndex = 0;
if($DemoPlaybackIndex > 9)
$DemoPlaybackIndex = 9;
DemoPlayback_StatusText.setValue($DemoPlaybackText[$DemoPlaybackIndex]);
$timeScale = $DemoPlaybackSpeed[$DemoPlaybackIndex];
}
function toggleDemoPause()
{
// save the current index for unpause
if($DemoPlaybackIndex == 0)
$DemoPlaybackIndex = $DemoPlaybackLastIndex;
else
{
$DemoPlaybackLastIndex = $DemoPlaybackIndex;
$DemoPlaybackIndex = 0;
}
updateDemoPlaybackStatus();
}
function stepDemoPlaybackSpeed(%step)
{
$DemoPlaybackIndex += %step;
updateDemoPlaybackStatus();
}
function DemoPlaybackDlg::onWake(%this)
{
updateDemoPlaybackStatus();
}

View file

@ -12,6 +12,12 @@ function VerifyCDCheck(%func)
call(%func);
}
function logEcho(%msg)
{
if($LogEchoEnabled)
echo("LOG: " @ %msg);
}
function CreateServer(%mission, %missionType)
{
DestroyServer();
@ -77,6 +83,8 @@ function CreateServer(%mission, %missionType)
{
exec("scripts/DefaultGame.cs");
exec("scripts/SinglePlayerGame.cs");
exec("scripts/CTFGame.cs");
exec("scripts/HuntersGame.cs");
}
$missionSequence = 0;
@ -92,11 +100,11 @@ function CreateServer(%mission, %missionType)
%missionType = $HostTypeName[0];
}
if ( $HostGameType $= "Online" && $pref::Net::DisplayOnMaster !$= "Never" )
if ( ( isDemo() && $HostGameType !$= "SinglePlayer" ) || ( $HostGameType $= "Online" && $pref::Net::DisplayOnMaster !$= "Never" ) )
schedule(0,0,startHeartbeat);
// setup the bots for this server
if( $Host::BotsEnabled )
if( !isDemo() && $Host::BotsEnabled )
initGameBots( %mission, %missionType );
// load the mission...
@ -231,6 +239,9 @@ function Disconnect()
function DisconnectedCleanup()
{
$CurrentMissionType = "";
$CurrentMission = "";
// Make sure we're not still waiting for the loading info:
cancelLoadInfoCheck();
@ -384,38 +395,73 @@ function addDemoAlias( %name )
$DemoNameCount++;
}
addDemoAlias( "Amateur" );
addDemoAlias( "Bullseye" );
addDemoAlias( "Casualty" );
addDemoAlias( "Dogfood" );
addDemoAlias( "Extinct" );
addDemoAlias( "Fodder" );
addDemoAlias( "Grunt" );
addDemoAlias( "Helpless" );
addDemoAlias( "Itchy" );
addDemoAlias( "Joker" );
addDemoAlias( "Kibble" );
addDemoAlias( "Learner" );
addDemoAlias( "Meat" );
addDemoAlias( "Newbie" );
addDemoAlias( "Owned" );
addDemoAlias( "Poser" );
addDemoAlias( "Quaker" );
addDemoAlias( "Roadkill" );
addDemoAlias( "Skid Mark" );
addDemoAlias( "Easy Target" );
addDemoAlias( "Underdog" );
addDemoAlias( "Vegetable" );
addDemoAlias( "Weakling" );
addDemoAlias( "Flatline" );
addDemoAlias( "Yo-yo" );
addDemoAlias( "Zero" );
addDemoAlias( "Apprentice" );
addDemoAlias( "Bonehead" );
addDemoAlias( "Clown" );
addDemoAlias( "Dodo" );
addDemoAlias( "Endangered" );
addDemoAlias( "Feeble" );
if ( isDemo() )
{
addDemoAlias( "Butterfingers" );
addDemoAlias( "Bullseye" );
addDemoAlias( "Casualty" );
addDemoAlias( "Dogfood" );
addDemoAlias( "Extinct" );
addDemoAlias( "Fodder" );
addDemoAlias( "Grunt" );
addDemoAlias( "Helpless" );
addDemoAlias( "Itchy" );
addDemoAlias( "Bait" );
addDemoAlias( "Kibble" );
addDemoAlias( "MonkeyBoy" );
addDemoAlias( "Meat" );
addDemoAlias( "Newbie" );
addDemoAlias( "Owned" );
addDemoAlias( "Poser" );
addDemoAlias( "Quaker" );
addDemoAlias( "Roadkill" );
addDemoAlias( "SkidMark" );
addDemoAlias( "EZTarget" );
addDemoAlias( "Underdog" );
addDemoAlias( "Vegetable" );
addDemoAlias( "Weakling" );
addDemoAlias( "Flatline" );
addDemoAlias( "Spud" );
addDemoAlias( "Zero" );
addDemoAlias( "WetNose" );
addDemoAlias( "Chowderhead" );
addDemoAlias( "Clown" );
addDemoAlias( "Dodo" );
addDemoAlias( "Endangered" );
addDemoAlias( "Feeble" );
addDemoAlias( "Gimp" );
addDemoAlias( "Inky" );
addDemoAlias( "Pinky" );
addDemoAlias( "Blinky" );
addDemoAlias( "Clyde" );
addDemoAlias( "Loopy" );
addDemoAlias( "Masochist" );
addDemoAlias( "Pancake" );
addDemoAlias( "Rubbish" );
addDemoAlias( "Sickly" );
addDemoAlias( "Terminal" );
addDemoAlias( "Ugly Duckling" );
addDemoAlias( "Sheepish" );
addDemoAlias( "Whiplash" );
addDemoAlias( "KickMe" );
addDemoAlias( "Yellow Belly" );
addDemoAlias( "Bits" );
addDemoAlias( "Doofus" );
addDemoAlias( "Fluffy Bunny" );
addDemoAlias( "Lollipop" );
addDemoAlias( "Troglodyte" );
addDemoAlias( "Carcass" );
addDemoAlias( "Noodle" );
addDemoAlias( "Spastic" );
addDemoAlias( "Wimpy" );
addDemoAlias( "Sweet Pea" );
addDemoAlias( "Abused" );
addDemoAlias( "Happy Camper" );
addDemoAlias( "FreakShow" );
addDemoAlias( "Bumpkin" );
addDemoAlias( "Mad Cow" );
addDemoAlias( "Cud" );
}
function pickDemoName()
{
@ -474,7 +520,7 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
sendLoadInfoToClient( %client );
//%client.setSimulatedNetParams(0.1, 30);
if ( isDemoServer() )
if (isDemo() && $CurrentMissionType !$= "SinglePlayer")
{
%client.armor = "Light";
%client.sex = "Male";
@ -543,6 +589,62 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
{
%client.isSmurf = false;
//make sure the name is unique - that a smurf isn't using this name...
%dup = -1;
%count = ClientGroup.getCount();
for (%i = 0; %i < %count; %i++)
{
%test = ClientGroup.getObject( %i );
if (%test != %client)
{
%rawName = stripChars( detag( getTaggedString( %test.name ) ), "\cp\co\c6\c7\c8\c9" );
if (%realName $= %rawName)
{
%dup = %test;
%dupName = %rawName;
break;
}
}
}
//see if we found a duplicate name
if (isObject(%dup))
{
//change the name of the dup
%isUnique = false;
%suffixCount = 1;
while (!%isUnique)
{
%found = false;
%testName = %dupName @ "." @ %suffixCount;
for (%i = 0; %i < %count; %i++)
{
%cl = ClientGroup.getObject(%i);
%rawName = stripChars( detag( getTaggedString( %cl.name ) ), "\cp\co\c6\c7\c8\c9" );
if (%rawName $= %testName)
{
%found = true;
break;
}
}
if (%found)
%suffixCount++;
else
%isUnique = true;
}
//%testName will now have the new unique name...
%oldName = %dupName;
%newName = %testName;
MessageAll( 'MsgSmurfDupName', '\c2The real \"%1\" has joined the server.', %dupName );
MessageAll( 'MsgClientNameChanged', '\c2The smurf \"%1\" is now called \"%2\".', %oldName, %newName, %dup );
%dup.name = addTaggedString(%newName);
setTargetName(%dup.target, %dup.name);
}
// Add the tribal tag:
%tag = getField( %authInfo, 1 );
%append = getField( %authInfo, 2 );
@ -670,15 +772,30 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
if ( $CurrentMissionType !$= "SinglePlayer" )
{
messageClient(%client, 'MsgClientJoin', '\c2Welcome to Tribes2 %1.',
%client.name,
%client,
%client.target,
false, // isBot
%client.isAdmin,
%client.isSuperAdmin,
%client.isSmurf,
%client.sendGuid );
if ( isDemo() )
{
messageClient(%client, 'MsgClientJoin', '\c2Welcome to the Tribes 2 Demo!',
%client.name,
%client,
%client.target,
false, // isBot
%client.isAdmin,
%client.isSuperAdmin,
%client.isSmurf,
%client.sendGuid );
}
else
{
messageClient(%client, 'MsgClientJoin', '\c2Welcome to Tribes2 %1.',
%client.name,
%client,
%client.target,
false, // isBot
%client.isAdmin,
%client.isSuperAdmin,
%client.isSmurf,
%client.sendGuid );
}
messageAllExcept(%client, -1, 'MsgClientJoin', '\c1%1 joined the game.',
%client.name,
@ -714,17 +831,21 @@ function GameConnection::onDrop(%client, %reason)
{
if(isObject(Game))
Game.onClientLeaveGame(%client);
// make sure that tagged string of player name is not used
if ( $CurrentMissionType $= "SinglePlayer" )
messageAllExcept(%client, -1, 'MsgClientDrop', "", %client.name, %client);
messageAllExcept(%client, -1, 'MsgClientDrop', "", getTaggedString(%client.name), %client);
else
messageAllExcept(%client, -1, 'MsgClientDrop', '\c1%1 has left the game.', %client.name, %client);
messageAllExcept(%client, -1, 'MsgClientDrop', '\c1%1 has left the game.', getTaggedString(%client.name), %client);
if ( isObject( %client.camera ) )
%client.camera.delete();
freeClientTarget(%client);
removeTaggedString(%client.name);
removeTaggedString(%client.voiceTag);
removeTaggedString(%client.skin);
freeClientTarget(%client);
echo("CDROP: " @ %client @ " " @ %client.getAddress());
$HostGamePlayerCount--;
@ -750,6 +871,20 @@ function dismountPlayers()
function loadMission( %missionName, %missionType, %firstMission )
{
//ensure the demo server is using appropriate missions
if (isDemo() && %missionType !$= "SinglePlayer")
{
if (%missionName $= "Slapdash")
%missionType = "CTF";
else if (%missionName $= "Rasp")
%missionType = "Hunters";
else
{
%missionName = "Slapdash";
%missionType = "CTF";
}
}
$LoadingMission = true;
disableCyclingConnections(true);
if (!$pref::NoClearConsole)
@ -762,7 +897,7 @@ function loadMission( %missionName, %missionType, %firstMission )
ClearCenterPrintAll();
ClearBottomPrintAll();
if( $Host::TournamentMode )
if( !isDemo() && $Host::TournamentMode )
resetTournamentPlayers();
// Send load info to all the connected clients:
@ -891,13 +1026,15 @@ function loadMissionStage2()
AISystemEnabled( false );
// Set the team damage here so that the game type can override it:
if ( $Host::TournamentMode )
if ( isDemo() )
$TeamDamage = 0;
else if ( $Host::TournamentMode )
$TeamDamage = 1;
else
$TeamDamage = $Host::TeamDamageOn;
//the demo version always has team damage off
if (isDemo() || isDemoServer())
if (isDemo())
$TeamDamage = 0;
Game.missionLoadDone();
@ -909,7 +1046,7 @@ function loadMissionStage2()
if(!$MatchStarted && $LaunchMode !$= "NavBuild" && $LaunchMode !$= "SpnBuild" )
{
if( $Host::TournamentMode )
if( !isDemo() && $Host::TournamentMode )
checkTourneyMatchStart();
else if( $currentMissionType !$= "SinglePlayer" )
checkMissionStart();
@ -1066,7 +1203,7 @@ function serverSetClientTeamState( %client )
MissionCleanup.add( %client.camera ); // we get automatic cleanup this way.
%observer = false;
if( !$Host::TournamentMode )
if( isDemo() || !$Host::TournamentMode )
{
if( %client.justConnected )
{
@ -1174,6 +1311,16 @@ function clientCmdSetFirstPerson(%value)
ammoHud.setVisible(false);
}
function clientCmdGetFirstPerson()
{
commandToServer('FirstPersonValue', $firstPerson);
}
function serverCmdFirstPersonValue(%client, %firstPerson)
{
%client.player.firstPerson = %firstPerson;
}
function clientCmdVehicleMount()
{
if ( $pref::toggleVehicleView )
@ -1387,6 +1534,14 @@ function serverCmdAddBot( %client )
function serverCmdClientJoinTeam( %client, %team )
{
if( %team == -1 )
{
if( %client.team == 1 )
%team = 2;
else
%team = 1;
}
if ( isObject( Game ) && Game.kickClient != %client)
{
if(%client.team != %team)
@ -1424,7 +1579,7 @@ function serverCmdClientAddToGame( %client, %targetClient )
%targetClient.setControlObject( %targetClient.camera );
}
if($Host::TournamentMode && !$CountdownStarted)
if( !isDemo() && $Host::TournamentMode && !$CountdownStarted)
{
%targetClient.notReady = true;
centerprint( %targetClient, "\nPress FIRE when ready.", 0, 3 );
@ -1460,7 +1615,7 @@ function serverCmdChangePlayersTeam( %clientRequesting, %client, %team)
%client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player );
%client.setControlObject( %client.camera );
if($Host::TournamentMode && !$CountdownStarted)
if( !isDemo() && $Host::TournamentMode && !$CountdownStarted)
{
%client.notReady = true;
centerprint( %client, "\nPress FIRE when ready.", 0, 3 );
@ -1473,7 +1628,7 @@ function serverCmdChangePlayersTeam( %clientRequesting, %client, %team)
if(%multiTeam)
{
messageClient( %client, 'MsgClient', '\c1The Admin has changed your team.');
messageAllExcept( %client, -1, 'MsgClient', '\c1The Admin forced %1 to join the %2 team.', %client.name, $teamName[%client.team]);
messageAllExcept( %client, -1, 'MsgClient', '\c1The Admin forced %1 to join the %2 team.', %client.name, game.getTeamName(%client.team) );
}
else
{
@ -1597,7 +1752,7 @@ function playerPickTeam( %client )
if(%numTeams > 1)
{
%client.camera.mode = "PickingTeam";
schedule( 0, 0, "commandToClient", %client, 'pickTeamMenu', getTaggedString($TeamName[1]), getTaggedString($TeamName[2]));
schedule( 0, 0, "commandToClient", %client, 'pickTeamMenu', Game.getTeamName(1), Game.getTeamName(2));
}
else
{
@ -1612,7 +1767,7 @@ function playerPickTeam( %client )
function serverCmdPlayContentSet( %client )
{
if( $Host::TournamentMode && !$CountdownStarted && !$MatchStarted )
if( !isDemo() && $Host::TournamentMode && !$CountdownStarted && !$MatchStarted )
playerPickTeam( %client );
}
@ -2008,34 +2163,37 @@ function resetServerDefaults()
exec( "scripts/ServerDefaults.cs" );
exec( $serverprefs );
//convert the team skin and name vars to tags...
%index = 0;
while ($Host::TeamSkin[%index] !$= "")
if ( !isDemo() )
{
$TeamSkin[%index] = addTaggedString($Host::TeamSkin[%index]);
%index++;
}
//convert the team skin and name vars to tags...
%index = 0;
while ($Host::TeamSkin[%index] !$= "")
{
$TeamSkin[%index] = addTaggedString($Host::TeamSkin[%index]);
%index++;
}
%index = 0;
while ($Host::TeamName[%index] !$= "")
{
$TeamName[%index] = addTaggedString($Host::TeamName[%index]);
%index++;
}
%index = 0;
while ($Host::TeamName[%index] !$= "")
{
$TeamName[%index] = addTaggedString($Host::TeamName[%index]);
%index++;
}
// Get the hologram names from the prefs...
%index = 1;
while ( $Host::holoName[%index] !$= "" )
{
$holoName[%index] = $Host::holoName[%index];
%index++;
// Get the hologram names from the prefs...
%index = 1;
while ( $Host::holoName[%index] !$= "" )
{
$holoName[%index] = $Host::holoName[%index];
%index++;
}
}
// kick all bots...
removeAllBots();
// add bots back if they were there before..
if( $Host::botsEnabled )
if( !isDemo() && $Host::botsEnabled )
initGameBots( $Host::Map, $Host::MissionType );
// load the missions

View file

@ -3,17 +3,6 @@
// Audio Descriptions
//
//datablock AudioDescription(TestLooping3d)
//{
// volume = 0.5;
// isLooping= true;
//
// is3D = true;
// minDistance= 10.0;
// MaxDistance= 640.0;
// type = $EffectAudioType;
//};
datablock AudioDescription(ProjectileLooping3d)
{
volume = 1.0;
@ -112,7 +101,7 @@ datablock AudioDescription(AudioExplosion3d)
};
datablock AudioDescription(AudioBomb3d)
// Regular weapon explosions
// Bomber Bombs
{
volume = 1.0;
isLooping= false;
@ -163,17 +152,20 @@ datablock AudioEnvironment(Underwater)
{
useRoom = true;
room = UNDERWATER;
effectVolume = 0.6;
};
datablock AudioEnvironment(BigRoom)
{
useRoom = true;
room = CAVE;
room = AUDITORIUM;
effectVolume = 0.4;
};
datablock AudioEnvironment(SmallRoom)
{
useRoom = true;
room = HALLWAY;
room = STONEROOM;
effectVolume = 0.4;
};

View file

@ -225,4 +225,6 @@ function serverCmdScopeCommanderMap(%client, %scope)
if(%scope)
resetControlObject(%client);
%client.scopeCommanderMap(%scope);
commandToClient(%client, 'ScopeCommanderMap', %scope);
}

View file

@ -9,7 +9,7 @@ $Host::teamSkin[6] = "cotp";
$Host::teamName[0] = "Unassigned";
$Host::teamName[1] = "Storm";
$Host::teamName[2] = "Inferno";
$Host::teamName[3] = "Star Wolf";
$Host::teamName[3] = "Starwolf";
$Host::teamName[4] = "Diamond Sword";
$Host::teamName[5] = "Blood Eagle";
$Host::teamName[6] = "Phoenix";
@ -21,28 +21,37 @@ $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 = "Tribes 2 Server";
$Host::Info = "This is a Tribes 2 Server.";
$Host::Map = "Katabatic";
$Host::MaxPlayers = 64;
}
$Host::AdminList = ""; // all players that will be automatically an admin upon joining server
$Host::SuperAdminList = ""; // all players that will be automatically a super admin upon joining server
$Host::BindAddress = ""; // set to an ip address if the server wants to specify which NIC/IP to use
$Host::Port = 28000;
$Host::GameName = "Tribes 2 Server";
$Host::Password = "";
$Host::AdminPassword = "";
$Host::PureServer = 1;
$Host::Dedicated = 0;
$Host::MissionType = "CTF";
if (!isDemo())
$Host::Map = "Katabatic";
else
$Host::Map = "SlapDash";
$Host::MaxPlayers = 64;
$Host::TimeLimit = 30;
$Host::BotCount = 2;
$Host::BotsEnabled = 0;
$Host::MinBotDifficulty = 0.5;
$Host::MaxBotDifficulty = 0.75;
$Host::Info = "This is a Tribes 2 Server.";
$Host::NoSmurfs = 0;
$Host::VoteTime = 30; // amount of time before votes are calculated
$Host::VotePassPercent = 60; // percent needed to pass a vote
@ -56,68 +65,73 @@ $Host::FloodProtectionEnabled = 1;
$Host::MaxMessageLen = 120;
$Host::VoteSpread = 20;
$Host::TeamDamageOn = 0;
$MasterServerAddress = "IP:198.74.40.152:28000";
$Host::Siege::Halftime = 20000;
$Host::CRCTextures = 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 32";
$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 16";
$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 24";
$Host::MapPlayerLimits["CasernCavite", "Bounty"] = "-1 32";
$Host::MapPlayerLimits["Damnation", "CTF"] = "-1 32";
$Host::MapPlayerLimits["DeathBirdsFly", "CTF"] = "32 -1";
$Host::MapPlayerLimits["Desiccator", "CTF"] = "16 -1";
$Host::MapPlayerLimits["DustToDust", "CTF"] = "-1 24";
$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 32";
$Host::MapPlayerLimits["Equinox", "CnH"] = "-1 -1";
$Host::MapPlayerLimits["Equinox", "DM"] = "-1 32";
$Host::MapPlayerLimits["Escalade", "Hunters"] = "16 -1";
$Host::MapPlayerLimits["Escalade", "TeamHunters"] = "16 -1";
$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"] = "16 -1";
$Host::MapPlayerLimits["Gehenna", "Hunters"] = "16 -1";
$Host::MapPlayerLimits["Gehenna", "TeamHunters"] = "16 -1";
$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 32";
$Host::MapPlayerLimits["Katabatic", "CTF"] = "-1 24";
$Host::MapPlayerLimits["Masada", "Siege"] = "-1 16";
$Host::MapPlayerLimits["Minotaur", "CTF"] = "-1 24";
$Host::MapPlayerLimits["Myrkwood", "Hunters"] = "-1 16";
$Host::MapPlayerLimits["Myrkwood", "DM"] = "-1 16";
$Host::MapPlayerLimits["Myrkwood", "Rabbit"] = "-1 24";
$Host::MapPlayerLimits["Oasis", "DM"] = "-1 16";
$Host::MapPlayerLimits["Overreach", "CnH"] = "16 -1";
$Host::MapPlayerLimits["Quagmire", "CTF"] = "16 -1";
$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 24";
$Host::MapPlayerLimits["Rasp", "Bounty"] = "-1 32";
$Host::MapPlayerLimits["Recalescence", "CTF"] = "16 -1";
$Host::MapPlayerLimits["Reversion", "CTF"] = "-1 32";
$Host::MapPlayerLimits["Rimehold", "Hunters"] = "16 -1";
$Host::MapPlayerLimits["Rimehold", "Hunters"] = "16 -1";
$Host::MapPlayerLimits["Riverdance", "CTF"] = "8 32";
$Host::MapPlayerLimits["Sanctuary", "CTF"] = "-1 32";
$Host::MapPlayerLimits["Sirocco", "CnH"] = "16 -1";
$Host::MapPlayerLimits["Slapdash", "CTF"] = "16 -1";
$Host::MapPlayerLimits["SunDried", "DM"] = "16 -1";
$Host::MapPlayerLimits["SunDried", "Bounty"] = "16 -1";
$Host::MapPlayerLimits["Talus", "Bounty"] = "-1 24";
$Host::MapPlayerLimits["ThinIce", "CTF"] = "-1 32";
$Host::MapPlayerLimits["Tombstone", "CTF"] = "8 32";
$Host::MapPlayerLimits["UltimaThule", "CTF"] = "-1 -1";
$Host::MapPlayerLimits["Underhill", "DM"] = "16 -1";
$Host::MapPlayerLimits["Underhill", "Bounty"] = "-1 24";
$Host::MapPlayerLimits["Whiteout", "DM"] = "16 -1";
$Host::MapPlayerLimits["Whiteout", "Bounty"] = "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";

View file

@ -537,6 +537,8 @@ function createText(%who)
%who.miscMsg[InBounds] = "You have returned to the mission area.";
%who.miscMsg[OOBLoss] = "You were outside the mission area too long. Do you want to try again?";
%who.miscMsg[LeaveGame] = "Are you sure you want to abandon this game?";
%who.miscMsg[noTaskListDlg] = "You have not yet been granted access to the task list dialog.";
%who.miscMsg[noInventoryHUD] = "You have not yet been granted access to the Inventory HUD.";
}

View file

@ -413,6 +413,278 @@ function getTerrainAngle(%point)
//echo("angle is "@%angleDeg);
return %angleDeg;
}
function randomGrove(%organicName, %num, %radius)
{
%minHeight = 0;
%maxHeight = 1000;
%SPACING = 1.5; //meters between center of organic and another object
//return help info
if(%organicName $="" || !%num || !%radius) {
echo("randomOrg(<shape name>, <quantity>[, radius of grove desired]);");
return;
}
%organicIndex = -1;
for (%i = 0; %i < $NumStaticTSObjects; %i++) {
if (getWord($StaticTSObjects[%i], 1) $= %organicName) {
%organicIndex = %i;
break;
}
}
if (%organicIndex == -1) {
error("There is no static shape named" SPC %organicName);
return;
}
%shapeFileName = getWord($StaticTSObjects[%organicIndex], 2);
%maxSlope = getWord($StaticTSObjects[%organicIndex], 3);
if (%maxSlope $= "")
%maxSlope = 40;
%zOffset = getWord($StaticTSObjects[%organicIndex], 4);
if (%zOffset $= "")
%zOffset = 0;
%slopeWithTerrain = getWord($StaticTSObjects[%organicIndex], 5);
if (%slopeWithTerrain $= "")
%slopeWithTerrain = false;
%minScale = getWord($StaticTSObjects[%organicIndex], 6);
%maxScale = getWord($StaticTSObjects[%organicIndex], 7);
//set up folders in mis file
$RandomOrganicsAdded++; //to keep track of groups
if(!isObject(RandomOrganics)) {
%randomOrgGroup = new simGroup(RandomOrganics);
MissionGroup.add(%randomOrgGroup);
}
%groupName = "Addition"@$RandomOrganicsAdded@%organicName;
%group = new simGroup(%groupName);
RandomOrganics.add(%group);
%ctr = LocalClientConnection.camera.getPosition();
%areaX = getWord(%ctr, 0) - %radius;
%areaY = getWord(%ctr, 1) - %radius;
%orgCount = %num;
while((%orgCount > 0) && (%retries < (15000 / %maxSlope))) //theoretically, a thorough number of retries
{
//find a tile
%x = (getRandom(mFloor(%areaX / 8), mFloor((%areaX + (%radius * 2)) / 8)) * 8) + 4; //tile center
%y = (getRandom(mFloor(%areaY / 8), mFloor((%areaY + (%radius * 2)) / 8)) * 8) + 4;
%start = %x @ " " @ %y @ " 2000";
%end = %x @ " " @ %y @ " -1";
%ground = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0);
%z = getWord(%ground, 3);
// elevation test
if ((%z < %minHeight) || (%z > %maxHeight))
{
echo("Broke height range rules. Readjust allowable elevations.");
%retries++;
echo("Z is " @ %z);
continue;
}
%z += %zOffset;
%position = %x @ " " @ %y @ " " @ %z;
// get normal from both sides of the square
%start = %x + 2 @ " " @ %y @ " 2000";
%end = %x + 2 @ " " @ %y @ " -1";
%hit1 = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0);
%start = %x - 2 @ " " @ %y @ " 2000";
%end = %x - 2 @ " " @ %y @ " -1";
%hit2 = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0);
%norm1 = getWord(%hit1, 4) @ " " @ getWord(%hit1, 5) @ " " @ getWord(%hit1, 6);
%norm2 = getWord(%hit2, 4) @ " " @ getWord(%hit2, 5) @ " " @ getWord(%hit2, 6);
//if either side of tile has greater slope than allowed, move on.
%angNorm1 = getTerrainAngle(%norm1);
%angNorm2 = getTerrainAngle(%norm2);
if ((getTerrainAngle(%norm1) > %maxSlope) || (getTerrainAngle(%norm2) > %maxslope))
{
%retries++;
continue;
}
%terrainNormal = VectorAdd(%norm1, %norm2);
%terrainNormal = VectorNormalize(%terrainNormal);
//search surroundings for obstacles. If obstructed, move on.
InitContainerRadiusSearch(%position, %spacing, $TypeMasks::VehicleObjectType |
$TypeMasks::MoveableObjectType |
$TypeMasks::StaticShapeObjectType |
$TypeMasks::TSStaticShapeObjectType |
$TypeMasks::ForceFieldObjectType |
$TypeMasks::TurretObjectType |
$TypeMasks::InteriorObjectType |
$TypeMasks::ItemObjectType);
%this = containerSearchNext();
if(%this)
{
%retries++;
continue;
}
//rotate it
if(%slopeWithTerrain)
{
%rotAxis = vectorCross(%terrainNormal, "0 0 1");
%rotAxis = vectorNormalize(%rotAxis);
%rotation = %rotAxis @ " " @ getTerrainAngle(%terrainNormal);
}
else %rotation = "1 0 0 0";
%randomAngle = getRandom(360);
%zrot = MatrixCreate("0 0 0", "0 0 1 " @ %randomAngle);
%orient = MatrixCreate(%position, %rotation);
%finalXForm = MatrixMultiply(%orient, %zrot);
//scale it
%scaleMin = 8; //default min
%scaleMax = 14; //default max
if(%minScale)
%scaleMin = %minScale * 10;
if(%maxScale)
%scaleMax = %maxScale * 10;
%scaleInt = getRandom(%scaleMin, %scaleMax);
%scale = %scaleInt/10;
%evenScale = %scale SPC %scale SPC %scale;
//create it
%position = %x SPC %y SPC (%z += %zoffset);
%newOrganic = new TSStatic() {
position = %position;
rotation = %rotation;
scale = %evenScale;
shapeName = %shapeFileName;
};
%group.add(%newOrganic);
%newOrganic.setTransform(%finalXForm);
%orgCount--; //dec number of shapes left to place
%retries = 0; //reset retry counter
}
if (%orgCount > 0)
{
error("Unable to place all shapes, area saturated.");
error("Looking for clear area " @ (%spacing * 2) @ " meters in diameter, with a max slope of " @ %maxSlope);
}
echo("Placed " @ %num - %orgCount @ " of " @ %num);
}
function randomRock(%rock, %quantity, %radius, %maxElev)
{
if (!%radius || !%quantity || !%rock)
{
echo("randomRock(<name>, <quantity>, <radius>, [maximum elevation]");
return;
}
if (!%maxElev)
%maxElev = 2000;
%rotation[0] = "0 0 1 0";
%rotation[1] = "0.999378 -0.0145686 -0.0321219 194.406";
%rotation[2] = "0.496802 0.867682 0.0177913 176.44";
%rotation[3] = "0.991261 0.0933696 0.0931923 181.867";
%rotation[4] = "0.246801 0.360329 -0.899584 92.3648";
%rotation[5] = "1 0 0 82.59";
%rotation[6] = "0.0546955 -0.629383 0.55201 116.103";
%spacing = 4.0; //check 4 meters around object for collisions before placing
%ctr = localClientConnection.camera.getPosition();
%areaX = getWord(%ctr, 0) - %radius;
%areaY = getWord(%ctr, 1) - %radius;
$RandomOrganicsAdded++;
if(!isObject(RandomRocks)) {
%randomOrgGroup = new simGroup(RandomRocks);
MissionGroup.add(%randomOrgGroup);
}
%groupName = "Addition"@$RandomOrganicsAdded@%rock;
%group = new simGroup(%groupName);
RandomRocks.add(%group);
%orgCount = %quantity;
while((%orgCount > 0) && (%retries < (15000 / %maxSlope))) //theoretically, a thorough number of retries
{
//find a tile
%x = %areaX + getRandom(%radius * 2);
%y = %areaY + getRandom(%radius * 2);
%start = %x @ " " @ %y @ " 2000";
%end = %x @ " " @ %y @ " -1";
%ground = containerRayCast(%start, %end, $TypeMasks::TerrainObjectType, 0);
%position = getWord(%ground, 1) @ " " @ getWord(%ground, 2) @ " " @ getWord(%ground, 3);
echo("position =*" @ %position @ "*");
%z = getWord(%position, 2);
// elevation test
if (%z > %maxElev) //65 meters and above only
{
%retries++;
echo("Z is " @ %z);
continue;
}
//search surroundings for obstacles. If obstructed, move on.
InitContainerRadiusSearch(%position, %spacing, $TypeMasks::VehicleObjectType |
$TypeMasks::MoveableObjectType |
$TypeMasks::StaticShapeObjectType |
$TypeMasks::TSStaticShapeObjectType |
$TypeMasks::ForceFieldObjectType |
$TypeMasks::TurretObjectType |
$TypeMasks::InteriorObjectType |
$TypeMasks::ItemObjectType);
%this = containerSearchNext();
if(%this)
{
%retries++;
continue;
}
%primaryRot = %rotation[getRandom(7)];
%randomAngle = mDegToRad(getRandom(360));
%zrot = MatrixCreate("0 0 0", "0 0 1 " @ %randomAngle);
%orient = MatrixCreate(%position, %primaryRot);
%scale = getRandom(3);
%evenScale = %scale @ " " @ %scale @ " " @ %scale;
%newRock = new InteriorInstance() {
scale = %evenScale;
interiorFile = %rock @ ".dif";
showTerrainInside = "0";
};
%group.add(%newRock);
%transfrm = MatrixMultiply(%orient, %zrot);
echo("Transform = *" @ %transfrm @ "*");
%newRock.setTransform(%transfrm);
%orgCount--; //dec number of shapes left to place
%retries = 0; //reset retry counter
}
if (%orgCount > 0)
{
error("Unable to place all shapes, area saturated.");
error("Looking for clear area " @ (%spacing * 2) @ " meters in diameter, with a max slope of " @ %maxSlope);
}
echo("Placed " @ %num - %orgCount @ " of " @ %num);
}
//--------------------------------------------------------------------------
@ -767,7 +1039,7 @@ function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %pos
if(%data.noDamageInSiege && Game.class $= "SiegeGame")
return;
if(%sourceObject)
if(%sourceObject && %targetObject.isEnabled())
{
if(%sourceObject.client)
{
@ -799,7 +1071,7 @@ function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %pos
%attackerTeam = getVehicleAttackerTeam(%sourceObject);
else %attackerTeam = %sourceObject.team;
if (isTargetFriendly(%targetObject.getTarget(), %attackerTeam))
if ((%targetObject.getTarget() != -1) && isTargetFriendly(%targetObject.getTarget(), %attackerTeam))
{
%curDamage = %targetObject.getDamageLevel();
%availableDamage = %targetObject.getDataBlock().disabledLevel - %curDamage - 0.05;
@ -841,6 +1113,7 @@ function StaticShapeData::onDamage(%this,%obj)
// if object has an explosion damage radius associated with it, apply explosion damage
if(%this.expDmgRadius)
RadiusExplosion(%obj, %obj.getWorldBoxCenter(), %this.expDmgRadius, %this.expDamage, %this.expImpulse, %obj, $DamageType::Explosion);
%obj.setDamageLevel(%this.maxDamage);
}
}
else
@ -861,14 +1134,14 @@ function StaticShapeData::onDamage(%this,%obj)
// --------------------------------------------------------------------
// Team logos - only the logo projector should be placed in a mission
datablock StaticShapeData(StormLogo)
datablock StaticShapeData(BaseLogo) //storm logo
{
className = Logo;
shapeFile = "teamlogo_storm.dts";
alwaysAmbient = true;
};
datablock StaticShapeData(InfernoLogo)
datablock StaticShapeData(BaseBLogo) //Inferno Logo
{
className = Logo;
shapeFile = "teamlogo_inf.dts";
@ -882,7 +1155,7 @@ datablock StaticShapeData(BiodermLogo)
alwaysAmbient = true;
};
datablock StaticShapeData(BloodEagleLogo)
datablock StaticShapeData(BEagleLogo)
{
className = Logo;
shapeFile = "teamlogo_be.dts";
@ -896,14 +1169,14 @@ datablock StaticShapeData(DSwordLogo)
alwaysAmbient = true;
};
datablock StaticShapeData(HarbingerLogo)
datablock StaticShapeData(COTPLogo)
{
className = Logo;
shapeFile = "teamlogo_hb.dts";
alwaysAmbient = true;
};
datablock StaticShapeData(StarwolfLogo)
datablock StaticShapeData(SwolfLogo)
{
className = Logo;
shapeFile = "teamlogo_sw.dts";
@ -1015,8 +1288,8 @@ $StaticTSObjects[43] = "Stackables Crate9 stackable3s.dts";
$StaticTSObjects[44] = "Stackables Crate10 stackable4l.dts";
$StaticTSObjects[45] = "Stackables Crate11 stackable4m.dts";
$StaticTSObjects[46] = "Stackables Crate12 stackable5l.dts";
$StaticTSObjects[47] = "VehicleWrecks ScoutWreckageShape vehicle_air_scout_wreck.dts";
$StaticTSObjects[48] = "VehicleWrecks TankWreckageShape vehicle_land_assault_wreck.dts";
$StaticTSObjects[47] = "Debris ScoutWreckageShape vehicle_air_scout_wreck.dts";
$StaticTSObjects[48] = "Debris TankWreckageShape vehicle_land_assault_wreck.dts";
$StaticTSObjects[49] = "Organics DSPlant16 dorg16.dts 20 -3.0 0 0.8 1.5";
$StaticTSObjects[50] = "Organics DSPlant17 dorg17.dts 20 -3.0 1 0.8 1.5";
$StaticTSObjects[51] = "Organics DSPlant18 dorg18.dts 20 -3.0 0 0.8 1.5";
@ -1045,12 +1318,38 @@ $StaticTSObjects[69] = "Statues HeavyMaleStatue statue_hmale.dts";
$StaticTSObjects[70] = "Statues LightFemaleStatue statue_lfemale.dts";
$StaticTSObjects[71] = "Statues LightMaleStatue statue_lmale.dts";
$StaticTSObjects[72] = "Statues Plaque statue_plaque.dts";
$StaticTSObjects[73] = "Debris BomberDebris1 bdb1.dts";
$StaticTSObjects[74] = "Debris BomberDebris2 bdb2.dts";
$StaticTSObjects[75] = "Debris BomberDebris3 bdb3.dts";
$StaticTSObjects[76] = "Debris BomberDebris4 bdb4.dts";
$StaticTSObjects[77] = "Debris BomberDebris5 bdb5.dts";
$StaticTSObjects[78] = "Debris HavocDebris1 hdb1.dts";
$StaticTSObjects[79] = "Debris HavocDebris2 hdb2.dts";
$StaticTSObjects[80] = "Debris HavocDebris3 hdb3.dts";
$StaticTSObjects[81] = "Debris IDebris1 idb.dts";
$StaticTSObjects[82] = "Debris MPBDebris1 mpbdb1.dts";
$StaticTSObjects[83] = "Debris MPBDebris2 mpbdb2.dts";
$StaticTSObjects[84] = "Debris MPBDebris3 mpbdb3.dts";
$StaticTSObjects[85] = "Debris MPBDebris4 mpbdb4.dts";
$StaticTSObjects[86] = "Debris ScoutDebris1 sdb1.dts";
$StaticTSObjects[87] = "Debris TankDebris1 tdb1.dts";
$StaticTSObjects[88] = "Debris TankDebris2 tdb2.dts";
$StaticTSObjects[89] = "Debris TankDebris3 tdb3.dts";
$StaticTSObjects[90] = "Debris GraveMarker1 gravemarker1.dts";
$StaticTSObjects[91] = "Test Test1 test1.dts";
$StaticTSObjects[92] = "Test Test2 test2.dts";
$StaticTSObjects[93] = "Test Test3 test3.dts";
$StaticTSObjects[94] = "Test Test4 test4.dts";
$StaticTSObjects[95] = "Test Test5 test5.dts";
$NumStaticTSObjects = 73;
$NumStaticTSObjects = 96;
function TSStatic::create(%shapeName)
{
echo("Foo:" SPC %shapeName);
//echo("Foo:" SPC %shapeName);
%obj = new TSStatic()
{
shapeName = %shapeName;
@ -1061,4 +1360,47 @@ function TSStatic::create(%shapeName)
function TSStatic::damage(%this)
{
// prevent console error spam
}
}
function stripFields(%this)
{
if(%this $= "")
%this = MissionGroup;
for (%i = 0; %i < %this.getCount(); %i++){
%obj = %this.getObject(%i);
if (%obj.getClassName() $= SimGroup)
{
%obj.powerCount = "";
%obj.team = "";
stripFields(%obj);
}
else
{
%obj.threshold = "";
%obj.team = "";
%obj.powerCount = "";
%obj.trigger = "";
%obj.hidden = "";
%obj.locked = "true";
%obj.notReady = "";
%obj.inUse = "";
%obj.triggeredBy = "";
%obj.lastDamagedBy = "";
%obj.lastDamagedByTeam ="";
%obj.isHome = "";
%obj.originalPosition = "";
%obj.objectiveCompleted = "";
%obj.number = "";
%obj.target = "";
%obj.lockCount = "";
%obj.homingCount = "";
%obj.projector = "";
%obj.holo = "";
%obj.waypoint = "";
%obj.scoreValue ="";
%obj.damageTimeMS = "";
%obj.station = "";
%homingCount = "";
}
}
}

View file

@ -5,18 +5,34 @@ datablock EffectProfile(StationInventoryActivateEffect)
{
effectname = "powered/inv_pad_on";
minDistance = 5.0;
maxDistance = 7.5;
};
datablock EffectProfile(StationVehicleAcitvateEffect)
{
effectname = "powered/vehicle_screen_on2";
minDistance = 3.0;
maxDistance = 5.0;
};
datablock EffectProfile(StationVehicleDeactivateEffect)
{
effectname = "powered/vehicle_screen_off";
minDistance = 3.0;
maxDistance = 5.0;
};
//datablock EffectProfile(MobileBaseInventoryActivateEffect)
//{
// effectname = "misc/diagnostic_on";
// minDistance = 3.0;
//};
datablock EffectProfile(StationAccessDeniedEffect)
{
effectname = "powered/station_denied";
minDistance = 3.0;
maxDistance = 5.0;
};
datablock AudioProfile(StationInventoryActivateSound)
@ -32,6 +48,7 @@ datablock AudioProfile(MobileBaseInventoryActivateSound)
filename = "fx/vehicles/mpb_inv_station.wav";
description = AudioClose3d;
preload = true;
effect = StationInventoryActivateEffect;
};
datablock AudioProfile(DepInvActivateSound)
@ -39,6 +56,7 @@ datablock AudioProfile(DepInvActivateSound)
filename = "fx/powered/dep_inv_station.wav";
description = AudioClose3d;
preload = true;
effect = StationInventoryActivateEffect;
};
datablock AudioProfile(StationVehicleAcitvateSound)
@ -62,6 +80,7 @@ datablock AudioProfile(StationAccessDeniedSound)
filename = "fx/powered/station_denied.wav";
description = AudioClosest3d;
preload = true;
effect = StationAccessDeniedEffect;
};
datablock AudioProfile(StationVehicleHumSound)
@ -156,6 +175,41 @@ datablock StaticShapeData(StationInventory) : StaticShapeDamageProfile
debris = StationDebris;
};
datablock StaticShapeData(StationAmmo) : StaticShapeDamageProfile
{
className = Station;
catagory = "Stations";
// shapeFile = "station_ammo.dts";
shapeFile = "station_inv_human.dts";
maxDamage = 1.00;
destroyedLevel = 1.00;
disabledLevel = 0.70;
explosion = ShapeExplosion;
expDmgRadius = 8.0;
expDamage = 0.4;
expImpulse = 1500.0;
// don't allow this object to be damaged in non-team-based
// mission types (DM, Rabbit, Bounty, Hunters)
noIndividualDamage = true;
dynamicType = $TypeMasks::StationObjectType;
isShielded = true;
energyPerDamagePoint = 75;
maxEnergy = 50;
rechargeRate = 0.35;
doesRepair = true;
humSound = StationInventoryHumSound;
cmdCategory = "Support";
cmdIcon = CMDStationIcon;
cmdMiniIconName = "commander/MiniIcons/com_inventory_grey";
targetNameTag = 'Ammo';
targetTypeTag = 'Station';
debrisShapeName = "debris_generic.dts";
debris = StationDebris;
};
datablock StaticShapeData(StationVehicle) : StaticShapeDamageProfile
{
className = Station;
@ -346,6 +400,102 @@ function StationInventory::setPlayersPosition(%data, %obj, %trigger, %colObj)
return false;
}
///////////////////////////////////////////////////////////////////////////////
/// -Ammo- ////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
function StationAmmo::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%obj.setRechargeRate(%obj.getDatablock().rechargeRate);
%trigger = new Trigger()
{
dataBlock = stationTrigger;
polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3";
};
MissionCleanup.add(%trigger);
%trigger.setTransform(%obj.getTransform());
%trigger.station = %obj;
%trigger.mainObj = %obj;
%trigger.disableObj = %obj;
%obj.trigger = %trigger;
}
//-------------------------------------------------------------------------------
function StationAmmo::stationReady(%data, %obj)
{
//error("StationAmmo::stationReady");
%obj.notReady = 1;
%obj.inUse = "Down";
%obj.setThreadDir($ActivateThread, true);
%obj.schedule(100, "playThread", $ActivateThread, "activate1");
%player = %obj.triggeredBy;
%energy = %player.getEnergyLevel();
//%player.setCloaked(true);
//%player.schedule(500, "setCloaked", false);
if (!%player.client.isAIControlled())
getAmmoStationLovin(%player.client);
//%data.schedule( 500, "beginPersonalInvEffect", %obj );
}
//-------------------------------------------------------------------------------
function StationAmmo::onEndSequence(%data, %obj, %thread)
{
if(%thread == $ActivateThread)
{
%obj.setThreadDir($ActivateThread, false);
%obj.playThread( $ActivateThread, "activate1");
if(%obj.inUse $= "Up")
{
%data.stationReady(%obj);
%player = %obj.triggeredBy;
if(%data.doesRepair && !%player.stationRepairing && %player.getDamageLevel() != 0) {
%oldRate = %player.getRepairRate();
%player.setRepairRate(%oldRate + 0.00625);
%player.stationRepairing = 1;
}
}
}
//Parent::onEndSequence(%data, %obj, %thread);
}
//-------------------------------------------------------------------------------
function StationAmmo::stationFinished(%data, %obj)
{
//Hide the Inventory Station GUI
}
//-------------------------------------------------------------------------------
function StationAmmo::getSound(%data, %forward)
{
if(%forward)
return "StationInventoryActivateSound";
else
return false;
}
//-------------------------------------------------------------------------------
function StationAmmo::setPlayersPosition(%data, %obj, %trigger, %colObj)
{
%vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0";
if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj))
{
%pos = %trigger.position;
%colObj.setvelocity("0 0 0");
%rot = getWords(%colObj.getTransform(),3, 6);
%colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2) + 0.8 @ " " @ %rot);//center player on object
%colObj.setMoveState(true);
%colObj.schedule(1600,"setMoveState", false);
%colObj.setvelocity("0 0 0");
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
/// -Vehicle- //////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
@ -398,7 +548,11 @@ function StationVehicle::stationReady(%data, %obj)
function StationVehicle::stationFinished(%data, %obj)
{
//Hide the Vehicle Station GUI
commandToClient(%obj.triggeredBy.client, 'StationVehicleHideHud');
if(!%obj.triggeredBy.isMounted())
commandToClient(%obj.triggeredBy.client, 'StationVehicleHideHud');
else
commandToClient(%obj.triggeredBy.client, 'StationVehicleHideJustHud');
}
/// -Vehicle- //////////////////////////////////////////////////////////////////
@ -480,7 +634,6 @@ function StationVehiclePad::onAdd(%this, %obj)
if(%obj.mobileBaseVehicle !$= "Removed")
{
%sv.vehicle[mobileBasevehicle] = true;
// createTeleporter(%sv.getDataBlock(), %sv);
}
if(%obj.scoutFlyer !$= "Removed")
%sv.vehicle[scoutFlyer] = true;
@ -645,8 +798,8 @@ function stationTrigger::onEnterTrigger(%data, %obj, %colObj)
//verify station.team is team associated and isn't on player's team
if((%obj.mainObj.team != %colObj.client.team) && (%obj.mainObj.team != 0))
{
%obj.station.playAudio(2, StationAccessDeniedSound);
messageClient(%colObj.client, 'msgStationDenied', '\c2Access Denied -- Wrong team.');
//%obj.station.playAudio(2, StationAccessDeniedSound);
messageClient(%colObj.client, 'msgStationDenied', '\c2Access Denied -- Wrong team.~wfx/powered/station_denied.wav');
}
else if(%obj.disableObj.isDisabled())
{
@ -725,35 +878,32 @@ function stationTrigger::onLeaveTrigger(%data, %obj, %colObj)
////////////////////////////////////////////////////////////////////////////////
function Station::stationTriggered(%data, %obj, %isTriggered)
{
if(%data.teleporter $= "")
{
if(%isTriggered)
if(%isTriggered)
{
%obj.setThreadDir($ActivateThread, TRUE);
%obj.playThread($ActivateThread,"activate");
%obj.playAudio($ActivateSound, %data.getSound(true));
%obj.inUse = "Up";
}
else
{
if(%obj.getDataBlock().getName() !$= StationVehicle)
{
%obj.setThreadDir($ActivateThread, TRUE);
%obj.playThread($ActivateThread,"activate");
%obj.playAudio($ActivateSound, %data.getSound(true));
%obj.inUse = "Up";
%obj.stopThread($ActivateThread);
if(%obj.getObjectMount())
%obj.getObjectMount().stopThread($ActivateThread);
%obj.inUse = "Down";
}
else
{
if(%obj.getDataBlock().getName() !$= StationVehicle)
{
%obj.stopThread($ActivateThread);
if(%obj.getObjectMount())
%obj.getObjectMount().stopThread($ActivateThread);
%obj.inUse = "Down";
}
else
{
%obj.setThreadDir($ActivateThread, FALSE);
%obj.playThread($ActivateThread,"activate");
%obj.playAudio($ActivateSound, %data.getSound(false));
%obj.inUse = "Down";
}
}
%obj.setThreadDir($ActivateThread, FALSE);
%obj.playThread($ActivateThread,"activate");
%obj.playAudio($ActivateSound, %data.getSound(false));
%obj.inUse = "Down";
}
}
else
%data.tryTeleport(%obj);
}
////-Station-///////////////////////////////////////////////////////////////////
@ -938,332 +1088,3 @@ function DeployedStationInventory::getSound(%data, %forward)
return false;
}
////////////////////////////////////////////////////////////////////////////////
/// -Mobile Base Teleporter DATA- //////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
datablock AudioProfile(StationTeleportAcitvateSound)
{
filename = "fx/powered/vehicle_screen_on2.wav";
description = AudioClosest3d;
preload = true;
effect = StationVehicleAcitvateEffect;
};
datablock AudioProfile(StationTeleportHumSound)
{
filename = "fx/powered/station_hum.wav";
description = CloseLooping3d;
preload = true;
};
datablock AudioProfile(StationTeleportDeactivateSound)
{
filename = "fx/powered/vehicle_screen_off.wav";
description = AudioClose3d;
preload = true;
effect = StationVehicleDeactivateEffect;
};
datablock AudioProfile(TeleportSound)
{
filename = "fx/powered/vehicle_screen_on2.wav";
description = AudioClosest3d;
preload = true;
effect = StationVehicleAcitvateEffect;
};
datablock AudioProfile(UnTeleportSound)
{
filename = "fx/powered/vehicle_screen_off.wav";
description = AudioClose3d;
preload = true;
effect = StationVehicleDeactivateEffect;
};
datablock StaticShapeData(MPBTeleporter) : StaticShapeDamageProfile
{
className = Station;
catagory = "Stations";
shapeFile = "station_teleport.dts";
maxDamage = 1.20;
destroyedLevel = 1.20;
disabledLevel = 0.84;
explosion = ShapeExplosion;
expDmgRadius = 10.0;
expDamage = 0.4;
expImpulse = 1500.0;
dynamicType = $TypeMasks::StationObjectType;
isShielded = true;
energyPerDamagePoint = 33;
maxEnergy = 250;
rechargeRate = 0.31;
humSound = StationTeleportHumSound;
// don't let these be damaged in Siege missions
noDamageInSiege = true;
cmdCategory = "Support";
cmdIcon = CMDVehicleStationIcon;
cmdMiniIconName = "commander/MiniIcons/com_vehicle_pad_inventory";
targetTypeTag = 'Teleport Station';
teleporter = 1;
};
////////////////////////////////////////////////////////////////////////////////
/// -Mobile Base Teleport- /////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- onAdd (%this, %obj)
// %this = Object data block
// %obj = Object being added
//Decription -- Called when the object is added to the mission
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
}
function MPBTeleporter::createTrigger(%this, %obj)
{
// createTarget(%obj, 'Inventory Station', "", "", 'Station', 0, 0);
%obj.setRechargeRate(%obj.getDatablock().rechargeRate);
%trigger = new Trigger()
{
dataBlock = stationTrigger;
polyhedron = "-0.75 0.75 0.1 1.5 0.0 0.0 0.0 -1.5 0.0 0.0 0.0 2.3";
};
MissionCleanup.add(%trigger);
%trigger.setTransform(%obj.getTransform());
%trigger.station = %obj;
%trigger.mainObj = %obj.vStation;
%trigger.disableObj = %obj;
%obj.trigger = %trigger;
}
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- stationReady(%data, %obj)
// %data = Station Data Block
// %obj = Station Object
//Decription -- Called when station has been triggered and animation is
// completed
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::stationReady(%data, %obj)
{
//Display the Inventory Station GUI here
%obj.notReady = 1;
%obj.inUse = "Down";
%obj.schedule(200,"playThread",$ActivateThread,"activate1");
%obj.getObjectMount().playThread($ActivateThread,"Activate");
%player = %obj.triggeredBy;
%energy = %player.getEnergyLevel();
%player.setCloaked(true);
%player.schedule(900, "setCloaked", false);
if (!%player.client.isAIControlled())
buyFavorites(%player.client);
%player.setEnergyLevel(%energy);
}
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- stationFinished(%data, %obj)
// %data = Station Data Block
// %obj = Station Object
//Decription -- Called when player has left the station
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::stationFinished(%data, %obj)
{
//Hide the Inventory Station GUI
}
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- getSound(%data, %forward)
// %data = Station Data Block
// %forward = direction the animation is playing
//Decription -- This sound will be played at the same time as the activate
// animation.
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::getSound(%data, %forward)
{
if(%forward)
return "MobileBaseInventoryActivateSound";
else
return false;
}
/// -Mobile Base- //////////////////////////////////////////////////////////////
//Function -- setPlayerPosition(%data, %obj, %trigger, %colObj)
// %data = Station Data Block
// %obj = Station Object
// %trigger = Stations trigger
// %colObj = Object that is at the station
//Decription -- Called when player enters the trigger. Used to set the player
// in the center of the station.
////////////////////////////////////////////////////////////////////////////////
function MPBTeleporter::setPlayersPosition(%data, %obj, %trigger, %colObj)
{
%vel = getWords(%colObj.getVelocity(), 0, 1) @ " 0";
if((VectorLen(%vel) < 22) && (%obj.triggeredBy != %colObj))
{
%pos = %trigger.position;
%colObj.setvelocity("0 0 0");
%rot = getWords(%colObj.getTransform(),3, 6);
%colObj.setTransform(getWord(%pos,0) @ " " @ getWord(%pos,1) @ " " @ getWord(%pos,2)+0.8 @ " " @ %rot);//center player on object
%colObj.setvelocity("0 0 0");
return true;
}
return false;
}
function MPBTeleporter::tryTeleport(%data, %obj)
{
if(isObject(%obj.MPB) && %obj.MPB.fullyDeployed && %obj.triggeredBy !$= "")
{
%trans = %obj.MPB.getTransform();
%vX = getWord(%trans, 0);
%vY = getWord(%trans, 1);
%vZ = getWord(%trans, 2);
%rot= getWords(%trans, 3,6);
%obj.triggeredBy.teleporting = 1;
%obj.triggeredBy.startFade( 1000, 0, true );
%obj.triggeredBy.playAudio($PlaySound, TeleportSound);
%obj.triggeredBy.setMoveState(true);
%data.schedule(4500,"teleportingDone", %obj.triggeredBy);
%data.schedule(2000, "teleportout", %obj, %obj.triggeredBy, %vX @ " " @ %vY @ " " @ %vZ + 3 @ " " @ %rot);
}
else if(%obj.triggeredBy !$= "")
MessageClient(%obj.triggeredBy.client, "", 'MPB is not deployed.');
}
function MPBTeleporter::onEndSequence(%data, %obj, %thread)
{
}
function MPBTeleporter::teleportOut(%data, %obj, %player, %trans)
{
if(isObject(%obj.MPB))
{
%index = -1;
for(%x=0; %x < %obj.MPB.spawnPosCount; %x++)
{
%index = mFloor(getRandom() * %obj.MPB.spawnPosCount);
InitContainerRadiusSearch(%MPB.spawnPos[%index], 2, $TypeMasks::MoveableObjectType);
if(ContainerSearchNext() == 0)
break;
else
%index = -1;
}
if(%index >= 0)
%player.setTransform(%obj.MPB.spawnPos[%index] @ " " @ getWords(%obj.MPB.getTransform(), 3, 6));
else
{
messageClient(%player.client, "", 'No Valid teleporting positions.');
%player.teleporting = 0;
}
}
else
{
messageClient(%player.client, "", 'No Valid teleporting positions because MPB was destroyed');
%player.teleporting = 0;
}
%data.schedule(1000, "teleportIn", %player);
}
function MPBTeleporter::teleportIn(%data, %player, %trans)
{
%player.startFade(1000, 0, false );
%player.playAudio($PlaySound, UnTeleportSound);
}
function MPBTeleporter::teleportingDone(%data, %player)
{
%player.setMoveState(false);
%player.teleporting = 0;
%player.station = "";
if(%player.getMountedImage($WeaponSlot) == 0)
{
if(%player.inv[%player.lastWeapon])
%player.use(%player.lastWeapon);
if(%player.getMountedImage($WeaponSlot) == 0)
%player.selectWeaponSlot( 0 );
}
}
for(%y = -1; %y < 1; %y += 0.25)
{
%xCount=0;
for(%x = -1; %x < 1; %x += 0.25)
{
$MPBSpawnPos[(%yCount * 8) + %xCount] = %x @ " " @ %y;
%xCount++;
}
%yCount++;
}
function checkSpawnPos(%MPB, %radius)
{
%count = -1;
for(%x = 0; %x < 64; %x++)
{
%pPos = getWords(%MPB.getTransform(), 0, 2);
%pPosX = getWord(%pPos, 0);
%pPosY = getWord(%pPos, 1);
%pPosZ = getWord(%pPos, 2);
%posX = %pPosX + ( getWord($MPBSpawnPos[%x],0) * %radius);
%posY = %pPosY + (getWord($MPBSpawnPos[%x],1) * %radius);
%terrHeight = getTerrainHeight(%posX @ " " @ %posY);
if(mAbs(%terrHeight - %pPosZ) < %radius )
{
%mask = $TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType |
$TypeMasks::StaticShapeObjectType | $TypeMasks::StaticTSObjectType |
$TypeMasks::ForceFieldObjectType | $TypeMasks::ItemObjectType |
$TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType |
$TypeMasks::InteriorObjectType;
InitContainerRadiusSearch(%posX @ " " @ %posY @ " " @ %terrHeight, 2, %mask);
if(ContainerSearchNext() == 0)
%MPB.spawnPos[%count++] = %posX @ " " @ %posY @ " " @ %terrHeight;
}
}
%MPB.spawnPosCount = %count;
}
function createTeleporter(%data, %obj)
{
%Teleporter = new StaticShape() {
scale = "1 1 1";
dataBlock = "MPBTeleporter";
lockCount = "0";
homingCount = "0";
team = %obj.team;
};
%obj.teleporter = %Teleporter;
%Teleporter.vStation = %obj.pad;
MissionCleanup.add(%Teleporter);
%trans = %obj.getTransform();
%vSPos = getWords(%trans,0,2);
%vRot = getWords(%trans,3,5);
%vAngle = getWord(%trans,6);
%matrix = VectorOrthoBasis(%vRot @ " " @ %vAngle + 0.36);
%yRot = getWords(%matrix, 3, 5);
%pos = vectorAdd(%vSPos, vectorScale(%yRot, -31.5));
%Teleporter.setTransform(%pos @ " " @ %vRot @ " " @ %vAngle);
%Teleporter.getDataBlock().createTrigger(%Teleporter);
}

View file

@ -2,9 +2,6 @@
// helper function for creating targets
function createTarget(%obj, %nameTag, %skinTag, %voiceTag, %typeTag, %sensorGroup, %voicePitch)
{
if(%obj.nameTag !$= "")
%nameTag = addTaggedString(%obj.nameTag);
if (%voicePitch $= "" || %voicePitch == 0)
%voicePitch = 1.0;
%data = (%obj.getType() & $TypeMasks::ShapeBaseObjectType) ? %obj.getDataBlock() : 0;

View file

@ -1,3 +1,20 @@
// sounds and effects
///////////////////////
datablock EffectProfile(DeployableExplosionEffect)
{
effectname = "explosions/explosion.xpl10";
minDistance = 10;
maxDistance = 50;
};
datablock AudioProfile(DeployablesExplosionSound)
{
filename = "fx/explosions/deployables_explosion.wav";
description = AudioExplosion3d;
preload = true;
effect = DeployableExplosionEffect;
};
//--------------------------------------------------------------------------
// Shockwave
//--------------------------------------------------------------------------
@ -147,7 +164,7 @@ datablock TurretData(TurretBaseLarge) : TurretDamageProfile
disabledLevel = 1.35;
explosion = TurretExplosion;
expDmgRadius = 15.0;
expDamage = 0.7;
expDamage = 0.66;
expImpulse = 2000.0;
repairRate = 0;
emap = true;
@ -276,7 +293,9 @@ function checkTurretMount(%data, %obj, %slot)
%potTurret = ContainerRayCast(%obj.getEyeTransform(), %srchEnd, $TypeMasks::TurretObjectType);
if(%potTurret != 0)
{
if(%potTurret.getDatablock().getName() $= "TurretBaseLarge")
%otherMountObj = "foo";
if(%potTurret.getDatablock().getName() $= "TurretBaseLarge" || %potTurret.getDatablock().getName() $= %otherMountObj)
{
// found a turret base, what team is it on?
if(%potTurret.team == %obj.client.team)

View file

@ -5,12 +5,26 @@
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------------------------------------------
datablock EffectProfile(EBLSwitchEffect)
{
effectname = "powered/turret_light_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(EBLFireEffect)
{
effectname = "weapons/ELF_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(EBLSwitchSound)
{
filename = "fx/powered/turret_light_activate.wav";
description = AudioClose3d;
preload = true;
effect = EBLSwitchEffect;
};
datablock AudioProfile(EBLFireSound)
@ -18,6 +32,7 @@ datablock AudioProfile(EBLFireSound)
filename = "fx/weapons/ELF_fire.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = EBLFireEffect;
};
//--------------------------------------------------------------------------

View file

@ -3,13 +3,29 @@
//--------------------------------------
//--------------------------------------------------------------------------
// Sounds
// Sounds and feedback effects
//--------------------------------------
datablock EffectProfile(AASwitchEffect)
{
effectname = "powered/turret_light_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(AAFireEffect)
{
effectname = "powered/turret_aa_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(AASwitchSound)
{
filename = "fx/powered/turret_aa_activate.wav";
description = AudioClose3d;
preload = true;
effect = AASwitchEffect;
};
datablock AudioProfile(AAFireSound)
@ -17,10 +33,9 @@ datablock AudioProfile(AAFireSound)
filename = "fx/powered/turret_aa_fire.wav";
description = AudioDefault3d;
preload = true;
effect = AAFireEffect;
};
//--------------------------------------------------------------------------
// Particle effects
//--------------------------------------
@ -164,7 +179,7 @@ datablock TurretImageData(AABarrelLarge)
seekRadius = 200;
maxSeekAngle = 6;
seekTime = 1.0;
minSeekHeat = 0.7;
minSeekHeat = 0.6;
useTargetAudio = false;
// Turret parameters

View file

@ -1,8 +1,23 @@
datablock EffectProfile(IBLSwitchEffect)
{
effectname = "powered/turret_light_activate";
minDistance = 5.0;
maxDistance = 5.0;
};
datablock EffectProfile(IBLFireEffect)
{
effectname = "powered/turret_indoor_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(IBLSwitchSound)
{
filename = "fx/powered/turret_light_activate.wav";
description = AudioClose3d;
preload = true;
effect = IBLSwitchEffect;
};
datablock AudioProfile(IBLFireSound)
@ -10,6 +25,7 @@ datablock AudioProfile(IBLFireSound)
filename = "fx/powered/turret_indoor_fire.wav";
description = AudioDefault3d;
preload = true;
effect = IBLFireEffect;
};
datablock SensorData(DeployedIndoorTurretSensor)

View file

@ -7,11 +7,26 @@
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock EffectProfile(MBLSwitchEffect)
{
effectname = "powered/turret_heavy_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(MBLFireEffect)
{
effectname = "powered/turret_missile_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(MBLSwitchSound)
{
filename = "fx/powered/turret_missile_activate.wav";
description = AudioClose3d;
preload = true;
effect = MBLSwitchEffect;
};
datablock AudioProfile(MBLFireSound)
@ -19,6 +34,7 @@ datablock AudioProfile(MBLFireSound)
filename = "fx/powered/turret_missile_fire.wav";
description = AudioDefault3d;
preload = true;
effect = MBLFireEffect;
};
//--------------------------------------------------------------------------
@ -49,7 +65,7 @@ datablock SeekerProjectileData(TurretMissile)
flareDistance = 200;
flareAngle = 30;
minSeekHeat = 0.7;
minSeekHeat = 0.6;
explosion = "MissileExplosion";
velInheritFactor = 0.2;
@ -94,7 +110,7 @@ datablock TurretImageData(MissileBarrelLarge)
seekRadius = 300;
maxSeekAngle = 30;
seekTime = 1.0;
minSeekHeat = 0.7;
minSeekHeat = 0.6;
emap = true;
minTargetingDistance = 40;

View file

@ -7,11 +7,26 @@
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------
datablock EffectProfile(MBLSwitchEffect)
{
effectname = "powered/turret_heavy_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(MBLFireEffect)
{
effectname = "powered/turret_mortar_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(MBLSwitchSound)
{
filename = "fx/powered/turret_heavy_activate.wav";
description = AudioClose3d;
preload = true;
effect = MBLSwitchEffect;
};
datablock AudioProfile(MBLFireSound)
@ -19,6 +34,7 @@ datablock AudioProfile(MBLFireSound)
filename = "fx/powered/turret_mortar_fire.wav";
description = AudioDefault3d;
preload = true;
effect = MBLFireEffect;
};
//--------------------------------------------------------------------------

View file

@ -5,12 +5,26 @@
// --------------------------------------------------------------
// Sound datablocks
// --------------------------------------------------------------
datablock EffectProfile(OBLSwitchEffect)
{
effectname = "powered/turret_light_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(OBLFireEffect)
{
effectname = "powered/turret_outdoor_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(OBLSwitchSound)
{
filename = "fx/powered/turret_light_activate.wav";
description = AudioClose3d;
preload = true;
effect = OBLSwitchEffect;
};
datablock AudioProfile(OBLFireSound)
@ -18,6 +32,7 @@ datablock AudioProfile(OBLFireSound)
filename = "fx/powered/turret_outdoor_fire.wav";
description = AudioDefault3d;
preload = true;
effect = OBLFireEffect;
};
// --------------------------------------------------------------
@ -130,6 +145,9 @@ datablock TurretData(TurretDeployedOutdoor) : TurretDamageProfile
thetaMax = 145;
thetaNull = 90;
yawVariance = 30.0; // these will smooth out the elf tracking code.
pitchVariance = 30.0; // more or less just tolerances
isShielded = true;
energyPerDamagePoint = 110;
maxEnergy = 60;

View file

@ -7,12 +7,26 @@
//--------------------------------------------------------------------------
// Sounds
//--------------------------------------------------------------------------
datablock EffectProfile(PBLSwitchEffect)
{
effectname = "powered/turret_light_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(PBLFireEffect)
{
effectname = "powered/turret_plasma_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(PBLSwitchSound)
{
filename = "fx/powered/turret_light_activate.wav";
description = AudioClose3d;
preload = true;
effect = PBLSwitchEffect;
};
datablock AudioProfile(PBLFireSound)
@ -20,6 +34,7 @@ datablock AudioProfile(PBLFireSound)
filename = "fx/powered/turret_plasma_fire.wav";
description = AudioDefault3d;
preload = true;
effect = PBLFireEffect;
};
//--------------------------------------------------------------------------

View file

@ -1,10 +1,24 @@
// Sound datablocks
datablock EffectProfile(SentryTurretSwitchEffect)
{
effectname = "powered/turret_sentry_activate";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(SentryTurretFireEffect)
{
effectname = "powered/turret_sentry_fire";
minDistance = 2.5;
maxDistance = 5.0;
};
datablock AudioProfile(SentryTurretSwitchSound)
{
filename = "fx/powered/turret_sentry_activate.wav";
description = AudioClose3d;
preload = true;
effect = SentryTurretSwitchEffect;
};
datablock AudioProfile(SentryTurretFireSound)
@ -12,6 +26,7 @@ datablock AudioProfile(SentryTurretFireSound)
filename = "fx/powered/turret_sentry_fire.wav";
description = AudioDefault3d;
preload = true;
effect = SentryTurretFireEffect;
};
datablock AudioProfile(SentryTurretExpSound)

View file

@ -66,7 +66,7 @@ function VehicleHud::quickBuy( %this, %id )
if ( isObject( $Hud['vehicleHud'].data[%id, 0] ) )
{
if ( %this.selId != %id )
eval( $Hud['vehicleHud'].data[%id, 0].command );
VehicleHud.onTabSelect( %id, $Hud['vehicleHud'].data[%id, 0].vName, $Hud['vehicleHud'].data[%id, 0].vCount );
%this.onBuy();
}
}
@ -113,8 +113,10 @@ function VehicleHud::addLine( %this, %tag, %lineNum, %name, %count )
minExtent = "8 8";
visible = "1";
helpTag = "0";
command = "VehicleHud.onTabSelect(" @ %lineNum @ ", " @ %name @ ", " @ %count @ ");";
command = "VehicleHud.onTabSelect(" @ %lineNum @ "," @ %name @ "," @ %count @ ");";
text = "";
vName = %name;
vCount = %count;
};
// If nothing is selected, select something:
@ -142,4 +144,9 @@ function clientCmdStationVehicleHideHud()
{
hideHud( 'vehicleHud' );
clientCmdTogglePlayHuds(true);
}
function clientCmdStationVehicleHideJustHud()
{
hideHud( 'vehicleHud' );
}

View file

@ -1,9 +1,24 @@
//------------------------------------------------------------------------------
datablock EffectProfile(VehicleAppearEffect)
{
effectname = "vehicles/inventory_pad_appear";
minDistance = 5;
maxDistance = 10;
};
datablock EffectProfile(ActivateVehiclePadEffect)
{
effectname = "powered/vehicle_pad_on";
minDistance = 20;
maxDistance = 30;
};
datablock AudioProfile(VehicleAppearSound)
{
filename = "fx/vehicles/inventory_pad_appear.wav";
description = AudioClosest3d;
preload = true;
effect = VehicleAppearEffect;
};
datablock AudioProfile(ActivateVehiclePadSound)
@ -11,6 +26,7 @@ datablock AudioProfile(ActivateVehiclePadSound)
filename = "fx/powered/vehicle_pad_on.wav";
description = AudioClose3d;
preload = true;
effect = ActivateVehiclePadEffect;
};
datablock StationFXVehicleData( VehicleInvFX )
@ -69,8 +85,8 @@ function serverCmdBuyVehicle(%client, %blockName)
%p = vectorAdd(%pos,vectorScale(%yrot, -3));
%p = getWords(%p,0, 1) @ " " @ getWord(%p,2) + 4;
error(%blockName);
error(%blockName.spawnOffset);
// error(%blockName);
// error(%blockName.spawnOffset);
%p = vectorAdd(%p, %blockName.spawnOffset);
%rot = getWords(%trans, 3, 5);
@ -121,11 +137,6 @@ function createVehicle(%client, %station, %blockName, %team , %pos, %rot, %angle
%obj = %blockName.create(%team);
if(%obj)
{
if ( %blockName $= "MobileBaseVehicle" )
{
%station.station.teleporter.MPB = %obj;
%obj.teleporter = %station.station.teleporter;
}
%station.ready = false;
%obj.team = %team;
%obj.useCreateHeight(true);
@ -168,7 +179,8 @@ function createVehicle(%client, %station, %blockName, %team , %pos, %rot, %angle
stationObject = %station;
};
%obj.getDataBlock().schedule(5000, "mountDriver", %obj, %client.player);
if ( %client.isVehicleTeleportEnabled() )
%obj.getDataBlock().schedule(5000, "mountDriver", %obj, %client.player);
}
if(%obj.getTarget() != -1)
setTargetSensorGroup(%obj.getTarget(), %client.getSensorGroup());
@ -286,4 +298,9 @@ function VehicleHud::clearHud( %obj, %client, %tag, %count )
for ( %i = 0; %i < %count; %i++ )
messageClient( %client, 'RemoveLineHud', "", %tag, %i );
}
//------------------------------------------------------------------------------
function serverCmdEnableVehicleTeleport( %client, %enabled )
{
%client.setVehicleTeleportEnabled( %enabled );
}

View file

@ -81,6 +81,12 @@ function VehicleData::playerDismounted(%data, %obj, %player)
{
if( %player.client.observeCount > 0 )
resetObserveFollow( %player.client, true );
setTargetSensorGroup(%obj.getTarget(), %obj.team);
// if there is a turret, set its team as well.
if( %obj.turretObject > 0 )
setTargetSensorGroup(%obj.turretObject.getTarget(), %obj.team);
}
function HoverVehicle::useCreateHeight()
@ -95,13 +101,15 @@ function WheeledVehicle::useCreateHeight()
function AssaultVehicle::onDamage(%this, %obj)
{
(%obj.getMountNodeObject(10)).setDamagelevel(%obj.getDamageLevel());
if(isObject(%obj.getMountNodeObject(10)))
(%obj.getMountNodeObject(10)).setDamagelevel(%obj.getDamageLevel());
Parent::onDamage(%this, %obj);
}
function BomberFlyer::onDamage(%this, %obj)
{
(%obj.getMountNodeObject(10)).setDamagelevel(%obj.getDamageLevel());
if(isObject(%obj.getMountNodeObject(10)))
(%obj.getMountNodeObject(10)).setDamagelevel(%obj.getDamageLevel());
Parent::onDamage(%this, %obj);
}
@ -233,7 +241,6 @@ function VehicleData::onDestroyed(%data, %obj, %prevState)
%obj.turretObject.getDataBlock().playerDismount(%obj.turretObject);
for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++)
{
echo("damaging objects...");
if (%obj.getMountNodeObject(%i)) {
%flingee = %obj.getMountNodeObject(%i);
%flingee.getDataBlock().doDismount(%flingee, true);
@ -467,7 +474,7 @@ function AssaultVehicle::deleteAllMounted(%data, %obj)
function BomberFlyer::deleteAllMounted(%data, %obj)
{
if(%obj.beacon)
if(isObject(%obj.beacon))
%obj.beacon.delete();
%turret = %obj.getMountNodeObject(10);
@ -512,12 +519,6 @@ function MobileBaseVehicle::deleteAllMounted(%data, %obj)
if(isObject(%obj.shield))
%obj.shield.delete();
if (isObject(%obj.teleporter))
{
%obj.teleporter.setThreadDir($ActivateThread, FALSE);
%obj.teleporter.playThread($ActivateThread,"activate");
%obj.teleporter.playAudio($ActivateSound, StationTeleportDeacitvateSound);
}
if(isObject(%obj.beacon))
{
%obj.beacon.delete();
@ -725,9 +726,6 @@ function MobileBaseVehicle::playerMounted(%data, %obj, %player, %node)
%obj.shield.schedule(1000,"delete");
%obj.deploySchedule = "";
%obj.teleporter.setThreadDir($ActivateThread, FALSE);
%obj.teleporter.playThread($ActivateThread,"activate");
%obj.teleporter.playAudio($ActivateSound, StationTeleportDeacitvateSound);
%obj.fullyDeployed = 0;
%obj.noEnemyControl = 0;
@ -808,7 +806,7 @@ function MobileBaseVehicle::vehicleDeploy(%data, %obj, %player, %force)
%obj.turret.playThread($PowerThread,"Power");
%obj.turret.mountImage(MissileBarrelLarge, 0 ,false);
%obj.beacon = new ScopeAlwaysShape() {
%obj.beacon = new BeaconObject() {
dataBlock = "DeployedBeacon";
position = %obj.position;
rotation = %obj.rotation;
@ -915,12 +913,6 @@ function MobileInvStation::onEndSequence(%data, %obj, %thread)
{
%obj.notDeployed = 0;
%obj.vehicle.fullyDeployed = 1;
if(isObject(%obj.vehicle.teleporter))
{
%obj.vehicle.teleporter.setThreadDir($ActivateThread, TRUE);
%obj.vehicle.teleporter.playThread($ActivateThread,"activate");
%obj.vehicle.teleporter.playAudio($ActivateSound, StationTeleportAcitvateSound);
}
}
Parent::onEndSequence(%data, %obj, %thread);
}

View file

@ -4,12 +4,75 @@
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(BomberFlyerEngineEffect)
{
effectname = "vehicles/bomber_engine";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberFlyerThrustEffect)
{
effectname = "vehicles/bomber_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberTurretFireEffect)
{
effectname = "vehicles/bomber_turret_fire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberTurretActivateEffect)
{
effectname = "vehicles/bomber_turret_activate";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberTurretReloadEffect)
{
effectname = "vehicles/bomber_turret_reload";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberTurretDryFireEffect)
{
effectname = "vehicles/bomber_turret_dryfire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberBombReloadEffect)
{
effectname = "vehicles/bomber_bomb_reload";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberBombDryFireEffect)
{
effectname = "vehicles/bomber_bomb_dryfire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(BomberBombFireEffect)
{
effectname = "weapons/generic_throw";
minDistance = 10.0;
maxDistance = 20.0;
};
datablock AudioProfile(BomberFlyerEngineSound)
{
filename = "fx/vehicles/bomber_engine.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = BomberFlyerEngineEffect;
};
datablock AudioProfile(BomberFlyerThrustSound)
@ -17,6 +80,7 @@ datablock AudioProfile(BomberFlyerThrustSound)
filename = "fx/vehicles/bomber_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = BomberFlyerThrustEffect;
};
datablock AudioProfile(FusionExpSound)
@ -32,6 +96,7 @@ datablock AudioProfile(BomberTurretFireSound)
filename = "fx/vehicles/bomber_turret_fire.wav";
description = AudioClose3d;
preload = true;
effect = BomberTurretFireEffect;
};
datablock AudioProfile(BomberTurretActivateSound)
@ -39,6 +104,7 @@ datablock AudioProfile(BomberTurretActivateSound)
filename = "fx/vehicles/bomber_turret_activate.wav";
description = AudioClose3d;
preload = true;
effect = BomberTurretActivateEffect;
};
datablock AudioProfile(BomberTurretReloadSound)
@ -46,6 +112,7 @@ datablock AudioProfile(BomberTurretReloadSound)
filename = "fx/vehicles/bomber_turret_reload.wav";
description = AudioClose3d;
preload = true;
effect = BomberTurretReloadEffect;
};
datablock AudioProfile(BomberTurretIdleSound)
@ -60,6 +127,7 @@ datablock AudioProfile(BomberTurretDryFireSound)
filename = "fx/vehicles/bomber_turret_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = BomberTurretDryFireEffect;
};
datablock AudioProfile(BomberBombReloadSound)
@ -67,6 +135,7 @@ datablock AudioProfile(BomberBombReloadSound)
filename = "fx/vehicles/bomber_bomb_reload.wav";
description = AudioClose3d;
preload = true;
effect = BomberBombReloadEffect;
};
datablock AudioProfile(BomberBombProjectileSound)
@ -74,6 +143,7 @@ datablock AudioProfile(BomberBombProjectileSound)
filename = "fx/vehicles/bomber_bomb_projectile.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = BomberBombFireEffect;
};
datablock AudioProfile(BomberBombDryFireSound)
@ -81,6 +151,7 @@ datablock AudioProfile(BomberBombDryFireSound)
filename = "fx/vehicles/bomber_bomb_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = BomberBombDryFireEffect;
};
datablock AudioProfile(BomberBombFireSound)
@ -88,6 +159,7 @@ datablock AudioProfile(BomberBombFireSound)
filename = "fx/vehicles/bomber_bomb_reload.wav";
description = AudioClose3d;
preload = true;
effect = BomberBombFireEffect;
};
datablock AudioProfile(BomberBombIdleSound)
@ -157,15 +229,16 @@ datablock FlyingVehicleData(BomberFlyer) : BomberDamageProfile
maxSteeringAngle = 5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 5; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 8; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 4500; // Horizontal jets (W,S,D,A key thrust)
maneuveringForce = 4700; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 1100; // Steering jets (force applied when you move the mouse)
steeringRollForce = 300; // Steering jets (how much you heel over when you turn)
rollForce = 8; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 5; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created
maxForwardSpeed = 85; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 2000; // Afterburner thrust (this is in addition to normal thrust)
jetForce = 3000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 40.0; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 3.0; // Energy use of the afterburners (low number is less drain...can be fractional)
vertThrustMultiple = 3.0;
@ -793,8 +866,6 @@ datablock TargetProjectileData(BomberTargeter)
textureName[1] = "special/flare";
textureName[2] = "special/pulse";
textureName[3] = "special/expFlare";
beacon = true;
beaconType = vehicle;
};
//-------------------------------------
@ -868,8 +939,9 @@ function BomberTargetingImage::deconstruct(%data, %obj, %slot)
%bomber.beacon.delete();
%bomber.beacon = "";
}
%bomber.beacon = new ScopeAlwaysShape() {
%bomber.beacon = new BeaconObject() {
dataBlock = "BomberBeacon";
beaconType = "vehicle";
position = %pos;
};
@ -890,9 +962,7 @@ function BomberTargetingImage::deconstruct(%data, %obj, %slot)
datablock StaticShapeData(BomberBeacon)
{
shapeFile = "turret_muzzlepoint.dts";
beacon = true;
targetNameTag = 'beacon';
beaconType = vehicle;
isInvincible = true;
dynamicType = $TypeMasks::SensorObjectType;

View file

@ -4,17 +4,32 @@
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(HAPCFlyerEngineEffect)
{
effectname = "vehicles/htransport_thrust";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(HAPCFlyerThrustEffect)
{
effectname = "vehicles/htransport_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(HAPCFlyerEngineSound)
{
filename = "fx/vehicles/htransport_thrust.wav";
description = AudioDefaultLooping3d;
effect = HAPCFlyerEngineEffect;
};
datablock AudioProfile(HAPCFlyerThrustSound)
{
filename = "fx/vehicles/htransport_boost.wav";
description = AudioDefaultLooping3d;
effect = HAPCFlyerThrustEffect;
};
//**************************************************************
@ -81,6 +96,7 @@ datablock FlyingVehicleData(HAPCFlyer) : HavocDamageProfile
rollForce = 12; // Auto-roll
hoverHeight = 8; // Height off the ground at rest
createHoverHeight = 6; // Height off the ground when created
maxForwardSpeed = 71; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 5000;

View file

@ -4,12 +4,26 @@
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(MPBEngineEffect)
{
effectname = "vehicles/mpb_thrust";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(MPBThrustEffect)
{
effectname = "vehicles/mpb_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(MPBEngineSound)
{
filename = "fx/vehicles/mpb_thrust.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = MPBEngineEffect;
};
datablock AudioProfile(MPBThrustSound)
@ -17,6 +31,7 @@ datablock AudioProfile(MPBThrustSound)
filename = "fx/vehicles/mpb_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = MPBThrustEffect;
};
datablock AudioProfile(MobileBaseDeploySound)
@ -193,7 +208,7 @@ datablock WheeledVehicleData(MobileBaseVehicle) : MPBDamageProfile
squeelSound = AssaultVehicleSkid;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
wheelImpactSound = WheelImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 5.0;

View file

@ -4,12 +4,33 @@
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(ScoutFlyerThrustEffect)
{
effectname = "vehicles/shrike_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(ScoutFlyerEngineEffect)
{
effectname = "vehicles/shrike_engine";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(ShrikeBlasterFireEffect)
{
effectname = "vehicles/shrike_blaster";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(ScoutFlyerThrustSound)
{
filename = "fx/vehicles/shrike_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = ScoutFlyerThrustEffect;
};
datablock AudioProfile(ScoutFlyerEngineSound)
@ -24,6 +45,7 @@ datablock AudioProfile(ShrikeBlasterFire)
filename = "fx/vehicles/shrike_blaster.wav";
description = AudioDefault3d;
preload = true;
effect = ScoutFlyerEngineEffect;
};
datablock AudioProfile(ShrikeBlasterProjectile)
@ -31,6 +53,7 @@ datablock AudioProfile(ShrikeBlasterProjectile)
filename = "fx/weapons/shrike_blaster_projectile.wav";
description = ProjectileLooping3d;
preload = true;
effect = ShrikeBlasterFireEffect;
};
datablock AudioProfile(ShrikeBlasterDryFireSound)
@ -113,15 +136,16 @@ datablock FlyingVehicleData(ScoutFlyer) : ShrikeDamageProfile
maxSteeringAngle = 5; // Max radiens you can rotate the wheel. Smaller number is more maneuverable.
horizontalSurfaceForce = 6; // Horizontal center "wing" (provides "bite" into the wind for climbing/diving and turning)
verticalSurfaceForce = 4; // Vertical center "wing" (controls side slip. lower numbers make MORE slide.)
maneuveringForce = 2500; // Horizontal jets (W,S,D,A key thrust)
maneuveringForce = 3000; // Horizontal jets (W,S,D,A key thrust)
steeringForce = 1200; // Steering jets (force applied when you move the mouse)
steeringRollForce = 400; // Steering jets (how much you heel over when you turn)
rollForce = 4; // Auto-roll (self-correction to right you after you roll/invert)
hoverHeight = 5; // Height off the ground at rest
createHoverHeight = 3; // Height off the ground when created
maxForwardSpeed = 100; // speed in which forward thrust force is no longer applied (meters/second)
// Turbo Jet
jetForce = 1750; // Afterburner thrust (this is in addition to normal thrust)
jetForce = 2000; // Afterburner thrust (this is in addition to normal thrust)
minJetEnergy = 28; // Afterburner can't be used if below this threshhold.
jetEnergyDrain = 2.8; // Energy use of the afterburners (low number is less drain...can be fractional) // Auto stabilize speed
vertThrustMultiple = 3.0;
@ -221,7 +245,10 @@ datablock ShapeBaseImageData(ScoutChaingunPairImage)
projectile = ScoutChaingunBullet;
projectileType = TracerProjectile;
mountPoint = 10;
offset = ".73 0 0";
//**original** offset = ".73 0 0";
offset = "1.93 -0.52 0.044";
projectileSpread = 1.0 / 1000.0;
usesEnergy = true;
useMountEnergy = true;
@ -230,6 +257,7 @@ datablock ShapeBaseImageData(ScoutChaingunPairImage)
fireEnergy = 5;
fireTimeout = 125;
//--------------------------------------
stateName[0] = "Activate";
stateSequence[0] = "Activate";
@ -296,7 +324,8 @@ datablock ShapeBaseImageData(ScoutChaingunPairImage)
datablock ShapeBaseImageData(ScoutChaingunImage) : ScoutChaingunPairImage
{
offset = "-.73 0 0";
//**original** offset = "-.73 0 0";
offset = "-1.93 -0.52 0.044";
stateScript[3] = "onTriggerDown";
stateScript[5] = "onTriggerUp";
stateScript[6] = "onTriggerUp";

View file

@ -24,12 +24,33 @@
//--------------------------------------------------------------
// SOUNDS
//--------------------------------------------------------------
datablock EffectProfile(SoftImpactEffect)
{
effectname = "vehicles/crash_soft";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(HardImpactEffect)
{
effectname = "vehicles/crash_hard";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(GravSoftImpactEffect)
{
effectname = "vehicles/crash_ground_vehicle";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(SoftImpactSound)
{
filename = "fx/vehicles/crash_soft.wav";
description = AudioClose3d;
preload = true;
effect = SoftImpactEffect;
};
datablock AudioProfile(HardImpactSound)
@ -37,6 +58,7 @@ datablock AudioProfile(HardImpactSound)
filename = "fx/vehicles/crash_hard.wav";
description = AudioExplosion3d;
preload = true;
effect = HardImpactEffect;
};
datablock AudioProfile(GravSoftImpactSound)
@ -44,6 +66,7 @@ datablock AudioProfile(GravSoftImpactSound)
filename = "fx/vehicles/crash_grav_soft.wav";
description = AudioClose3d;
preload = true;
effect = GravSoftImpactEffect;
};
datablock AudioProfile(BombExplosionSound)
@ -1080,15 +1103,15 @@ datablock ExplosionData(VehicleBombExplosion)
camShakeRadius = 30.0;
};
//--------------------------------------------------------------
// VEHICLE SHIELD IMPACT DATA
//--------------------------------------------------------------
datablock ShieldImpactData( VehicleShieldImpact )
{
lifetimeMS = 300;
startScale = 1.0;
endScale = 1.1;
};
////--------------------------------------------------------------
//// VEHICLE SHIELD IMPACT DATA
////--------------------------------------------------------------
//datablock ShieldImpactData( VehicleShieldImpact )
//{
// lifetimeMS = 300;
// startScale = 1.0;
// endScale = 1.1;
//};
//--------------------------------------------------------------
// VEHICLE SENSORS
@ -1206,7 +1229,7 @@ datablock ParticleEmitterData(TankJetEmitter)
periodVarianceMS = 0;
ejectionVelocity = 20;
velocityVariance = 1.0;
ejectionOffset = -0.25;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 10;
phiReferenceVel = 0;

View file

@ -4,6 +4,54 @@
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(AssaultVehicleEngineEffect)
{
effectname = "vehicles/tank_engine";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultVehicleThrustEffect)
{
effectname = "vehicles/tank_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultTurretActivateEffect)
{
effectname = "vehicles/tank_activate";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultMortarDryFireEffect)
{
effectname = "weapons/mortar_dryfire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultMortarFireEffect)
{
effectname = "vehicles/tank_mortar_fire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultMortarReloadEffect)
{
effectname = "weapons/mortar_reload";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(AssaultChaingunFireEffect)
{
effectname = "weapons/chaingun_fire";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(AssaultVehicleSkid)
{
@ -17,6 +65,7 @@ datablock AudioProfile(AssaultVehicleEngineSound)
filename = "fx/vehicles/tank_engine.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = AssaultVehicleEngineEffect;
};
datablock AudioProfile(AssaultVehicleThrustSound)
@ -24,6 +73,7 @@ datablock AudioProfile(AssaultVehicleThrustSound)
filename = "fx/vehicles/tank_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = AssaultVehicleThrustEffect;
};
datablock AudioProfile(AssaultChaingunFireSound)
@ -31,6 +81,7 @@ datablock AudioProfile(AssaultChaingunFireSound)
filename = "fx/vehicles/tank_chaingun.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = AssaultChaingunFireEffect;
};
datablock AudioProfile(AssaultChaingunReloadSound)
@ -52,6 +103,7 @@ datablock AudioProfile(AssaultTurretActivateSound)
filename = "fx/vehicles/tank_activate.wav";
description = AudioClose3d;
preload = true;
effect = AssaultTurretActivateEffect;
};
datablock AudioProfile(AssaultChaingunDryFireSound)
@ -73,6 +125,7 @@ datablock AudioProfile(AssaultMortarDryFireSound)
filename = "fx/weapons/mortar_dryfire.wav";
description = AudioClose3d;
preload = true;
effect = AssaultMortarDryFireEffect;
};
datablock AudioProfile(AssaultMortarFireSound)
@ -80,6 +133,7 @@ datablock AudioProfile(AssaultMortarFireSound)
filename = "fx/vehicles/tank_mortar_fire.wav";
description = AudioClose3d;
preload = true;
effect = AssaultMortarFireEffect;
};
datablock AudioProfile(AssaultMortarReloadSound)
@ -87,6 +141,7 @@ datablock AudioProfile(AssaultMortarReloadSound)
filename = "fx/weapons/mortar_reload.wav";
description = AudioClose3d;
preload = true;
effect = AssaultMortarReloadEffect;
};
datablock AudioProfile(AssaultMortarIdleSound)
@ -508,7 +563,7 @@ datablock GrenadeProjectileData(AssaultMortar)
grenadeElasticity = 0.0;
grenadeFriction = 0.4;
armingDelayMS = 50;
armingDelayMS = 250;
muzzleVelocity = 65;
drag = 0.1;

View file

@ -4,6 +4,19 @@
//**************************************************************
// SOUNDS
//**************************************************************
datablock EffectProfile(ScoutEngineEffect)
{
effectname = "vehicles/outrider_engine";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock EffectProfile(ScoutThrustEffect)
{
effectname = "vehicles/outrider_boost";
minDistance = 5.0;
maxDistance = 10.0;
};
datablock AudioProfile(ScoutSqueelSound)
{
@ -18,6 +31,7 @@ datablock AudioProfile(ScoutEngineSound)
filename = "fx/vehicles/outrider_engine.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = ScoutEngineEffect;
};
datablock AudioProfile(ScoutThrustSound)
@ -25,6 +39,7 @@ datablock AudioProfile(ScoutThrustSound)
filename = "fx/vehicles/outrider_boost.wav";
description = AudioDefaultLooping3d;
preload = true;
effect = ScoutThrustEffect;
};
//**************************************************************
@ -120,7 +135,7 @@ datablock HoverVehicleData(ScoutVehicle) : WildcatDamageProfile
vertFactor = 0.0;
floatingThrustFactor = 0.35;
mainThrustForce = 25;
mainThrustForce = 30;
reverseThrustForce = 10;
strafeThrustForce = 8;
turboFactor = 1.5;
@ -129,14 +144,14 @@ datablock HoverVehicleData(ScoutVehicle) : WildcatDamageProfile
brakingActivationSpeed = 4;
stabLenMin = 2.25;
stabLenMax = 3.25;
stabLenMax = 3.75;
stabSpringConstant = 30;
stabDampingConstant = 12;
stabDampingConstant = 16;
gyroDrag = 16;
normalForce = 30;
restorativeForce = 20;
steeringForce = 25;
steeringForce = 30;
rollForce = 15;
pitchForce = 7;
@ -153,7 +168,7 @@ datablock HoverVehicleData(ScoutVehicle) : WildcatDamageProfile
floatSound = ScoutThrustSound;
softImpactSound = GravSoftImpactSound;
hardImpactSound = HardImpactSound;
wheelImpactSound = WheelImpactSound;
//wheelImpactSound = WheelImpactSound;
//
softSplashSoundVelocity = 10.0;

View file

@ -679,8 +679,9 @@ function FlashGrenadeThrown::onThrow(%this, %gren)
function detonateFlashGrenade(%hg)
{
%maxWhiteout = %hg.getDataBlock().maxWhiteout;
%thrower = %hg.sourceObject.client;
%hg.setDamageState(Destroyed);
%hg.setDamageState(Destroyed);
%hgt = %hg.getTransform();
%plX = firstword(%hgt);
%plY = getWord(%hgt, 1);
@ -728,19 +729,26 @@ function detonateFlashGrenade(%hg)
%dotFactor = ((1.0 - ((%difAcos - 45.0) / 15.0)) * 0.5) + 0.5;
%totalFactor = %dotFactor * %distFactor;
%prevWhiteOut = %damage.getWhiteOut();
if(!%prevWhiteOut)
if(!$teamDamage)
{
error("checking for message");
if(%damage.client != %thrower && %damage.client.team == %thrower.team)
messageClient(%damage.client, 'teamWhiteOut', '\c1You were hit by %1\'s whiteout grenade.', getTaggedString(%thrower.name));
}
%damage.setWhiteOut( %prevWhiteOut + %totalFactor);
%whiteoutVal = %prevWhiteOut + %totalFactor;
if(%whiteoutVal > %maxWhiteout)
{
//error("whitout at max");
%whiteoutVal = %maxWhiteout;
}
%damage.setWhiteOut( %whiteoutVal );
}
%hg.schedule(500, "delete");
%hg.schedule( 500, "delete" );
}
// ----------------------------------------------
@ -883,7 +891,9 @@ function MineDeployed::damageObject(%data, %targetObject, %sourceObject, %positi
%targetObject.damaged += %amount;
if(%targetObject.damaged >= %data.maxDamage)
{
%targetObject.setDamageState(Destroyed);
}
}
function MineDeployed::onDestroyed(%data, %obj, %lastState)

View file

@ -5,18 +5,21 @@ datablock EffectProfile(ELFGunSwitchEffect)
{
effectname = "weapons/generic_switch";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ELFGunFireEffect)
{
effectname = "weapons/ELF_fire";
minDistance = 10.0;
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ElfFireWetEffect)
datablock EffectProfile(ELFGunFireWetEffect)
{
effectname = "weapons/ELF_underwater";
minDistance = 10.0;
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(ELFGunSwitchSound)
@ -47,6 +50,7 @@ datablock AudioProfile(ELFHitTargetSound)
filename = "fx/weapons/ELF_hit.wav";
description = CloseLooping3d;
preload = true;
effect = ELFGunFireEffect;
};
//--------------------------------------

View file

@ -9,12 +9,14 @@ datablock EffectProfile(BlasterSwitchEffect)
{
effectname = "weapons/blaster_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(BlasterFireEffect)
{
effectname = "weapons/blaster_fire";
minDistance = 3.0;
minDistance = 2.5;
maxDistance = 2.5;
};
//--------------------------------------------------------------------------

View file

@ -6,7 +6,7 @@
// deploy on) interior surfaces and terrain.
// ------------------------------------------------------------------
$TeamDeployableMax[DeployedCamera] = 20;
$TeamDeployableMax[DeployedCamera] = 15;
// ------------------------------------------
// force-feedback effect datablocks
@ -15,20 +15,22 @@ $TeamDeployableMax[DeployedCamera] = 20;
datablock EffectProfile(CameraGrenadeActivateEffect)
{
effectname = "weapons/grenade_camera_activate";
minDistance = 3.0;
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(CameraGrenadeAttachEffect)
{
effectname = "weapons/grenade_camera_activate";
minDistance = 3.0;
minDistance = 2.5;
maxDistance = 5.0;
};
datablock EffectProfile(CameraGrenadeExplosionEffect)
{
effectname = "explosions/explosion.xpl10";
minDistance = 10;
maxDistance = 50;
maxDistance = 30;
};
// ------------------------------------------
@ -113,6 +115,7 @@ datablock SensorData(CameraSensorObject)
detectsUsingLOS = true;
detectionPings = false;
detectsPassiveJammed = true;
detectsActiveJammed = false;
detectRadius = 40;
detectsFOVOnly = true;
useObjectFOV = true;
@ -180,3 +183,11 @@ datablock TurretImageData(DeployableCameraBarrel)
degPerSecPhi = 360;
};
//------------------------------------------------------------------------------
// Functions:
//------------------------------------------------------------------------------
function CameraGrenadeThrown::onCollision( %data, %obj, %col )
{
// Do nothing...
}

View file

@ -9,30 +9,35 @@ datablock EffectProfile(ChaingunSwitchEffect)
{
effectname = "weapons/chaingun_activate";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ChaingunFireEffect)
{
effectname = "weapons/chaingun_fire";
minDistance = 4.0;
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ChaingunSpinUpEffect)
{
effectname = "weapons/chaingun_spinup";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ChaingunSpinDownEffect)
{
effectname = "weapons/chaingun_spindown";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ChaingunDryFire)
{
effectname = "weapons/chaingun_dryfire";
minDistance = 2.5;
maxDistance = 2.5;
};
//--------------------------------------------------------------------------
@ -516,8 +521,8 @@ datablock TracerProjectileData(ScoutChaingunBullet)
dryVelocity = 425.0;
wetVelocity = 100.0;
velInheritFactor = 1.0;
fizzleTimeMS = 3000;
lifetimeMS = 3000;
fizzleTimeMS = 1000;
lifetimeMS = 1000;
explodeOnDeath = false;
reflectOnWaterImpactAngle = 0.0;
explodeOnWaterImpact = false;

View file

@ -5,12 +5,14 @@ datablock EffectProfile(ConcussionGrenadeThrowEffect)
{
effectname = "weapons/grenade_throw";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ConcussionGrenadeSwitchEffect)
{
effectname = "weapons/generic_switch";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(ConcussionGrenadeExplosionEffect)
@ -28,6 +30,14 @@ datablock AudioProfile(ConcussionGrenadeExplosionSound)
effect = ConcussionGrenadeExplosionEffect;
};
datablock AudioProfile(ConcussionGrenadeExplosionSound)
{
filename = "fx/weapons/grenade_explode.wav";
description = AudioExplosion3d;
preload = true;
effect = ConcussionGrenadeExplosionEffect;
};
//--------------------------------------------------------------------------
// Sparks
@ -186,3 +196,11 @@ datablock ItemData(ConcussionGrenade)
isGrenade = true;
};
//--------------------------------------------------------------------------
// Functions:
//--------------------------------------------------------------------------
function ConcussionGrenadeThrown::onCollision( %data, %obj, %col )
{
// Do nothing...
}

View file

@ -8,31 +8,36 @@
datablock EffectProfile(DiscFireEffect)
{
effectname = "weapons/spinfusor_fire";
MinDistance = 4.0;
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscSwitchEffect)
{
effectname = "weapons/spinfusor_activate";
MinDistance = 2.5;
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscDryFireEffect)
{
effectname = "weapons/spinfusor_dryfire";
MinDistance = 2.5;
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscIdleEffect)
{
effectname = "weapons/spinfusor_idle";
MinDistance = 2.5;
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscReloadEffect)
{
effectname = "weapons/spinfusor_reload";
MinDistance = 2.5;
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(DiscExpEffect)
@ -401,19 +406,6 @@ datablock ItemData(DiscAmmo)
//--------------------------------------------------------------------------
// Weapon
//--------------------------------------
datablock ItemData(Disc)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_disc.dts";
image = DiscImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a spinfusor";
emap = true;
};
datablock ShapeBaseImageData(DiscImage)
{
@ -424,6 +416,8 @@ datablock ShapeBaseImageData(DiscImage)
offset = "0 0 0";
emap = true;
projectileSpread = 1.0 / 1000.0;
projectile = DiscProjectile;
projectileType = LinearProjectile;
@ -473,3 +467,17 @@ datablock ShapeBaseImageData(DiscImage)
stateTransitionOnTimeout[6] = "NoAmmo";
};
datablock ItemData(Disc)
{
className = Weapon;
catagory = "Spawn Items";
shapeFile = "weapon_disc.dts";
image = DiscImage;
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickupRadius = 2;
pickUpName = "a spinfusor";
emap = true;
};

View file

@ -135,3 +135,11 @@ datablock ItemData(FlareGrenade)
};
//------------------------------------------------------------------------------
// Functions:
//------------------------------------------------------------------------------
function FlareGrenadeThrown::onCollision( %data, %obj, %col )
{
// Do nothing...
}

View file

@ -39,6 +39,7 @@ datablock ItemData(FlashGrenadeThrown)
computeCRC = true;
maxWhiteout = 1.2;
};
datablock ItemData(FlashGrenade)
@ -58,3 +59,11 @@ datablock ItemData(FlashGrenade)
};
//--------------------------------------------------------------------------
// Functions:
//--------------------------------------------------------------------------
function FlashGrenadeThrown::onCollision( %data, %obj, %col )
{
// Do nothing...
}

View file

@ -1,18 +1,34 @@
// ------------------------------------------------------------------------
// grenade (thrown by hand) script
// ------------------------------------------------------------------------
datablock EffectProfile(GrenadeThrowEffect)
{
effectname = "weapons/grenade_throw";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock EffectProfile(GrenadeSwitchEffect)
{
effectname = "weapons/generic_switch";
minDistance = 2.5;
maxDistance = 2.5;
};
datablock AudioProfile(GrenadeThrowSound)
{
filename = "fx/weapons/throw_grenade.wav";
description = AudioClose3D;
preload = true;
preload = true;
effect = GrenadeThrowEffect;
};
datablock AudioProfile(GrenadeSwitchSound)
{
filename = "fx/weapons/generic_switch.wav";
description = AudioClosest3D;
preload = true;
preload = true;
effect = GrenadeSwitchEffect;
};
//**************************************************************************

Some files were not shown because too many files have changed in this diff Show more