View Single Post
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 08-21-2014 , 19:31   Re: [L4D1&2] Scene Processor
Reply With Quote #19

Quote:
Originally Posted by DeathChaos25 View Post
However, it says noscene, I'm guessing SceneProcessor won't be able to pick and interrupt these lines, any Idea of what I could do for them?
If it is a spoken line, it will also spawn a scene entity, which the plugin will pick up.

See my "No Lost Call" plugin (attached) for an example of stopping L4D2 Survivors keep calling out for help when they are the only one (everyone else have changed to a L4D1 character).

And just for short form:
PHP Code:
public OnSceneStageChanged(sceneSceneStages:stage)
{
    switch (
stage) {
        case 
SceneStage_Started: {
            new 
client GetActorFromScene(scene)
            
            if (
client <= || client MaxClients || !IsClientInGame(client)) {
                return
            }
            
            new 
initiator GetSceneInitiator(scene)
            if (
initiator != SCENE_INITIATOR_WORLD) {
                return
            }
            
            
decl String:file[PLATFORM_MAX_PATH]
            if (
GetSceneFile(scenefilesizeof(file)) == 0) {
                return
            }
            
            if (
StrContains(file"lostcall"false) == -1) {
                return
            }
            
            
CancelScene(scene)
        }
    }

Also if I were you, when trying to find scenes, make a debug plugin that just prints all of the scenes out when created. On scene started, get scene file name and print it to chat. That way you will know if the scene processor can pick it up.
Attached Files
File Type: zip vocalizenolostcall_release.zip (16.5 KB, 192 views)

Last edited by Mr. Zero; 08-21-2014 at 19:52.
Mr. Zero is offline