Frictional Games Forum (read-only)
[SCRIPT] Intro script help and monster nodes [SOLVED] - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Intro script help and monster nodes [SOLVED] (/thread-24175.html)

Pages: 1 2 3


Intro script help and monster nodes [SOLVED] - lothabread - 12-21-2013

hey everybody, i seem to be having a biiiiit of trouble getting an intro up and running for a Demo i'll be showing off for my school sometime in may.

What i want is for the player to look at area 2, 4, 3, 1, and then back at 2. but when ever i do start up the game it fails to go to the second one. Oh and how is it i could go about making an enemy walk around on its own during a cutscene? ive placed nodes and stuff, but he doesnt move away until he sees me? APPOLOGIES FOR THE WALL OF TEXT

PHP Code:
////////////////////////////
// Run when starting game
void OnStart()
{
    if(
ScriptDebugOn())
          {
               
GiveItemFromFile("lantern""lantern.ent");
               
SetPlayerLampOil(100.0f);
 
               for(
int i 0;10;i++)
               {
                    
GiveItemFromFile("tinderbox""tinderbox.ent");
               }
          }
    
SetSanityDrainDisabled(true);
    
SetPlayerCrouching(true);
    
SetPlayerActive(false);
    
FadeOut(0);
    
AddTimer("Intro"2.0f"Intro");
}

void Intro(string &in asTimer)
{
    
string sEvent asTimer;    
    
AddLocalVarInt(sEvent1);    
    
bool bPauseAtStep false;    

    
float fEventSpeed 1.0f;    
    
    switch(
GetLocalVarInt(sEvent))
    {
        case 
1:
            
PlayGuiSound(""1.0f);
            
FadeIn(4.0f);
            
StartPlayerLookAt("AreaIntroLook_2"1.0f1.0f"");
            
FadePlayerRollTo(-450.88);
            
fEventSpeed 2.0f;
        break;
        
        case 
2:
            
StartPlayerLookAt("AreaIntroLook_4"1.0f1.0f"");
            
fEventSpeed 2.0f;
        break;
        
        case 
3:
            
StartPlayerLookAt("AreaIntroLook_3"1.0f1.0f"");
            
PlayGuiSound(""0.7f);
            
FadeOut(3.0f);
        break;
        
        case 
4:
            
FadeIn(6.0f);
            
SetPlayerLookSpeedMul(0.06f);
            
StartPlayerLookAt("AreaIntroLook_1"1.0f1.0f"");
        break;
        
        case 
5:
            
StartPlayerLookAt("AreaIntroLook_2"1.0f1.0f"");
            
FadeOut(8.0f);
            
PlayGuiSound(""0.8f);
            
fEventSpeed 4.0f;
        break;
    }
}

void monster(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("engineer_1"true);
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_1"0"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_2"0.001"");
    
AddEnemyPatrolNode("engineer_1""PathNodeArea_3"0"");
}

void OnBruteCollide_1(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("engineer_1"false);
}



////////////////////////////
// Run when entering map
void OnEnter()
{




RE: Intro script help - WALP - 12-21-2013

As far as I know SenEntityActive should come after patrol nodes and not before


RE: Intro script help - lothabread - 12-21-2013

(12-21-2013, 05:38 PM)The Mug Wrote: As far as I know SenEntityActive should come after patrol nodes and not before

Alrighty Big Grin thanks


RE: Intro script help - lothabread - 12-23-2013

undefined

undefined


RE: Intro script help - lothabread - 12-26-2013

my desktop wouldnt post the other past posts so im on ,y laptop again. and i still cant get the player to look where i would like them to


RE: Intro script help - Romulator - 12-26-2013

Does the player not look at a particular one of your required areas or all?


RE: Intro script help - lothabread - 12-26-2013

(12-26-2013, 08:17 AM)Romulator Wrote: Does the player not look at a particular one of your required areas or all?

The player looks at the first one. But then fails to continue to the others.


RE: Intro script help - lothabread - 12-27-2013

hmm okay, out of nowhere, the manpigs no longer walk, and i have resaved them but to no avail, very odd things happening out of nowhere


RE: Intro script help - lothabread - 12-27-2013

alrighty, scratch the before post, i fixed it Big Grin, but on the other hand, stil havent progressed with the player problem, ive tried the case script but im not all too sure as to how it works


RE: Intro script help - Romulator - 12-27-2013

I never understood cases :p I always used timers. If you find cases difficult, perhaps try them instead :3 Not a perfect way to do things, but it can serve as a workaround in the meantime if that helps.