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
Script Help (Solved) GetPropIsInteractedWith not working?
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#5
RE: GetPropIsInteractedWith not working?

(08-21-2015, 06:18 PM)Daemian Wrote: where's Distance declared?
Debug it all, check each value. I'd start with this:
PHP Code: (Select All)
(Speed >= 0.25f && GetPropIsInteractedWith(asParent)) 
Try without those conditions. If it works, try using the conditions separated, like:
PHP Code: (Select All)
boolean a = (Speed >= 0.5f);
boolean b = (GetPropIsInteractedWith(asParent));

if ( 
&& ) { playmusic... } 

Nope, did not work. The same thing happens. I might as well send the entire script of how it looks like atm.

float Distance = 0.015f;

void Impact1(string &in asParent , string &in asChild , int alState)
{
    AddTimer("ImpactTime" , 1.0f , "HitTime"); // This doesnt need to call anything
}

void Impact2(string &in asParent, string &in asChild, int alState)
{
    float Time = (1.05f - GetTimerTimeLeft("ImpactTime")); // Get's the time taken to impact
    float Speed = (Distance / Time); // Gets the speed
    
    bool a = (Speed >= 0.25f);
    bool b = (GetPropIsInteractedWith(asParent));
    
    if(a && b) // Minimum necessary speed (don't want this to happen if the rock is hold)
    {
        PlayMusic("17_paper_herbert01.ogg", false, 0.7f, 0, 10, false);
        CompleteQuest("MainVaultDoorsClosed", "MainVaultDoorsClosed");
        SetEntityActive("shovel_joint_1", false); //Prepare new shovel
        SetEntityActive("shovel_joint_2", true);
        ShovelImpulse();
        
        SetMoveObjectStateExt("slide_doo_thick_1", -0.5f, 1.0f, 1.0f, 0.0f, true);
        SetMoveObjectStateExt("slide_doo_thick_2", 0.5f, 1.0f, 1.0f, 0.0f, true);
        
        SetEntityActive("AreaRockOnShovel", false);
        SetEntityActive("AreaRockOnShovel_1", false);
        SetEntityActive("AreaRockTooFarIn", false);
        SetEntityActive("AreaLeftSide", false);
        SetEntityActive("AreaRightSide", false);
        
        SetEntityActive("AreaInteractDoors", false);
    }
    else
    {
        SetMessage("Ch04Level21", "ThrownHarder", 0);
        AddDebugMessage("Stone too lazy thrown or interacted!", false);
    }
}

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.

Derp.
(This post was last modified: 08-21-2015, 07:06 PM by Neelke.)
08-21-2015, 07:06 PM
Find


Messages In This Thread
RE: GetPropIsInteractedWith not working? - by Neelke - 08-21-2015, 07:06 PM



Users browsing this thread: 3 Guest(s)