![]() |
[SCRIPT] (Solved) GetPropIsInteractedWith not working? - 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: [SCRIPT] (Solved) GetPropIsInteractedWith not working? (/thread-30422.html) Pages:
1
2
|
(Solved) GetPropIsInteractedWith not working? - Neelke - 08-21-2015 No matter what I do with this function it cannot properly work at all. It literally doesn't do what I tell it to do. Code: float Time = (1.05f - GetTimerTimeLeft("ImpactTime")); // Get's the time taken to impact Is this a bug or am I just not using it correctly? RE: GetPropIsInteractedWith not working? - Mudbill - 08-21-2015 Which item are you using for this? A shovel joint? RE: GetPropIsInteractedWith not working? - Neelke - 08-21-2015 The entity which represents asParent is the stone_small01.ent simply named "stone". You're normally meant to throw this onto the edge of the shovel joint, but its possible to get the same effect by simply running into the shovel while holding the stone. So I'm trying to get this implemented and working, but it does not work. RE: GetPropIsInteractedWith not working? - Daemian - 08-21-2015 where's Distance declared? Debug it all, check each value. I'd start with this: PHP Code: (Speed >= 0.25f && GetPropIsInteractedWith(asParent)) PHP Code: boolean a = (Speed >= 0.5f); RE: GetPropIsInteractedWith not working? - Neelke - 08-21-2015 (08-21-2015, 06:18 PM)Daemian Wrote: where's Distance declared? Nope, did not work. The same thing happens. I might as well send the entire script of how it looks like atm. Code: float Distance = 0.015f; I think I'm able to change the script so you have to check where the player is located so you cannot stand infront of the shovel and throw it. But I'd rather wanna know if this function is impossible to use or not. RE: (Kinda Solved) GetPropIsInteractedWith not working? - Neelke - 08-21-2015 So I kinda half fixed it by instead checking where the player is. If player stands too close to the shovel, it's impossible to create the event. If you stand far away it will work. Thanks for the help guys anyway. RE: (Kinda Solved) GetPropIsInteractedWith not working? - FlawlessHappiness - 08-21-2015 Shouldn't you be checking if it is true/false? Or is there a default, like if you don't specify it, it's just checking for true? RE: (Kinda Solved) GetPropIsInteractedWith not working? - Neelke - 08-21-2015 You can modify it for true or false. If you simply leave it like I've done it, it's automatically set to true. You can change it to false by adding a ! at the start. Code: if(!GetPropIsInteractedWith(asParent)) But like I've mentioned previously, its pretty much been refusing to function properly. Can't tell if there's something I'm doing wrong or if its simply the function thats just plain broken like AddAttachedPropToProp. And yes I could add == true and such, but hey this method saves some space ![]() RE: (Kinda Solved) GetPropIsInteractedWith not working? - FlawlessHappiness - 08-21-2015 Have you tried a simple timer, refiring itself, and adding a debugmessage if a prop is interacted with, just to make sure it actually works? RE: (Kinda Solved) GetPropIsInteractedWith not working? - Neelke - 08-21-2015 Yeah, good idea. I'll update this comment after I've attempted it. Ok, that actually did work. The debug message changed when its interacted with now. But I don't understand why the if-statement in the collide function did not work. I think I solved it, but I had to do it in a method I didn't expect to use. I need to start a timer when entering the map constantly repeating and telling if stone is interacted, setting up an int variable. Code: int iInteractStoneIndex = 0; And then I just use the variable in the if-statement. Code: if(Speed >= 0.2f && iInteractStoneIndex == 0) Thanks alot Flawless for telling me to experiment with a timer ![]() |