Frictional Games Forum (read-only)
[Updated thread] Need help - 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: [Updated thread] Need help (/thread-26941.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


RE: [Updated thread] Need help - Romulator - 03-24-2015

Your AddTimers end up stacking, since your timer checks each if-statement, and say, your health and sanity are 100, then the code adds two AmountOfHealth timers. Then 3 seconds later, they both execute, and once again, adds 2 timers but does so twice because the two AmountOfHealth timers run, four timers run next time, etc.

So what we do, is we remove all the AddTimers, except one which will execute at the end of the whole Timer. This will keep the one looping timer.

Then we remove the last GetPlayerSanity(), because it doesn't do anything.

We end up with this:
Spoiler below!
PHP Code:
void AmountOfHealth(string &in asTimer)
{
if(
GetPlayerHealth() < 51.0f)
{
PlaySoundAtEntity("Player""woman_breath.snt""Player"0false);
FadeSepiaColorTo(1,1);
}
if(
GetPlayerHealth() > 51.0f)
{
FadeSepiaColorTo(0,1);
}
if(
GetPlayerSanity() < 45.0f)
{
PlaySoundAtEntity("Player""insanity_whispers.snt""Player"0false);
}
AddTimer(""3"AmountOfHealth");



You can also "lower" the number of if-checks by using an else statement.


RE: [Updated thread] Need help - Catalyst - 03-24-2015

Thank you Romulator, welcome back Smile


RE: [Updated thread] Need help - Catalyst - 03-26-2015

Greetings again...

I need a example of script, of changing state of entity or something else. I need for elevator activation rods. Something like ifEntityState==then, I don't know, you are pro at these scripts. Example, when I put first guilding rod, or one of them then state is 1 if 2/3 of them are in guilding machine, the state is 2, when all rods are placed, state is 3, and something, ifGetEntityState==3 then (bla bla, there I know what to do, when it's done, I can create some particles, sounds and then unblock elevator lever and proceed to next gameplay event)

Thank you


RE: [Updated thread] Need help - Mudbill - 03-26-2015

Use a local variable.

When you place a rod, run AddLocalVarInt("Rods", 1);
When you remove a rod, run AddLocalVarInt("Rods", -1);

Then run after those, the check:
PHP Code:
if(GetLocalVarInt("Rods") == 3) {
    
//Do something




RE: [Updated thread] Need help - Catalyst - 03-27-2015

Hm, it's really working, but you can give a example of Sanityboost screen effect? Sure if it's exists.
This blue effect, but with changed color R G B A amount, or such kind of effect doesnt exist? I have some ideas how to use it. Can you help me? Thanks.


RE: [Updated thread] Need help - Mudbill - 03-27-2015

You can give the sanity effect using GiveSanityBoost(); or GiveSanityBoostSmall();

The color is defined in the game.cfg file and can only be modified with a FC mod.


RE: [Updated thread] Need help - Catalyst - 03-27-2015

People, I have an question about models, it is possible to export model, with two textures per object and show them both? Everytime only one of texture is shown... To split these objects in two is almost impossible for noobie like me, so is possible to save both textures, is there a way out ? Confused


RE: [Updated thread] Need help - Traggey - 03-27-2015

NOPE!


RE: [Updated thread] Need help - Catalyst - 03-28-2015

(03-27-2015, 07:43 PM)Traggey Wrote: NOPE!

Bad, bad, bad, BAD :/


RE: [Updated thread] Need help - Traggey - 03-28-2015

3D's Max has a function called ''Select by material ID'' making the splitting you want super easy, maya does not have this and I don't know about blender, but you could try googling for it.