Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Crashes The Game
Wapez Offline
Senior Member

Posts: 360
Threads: 37
Joined: Mar 2012
Reputation: 19
#1
Script Crashes The Game

Hello Forum Members!

So recently I created a script for our mod, In Lucy's Eyes. After finishing it, I tried it and got an error message. I fixed some simple mistakes in the script, and then I tried it again. I got into the map, and everything worked normally. Until my script was activated.

The game first froze completely, and after a while I managed to tab it down. I saw a BlackBox message saying "Please wait, gathering system information" or something, as well as being stuck on 2% in the loading bar. This same thing happened repeatedly every time I tried the map.

What the script does:
It's a simple "movement puzzle". Six pipes are placed in a corridor, and each one of them release steam into the corridor every few seconds. (For this I have one area inside every pipe, which I spawn particle systems and sounds at, and one larger area in front of every pipe that I check whether the player is colliding with or not during the time the steam is being released) Your goal is to get past it. The steam will deal damage to you as you get hit.

I wanted to randomize and tweak stuff in a specific way, so I made the script a lot more complicated than it had to be. For anyone who hasn't created it I bet it's hard to read, but just let me know if I can help you understand something.

My question is:
Why does the game crash only when the script is activated, and why does it not provide me with an error message?

What is causing the crash?

After seeing the HPL log, I noticed the 18_steam_release.ogg sound was causing some problems. I disabled that sound in the script, but it still crashes. Any help here is much appreciated.

As I mentioned, there is no problem loading the map.

The actual script:
Spoiler below!

PHP Code: (Select All)
void SteamRun(string &in asTimer)
{
    
AddLocalVarInt("SteamSequenceStep"1);
    
float fEventSpeed RandFloat(1.5f3.0f);

    switch(
GetLocalVarInt("SteamSequenceStep")) {
        case 
1:
            
RunSteamFlow(1);
        break;
        case 
2:
            
RunSteamFlow(2);
        break;
        case 
3:
            
RunSteamFlow(3);
        break;
        case 
4:
            
RunSteamFlow(4);
        break;
        case 
5:
            
RunSteamFlow(5);
        break;
        case 
6:
            
RunSteamFlow(6);
        break;
    }
    
    if(
GetLocalVarInt("SteamSequenceStep") < 7){
        
AddTimer("steamloop"fEventSpeed"SteamRun");
    }
    else{ 
        
SetLocalVarInt("SteamSequenceStep"0);

        
AddTimer("steamrestart"RandFloat(5.0f10.0f), "SteamRun");
        
        for(
int i=1;i<=6;i++) SetLocalVarInt("iBlockedSteamArea_"+i0);
    }
}

void RunSteamFlow(int alEventCount){
    
int iSteamArea RandInt(16);
    
int RunCount alEventCount;
    for(
int i=1;i<=6;i++)
        if(
iSteamArea == GetLocalVarInt("iBlockedSteamArea_"+i)){
            
RunSteamFlow(RunCount);
        }
        else{
            
SteamEvent(iSteamArea);
            
SetLocalVarInt("iBlockedSteamArea_"+alEventCountiSteamArea);
        }
}

