Projektamensia
Junior Member
Posts: 16
Threads: 3
Joined: Oct 2012
Reputation:
0
|
Need help!
Hello there guys!
Me and my three friends are currently working on a school project and of course we chosen an Amnesia Mod.
Right now we are stuck in the programming and we need your help!
Problem:
We have just picked up the grunt and placed him on the map, programmed him to follow some waypoints in a circle and now we want it to loop. I have been looking all over the internet for some guides but I can not get it working...
I also want to know if you know where to place the grunt because when the player enters the area "monact" the grunt activates but he does not start to walk. The grunt just stands still.
We have 39 waypoints on the map and two script boxes.
Script box nr. 1: monact, activates the monster when the player touches it.
Script box nr. 2: PNScriptArea, SHOULD make the grunt loop when he touches it and make the grunt walk the same waypoints as before.
Hope you can give me some tips on the area boxes placement or/and some programming.
SORRY FOR MY BAD ENGLISH!
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "monact", "startmonster", false, -1);
AddEntityCollideCallback("grunt", "PNScriptArea", "MonsterFunction2", false, 1);
}
void startmonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt", true);
}
void MonsterFunction2(string &in asParent, string &in asChild, int alState)
{
for (int i = 1; i <40; i++)
{
AddEnemyPatrolNode("grunt", "PathNodeArea_"+i, 0, "");
}
}
|
|
11-26-2012, 01:32 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Need help!
(11-26-2012, 01:32 PM)Projektamensia Wrote: Hello there guys!
Me and my three friends are currently working on a school project and of course we chosen an Amnesia Mod.
Right now we are stuck in the programming and we need your help!
Problem:
We have just picked up the grunt and placed him on the map, programmed him to follow some waypoints in a circle and now we want it to loop. I have been looking all over the internet for some guides but I can not get it working...
I also want to know if you know where to place the grunt because when the player enters the area "monact" the grunt activates but he does not start to walk. The grunt just stands still.
We have 39 waypoints on the map and two script boxes.
Script box nr. 1: monact, activates the monster when the player touches it.
Script box nr. 2: PNScriptArea, SHOULD make the grunt loop when he touches it and make the grunt walk the same waypoints as before.
Hope you can give me some tips on the area boxes placement or/and some programming.
SORRY FOR MY BAD ENGLISH!
Code:
void OnStart()
{
AddEntityCollideCallback("Player", "monact", "startmonster", false, -1);
AddEntityCollideCallback("grunt", "PNScriptArea", "MonsterFunction2", false, 1);
}
void startmonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt", true);
}
void MonsterFunction2(string &in asParent, string &in asChild, int alState)
{
for (int i = 1; i <40; i++)
{
AddEnemyPatrolNode("grunt", "PathNodeArea_"+i, 0, "");
}
} I think it would be way more better if:
void OnStart()
{
AddEntityCollideCallback("Player", "monact", "startmonster", false, -1);
}
void startmonster(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt", true);
AddTimer("", 1, "MonsterFunction2");
}
void MonsterFunction2(string &in asTimer)
{
for (int i = 1; i <40; i++)
{
AddEnemyPatrolNode("grunt", "PathNodeArea_"+i, 0, "");
}
}
It's the only thing I can help in. If there's a .map_cache delete it.
This web may be useful for you:
http://wiki.frictionalgames.com/hpl2/start
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
11-26-2012, 02:43 PM |
|
Projektamensia
Junior Member
Posts: 16
Threads: 3
Joined: Oct 2012
Reputation:
0
|
RE: Need help!
Thank you! It solved the problem with the grunts movement!
Now to the next problem, the disappearing of the grunt...
The grunt NEVER disappears when I follow him around his path but when i run away from him and just sit in a corner he disappears.
So I think that the grunt disappears because I am not near him, can that be solved in some way?
|
|
11-26-2012, 11:17 PM |
|
Damascus
Senior Member
Posts: 646
Threads: 118
Joined: Mar 2012
Reputation:
29
|
RE: Need help!
In order to keep it from disappearing, you'll need to save it as a new entity for your Custom Story. Then, open the .ENT file in Notepad and add the following line under the category called "UserDefinedVariables":
<Var Name="AutoRemoveAtPathEnd" Value="false" />
If it has this property, it will not disappear as long as there are still PathNodes to follow.
|
|
11-27-2012, 02:33 AM |
|
Projektamensia
Junior Member
Posts: 16
Threads: 3
Joined: Oct 2012
Reputation:
0
|
RE: Need help!
Thank you for trying to help me but it did not work...
The thing is that the grunt disappears while in the path and not when the grunt has finished the path so your property did not fixed the disappearing under the path.
As I said before, the grunt only disappears while I am far away from him but the grunt do not disappears while I am right next to him.
So I would be glad if someone could help me with this problem!
|
|
11-27-2012, 02:01 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
RE: Need help!
THE OTHERWORLD (WIP)
Aculy iz dolan.
|
|
11-27-2012, 02:06 PM |
|
Projektamensia
Junior Member
Posts: 16
Threads: 3
Joined: Oct 2012
Reputation:
0
|
RE: Need help!
That is the same tutorial I have been using but it did not solve my problem.
So let's say that I just entered the map and walked past the script box(monact). Now the grunt spawns and starts walk in the path. If you think the path as a square with four corners, corner A,B,C,D.
You spawned into the map in corner A and you triggered the grunt at corner A.
Now, when you have triggered the grunt, you run past corner B to the right on corner A and up to corner C(diagonal to corner A) and hide there to wait for the grunt to pass you.
The problem is that the grunt NEVER pass you, it disappears somehow between corner A-C.
The thing is that you could also have hided at corner D(left to corner C) and see him pass corner B and then he disappears at corner C.
But if you now hide at corner A and see the grunt pass you there. Then hide at corner B and hid there and see the grunt pass you. Then hide at corner C and wait until he passes you and then wait at corner D and wait until he passes you. If you are at this distance, he NEVER disappears.
NOTE: You can never see the grunt disappear, he only does it when you are´not looking and he is far waya from you.
|
|
11-27-2012, 02:19 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Need help!
So actually you want the grunt as a cinematic scene?
What Frictional Games did was spawning the grunt, giving it some pathnodes, and then it's up to the player, what's gonna happen.
I'm pretty sure they made the pathnodes like this:
3 main points: A - B - C
A:
Where the grunt spawns.
Maybe it has a little wait time before it goes...
B: A place somewhere close. An open place. Could be a crossway. Here it waits a bit. Then it proceeds to...
C:
The ending, where the player will not be, and where it disappears without the player noticing.
They're not really meant for being controlled. They're meant for walking from point A to C, while looking for the player.
Trying is the first step to success.
|
|
11-27-2012, 02:33 PM |
|
Projektamensia
Junior Member
Posts: 16
Threads: 3
Joined: Oct 2012
Reputation:
0
|
RE: Need help!
But the loop is not the problem, the problem is that the grunt disappears because that I am not near him. So it dose not matter if I change the path from a loop to a "nonloop"...
|
|
11-27-2012, 04:00 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Need help!
The game still thinks it's a A to D line, and not a loop. The monster disappears whenever you simply are at a distance of 20 i think...
YourComputer made a youtube video about it:
http://www.youtube.com/watch?v=xWPU6frXm...8&index=19
Trying is the first step to success.
|
|
11-27-2012, 04:12 PM |
|
|