Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What function returns the players position?
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#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
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#2
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 Smile

03-15-2013, 03:39 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#3
RE: What function returns the players position?

nope nope nope.

i guess i will just deal with it >_> Big Grin 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
Find
ingedoom Offline
Member

Posts: 120
Threads: 12
Joined: Feb 2012
Reputation: 0
#4
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 Smile
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

[Image: 23778.png]
03-15-2013, 03:51 PM
Website Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#5
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 Smile
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 Smile

03-15-2013, 03:55 PM
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#6
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 Smile
(This post was last modified: 03-15-2013, 06:43 PM by ExpectedIdentifier.)
03-15-2013, 06:41 PM
Find
Akos115 Offline
Member

Posts: 101
Threads: 14
Joined: Aug 2012
Reputation: 0
#7
RE: What function returns the players position?

It's possible, but it would take forever to script it Tongue


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. Tongue


(This post was last modified: 03-15-2013, 08:04 PM by Akos115.)
03-15-2013, 08:04 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#8
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 Smile

thats not what i wanted, but thanks for the advice Smile

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
Find
ingedoom Offline
Member

Posts: 120
Threads: 12
Joined: Feb 2012
Reputation: 0
#9
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 Smile

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. ^^

[Image: 23778.png]
03-15-2013, 09:22 PM
Website Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#10
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 Smile

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 Smile 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
Find




Users browsing this thread: 1 Guest(s)