void SteamEvent(int alCount)
{
    if(
GetLocalVarInt("PlayerInAreaSteamDamage_"+alCount) == 1)
    {
        
GivePlayerDamage(20"BloodSplat"truefalse);     
        
PlaySoundAtEntity("""18_burn_steam""Player"0.0ffalse);
    }

    
CreateParticleSystemAtEntity("damage_steam"+alCount"ps_steam_deadly""AreaSteamCore_"+alCountfalse);
    
//PlaySoundAtEntity("sound_damage_steam"+alCount, "18_steam_release", "AreaSteamCore_"+alCount, 0.2f, false);
    
SetLocalVarInt("iSteamCount"alCount);
    
SetLocalVarInt("iSteamActive_"+alCount1);
    
    
AddTimer("timer"+alCount2.5"TimerStopSteam");
}

void TimerStopSteam(string asTimer)
{
    if(
asTimer == "timer1"){
        
SetLocalVarInt("iSteamActive_1"0);
        
StopSound("sound_damage_steam1"0.3f);
    }
    if(
asTimer == "timer2"){
        
SetLocalVarInt("iSteamActive_2"0);
        
StopSound("sound_damage_steam2"0.3f);
    }
    if(
asTimer == "timer3"){
        
SetLocalVarInt("iSteamActive_3"0);
        
StopSound("sound_damage_steam3"0.3f);
    }
    if(
asTimer == "timer4"){
        
SetLocalVarInt("iSteamActive_4"0);
        
StopSound("sound_damage_steam4"0.3f);
    }
    if(
asTimer == "timer5"){
        
SetLocalVarInt("iSteamActive_5"0);
        
StopSound("sound_damage_steam5"0.3f);
    }
    if(
asTimer == "timer6"){
        
SetLocalVarInt("iSteamActive_6"0);
        
StopSound("sound_damage_steam6"0.3f);
    }
}

void CollidePlayerSteam(string &in asParentstring &in asChildint alState)
{    
    if(
alState == 1SetLocalVarInt("PlayerIn"+asChild1);
    if(
alState == -1SetLocalVarInt("PlayerIn"+asChild0);
    
    
GetSteamActivePos();
    
    if(
alState == && GetLocalVarInt(asChild) == 1)
    {
        
GivePlayerDamage(20"BloodSplat"truefalse);     
        
PlaySoundAtEntity("""18_burn_steam""Player"0.0ffalse);
    }
}

void GetSteamActivePos()
{
    for(
int i=1;i<=6;i++) SetLocalVarInt("AreaSteamDamage_"+iGetLocalVarInt("iSteamActive_"+i));
}

void OnStart()
{
    for(
int i=1i<=6; ++iAddEntityCollideCallback("Player""AreaSteamDamage_"+i"CollidePlayerSteam"false0);
}

void OnEnter()
{
    
AddTimer("steam"RandFloat(7.0f12.0f), "SteamRun");
}

void OnLeave()
{



(Is the window too small to read the script in? Copy it all and paste it into a .hps or .txt file to get a better view.)


HPL log after disabling the sound:
Spoiler below!

Version 1.20
-------- THE HPL ENGINE LOG ------------
Engine build ID 20101021192547

Creating Engine Modules
--------------------------------------------------------
Creating graphics module
Creating system module
Creating resource module
Creating input module
Creating sound module
Creating physics module
Creating ai module
Creating gui module
Creating generate module
Creating haptic module
Creating scene module
--------------------------------------------------------

Initializing Resources Module
--------------------------------------------------------
Creating loader handlers
Creating resource managers
Adding loaders to handlers
--------------------------------------------------------

Initializing Graphics Module
--------------------------------------------------------
Init lowlevel graphics: 1920x1080 bpp:32 fs:1 ms:0 gpufmt:2 cap:'FPProject - Loading...' posSad-1x-1)
Setting video mode: 1920 x 1080 - 32 bpp
Init Glew...OK
Setting up OpenGL
Vendor: ATI Technologies Inc.
Renderer: AMD Radeon HD 7900 Series
Version: 4.2.12430 Compatibility Profile Context 13.152.1.8000
Max texture image units: 32
Max texture coord units: 16
Max user clip planes: 8
Two sided stencil: 1
Vertex Buffer Object: 1
Anisotropic filtering: 1
Max Anisotropic degree: 16
Multisampling: 1
Texture compression: 1
Texture compression S3TC: 1
Auto generate MipMaps: 1
Render to texture: 1
Max draw buffers: 8
Max color render targets: 8
Packed depth-stencil: 1
Texture float: 1
GLSL Version: 4.30
ShaderModel 2: 1
ShaderModel 3: 1
ShaderModel 4: 1
OGL ATIFragmentShader: 1
Setting up G-Bugger: type: 0 texturenum: 3
Adding engine materials
Initializing DevIL
Vendor String: Abysmal Software
Version String: Developer's Image Library (DevIL) 1.6.8pre Aug 12 2006
Version Number: 168
Adding engine post effects
--------------------------------------------------------

Initializing Sound Module
--------------------------------------------------------
Initializing OpenAL
Available OpenAL devices:
0. Generic Software on Speakers (Realtek High Definition Audio)(OpenAL default)
1. Generic Software on 1 - BenQ G2450H (AMD High Definition Audio Device)
Trying to open device 'Generic Software on Speakers (Realtek High Definition Audio)'... Success!
Number of mono sources: 32
Streaming setup: 4 Buffers x 262144 bytes each
--------------------------------------------------------

Initializing Game Module
--------------------------------------------------------
Adding engine updates
Initializing script functions
--------------------------------------------------------

User Initialization
--------------------------------------------------------
WARNING: No resources element found in 'FPProject/config/lang_main/english.lang'
Setting profile: 'Wapez' Path: 'C:\Users\Wilmer\Documents/Amnesia/FP_Main/Wapez/'
ERROR: Couldn't create script '/main/global.hps'
ERROR: Global script '/main/global.hps' could not be created!
-------- Loading map '06_cellar.map' ---------
WARNING: Texture 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/static_objects/fp_stuff/ceiling_stone01/CeilingTexture02Diff.jpg' does not have a pow2 size!
WARNING: Texture 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/static_objects/fp_stuff/ceiling_stone01/CeilingTexture02Normal.jpg' does not have a pow2 size!
WARNING: Texture 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/static_objects/fp_stuff/ceiling_stone01/CeilingTexture02Spec.jpg' does not have a pow2 size!
WARNING: Texture 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/static_objects/fp_stuff/floor_planks/Floor03Normal.jpg' does not have a pow2 size!
WARNING: Texture 'C:/Program Files (x86)/Steam/steamapps/common/Amnesia The Dark Descent/static_objects/fp_stuff/floor_planks/Floor03Spec.jpg' does not have a pow2 size!
Cache Loading: 2807 ms
ERROR: Couldn't create SoundEntity 'sounds/ambience/fp_metal_scraping_ambient.snt'
ERROR: Cannot find sound entity 'sounds/ambience/fp_metal_scraping_ambient.snt'
Entities: 2126 ms
Compilation: 40 ms
Total: 5130 ms
Meshes created: 451
Bodies created: 181
-------- Loading complete ---------
--------------------------------------------------------

Game Running
--------------------------------------------------------


Founder & Legally Accountable Publisher of Red Line Games.
Environment & Gameplay Designer and Scripter.
http://moddb.com/mods/in-lucys-eyes
(This post was last modified: 03-11-2014, 01:55 PM by Wapez.)
03-11-2014, 01:54 PM
Find Reply


Messages In This Thread
Script Crashes The Game - by Wapez - 03-11-2014, 01:54 PM
RE: Script Crashes The Game - by PutraenusAlivius - 03-11-2014, 02:34 PM
RE: Script Crashes The Game - by Wapez - 03-11-2014, 02:39 PM
RE: Script Crashes The Game - by PutraenusAlivius - 03-11-2014, 02:43 PM
RE: Script Crashes The Game - by Wapez - 03-11-2014, 02:57 PM
RE: Script Crashes The Game - by Mudbill - 03-11-2014, 03:12 PM
RE: Script Crashes The Game - by Daemian - 03-11-2014, 03:15 PM
RE: Script Crashes The Game - by Wapez - 03-11-2014, 03:40 PM
RE: Script Crashes The Game - by Mudbill - 03-11-2014, 09:09 PM
RE: Script Crashes The Game - by Daemian - 03-12-2014, 01:22 AM
RE: Script Crashes The Game - by Mudbill - 03-13-2014, 09:27 PM
RE: Script Crashes The Game - by Wapez - 03-14-2014, 08:54 AM
RE: Script Crashes The Game - by Mudbill - 03-14-2014, 02:59 PM
RE: Script Crashes The Game - by Wapez - 03-14-2014, 03:56 PM
RE: Script Crashes The Game - by Apfel - 03-14-2014, 04:35 PM
RE: Script Crashes The Game - by Wapez - 03-14-2014, 04:42 PM
RE: Script Crashes The Game - by Apfel - 03-14-2014, 05:31 PM
RE: Script Crashes The Game - by Wapez - 03-14-2014, 05:36 PM
RE: Script Crashes The Game - by Mudbill - 03-14-2014, 05:49 PM



Users browsing this thread: 1 Guest(s)