| 
		
	
		| SiderealStop   Junior Member
 
 Posts: 32
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: Looping? 
 
				Kay added it, changed it to false and everything. Still getting the error though when I walk into the room. This is what I have in the script:
 
 
 void OnStart()
 {
 AddEntityCollideCallback("Player", "PlayerCollide", "servant_grunt_1", true, 1);
 InteractConnectPropWithMoveObject("MachineryDoor", "valve_iron_rusty_1", "MachineryDoor", true, false, -1);
 AddEntityCollideCallback("ScriptArea_1", "servant_grunt_1", "Loop", fale, 1);
 }
 void OnEnter()
 void Loop(string &in asTimer)
 {
 SetEntityActive("servant_grunt_1", true);
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 1, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
 AddTimer("2", 1, "Loop");
 }
 
 'Loop', I', guessing, is the name of the loop function. I used that in the 'function' part of the callback. Put the grunt as 'child' and put the script as 'parent'. Still not working. xD It looks like it actually should work so, really, I think it might be the timer itself...?
 |  |  
	| 06-24-2012, 08:06 PM |  |  
	
		| Cruzore   Senior Member
 
 Posts: 301
 Threads: 2
 Joined: Jun 2012
 Reputation: 
37
 | 
			| RE: Looping? 
 
				AddEntityCollideCallback("ScriptArea_1", "servant_grunt_1", "Loop", fale, 1);false has a typo.
 
 Also, void OnEnter() is missing..what is that called again? well..
 I mean those: { }
 
				
(This post was last modified: 06-24-2012, 08:08 PM by Cruzore.)
 |  |  
	| 06-24-2012, 08:07 PM |  |  
	
		| SiderealStop   Junior Member
 
 Posts: 32
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: Looping? 
 
				@-@ WOW Kay. That...was a horrible fail on my part... *facepalms*
 As much of a fail as that was, I fixed, saved and tried again but am still getting the error.
 |  |  
	| 06-24-2012, 08:15 PM |  |  
	
		| Cruzore   Senior Member
 
 Posts: 301
 Threads: 2
 Joined: Jun 2012
 Reputation: 
37
 | 
			| RE: Looping? 
 
				Who's Kay?   
I think I got the mistake: 
AddEntityCollideCallback("Player", "PlayerCollide", "servant_grunt_1", true, 1); 
servant_grunt_1 should be the function. But instead, you pasted the name of your monster. What you have to do is rename it, make a new function and set the grunt active.
			 |  |  
	| 06-24-2012, 08:19 PM |  |  
	
		| SiderealStop   Junior Member
 
 Posts: 32
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: Looping? 
 
				servant_grunt_1 is the name of the entity, the grunt. That entire script used to work until I added the loop.. ;A; So I'm not entirely sure what you mean.. ><
			 |  |  
	| 06-24-2012, 08:23 PM |  |  
	
		| Cruzore   Senior Member
 
 Posts: 301
 Threads: 2
 Joined: Jun 2012
 Reputation: 
37
 | 
			| RE: Looping? 
 
				It's strange, because the third string of the collide callback is supposed to be the function. And an entity is not a function.
			 |  |  
	| 06-24-2012, 08:28 PM |  |  
	
		| SiderealStop   Junior Member
 
 Posts: 32
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: Looping? 
 
				Mm I copied that one directly from the wiki, the example conveniently had the grunt as the enemy patrolling. I was just looking at it too, seeing the difference between the entity callback on the list of commands on the site and the callback from that example. Thing is that it works fine if you take out the whole loop thing. :/
			 |  |  
	| 06-24-2012, 08:33 PM |  |  
	
		| Cruzore   Senior Member
 
 Posts: 301
 Threads: 2
 Joined: Jun 2012
 Reputation: 
37
 | 
			| RE: Looping? 
 
				Well, another thing: About every thing in this script is either horribly wrong or I have eye cancer. Or, better off: After reading some threads, it seems like the grunt will loop automatically? You just have to make sure he doesn't dissapear when out of reach of the player and not in sight, which you do by changing it's stats at the modeleditor? Someone must clear this up, I think. I have no idea about how the grunt reacts.
 |  |  
	| 06-24-2012, 08:46 PM |  |  
	
		| SiderealStop   Junior Member
 
 Posts: 32
 Threads: 3
 Joined: Jun 2012
 Reputation: 
0
 | 
			| RE: Looping? 
 
				Oh it will? I've tested multiple times, different things and such. Usually it disappears at the end of the path...I just checked settings and such, there's nowhere where I can set anything to not disappear when it finishes its path or anything like it...
			 |  |  
	| 06-24-2012, 08:52 PM |  |  
	
		| Cruzore   Senior Member
 
 Posts: 301
 Threads: 2
 Joined: Jun 2012
 Reputation: 
37
 | 
			| RE: Looping? 
 
				Okay, I've read some stuff and I think this way it works:void OnStart()
 {
 AddEntityCollideCallback("Player", "PlayerCollide", "Loop", true, 1);
 InteractConnectPropWithMoveObject("MachineryDoor", "valve_iron_rusty_1", "MachineryDoor", true, false, -1);
 }
 void OnEnter()
 {
 }
 void Loop(string &in asParent, string &in asChild, int alState)
 {
 SetEntityActive("servant_grunt_1", true);
 for(int i=0;i<11;i++)
 {
 if(i == 11)
 {
 i = 0;
 }
 
 AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_"+i, 0.0f, "");
 }
 }
 
 Though the grunt may still dissapear after hiding long enough. You will probably have to change something in the user defined variables in the model editor.
 
				
(This post was last modified: 06-24-2012, 09:01 PM by Cruzore.)
 |  |  
	| 06-24-2012, 08:55 PM |  |  |