Frictional Games Forum (read-only)
Help with scripting - 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: Help with scripting (/thread-18296.html)

Pages: 1 2


Help with scripting - Varrsharighall - 09-12-2012

I am working on mods for Amnesia. I am wondering is possible to make a script for enemies. Namely, I need script which force Grunt or Brute to follow player. Simple 'never-ending' following in close distance with disable triggers (not combat chasing). I know they follow path nodes, but I am not sure they can follow also moving target freely. Anyone can help?


RE: Help with scripting - FlawlessHappiness - 09-12-2012

How about making a script area in all the rooms, and then whenever the player enters the room, the it will set the monster to go to a specific pathnode inside that room


RE: Help with scripting - Ongka - 09-12-2012

This function lets the monster follow you, no matter where you are.
You should place pathnodes so the monster doesn't get stuck. You don't have to connect the pathnodes to the monster.
Code:
ShowEnemyPlayerPosition("MonsterName");



RE: Help with scripting - Adny - 09-12-2012

There's no basic (non-combat) follow function for the enemies; you could use beecake's idea, but it would require a lot of scripting and a lot of time spent placing nodes in the editor. Even then, it could still get stuck behind walls and what-not.


RE: Help with scripting - FlawlessHappiness - 09-13-2012

and showenemyplayerposition would just make the terror sound play all the time, and make the monster begin attacking. If that is what's intended, then that script would be fine


RE: Help with scripting - Varrsharighall - 09-14-2012

So, I created script:

Code:
void OnStart()

{
              ShowEnemyPlayerPosition("grunt_x1");

}

I changed enemy name to grunt_x1 in level editor. It appeared at player start position, but won't go anyway, not follow me. I put some pathnodes (not connected to monster), but it didn't help.


RE: Help with scripting - Kreekakon - 09-14-2012

Did you check Disable Triggers? Try unchecking that to see if it does anything.


RE: Help with scripting - The chaser - 09-14-2012

I think that disabling triggers and putting path nodes are the best ideas. That will make the player follow path nodes, but nothing is able to attract his attention. In fact, the player can stand in front of the monster, that it won't attack.


RE: Help with scripting - Varrsharighall - 09-14-2012

Disable Triggers was checked (according with my intentions). But even when I unchecked it, grunt wasn't chasing me when I was out of its sight.


RE: Help with scripting - The chaser - 09-14-2012

I mean disable triggers and path nodes at the same time. Try if works.