Raised This Month: $ Target: $400
 0% 

[L4D2] Sky (comp. config), that adds only the additional events to camapigns?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LN5005
Member
Join Date: Oct 2022
Location: Mad Universe
Old 11-18-2023 , 10:04   Re: [L4D2] Sky (comp. config), that adds only the additional events to camapigns?
Reply With Quote #28

Well, I've got COVID-19 again. So I decided to use some free time to modify
this map.
* I tried to make a model with Blender earlier and got stuck on Crowbar not generating a .phy file, and then I got COVID-19 due to an overwork induced immune deficiency xd.
Long story short, this time I'm going to modify the spawnpoint of survivors so that they will spawn in a different position when onmapspawn. I tried this before in c1m1, but didn't leave a manual for it.

We can know from the documents on Valve Developer Community that the spawnpoint of survivors is controlled by info_survivor_position in L4D2, so the next step is a simple one.

1) First, we export the entity information of the map we want to modify (e.g. c5m1) using the stripper_dump console command (the exported entity information is located in the Left 4 Dead 2\left4dead2\addons\stripper\dumps\ folder);
* This console command will only work if Stripper is installed.
2) Then use CTRL+F to find the string info_survivor_position;
* The value of the entity parameter "SurvivorName" indicates which survivor spawnpoint the entity controls.
**It looks like a single info_survivor_position entity can only control one survivor spawnpoint, so we need to find // at least four info_survivor_position entities.

The next step is pretty simple, we just need to use modify to change the origin of the info_survivor_position entities (by their hammerid) to the position where we want the survivors to spawn.
* The hammerid is included in the exported result of stripper_dump;
* You can get the position where you want the survivors to spawn by using Dev Cmd's /pos command, just move to that position and use this command.

Use match to match the hammerid of the entities you want to modify, then use replace to replace the origin of the target entities with the position you get from /pos; you may also need to replace the value of the angles parameter to modify the orientation of the survivor(s)' vision. For example:

