![]() |
Idea for calculating position/angle? - 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: Idea for calculating position/angle? (/thread-25345.html) Pages:
1
2
|
RE: Idea for calculating position/angle? - Mudbill - 05-23-2014 Okay I think I have figured out a nice way of doing this. It's similar to something I tried before, but it works a lot better this time. There can be flaws, but I haven't encountered any. I can see where they can occur though, but I don't think that event will ever happen. The new system looks like this: ![]() The player collides with the areas and call this script: PHP Code: void CollideArea(string &in asParent, string &in asChild, int alState) It's very simple and efficient by the looks of it. I was a bit unsure about disabling and re-enabling the current area that's being used to trigger the event, but it appears to work fine with no issues. The string "Area" results in the co-ord of the area, for example x1y1 or x2y1 depending on there you use the item. This is so that the event can easily be duplicated for a huge number of times, because there's this for-loop in OnStart. PHP Code: for(int x = 1; x < 10; x++) for(int y = 1; y < 10; y++) { The area in the middle is the _Pick one. There is quite a bit more script, but I guess I won't need to post it. You can probably figure out how it works by now. Just wanted to let you know that, unless I encounter a problem, I have solved this little issue. The results are pretty nice. I can imagine it can bug out if the player is outside all the areas when trying to use the item, but in that case it will just use the last entered area. Still, in the for-loop, I just made the name ItemMirror_1 instead of +x due to the above problem. Anyone know anything about that? RE: Idea for calculating position/angle? - DnALANGE - 05-23-2014 Sorta whati suggested i see. good it works man. |