Arska134 Posted March 7, 2012 Share Posted March 7, 2012 How i can group one kind of entities? For example items which player is able to pick up. Some kind of prefix in name or something like that. Another question is how can i identify those "items" in my Blitzmax code to be able to pick up them? Quote Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax Link to comment Share on other sites More sharing options...
ParaToxic Posted March 7, 2012 Share Posted March 7, 2012 For example you can work with the Entity Keys.For example if you need the impact sounds of different materials,you give the entitys keys in the group "Impact" f.x : SetEntityKey(...,"Impact","Wood"); or SetEntityKey(...,"Impact","Sand"); and soone. Quote Link to comment Share on other sites More sharing options...
Arska134 Posted March 7, 2012 Author Share Posted March 7, 2012 So basically i can SetEntityKey() in LUA script in editor and then GetEntityKey() in Blitzmax code? Quote Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax Link to comment Share on other sites More sharing options...
ParaToxic Posted March 7, 2012 Share Posted March 7, 2012 Yes you set for example in lua : object.SetKey("Impact","Wood"); And in Bmax(sry I can't programm in Bmax ,only pseudocode) for picked entity : string keyvalue = GetEntityKey(pick.entity,"Impact"); if(keyvalue == "Wood") ....... Quote Link to comment Share on other sites More sharing options...
Arska134 Posted March 9, 2012 Author Share Posted March 9, 2012 Little bit confused with LUA... SetEntityKey( TEntity entity, str keyname, str keyvalue ) So what is "self" entity in LUA script for "TEntity entity". Need to have something like this: SetEntityKey( self entity, "food", "bread" ) Quote Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax Link to comment Share on other sites More sharing options...
ParaToxic Posted March 9, 2012 Share Posted March 9, 2012 No you need to use the mesh and write something like: function class:CreateObject(model) local object=self.super:CreateObject(model) self.model:SetKey(key,value) end Quote 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.