Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 4 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Anyone need help?
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
RE: Anyone need help?

(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

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, "");
}

[Image: 44917299.jpg]Dubstep <3
05-22-2011, 08:12 PM
Find Reply
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
RE: Anyone need help?

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

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, "");
     }
}

05-22-2011, 08:47 PM
Find Reply
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
RE: Anyone need help?

(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

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 ^^

[Image: 44917299.jpg]Dubstep <3
05-22-2011, 08:49 PM
Find Reply
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
RE: Anyone need help?

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?

05-22-2011, 09:16 PM
Find Reply
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
RE: Anyone need help?

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.

[Image: 44917299.jpg]Dubstep <3
(This post was last modified: 05-23-2011, 02:42 PM by xtron.)
05-23-2011, 02:42 PM
Find Reply
RawkBandMan Offline
Posting Freak

Posts: 1,146
Threads: 35
Joined: Nov 2010
Reputation: 5
RE: Anyone need help?

(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?

I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
05-23-2011, 03:05 PM
Find Reply
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
RE: Anyone need help?

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.

[Image: 44917299.jpg]Dubstep <3
05-23-2011, 05:41 PM
Find Reply
WatzUpzPeepz Offline
Member

Posts: 106
Threads: 12
Joined: May 2011
Reputation: 0
RE: Anyone need help?

(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:
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();
}
}

05-23-2011, 07:45 PM
Find Reply
RawkBandMan Offline
Posting Freak

Posts: 1,146
Threads: 35
Joined: Nov 2010
Reputation: 5
RE: Anyone need help?

(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:
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.

I've come to learn to not fear the living, nor the dead... But the monsters that hide in closets.
05-23-2011, 07:48 PM
Find Reply
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
RE: Anyone need help?

How do i make my player walk forward of their own accord WITHOUT the scripts from justine?
05-23-2011, 08:08 PM
Find Reply




Users browsing this thread: 2 Guest(s)