Jump to content

[Q] About Set/GetEntityUserData


Ywa
 Share

Recommended Posts

Hello. I'm trying to change a model (that means both mesh/physbody) for an entity and keep its properties intact (like velocity, keys, position, angles, color,etc). I've browsed the wiki to find a function suitable for me. I'm not sure about Set/GetEntityUserData. The wiki doesn't seem to say much. Anyone care to help me with a detailed explanation on how these 2 functions work. More over, how can I solve my SetModel function problem? Help is much appreciated.

Link to comment
Share on other sites

Hello. I'm trying to change a model (that means both mesh/physbody) for an entity and keep its properties intact (like velocity, keys, position, angles, color,etc). I've browsed the wiki to find a function suitable for me. I'm not sure about Set/GetEntityUserData. The wiki doesn't seem to say much. Anyone care to help me with a detailed explanation on how these 2 functions work. More over, how can I solve my SetModel function problem? Help is much appreciated.

 

You forget to say on what programming language?

 

In BMax:

 


Type MyData
   field x,y,z
end type

c=createcube()

md:MyData=new MyData
md.x=1
md.y=2
md.z=3

setentityuserdata c,md

' and now we can get data:

md=MyData(getentityuserdata(c))

print md.x
print md.y
print md.z

"Better" is big enemy of "good"

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...