Frictional Games Forum (read-only)
Anyone 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Anyone need help? (/thread-7825.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


RE: Anyone need help? - xtron - 05-22-2011

(05-22-2011, 08:10 PM)Kyle Wrote: Did you name it correctly? Check and make sure that the PathNode is called what you want it to be called.

I made 9 nodes and their named like: PosNodeArea_1, PosNodeArea_2, PosNodeArea_3 etc. And the script file looks like this

Code:
void monsterspawn(string &in asEntity)
{
    SetEntityActive("monster_key_keeper1", true);
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, "");
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_2", 0.0f, "");
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_3", 0.0f, "");
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_4", 0.0f, "");
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_5", 0.0f, "");
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_6", 0.0f, "");
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_7", 0.0f, "");
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_8", 0.0f, "");
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_9", 0.0f, "");
}



RE: Anyone need help? - Kyle - 05-22-2011

If it doesn't work, try this. Otherwise, you don't need to look at this. :p

Code:
void monsterspawn(string &in asEntity)
{
     SetEntityActive("monster_key_keeper1", true);
     for (int x = 1; x > 0 && x < 10; x++)
     {
          AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_"+x, 0, "");
     }
}



RE: Anyone need help? - xtron - 05-22-2011

(05-22-2011, 08:47 PM)Kyle Wrote: If it doesn't work, try this. Otherwise, you don't need to look at this. :p

Code:
void monsterspawn(string &in asEntity)
{
     SetEntityActive("monster_key_keeper1", true);
     for (int x = 1; x > 0 && x < 10; x++)
     {
          AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_"+x, 0, "");
     }
}

Can you explain this please?. Because I want to learn how to script ^^


RE: Anyone need help? - Kyle - 05-22-2011

Alright. First let me tell you a little about scripting.

Amnesia uses a type of scripting language that is similar to C++. It is called AngelScript.

A "for" statement is used to make multiple instances of something.

For example:

int x;
// an integer called x

for (int x = 1; x > 0 && x < 10; x++)
// So int x is equal to 1. x has to be greater than 0 and x has to be less that 10. Making 9 instances of x. Then increment x by 1 each time, and once x is greater than 9, the "for" statement is disabled. Thus creating no more instances of x.

for (int x = 1; x > 0 && x < 10; x++)
{
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_"+x, 0, "");
}
// This creates 9 patrol nodes, each with a different "PosNodeArea_"+x.

This is how it would look like without a "for" statement:

AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0, "");
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_2", 0, "");
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_3", 0, "");
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_4", 0, "");
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_5", 0, "");
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_6", 0, "");
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_7", 0, "");
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_8", 0, "");
AddEntityPatrolNode("monster_key_keeper1", "PosNodeArea_9", 0, "");

For more information on some scripting, go to my thread:

http://www.frictionalgames.com/forum/thread-7929.html?


RE: Anyone need help? - xtron - 05-23-2011

Thanks for the help Smile.
But regarding the second question i wrote.

When i pass a script a certain door takes enough damage that it destroys.
And
A entity moves from point A to point B.

Do you know how to make a script for these kind of stuff?.
If you want me to be more clear please tell me.


RE: Anyone need help? - RawkBandMan - 05-23-2011

(05-22-2011, 05:05 PM)Kyle Wrote:
(05-21-2011, 03:36 PM)XxRoCkBaNdMaNxX Wrote: I have yet another question. Not much of a scripting question, because the scripting part of it I know.

How can I make it so it uses Justine's player files and not Daniel's? I mean the .ogg files that are "player_female_jump1" and that goes to 5. Please help. Thanks in advance.

If you go to "config" under the Amnesia file, there are "game.cfg" and "ptest_game.cfg".

If you want to, copy the Jump, Crouch, and Stand sounds from below into your "game.cfg" under the specified subtitle from below.

You can change it much more easier when you are making a full conversion, but if you want to change it permanently, open the "game.cfg" and open "ptest_game.cfg". In the "ptest_game.cfg", scroll down until you find the subtitle "<Player_Movement_Normal", there are these lines:

JumpSound = "player_female_jump"
CrouchSound = "player_crouch"
StandSound = "player_stand"

Copy them and then paste under the subtitle in your "game.cfg" file under the same subtitle. If you want to, you can change all the other movement speeds and whatnot.

Sorry if I sort of repeated myself. :p

P.S. You can remove these 3 lines from your "game.cfg" if you want to switch back to Daniel. Smile

Alrite... How can I change them if I make a full conversion?


RE: Anyone need help? - xtron - 05-23-2011

Kyle. How do i make a script so when my player passes a certain script box a door opens with power so the player shit him self XD.


RE: Anyone need help? - WatzUpzPeepz - 05-23-2011

(05-23-2011, 05:41 PM)xtron Wrote: Kyle. How do i make a script so when my player passes a certain script box a door opens with power so the player shit him self XD.

Well you can do this:
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "DoorSlamArea", "CollideDoorSlam", true, 1);
}

void CollideDoorSlam(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("door3", 10, 50, "");
AddTimer("", 0.5f, "TimerSlamDoor");
SetEntityActive("ParticleSystem_1" , true);
}
void TimerSlamDoor(string &in asTimer)
{
SetSwingDoorClosed("door3", true, true);
GiveSanityDamage(4.0f, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
AddTimer("", 2.0f, "TimerStopLook");
}

void TimerStopLook(string &in asTimer)
{
StopPlayerLookAt();
}
}



RE: Anyone need help? - RawkBandMan - 05-23-2011

(05-23-2011, 07:45 PM)WatzUpzPeepz Wrote:
(05-23-2011, 05:41 PM)xtron Wrote: Kyle. How do i make a script so when my player passes a certain script box a door opens with power so the player shit him self XD.

Well you can do this:
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "DoorSlamArea", "CollideDoorSlam", true, 1);
}

void CollideDoorSlam(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("door3", 10, 50, "");
AddTimer("", 0.5f, "TimerSlamDoor");
SetEntityActive("ParticleSystem_1" , true);
}
void TimerSlamDoor(string &in asTimer)
{
SetSwingDoorClosed("door3", true, true);
GiveSanityDamage(4.0f, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
AddTimer("", 2.0f, "TimerStopLook");
}

void TimerStopLook(string &in asTimer)
{
StopPlayerLookAt();
}
}

This looks like it would close the door and not open it.


RE: Anyone need help? - Simpanra - 05-23-2011

How do i make my player walk forward of their own accord WITHOUT the scripts from justine?