Frictional Games Forum (read-only)
Scripting fatal errors? - 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: Scripting fatal errors? (/thread-18772.html)

Pages: 1 2 3 4 5 6 7 8 9


RE: Scripting fatal errors? - Rapsis - 08-06-2013

Uh, I'm not sure how fog is supposed to work. I'm using these parameters:


void OnStart()
{
SetFogActive(true);
SetFogColor(0.03, 0.08, 0.20, 0.01);
SetFogProperties(10, 15, 1, false);
}

But I see no difference in-game. There's not much info on fog in the first place.


RE: Scripting fatal errors? - The chaser - 08-06-2013

I see you did this:

SetFogColor(0.03, 0.08, 0.20, 0.01);

The last color, if I'm not wrong, is the alpha: With this value, is almost unseekable, so try setting it higher (like 0.2, 0.5, 1, etc).


RE: Scripting fatal errors? - Rapsis - 08-06-2013

(08-06-2013, 11:55 AM)The chaser Wrote: I see you did this:

SetFogColor(0.03, 0.08, 0.20, 0.01);

The last color, if I'm not wrong, is the alpha: With this value, is almost unseekable, so try setting it higher (like 0.2, 0.5, 1, etc).

Works like a charm, thanks!

Now I'm trying to make a cinematic sequence where the player starts moving forward automatically. I see that the script is "MovePlayerForward(float afAmount)", but I'm not sure how to make a timer that updates 60 times / second.


RE: Scripting fatal errors? - The chaser - 08-06-2013

(08-06-2013, 06:52 PM)Rapsis Wrote:
(08-06-2013, 11:55 AM)The chaser Wrote: I see you did this:

SetFogColor(0.03, 0.08, 0.20, 0.01);

The last color, if I'm not wrong, is the alpha: With this value, is almost unseekable, so try setting it higher (like 0.2, 0.5, 1, etc).

Works like a charm, thanks!

Now I'm trying to make a cinematic sequence where the player starts moving forward automatically. I see that the script is "MovePlayerForward(float afAmount)", but I'm not sure how to make a timer that updates 60 times / second.

Simple:

void OnStart()
{
AddTimer("Move", 0.1 //This might change, depending of the speed//, "Moveyourass");
}

void Moveyourass (string &in asTimer)
{
MovePlayerForward(?);
AddTimer("Move", 0.1 //This might change, depending of the speed//, "Moveyourass");
}

I have practically zero knowledge about these functions, so well, you'll have to play with the values :|


RE: Scripting fatal errors? - Rapsis - 08-06-2013

Thanks!
Changing the values didn't do much, so I simply changed the player move speed.

Now, I'm trying to make a looping SOUND. I'm using PlaySoundAtEntity, and making "bool abSaveSound" true doesn't make it loop. Should I use a timer or something?

Also:

void OnStart()
{
AddTimer("FadeOutTime", 7.0, "FadeOut_1");
}

void FadeOut_1(string &in asTimer)
{
StartEffectFlash(10, 1.0, 999);
}

Doesn't make it fade out to white Sad


RE: Scripting fatal errors? - The chaser - 08-07-2013

void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);



Fades the screen to white.




afFadeIn - time in seconds until screen is white


afWhite - determines to which percentage the screen fades to white (1.0 = completly white)


afFadeOut - time in seconds until screen is back to normal again

The wiki is your friend! Smile
if 999 is the seconds you have said to fade out, you'll have to wait 15 minutes or so to see it fade out, so, put something a lot lower (5.0, 10, depending on how you want it.


RE: Scripting fatal errors? - Rapsis - 08-07-2013

(08-07-2013, 10:14 AM)The chaser Wrote: void StartEffectFlash(float afFadeIn, float afWhite, float afFadeOut);



Fades the screen to white.




afFadeIn - time in seconds until screen is white


afWhite - determines to which percentage the screen fades to white (1.0 = completly white)


afFadeOut - time in seconds until screen is back to normal again

The wiki is your friend! Smile
if 999 is the seconds you have said to fade out, you'll have to wait 15 minutes or so to see it fade out, so, put something a lot lower (5.0, 10, depending on how you want it.


Thanks, but wow, that is kinda silly. It says "afFadeOut" is time in seconds until screen is back to NORMAL again, not full white.

But what about the looping sound? I can't get it to loop.


RE: Scripting fatal errors? - Kreekakon - 08-07-2013

Open the sound's .snt file with something like Notepad++.

It should look something like this:

Code:
<SOUNDENTITY>  <SOUNDS>      <Main>          <Sound File="ambience_cave" />      </Main>  </SOUNDS>  <PROPERTIES Volume="0.3" MinDistance="20" MaxDistance="30" Random="1" Interval="0" FadeEnd="False" FadeStart="False" Stream="True" Loop="True" Use3D="False" Blockable="False" BlockVolumeMul="0.5" Priority="0" /></SOUNDENTITY>


Guess setting which setting to true makes the sound loop.Smile


RE: Scripting fatal errors? - Rapsis - 08-07-2013

(08-07-2013, 11:14 AM)Kreekakon Wrote: Open the sound's .snt file with something like Notepad++.

It should look something like this:

Code:
<SOUNDENTITY>  <SOUNDS>      <Main>          <Sound File="ambience_cave" />      </Main>  </SOUNDS>  <PROPERTIES Volume="0.3" MinDistance="20" MaxDistance="30" Random="1" Interval="0" FadeEnd="False" FadeStart="False" Stream="True" Loop="True" Use3D="False" Blockable="False" BlockVolumeMul="0.5" Priority="0" /></SOUNDENTITY>


Guess setting which setting to true makes the sound loop.Smile

But I'm using a sound already included in-game, I don't think I should change it.


RE: Scripting fatal errors? - Kreekakon - 08-07-2013

(08-07-2013, 11:18 AM)Rapsis Wrote: But I'm using a sound already included in-game, I don't think I should change it.
Well, you could make a copy of the sound file along with its .snt, give them different names, and put it along with your other custom story files. That way you can alter them without any fear of messing with the main game.