Skip to content

Commit 516bb49

Browse files
committed
Added files.
0 parents  commit 516bb49

File tree

1,827 files changed

+491090
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,827 files changed

+491090
-0
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
System/*.u
2+
*.bmp
3+
*.jpg
4+
*.png
5+
*.idb
6+
*.id0
7+
*.id1
8+
*.nam
9+
*.log
10+
*.til
11+
*/Autoplay.s4m
12+
*/autosave_*.s4m

CompileSource.bat

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@echo off
2+
3+
REM Tell the user that we are compiling the mod
4+
5+
echo Compiling source code for MyMod
6+
REM Run UCC.exe from inside MyMod\System, so that the
7+
REM compiler uses the mod's initialisation files and settings
8+
REM and stores the compiled output in the MyMod\System
9+
REM directory
10+
11+
cd .\System\
12+
..\..\ContentExpansion\System\UCC.exe make -nobind
13+
14+
REM Tell the user that the game has exited, and wait for a keypress
15+
cd ..
16+
echo Finished compiling MyMod
17+
PAUSE

Content/Classes/SwatAmmo.u

12 KB
Binary file not shown.

Content/Classes/SwatAmmo2.u

4.12 KB
Binary file not shown.
2.95 KB
Binary file not shown.
3.91 KB
Binary file not shown.

Content/Maps/Autoplay.s4m

23 MB
Binary file not shown.

Content/Maps/SP-ABomb.s4m

14.6 MB
Binary file not shown.

Content/Maps/SP-Backstage.s4m

17.6 MB
Binary file not shown.

Content/Maps/SP-Hotel.s4m

14.2 MB
Binary file not shown.

Content/Maps/SP-MeatBarn.s4m

23 MB
Binary file not shown.

Content/Maps/Test-ShadyOffice.s4m

178 KB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
23 MB
Binary file not shown.
256 KB
Binary file not shown.
22.4 MB
Binary file not shown.
2.67 MB
Binary file not shown.
64.1 KB
Binary file not shown.

Content/Textures/gui_tex.utx

16.3 MB
Binary file not shown.

Content/Textures/gui_tex3.utx

64.4 KB
Binary file not shown.

LaunchMyMod.bat

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
3+
REM Tell the user that we are running the mod
4+
5+
echo Launching MyMod
6+
7+
REM Run Swat4.exe from inside MyMod\System, so that the
8+
REM game uses the mod's initialisation files and settings
9+
10+
cd .\System\
11+
12+
..\..\ContentExpansion\System\Swat4X.exe
13+
REM Tell the user that the game has exited
14+
15+
echo MyMod has exited

