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
Intro Problem - 02-05-2017
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#1
Intro Problem - 02-05-2017

Hi guys.
Today I decided make intro to my cs. I make 2 graphic .PNG, and custom in model editor. After this i add blackplane in my map and 2 intro point, and pictures. Like Mudbill in video yt:
https://www.youtube.com/watch?v=C5F5YzStg1o

But something gone wrong. When i open Amnesia and my cs i dont see anything, and after few seconds my character die. Idk what i do wrong, so please for help.


void OnStart()
{
FadeOut (0);
SetPlayerActive(false);
SetSanityDrainDisabled(true);
ShowPlayerCrossHairIcons(false);
AddTimer("fadein", 3, "TimerIntroOutro");

PlayMusic("in_motion.ogg", false, 1, 0, 1, true);

}

void TimerIntroOutro(string &in asTimer)
{
if(GetLocalVarInt("Intro") < 3) {
if (asTimer == "faidein") {
TeleportPlayer("intro_" + GetLocalVarInt("Intro"));
FadeIn(1);
AddTimer("fadeout", 4, "TimerIntroOutro");
}
if(asTimer == "fadeout") {
FadeOut(1);
AddTimer("faiden", 1, "TimerIntroOutro");
AddLocalVarInt("Intro", 1);
}
}
else
{
TeleportPlayer("PlayerStartArea_1");
FadeIn(2);
SetPlayerActive(true);
SetSanityDrainDisabled(false);
ShowPlayerCrossHairIcons(true);
PlayMusic("in_motion.ogg", false, 0.2, 1, 2, true);
}
}
(This post was last modified: 05-02-2017, 01:02 PM by Abihishi.)
05-02-2017, 01:00 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Intro Problem - 02-05-2017

If your character dies it must mean he's falling into the void. Make sure that you have a solid ground underneath the player so they don't fall.

05-02-2017, 01:05 PM
Find
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#3
RE: Intro Problem - 02-05-2017

Mhm, ok now my character dont fall down in void, yep...
But i dont see anything, only black screen, ofc i cant move or move around head etc. I wait 15-20 sec and nathing. Like my character hung up in void.

Ok i change something.
And now it is:
I see Picture number 1, but after few second i dont see Picture number 2, but Picture number 1 again. And after this i teleport to my "Spawn" but my character fall down to void. In editor i have floor, but in game i fall down. Nahh...
(This post was last modified: 05-02-2017, 01:51 PM by Abihishi.)
05-02-2017, 01:11 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Intro Problem - 02-05-2017

If you see picture 1 two times in a row, then it must mean the player didn't teleport while the screen was black. Check the PlayerStartArea name and make sure it matches with your script. Also make sure there's a solid floor in your room with "Collide" checked on it. Check that your spawn area isn't too low, in case the player starts below it.

(This post was last modified: 05-02-2017, 02:01 PM by Mudbill.)
05-02-2017, 02:00 PM
Find
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#5
RE: Intro Problem - 02-05-2017

Ok, i make a new map for intro.
And i make 3 room with start position name Intro_0, Intro_1 and Intro_2 with 3 pictures. But when i start a game my character fall down in floor (not hight, after my Postion was be in air but i change it, but in game still i fall down on floor) and i see picture nr1, but after this i have black screen.

Weired, when i save a map and restart Editor and open my intro map i dont have my pitcures. Why?
Plane is it in eidtor but invisible and i must open material with my picture.
When i exit for a split second at the top of the bar write - Unnamed map.

In intro.hps i make

void OnStart()
{
     FadeOut(2);
     SetPlayerActive(false);
     SetSanityDrainDisabled(true);
     ShowPlayerCrossHairIcons(false);

     AddTimer("fadein", 3, "TimerIntroOutro");

     PlayMusic("search_brute.ogg", false, 1, 0, 1, true);

}

void TimerIntroOutro(string &in asTimer)
{
     if(GetLocalVarInt("Intro") < 3) {

     if(asTimer == "faidein") {
      TeleportPlayer("Intro_" + GetLocalVarInt("Intro"));
      FadeIn(1);
      AddTimer("fadeout", 4, "TimerIntoOutro");
     }
    
     if(asTimer == "fadeout") {
      FadeOut(1);
      AddTimer("fadein", 1, "TimerIntroOutro");
      AddLocalVarInt("Intro", 1);
     }
     }
     else
     {
      TeleportPlayer("Spawn");
      FadeIn(2);
      SetPlayerActive(true);
      SetSanityDrainDisabled(false);
      ShowPlayerCrossHairIcons(true);

      PlayMusic("26_paper_daniel01.ogg", false, 0.2, 0, 2, true);
     }
}

