Jump to content

Recommended Posts

Posted

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?

Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax

Posted

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.

Posted

So basically i can SetEntityKey() in LUA script in editor and then GetEntityKey() in Blitzmax code?

Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax

Posted

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")
.......

Posted

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" )

Windows 7 Ultimate | Intel Core i7 930 @ 2.80 ghz | Nvidia GeForce GTX 560 | Leadwerks 2.5 | Blitzmax

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...