PHP Code:
modify:
{
    
match:
    {
        
"hammerid"    "1703281"
;        Coach's spawn position / spawnpoint
    }
    replace:
    {
        "origin"    "-148.340118 1324.557617 -175.968750"
;        "angles"    "10.825081 -97.690162 360"
    }

* Note: Using 0 as the value of angles may cause related changes to the entities not to work, because some entity classes do not accept 0 as a value for their angles parameter. In this case, use 360 as the value of this parameter instead of 0. See https://forums.alliedmods.net/showpo...&postcount=180.
* Note: "modify" is case sensitive. If you use "Modify", then the above code will not work (quite a strange bug).

Save the changes and then reload the map with the "map ..." console command. You should see Coach spawn at the position you specified.
* I recommend disabling the movement of bot survivors with "sb_move 0" in console.

The next step is to copy and paste the above code three times, change the hammerid in the copied code to the relevant entities (info_survivor_position) hammerid and replace their origin and angles parameters one by one to modify the other three survivors' spawnpoints. For example:
PHP Code:
modify:
{
    
match:
    {
        
"hammerid"    "1703281"
;        Coach's spawn position / spawnpoint
    }
    replace:
    {
        "origin"    "-148.340118 1324.557617 -175.968750"
        "angles"    "10.825081 -97.690162 360"
        "SurvivorName" "Louis"
;       Set the target survivor to Louis
    }
}

{
    match:
    {
        "hammerid"    "1703279"
;        Ellis'
s spawn position spawnpoint
    
}
    
replace:
    {
        
"origin"    "-215.296966 1310.801269 -175.968750"
        "angles"    "6.283115 -92.879920 360"
    
}
}

{
    
match:
    {
        
"hammerid"    "1703283"
;        Rochelle's spawn position / spawnpoint
    }
    replace:
    {
        "origin"    "-279.619598 1319.093627 -175.968750"
        "angles"    "7.088132 -84.163230 360"
    }
}

{
    match:
    {
        "hammerid"    "1703285"
;        Nick'
s spawn position spawnpoint
    
}
    
replace:
    {
        
"origin"    "-336.993164 1313.034057 -175.968750"
        "angles"    "4.562737 -73.222229 360"
    
}

You'll also have to add additional entities for the L4D1 survivors to make sure they spawn at the correct position (if your server uses plugins like csm), because when the game restarts by failure (or vote), these L4D1 survivors may respawn at a wrong position.

Simply copy the corresponding four info_survivor_position entities from the results exported by stripper_dump, add them to the Stripper:Source configuration file, and specify that the "SurvivorName" parameter of these entities is the name of one of the Left 4 Dead survivors.

The value of the SurvivorName parameter specifies who is affected by the entity. For example, setting the value to louis will cause the entity to change the spawnpoint of louis.
* Note: } and { cannot be on the same line, this will break the code, so after copying and pasting you will also have to create new lines for }{.
Example code:
PHP Code:
add:

{
"origin" "-215.296966 1310.801269 -175.968750"
"targetname" "survivorPos_intro_01"
"SurvivorName" "Francis"
"SurvivorIntroSequence" "c5m1_intro_mechanic"
"Order" "1"
"angles" "6.283115 -92.879920 360"
"classname" "info_survivor_position"
}

{
"origin" "-148.340118 1324.557617 -175.968750"
"targetname" "survivorPos_intro_03"
"SurvivorName" "Louis"
"SurvivorIntroSequence" "c5m1_intro_coach"
"Order" "1"
"angles" "10.825081 -97.690162 360"
"classname" "info_survivor_position"
}

{
"origin" "-279.619598 1319.093627 -175.968750"
"targetname" "survivorPos_intro_02"
"SurvivorName" "Zoey"
"SurvivorIntroSequence" "c5m1_intro_producer"
"Order" "1"
"angles" "7.088132 -84.163230 360"
"classname" "info_survivor_position"
}

{
"origin" "-336.993164 1313.034057 -175.968750"
"targetname" "survivorPos_intro_04"
"SurvivorName" "Bill"
"SurvivorIntroSequence" "c5m1_intro_gambler"
"Order" "1"
"angles" "4.562737 -73.222229 360"
"classname" "info_survivor_position"

* Don't forget to synchronize the "origin" and "angles" parameters of the code you copied from the stripper_dump results with the changes you made to the L4D2 survivor info_survivor_position entities in "modify:".
* To be on the safe side, it is best to remove the hammerid parameter and its value from the code you copied.

However, adding additional info_survivor_position entities for the L4D1 survivors is not enough, as it seems there is no entity to unlock the intro camera for the survivors after the intro camera relay ends.

Video: an intro camera issue: the director/relay has not unlocked the Left 4 Dead 1 survivors' intro camera on a Left 4 Dead 2 map.

* This bug seems really weird, although it can be exploited in some cases.

To solve this problem, we need to know which entities control the locking and unlocking of the intro camera.

The results that the stripper_dump exports show that survivorPos_intro_* are related to camera_intro_survivor_*, and by looking at the related documentation of this classname(point_viewcontrol_survivor), we can see that providing a StartMovement input for it will play the corresponding intro camera, but the point_viewcontrol_survivor will be automatically disabled after the intro camera finishes by spawnflags 1.

Testing StartMovement of point_viewcontrol_survivor (camera_intro_survivor_*) with ent_fire shows that this type of entity does not accept StartMovement input while it is disabled, which causes the intro camera controlled by the associated entity(ies) to not work properly, resulting in the affected survivor(s) being stuck by the locked intro camera.

For unknown reasons, when the game is restarted, point_viewcontrol_survivor entities will only play the L4D2 survivors' intro camera normally, and not the L4D1 survivors' intro camera normally.

Nanually enabling point_viewcontrol_survivor with ent_fire and giving it with a StartMovement input will play the L4D1 survivors' intro camera normally.

Spoiler

First create a logic_auto to create the bounding box needed to trigger OnStartTouchAll for l4d1_survivors_camera_fixer, then create four trigger_onces (all named l4d1_survivors_camera_fixer) and set their origin to the L4D1 survivor spawn position (specified by survivorPos_intro_*), and then add the OnStartTouchAll output for trigger_onces to enable the point_viewcontrol_survivor entities (corresponding to survivorPos_intro_*). This process is a bit tedious..:
PHP Code:
logic_auto:
{
    
"classname"        "logic_auto"
    "OnMapSpawn"     "l4d1_survivors_camera_fixeraddoutputmaxs 4 4 40-1"
    "OnMapSpawn"     "l4d1_survivors_camera_fixeraddoutputmins -4 -4 -40-1"
    "OnMapSpawn"    "l4d1_survivors_camera_fixeraddoutputsolid 20-1"
}
This creates bounding boxes for all trigger_onces to make sure survivors can trigger on those entities.

trigger_once:
{
    
"classname" "trigger_once"
    "targetname" "l4d1_survivors_camera_fixer"
    "spawnflags" "1"
    "startdisabled" "1"
    "origin" "-336.993164 1313.034057 -175.968750"
    "OnStartTouchAll" "camera_intro_survivor_04,Enable,,0,!activator"
;     Bill
}

{
    
"classname" "trigger_once"
    "targetname" "l4d1_survivors_camera_fixer"
    "spawnflags" "1"
    "startdisabled" "1"
    "origin" "-279.619598 1319.093627 -175.968750"
    "OnStartTouchAll" "camera_intro_survivor_02,Enable,,0,!activator"
;     Zoey
}

{
    
"classname" "trigger_once"
    "targetname" "l4d1_survivors_camera_fixer"
    "spawnflags" "1"
    "startdisabled" "1"
    "origin" "-215.296966 1310.801269 -175.968750"
    "OnStartTouchAll" "camera_intro_survivor_01,Enable,,0,!activator"
;     Francis
}

{
    
"classname" "trigger_once"
    "targetname" "l4d1_survivors_camera_fixer"
    "spawnflags" "1"
    "startdisabled" "1"
    "origin" "-148.340118 1324.557617 -175.968750"
    "OnStartTouchAll" "camera_intro_survivor_03,Enable,,0,!activator"
;     Louis

* Set the origin to the position(s) of survivorPos_intro_*. The origins of these four trigger_onces must be set to the position of survivorPos_intro_01, survivorPos_intro_02, survivorPos_intro_03 and survivorPos_intro_04 respectively.
* Change camera_intro_survivor_* in "OnStartTouchAll" of trigger_onces to camera_intro_survivor_* entities that are related to survivorPos_intro_* entities.
* By looking at OnTriggers in relay_intro_setup, you can determine which camera_intro_survivor_* survivorPos_intro_* is related to.
** For example, "OnTrigger" "survivorPos_intro_02 SetViewControl camera_intro_survivor_02 0 -1" indicates that the survivor intro camera (related to survivorPos_intro_02) is controlled by camera_intro_survivor_02.

point_viewcontrol_survivor will accept the StartMovement input if it's enabled, in which case, giving it this input to it will cause the intro camera to start moving.
* See https://developer.valvesoftware.com/...ntrol_survivor.

The intro camera is divided into two parts. the first part is not affected by the position of spawnpoint ( if you have played c1m1 of this map, you will probably understand what I am talking about), and the second part is the point_viewcontrol_survivor(camera_intro_survi vor_*) entities we are modifying.
To avoid these entities encountering some messy execution order issues and not working properly, trigger_onces should be disabled by default (via "startdisabled" "1"), and then enabled manually with logic_relay to ensure that the point_viewcontrol_survivor entities control the intro camera normally as expected.

Searching for camera_intro_survivor_* in stripper_dump will tell you which logic_relay (such as relay_intro_finished) provides the StartMovement input and controls the intro camera. find the parent logic_relay (not parentname) that triggers the sub logic_relay (such as relay_intro_survivor_cameras), and then insert the code that enables trigger_once entities into the parent logic_relay entity:
PHP Code:
{
    
match:
    {
        
"hammerid"    "1693402"
    
}
    
insert:
    {
        
"OnTrigger"    "l4d1_survivors_camera_fixer,Enable,,0,-1"
    
}

* 1693402 is the hammerid of relay_intro_survivor_cameras, which triggers relay_intro_finished to start the second part of the intro camera movement.
* It is recommended to enable the trigger_once entities of relay_intro_survivor_cameras one second in advance.
* If the delay of relay_intro_finished is less than 1, you may be able to insert the code to this logic_relay's parent logic_relay (such as relay_intro_start) and set the delay to enable trigger_once entities based on the delay of relay_intro_survivor_cameras in the parent logic_relay.
** For example, in relay_intro_start, the delay of relay_intro_survivor_cameras is 13, and we need to enable trigger_once entities one second in advance, so we need to set the 0 (delay) in "l4d1_survivors_camera_fixer,Enable,,0,-1" to 12.

Save the above changes and reload the map. After loading, change your survivor to an L4D1 survivor and then restart by committing suicide to see if there is an intro camera bug in the L4D1 survivor(s).
* For L4D1 survivors on L4D2 maps, intro camera glitches will only occur when the game is restarted.


I have also noticed that L4D2 survivors are also experiencing this intro camera bug at the same time (reason unknown). my opinion is that L4D1 survivors and L4D2 survivors should use the same spawn position so that the above code can handle intro camera glitches on both.

However, the camera movement during onmapspawn does not change with the spawnpoint change (mentioned above). While this problem is harmless, it also means that changing the spawnpoint will cause some visual glitches. I'm not currently interested in finding a solution to this problem xd.

On the other hand, changing the spawn position and solving the L4D1 survivor intro camera bug doesn't mean that this is the end of spawnpoint modification. In order for the area around the spawn point to be considered a "safe zone", the associated navmesh needs to be modified as well. I'll look into this later.
Attached Files
File Type: zip c5m1 example.zip (28.5 KB, 34 views)

Last edited by LN5005; 11-18-2023 at 10:22.
LN5005 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode