hello , i wanna create a gameover scene for my re/l4d2 mod but i am a total noob in coding so i asked ai for a overall look and this is what i have got :
Here's a CLEO script that prevents the game from triggering the normal "busted" or "wasted" sequence, allowing NPCs to continue attacking the player's corpse while the game world keeps running:
cleo
{$CLEO .cs}
0000:
while true
wait 0
if
0256: player $PLAYER_CHAR defined
then
if or
0118: actor $PLAYER_ACTOR dead
02BF: player $PLAYER_CHAR busted
then
// Prevent hospital/police station spawn
03CB: set_actor $PLAYER_ACTOR dead 0
02C0: store_player $PLAYER_CHAR wanted_level_to 0@
02C2: set_player $PLAYER_CHAR wanted_level_to 0@
// Keep corpse interactable
0223: set_actor $PLAYER_ACTOR health_to 1
03F3: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
// Disable fade effects
016A: fade 0 time 0
// Force camera to follow corpse
015F: set_camera_position 0.0 0.0 0.0 rotation 0.0 0.0 0.0
0160: point_camera 0.0 0.0 0.0 switchstyle 2
// Prevent mission failure triggers
0330: set_player $PLAYER_CHAR infinite_run_to 1
01D3: actor $PLAYER_ACTOR stay_in_car_when_dead 1
// Make NPCs continue attacking
05D1: AS_actor -1 kill_actor $PLAYER_ACTOR
// Wait until player respawns manually
while true
wait 0
if
0AB0: key_pressed 57 // NUM9 to respawn
then
0223: set_actor $PLAYER_ACTOR health_to 100
01EB: set_player $PLAYER_CHAR can_move 1
016A: fade 1 time 1000
break
end
end
end
end
end
Here's a CLEO script that prevents the game from triggering the normal "busted" or "wasted" sequence, allowing NPCs to continue attacking the player's corpse while the game world keeps running:
cleo
{$CLEO .cs}
0000:
while true
wait 0
if
0256: player $PLAYER_CHAR defined
then
if or
0118: actor $PLAYER_ACTOR dead
02BF: player $PLAYER_CHAR busted
then
// Prevent hospital/police station spawn
03CB: set_actor $PLAYER_ACTOR dead 0
02C0: store_player $PLAYER_CHAR wanted_level_to 0@
02C2: set_player $PLAYER_CHAR wanted_level_to 0@
// Keep corpse interactable
0223: set_actor $PLAYER_ACTOR health_to 1
03F3: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
// Disable fade effects
016A: fade 0 time 0
// Force camera to follow corpse
015F: set_camera_position 0.0 0.0 0.0 rotation 0.0 0.0 0.0
0160: point_camera 0.0 0.0 0.0 switchstyle 2
// Prevent mission failure triggers
0330: set_player $PLAYER_CHAR infinite_run_to 1
01D3: actor $PLAYER_ACTOR stay_in_car_when_dead 1
// Make NPCs continue attacking
05D1: AS_actor -1 kill_actor $PLAYER_ACTOR
// Wait until player respawns manually
while true
wait 0
if
0AB0: key_pressed 57 // NUM9 to respawn
then
0223: set_actor $PLAYER_ACTOR health_to 100
01EB: set_player $PLAYER_CHAR can_move 1
016A: fade 1 time 1000
break
end
end
end
end
end
Key Features:
- Death/Busted Prevention:
- Blocks the normal death sequence with 03CB: set_actor $PLAYER_ACTOR dead 0
- Maintains wanted level to keep cops aggressive
- Corpse Interaction:
- Sets health to 1 to maintain a "barely alive" state
- Removes all immunities so NPCs can keep attacking
- Camera Control:
- Prevents camera from moving to default death view
- Keeps focus on the player's body
- Manual Respawn:
- Press NUM9 to respawn at full health
- Fade effect for smooth transition
- NPC Behavior:
- Forces all nearby NPCs to attack the corpse with 05D1
- Cops will continue their assault routines