| 
		
	
		| Varrsharighall   Junior Member
 
 Posts: 6
 Threads: 1
 Joined: Sep 2012
 Reputation: 
0
 | 
			| Help with scripting 
 
				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?
			 |  |  
	| 09-12-2012, 06:22 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Help with scripting 
 
				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
			 
 Trying is the first step to success. |  |  
	| 09-12-2012, 06:36 PM |  |  
	
		| Ongka   Member
 
 Posts: 225
 Threads: 3
 Joined: Nov 2010
 Reputation: 
20
 | 
			| RE: Help with scripting 
 
				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.
 ShowEnemyPlayerPosition("MonsterName");
 |  |  
	| 09-12-2012, 10:32 PM |  |  
	
		| Adny   Posting Freak
 
 Posts: 1,766
 Threads: 6
 Joined: Mar 2012
 Reputation: 
173
 | 
			| RE: Help with scripting 
 
				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.
			 
 I rate it 3 memes. |  |  
	| 09-12-2012, 10:37 PM |  |  
	
		| FlawlessHappiness   Posting Freak
 
 Posts: 3,980
 Threads: 145
 Joined: Mar 2012
 Reputation: 
171
 | 
			| RE: Help with scripting 
 
				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
			 
 Trying is the first step to success. |  |  
	| 09-13-2012, 06:25 AM |  |  
	
		| Varrsharighall   Junior Member
 
 Posts: 6
 Threads: 1
 Joined: Sep 2012
 Reputation: 
0
 | 
			| RE: Help with scripting 
 
				So, I created script: 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.
			
				
(This post was last modified: 09-14-2012, 12:17 PM by Varrsharighall.)
 |  |  
	| 09-14-2012, 12:14 PM |  |  
	
		| Kreekakon   Pick a god and pray!
 
 Posts: 3,063
 Threads: 70
 Joined: Mar 2012
 Reputation: 
124
 | 
			| RE: Help with scripting 
 
				Did you check Disable Triggers? Try unchecking that to see if it does anything.
			 
 |  |  
	| 09-14-2012, 12:30 PM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: Help with scripting 
 
				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.
			 
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan.
				
(This post was last modified: 09-14-2012, 12:44 PM by The chaser.)
 |  |  
	| 09-14-2012, 12:43 PM |  |  
	
		| Varrsharighall   Junior Member
 
 Posts: 6
 Threads: 1
 Joined: Sep 2012
 Reputation: 
0
 | 
			| RE: Help with scripting 
 
				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.
			 |  |  
	| 09-14-2012, 12:45 PM |  |  
	
		| The chaser   Posting Freak
 
 Posts: 2,486
 Threads: 76
 Joined: Jun 2012
 Reputation: 
113
 | 
			| RE: Help with scripting 
 
				I mean disable triggers and path nodes at the same time. Try if works.
			 
                               THE OTHERWORLD (WIP) ![[Image: k6vbdhu]](http://tinyurl.com/k6vbdhu)  
Aculy iz dolan. |  |  
	| 09-14-2012, 12:51 PM |  |  |