ParaToxic Posted November 22, 2011 Share Posted November 22, 2011 Hey Guys,I would like to make a sound class for a FPS game and to check out on which type of ground the player is ,I would like to set to all Models a Key named "Surface" and a value like "Metal" or "Concrete".I set the Key ,but in C,in my Game it can't find this key or the value. Maybe somebody can help me ;D Little Map lue file: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) self.model:SetKey("Surface","Concrete") end and in C : else if(GetEntityKey(weapon->shootpick.entity,"Surface") == "Concrete") { PositionEntity(metal,EntityPosition(weapon->shootpick.entity)); PlaySource(concrete); } Thanks os much Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 22, 2011 Share Posted November 22, 2011 try this: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) object.model:SetKey("Surface","Concrete") end and probably in the C code, you would need to find the model of the pick.entity as a pick's entity is a mesh not the model... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
ParaToxic Posted November 22, 2011 Author Share Posted November 22, 2011 Thanks you with the Model it works well ;D Quote Link to comment Share on other sites More sharing options...
Josh Posted November 23, 2011 Share Posted November 23, 2011 That's why they call him macklebee... Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.