tonitoni1998 
 
 
		
			Member 
			
			
			
 
			
	Posts: 163 
	Threads: 54 
	Joined: Oct 2012
	
 Reputation: 
1
		
	 | 
	
		
			
What function returns the players position? 
			 
			
				is there any way to get the position of the player? i want to create a sound right behind the player. i could use an area, and then create the sound behind the area, but knowing the players position can be useful very often.
			 
			
			
 
When you are looking for someone, to do the scripting for your Custom Story, ask me! 
			
		 |  
	 
 | 
 
	| 03-15-2013, 03:22 PM  | 
	
		
	 | 
 
 
	
		
		Adrianis 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 620 
	Threads: 6 
	Joined: Feb 2012
	
 Reputation: 
27
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				Unfortanately there is no way, other than determining where they are using script area collides etc. Conceivably you could cover the whole map in a tight grid of SA's and track them like that, but it won't be very fun to arrange   
			 
			
			
 
			
		 |  
	 
 | 
 
	| 03-15-2013, 03:39 PM  | 
	
		
	 | 
 
 
	
		
		tonitoni1998 
 
 
		
			Member 
			
			
			
 
			
	Posts: 163 
	Threads: 54 
	Joined: Oct 2012
	
 Reputation: 
1
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				nope nope nope. 
i guess i will just deal with it >_>    thanks for reply
			  
			
			
 
When you are looking for someone, to do the scripting for your Custom Story, ask me! 
			
		 |  
	 
 | 
 
	| 03-15-2013, 03:40 PM  | 
	
		
	 | 
 
 
	
		
		ingedoom 
 
 
		
			Member 
			
			
			
 
			
	Posts: 120 
	Threads: 12 
	Joined: Feb 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				 (03-15-2013, 03:39 PM)Adrianis Wrote:  Conceivably you could cover the whole map in a tight grid of SA's and track them like that, but it won't be very fun to arrange   Well you could just do it in the local area where you wan't the event to take place. I could be worth considering, but it will be a challange. =P
			  
			
			
 
			
		 |  
	 
 | 
 
	| 03-15-2013, 03:51 PM  | 
	
		
	 | 
 
 
	
		
		Adrianis 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 620 
	Threads: 6 
	Joined: Feb 2012
	
 Reputation: 
27
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				 (03-15-2013, 03:51 PM)ingedoom Wrote:   (03-15-2013, 03:39 PM)Adrianis Wrote:  Conceivably you could cover the whole map in a tight grid of SA's and track them like that, but it won't be very fun to arrange   Well you could just do it in the local area where you wan't the event to take place. I could be worth considering, but it will be a challange. =P 
That's totally true, and would reduce the levels of pain-in-the-arsedness you'd have to deal with, but you may as well just use a few well placed SA's. I doubt the trouble would be worth it in the end   
			 
			
			
 
			
		 |  
	 
 | 
 
	| 03-15-2013, 03:55 PM  | 
	
		
	 | 
 
 
	
		
		ExpectedIdentifier 
 
 
		
			Member 
			
			
			
 
			
	Posts: 234 
	Threads: 10 
	Joined: Sep 2012
	
 Reputation: 
11
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				Get the sound you want, and edit it so it sounds close by, I'd recommend Audacity for sound editing, use Gverb or another reverb setting on the sound until you get the right kind of sound that you want. Save it as a .ogg file and then create a .snt file for it. Then just make it play at the Player. Another option is to have many many script areas, and just have a looping function that plays sounds at random areas, the player will hear them when they play at an area that's near to them, great for ambience   
			 
			
			
			
		 |  
	 
 | 
 
	| 03-15-2013, 06:41 PM  | 
	
		
	 | 
 
 
	
		
		Akos115 
 
 
		
			Member 
			
			
			
 
			
	Posts: 101 
	Threads: 14 
	Joined: Aug 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				It's possible, but it would take forever to script it  
 
For example you make a timer to scare the player at random times.
You have to place not too big, maybe 5x...x5 areas to overlap the whole map.
When the timer reaches zero, it has to make an addentitycollidecallback for EVERY area 
In the function, you have to remove all other addentitycollidecallbacks, and make setentityplayerlookatcallbacks for all areas, that surround the area which the player stands in.
The rest is easy, for each function for the setentityplayerlookatcallbacks you have to remove the other setentityplayerlookatcallbacks, and play a sound at the opposite area which the player looks at.I try to draw this part:
x - player
0 - other areas
1 - looked at area
2 - area which plays the sound
 
Top view:
 
000000
01x200
000000
 
So it's possible, but takes forever to script, escpecially with huge maps.  
 
			 
			
			
 
			
				
(This post was last modified: 03-15-2013, 08:04 PM by Akos115.)
 
				
			 
		 |  
	 
 | 
 
	| 03-15-2013, 08:04 PM  | 
	
		
	 | 
 
 
	
		
		tonitoni1998 
 
 
		
			Member 
			
			
			
 
			
	Posts: 163 
	Threads: 54 
	Joined: Oct 2012
	
 Reputation: 
1
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				 (03-15-2013, 06:41 PM)sonataarctica Wrote:  Get the sound you want, and edit it so it sounds close by, I'd recommend Audacity for sound editing, use Gverb or another reverb setting on the sound until you get the right kind of sound that you want. Save it as a .ogg file and then create a .snt file for it. Then just make it play at the Player. Another option is to have many many script areas, and just have a looping function that plays sounds at random areas, the player will hear them when they play at an area that's near to them, great for ambience   
thats not what i wanted, but thanks for the advice    
i actually wanted it behind the player. like a groan behind him so he thinks an enemy is right behind him.
			  
			
			
 
When you are looking for someone, to do the scripting for your Custom Story, ask me! 
			
		 |  
	 
 | 
 
	| 03-15-2013, 08:08 PM  | 
	
		
	 | 
 
 
	
		
		ingedoom 
 
 
		
			Member 
			
			
			
 
			
	Posts: 120 
	Threads: 12 
	Joined: Feb 2012
	
 Reputation: 
0
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				 (03-15-2013, 03:55 PM)Adrianis Wrote:  I doubt the trouble would be worth it in the end   
You can also use it for other things than just sound. Say for example you want the grunt to spawn directly in the players face, like a vision or something. Then you have to make a set of SA's and of course make it disable the other ones when player has collided with one of them. Really i just wanted to pin out that there is various possibilities. ^^
			  
			
			
 
			
		 |  
	 
 | 
 
	| 03-15-2013, 09:22 PM  | 
	
		
	 | 
 
 
	
		
		Adrianis 
 
 
		
			Senior Member 
			
			
			
 
			
	Posts: 620 
	Threads: 6 
	Joined: Feb 2012
	
 Reputation: 
27
		
	 | 
	
		
			
RE: What function returns the players position? 
			 
			
				 (03-15-2013, 09:22 PM)ingedoom Wrote:   (03-15-2013, 03:55 PM)Adrianis Wrote:  I doubt the trouble would be worth it in the end    
You can also use it for other things than just sound. Say for example you want the grunt to spawn directly in the players face, like a vision or something. Then you have to make a set of SA's and of course make it disable the other ones when player has collided with one of them. Really i just wanted to pin out that there is various possibilities. ^^ 
Hehe of course, my apologies    That's what the 'but you may as well just use a few well placed SA's' was meant to mean
			  
			
			
 
			
		 |  
	 
 | 
 
	| 03-15-2013, 10:42 PM  | 
	
		
	 | 
 
 
	 
 |