LaunchSwatEd.bat

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@echo off
2+
3+
REM Tell the user that we are running the editor
4+
echo Launching SwatEd
5+
6+
REM Run SwatEd.exe from inside MyMod\System, so that the
7+
REM editor uses the mod's initialisation files and settings
8+
9+
cd .\System\
10+
..\..\ContentExpansion\System\SwatEd.exe
11+
12+
REM Tell the user that the editor has exited
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// HearingNotifier.uc - HearingNotifier class
3+
// The HearingNotifier notifies all registered clients when the Listener hears a sound
4+
// Clients of the HearingNotifier are stored in the NotificationList, and should be registered through the Pawn
5+
6+
class HearingNotifier extends Core.RefCount
7+
native;
8+
///////////////////////////////////////////////////////////////////////////////
9+
10+
11+
/////////////////////////////////////////////////
12+
//// Private Variables
13+
/////////////////////////////////////////////////
14+
var private array<IHearingNotification> NotificationList;
15+
var private Pawn Listener;
16+
17+
/////////////////////////////////////////////////
18+
//// Initialization
19+
/////////////////////////////////////////////////
20+
function InitializeHearingNotifier(Pawn InListener)
21+
{
22+
assert(InListener != None);
23+
24+
Listener = InListener;
25+
}
26+
27+
/////////////////////////////////////////////////
28+
//// Notifications from Pawn
29+
/////////////////////////////////////////////////
30+
31+
// when we hear a sound, let all of the clients know we heard it,
32+
// whether or not they are interested.
33+
function OnHearSound(Actor SoundMaker, vector SoundOrigin, Name SoundCategory)
34+
{
35+
local int i;
36+
37+
for(i=0; i<NotificationList.Length; ++i)
38+
{
39+
NotificationList[i].OnListenerHeardNoise(Listener, SoundMaker, SoundOrigin, SoundCategory);
40+
}
41+
}
42+
43+
44+
/////////////////////////////////////////////////
45+
//// Registration functions
46+
/////////////////////////////////////////////////
47+
48+
// Register to be notified when the Listener hears a noise
49+
function RegisterHearingNotification(IHearingNotification Registrant)
50+
{
51+
assert(Registrant != None);
52+
assert(! IsOnHearingNotificationList(Registrant));
53+
54+
// push the registrant onto the notification list
55+
NotificationList[NotificationList.Length] = Registrant;
56+
}
57+
58+
// Unregister to be notified when the Listener hears a noise
59+
function UnregisterHearingNotification(IHearingNotification Registrant)
60+
{
61+
local int i;
62+
63+
assert(Registrant != None);
64+
65+
// commented out for the time being. Marc suggested that I comment it out.
66+
// assertion was being triggered because sensors are being cleaned up twice for some reason. (why?)
67+
//#if !IG_TRIBES3
68+
// assert(IsOnHearingNotificationList(Registrant));
69+
//#endif
70+
71+
for(i=0; i<NotificationList.Length; ++i)
72+
{
73+
if (NotificationList[i] == Registrant)
74+
{
75+
NotificationList.Remove(i, 1);
76+
break;
77+
}
78+
}
79+
}
80+
81+
/////////////////////////////////////////////////
82+
//// Vision Notification Private Functions
83+
/////////////////////////////////////////////////
84+
85+
// returns true if the Client interface is on the Hearing notification list
86+
// returns false if the Client interface is not on the Hearing notification list
87+
private function bool IsOnHearingNotificationList(IHearingNotification PossibleRegistrant)
88+
{
89+
local int i;
90+
91+
for(i=0; i<NotificationList.Length; ++i)
92+
{
93+
if (NotificationList[i] == PossibleRegistrant)
94+
{
95+
return true;
96+
}
97+
}
98+
99+
// PossibleRegistrant not found
100+
return false;
101+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// IHearingNotification.uc - IHearingNotification interface
3+
// this interface is used when we want to be a client of the Hearing notification system
4+
// clients are stored in the HearingNotifier of an AI
5+
6+
interface IHearingNotification native;
7+
///////////////////////////////////////////////////////////////////////////////
8+
9+
/////////////////////////////////////////////////
10+
/// IHearingNotification Signature
11+
/////////////////////////////////////////////////
12+
13+
function OnListenerHeardNoise(Pawn Listener, Actor SoundMaker, vector SoundOrigin, Name SoundCategory);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// this interface is used when we want to be a client of the Shot notification system
3+
// clients are stored in the ShotNotifier of an AI
4+
5+
interface IShotNotification;
6+
7+
/////////////////////////////////////////////////
8+
/// IShotNotification Signature
9+
/////////////////////////////////////////////////
10+
11+
function OnShooterFiredShot(Pawn Shooter, Actor projectile);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// IVisionNotification.uc - IVisionNotification interface
3+
// this interface is used when we want to be a client of the Vision notification system
4+
// clients are stored in the VisionNotifier of an AI
5+
6+
interface IVisionNotification native;
7+
8+
/////////////////////////////////////////////////
9+
/// IVisionNotification Signature
10+
/////////////////////////////////////////////////
11+
12+
function OnViewerSawPawn(Pawn Viewer, Pawn Seen);
13+
function OnViewerLostPawn(Pawn Viewer, Pawn Seen);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
///////////////////////////////////////////////////////////////////////////////
2+
// The ShotNotifier notifies all registered clients when the Shooter fires a weapon
3+
// Clients of the ShotNotifier are stored in the NotificationList, and should be registered through the Pawn
4+
5+
class ShotNotifier extends Core.Object
6+
native;
7+
///////////////////////////////////////////////////////////////////////////////
8+
9+
10+
/////////////////////////////////////////////////
11+
/// Private Variables
12+
/////////////////////////////////////////////////
13+
var private array<IShotNotification> NotificationList;
14+
var private Pawn Shooter;
15+
16+
17+
/////////////////////////////////////////////////
18+
/// Initialization
19+
/////////////////////////////////////////////////
20+
function InitializeShotNotifier(Pawn shooter)
21+
{
22+
assert(shooter != None);
23+
24+
self.Shooter = shooter;
25+
}
26+
27+
/////////////////////////////////////////////////
28+
/// Notifications from Pawn
29+
/////////////////////////////////////////////////
30+
31+
// The Shooter's weapon code will call this function when it fires its weapon
32+
function OnShotFired( Actor projectile )
33+
{
34+
NotifyShotFired( projectile );
35+
}
36+
37+
// Notify every client on the Notification List that we can see a Pawn
38+
private function NotifyShotFired( Actor projectile )
39+
{
40+
local int i;
41+
42+
for( i = 0; i < NotificationList.Length; ++i )
43+
{
44+
NotificationList[i].OnShooterFiredShot( Shooter, projectile );
45+
}
46+
}
47+
48+
/////////////////////////////////////////////////
49+
/// Registration functions
50+
/////////////////////////////////////////////////
51+
52+
// Register to be notified when the shooter shoots
53+
function RegisterShotNotification(IShotNotification Registrant)
54+
{
55+
local int i; // debug
56+
57+
assert(Registrant != None);
58+
59+
if ( IsOnShotNotificationList(Registrant) )
60+
{
61+
log( "AI ERROR:" @ Registrant @ "has already registered for" @ shooter.name );
62+
for( i = 0; i < NotificationList.Length; ++i )
63+
log( " " @ NotificationList[i] );
64+
}
65+
66+
assert(! IsOnShotNotificationList(Registrant));
67+
68+
NotificationList[NotificationList.Length] = Registrant;
69+
}
70+
71+
// Unregister to be notified when the shooter shoots
72+
function UnregisterShotNotification(IShotNotification Registrant)
73+
{
74+
local int i;
75+
76+
if ( Registrant == None )
77+
log( "AI WARNING:" @ self @ "has 'None' Registrant" );
78+
assert(Registrant != None);
79+
80+
#if !IG_TRIBES3
81+
if ( !IsOnShotNotificationList(Registrant) )
82+
log( "AI WARNING:" @ self @ Registrant @ "not on notification list" );
83+
assert(IsOnShotNotificationList(Registrant));
84+
#endif
85+
86+
for( i = 0; i < NotificationList.Length; ++i )
87+
{
88+
if (NotificationList[i] == Registrant)
89+
{
90+
NotificationList.Remove(i, 1);
91+
break;
92+
}
93+
}
94+
}
95+
96+
97+
/////////////////////////////////////////////////
98+
/// Shot Notification Private Functions
99+
/////////////////////////////////////////////////
100+
101+
// returns true if the Client interface is on the Shot notification list
102+
// returns false if the Client interface is not on the Shot notification list
103+
private function bool IsOnShotNotificationList(IShotNotification PossibleRegistrant)
104+
{
105+
local int i;
106+
107+
for( i = 0; i < NotificationList.Length; ++i)
108+
{
109+
if ( NotificationList[i] == PossibleRegistrant )
110+
{
111+
return true;
112+
}
113+
}
114+
115+
// PossibleRegistrant not found
116+
return false;
117+
}

0 commit comments

Comments
 (0)