possible to detect if standing near water tile ? [solved]
by Jeff Yaskus · in Torque 3D Professional · 01/19/2011 (1:28 am) · 2 replies
I'm making an outdoor game, where the player needs to "drink" water.
Is it possible to script a method to see if the player is standing in front of a water tile ?
Then I can "enable" the button/action to "drink" ...
Also, hoping to use the same approach to allow them to "eat" wild plants which I place as static meshes into the game level. I would assume the same method could be applied in that case as well...
Is there a standard approach for player interaction with the environment in T3D ??
Is it possible to script a method to see if the player is standing in front of a water tile ?
Then I can "enable" the button/action to "drink" ...
Also, hoping to use the same approach to allow them to "eat" wild plants which I place as static meshes into the game level. I would assume the same method could be applied in that case as well...
Is there a standard approach for player interaction with the environment in T3D ??
About the author
Long time gamer, hacker and programmer. With dreams of making video games -
#2
Its rather simple, but works!
04/14/2011 (4:01 pm)
I used the on_collision() to detect when the character is touching a plant (static item) ... and for water tiles I used the code in servers/player.cs which already checks for player entering or leaving water.Its rather simple, but works!
Torque Owner Brian Mayberry
Dead on Que Productions
http://www.torquepowered.com/community/resources/view/20273