What function returns the players position? - 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: What function returns the players position? (/thread-20757.html) |
What function returns the players position? - tonitoni1998 - 03-15-2013 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. RE: What function returns the players position? - Adrianis - 03-15-2013 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 RE: What function returns the players position? - tonitoni1998 - 03-15-2013 nope nope nope. i guess i will just deal with it >_> thanks for reply RE: What function returns the players position? - ingedoom - 03-15-2013 (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 arrangeWell 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 RE: What function returns the players position? - Adrianis - 03-15-2013 (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 arrangeWell 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 RE: What function returns the players position? - ExpectedIdentifier - 03-15-2013 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 RE: What function returns the players position? - Akos115 - 03-15-2013 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. RE: What function returns the players position? - tonitoni1998 - 03-15-2013 (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. RE: What function returns the players position? - ingedoom - 03-15-2013 (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. ^^ RE: What function returns the players position? - Adrianis - 03-15-2013 (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 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 |