Skip to content

Commit e4860d4

Browse files
feat(IW4/MP CJ): enable movement recording and playback
1 parent dcaedaa commit e4860d4

File tree

1 file changed

+14
-2
lines changed
  • resources/iw4/_codxe/mods/codjumper/maps/mp/gametypes

1 file changed

+14
-2
lines changed

resources/iw4/_codxe/mods/codjumper/maps/mp/gametypes/cj_mp.gsc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ init()
1212
SetDvar("scr_game_forceuav", 0); // Disable compass
1313
SetDvar("ui_drawCrosshair", 0);
1414

15+
SetDvar("r_fog", 0);
16+
1517
SetDvar("player_sprintUnlimited", 1);
1618
SetDvar("jump_slowdownEnable", 0);
1719

@@ -211,8 +213,8 @@ MonitorButtons()
211213
else
212214
{
213215
// Load last position immediately
216+
self LoadPosition();
214217
savenum = self.cj.saves.size;
215-
self LoadPosition(savenum);
216218
// If user holds the button, load previous positions when pressing use
217219
while (self SecondaryOffhandButtonPressed())
218220
{
@@ -242,17 +244,27 @@ MonitorPlayerCommands()
242244
if (!IsDefined(self.cj_commands_initialized) || self.cj_commands_initialized != true)
243245
{
244246
self NotifyOnPlayerCommand("dpad_up", "+actionslot 1");
247+
self NotifyOnPlayerCommand("dpad_down", "+actionslot 2");
248+
self NotifyOnPlayerCommand("dpad_right", "+actionslot 4");
249+
245250
self.cj_commands_initialized = true;
246251
}
247252

248253
for (;;)
249254
{
250-
button = self common_scripts\utility::waittill_any_return("dpad_up", "dpad_right");
255+
button = self common_scripts\utility::waittill_any_return("dpad_up", "dpad_down", "dpad_right");
251256
switch (button)
252257
{
253258
case "dpad_up":
254259
self SpawnBot();
255260
break;
261+
// TODO: remove once we have added .cfg loading
262+
case "dpad_down":
263+
exec("togglerecord");
264+
break;
265+
case "dpad_right":
266+
exec("startplayback");
267+
break;
256268
default:
257269
iprintln("^1Unknown button " + button);
258270
}

0 commit comments

Comments
 (0)