Mhm, i add
TeleportPlayer("Intro_0");

on
void OnStart()
but its still doesent work. All is in your wideo.
Even now I copied your code in website pastebin.com.
(This post was last modified: 05-02-2017, 08:35 PM by Abihishi.)
05-02-2017, 02:24 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
RE: Intro Problem - 02-05-2017

If you haven't added the custom_stories directory to the resources.cfg file, you should do so.
You'll find it in the root folder for Amnesia next to Amnesia.exe. Edit it and copy the bottom line, paste it below it and edit the folder name to be /custom_stories. Save and exit.

That should fix the images disappearing when you start the editor again.

Can you post a screenshot of your level editor of how the setup is where you fall through?

05-02-2017, 09:47 PM
Find
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#7
RE: Intro Problem - 02-05-2017

Ok, images fix.

https://scr.hu/0unb/tzqfg - First Scene
https://scr.hu/0unb/un0wd - Second Scene
https://scr.hu/0unb/ezbj6 - Third Scene

So:
1)I only see first scene, and after this black screen
2)Character fall down with little height. StartPos is on floor, but before its in air, and a little bit shifed. Now postion is good, but character fall down. This is a small thing but annoying.
(This post was last modified: 05-02-2017, 10:24 PM by Abihishi.)
05-02-2017, 10:19 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#8
RE: Intro Problem - 02-05-2017

If you don't want them to fall down as you spawn, you should position the area so that it's placed on the same level as the floor they'll be standing on. Alternatively you can place a block_box underneath which is an invisible box that the player collides with.

[Image: DWENT9N.png]

(This post was last modified: 05-02-2017, 10:33 PM by Mudbill.)
05-02-2017, 10:31 PM
Find
Abihishi Offline
Junior Member

Posts: 44
Threads: 8
Joined: Feb 2016
Reputation: 0
#9
RE: Intro Problem - 02-05-2017

Ok now work all Smile

But i have some questions.

So first how make "WakeUp" effect?

I have this:
void OnStart()
{
    FadeOut(0.01f);
    AddTimer("", 2.1f, "awake2");
    AddTimer("", 5.0f, "awake");
    FadePlayerRollTo(90, 1, 2);
    MovePlayerHeadPos(0, -1.5f, 0, 1, 0.1f);
}

void awake2(string asTimer)
{
    FadeIn(5.0f);
}

void awake(string asTimer)
{
    FadePlayerRollTo(0, 1, 2);
    MovePlayerHeadPos(0, 0.0f, 0, 0.5, 0.1f);
    
}


But I would like to add the fact that you can not move until our character completely can not get up.
(This post was last modified: 05-03-2017, 02:58 PM by Abihishi.)
05-03-2017, 06:32 AM
Find
hewiefreeman Offline
Junior Member

Posts: 7
Threads: 1
Joined: Oct 2014
Reputation: 1
#10
RE: Intro Problem - 02-05-2017

Try this from one of my stories (Please tweak it around a bit, so you aren't totally ripping it though):

void OnStart()
{
        FadeOut(0);
        MovePlayerHeadPos(0, -1.5, 0, 50, 1);
        SetPlayerActive(false);
        FadePlayerRollTo(90, 100, 100);
        AddTimer("wakeUp", 2, "wakeUp");
}

void wakeUp(string &in asTimer){
    FadeIn(6);
    AddTimer("startDream", 5, "startDream");
}

void startDream(string &in asTimer){
    FadePlayerRollTo(0, 75, 75);
    MovePlayerHeadPos(0, 0, 0, 6, 2);
    PlayGuiSound("player_climb1.ogg", 1);
    AddTimer("getUp", 2, "getUp");
}

void getUp(string &in asTimer){
    SetPlayerActive(true);
}

I would recommend bookmarking: https://wiki.frictionalgames.com/hpl2/am..._functions to look at all the functions I use and understand how I did this.
05-21-2017, 03:30 AM
Find




Users browsing this thread: 1 Guest(s)