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
Need help with scripting :)
triadtimes Offline
Senior Member

Posts: 508
Threads: 16
Joined: Jan 2011
Reputation: 21
#2
RE: Need help with scripting :)

AddPropImpulse("NAME", X,Y,Z, "world");

That is the line of code to be used to throw things. NAME is whatever the bottle is named in the editor. X Y and Z are coordinates, check it in the editor and change the values accordingly [i.e. if the bottle is going to be thrown across the room along the x axis it should look like this AddPropImpulse("Bottle", 50, 0, 0, "world); you may need to change the 50 if it is too powerful or not powerful enough.] This will be triggered whenever a play enters an area which was defined in the editor. (I will post that code below)

The code in your OnStart would be something like this:

AddEntityCollideCallback("Player", "trigger", "scare", true, 1);

Which means whenever the Player enters the area called trigger then the function scare will be called (in this case that is where you would put the AddPropImpulse.


OVERALL it should look something like this:

void OnStart()
{    
    AddEntityCollideCallback("Player", "trigger", "scarebottle", true, 1);
}
void scarebottle(string &in asParent, string &in asChild, int alState)
{
    AddPropImpulse("bottle", 50,0, 0, "world");
}

05-24-2011, 09:20 PM
Find


Messages In This Thread
Need help with scripting :) - by havis1337 - 05-24-2011, 08:47 PM
RE: Need help with scripting :) - by triadtimes - 05-24-2011, 09:20 PM
RE: Need help with scripting :) - by havis1337 - 05-25-2011, 12:27 PM



Users browsing this thread: 1 Guest(s)