User Tools

Site Tools


hpl2:tutorials:script:pushdoorsopen

Link to this comparison view

Next revision
Previous revision
hpl2:tutorials:script:pushdoorsopen [2011/07/18 12:26]
ouroboros created
hpl2:tutorials:script:pushdoorsopen [2011/07/18 13:19] (current)
ouroboros [Opening entities with doors]
Line 2: Line 2:
  
  
-Using Force, aside from moving things around, can be used to open doors and things such as cabinets which can be opened.+Force, aside from moving things around, can be used to open doors and things such as cabinets which can be opened.
  
  
-[[http://​wiki.frictionalgames.com/​hpl2/tutorials/script/force|This page]] describes what AddBodyForce/​AddPropForce does and how to find out which of the X, Y, or Z variables you want to increase or decrease, in this case it would be whichever way the door opens.+[[:hpl2:tutorials:script:force|This page]] describes what AddBodyForce/​AddPropForce does and how to find out which of the X, Y, or Z variables you want to increase or decrease, in this case it would be whichever way the door opens.
  
  
Line 30: Line 30:
  
  
-"​string &in entity"​ at the beginning of the function(just after it's name) will become ​the entity'​s name if it's placed on the entity'​s PlayerLookAtCallback text box. Meaning, this would work for a door name "​mansion_1",​ and for another named "​room3"​ at the same time. +the "​entity"​ in "​string &in entity"​ at the beginning of the function(just after it's name) is a string variable that is assigned ​the entity'​s name if it's placed on the entity'​s PlayerLookAtCallback text box. Meaning, this would work for a door name "​mansion_1",​ and for another named "​room3"​ at the same time.
  
 ===== Opening entities with "​doors"​ ===== ===== Opening entities with "​doors"​ =====
  
  
-Opening entities with doors, that aren't door entities is fairly similar to opening doors, however you need to use AddBodyForce,​ which requires a body name rather than an entity name, rather than AddPropForce.+Opening entities with doors, that aren't door entities is fairly similar to opening doors, however you need to use AddBodyForce ​instead of AddPropForce, which requires a body name rather than an entity name.
  
  
-So, for starters you'll need what you want to open, I happen to have the bodies needed to a metal cabinet in some code so I'll use that for an example. ​+So, for starters you'll need what you want to open, I happen to have the bodies needed to a metal cabinet in some code so I'll use that for an example.
  
  
Line 55: Line 54:
  
 Finding out what a body's name is, is rather easy. All you do is open the model editor and open the .ent file for the entity you want to use. This should bring up the finished model with pink boxes at the doors, just click these boxes, making sure that you select the right one, and then just use the name in the code as shown above. Finding out what a body's name is, is rather easy. All you do is open the model editor and open the .ent file for the entity you want to use. This should bring up the finished model with pink boxes at the doors, just click these boxes, making sure that you select the right one, and then just use the name in the code as shown above.
 +
 +
 +//\\  //
  
hpl2/tutorials/script/pushdoorsopen.1310991985.txt.gz · Last modified: 2011/07/18 12:26 by ouroboros