Jump to content

Mesh vs Model


fumanshoo
 Share

Recommended Posts

Collisions only work on bodies and terrains. LoadModel will load/create an invisible physics body with the visible mesh as the child. LoadMesh just loads the visible mesh. Since you want to color the visible child mesh of the model, you have to set the recursive parameter to 1.

entity:SetColor( color:TVec4, recursive )

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

sceneBuildings = LoadModel("abstract::general visualization of the slums.gmf")

sceneBuildings:SetPosition(Vec3(0,-.05,0))

sceneBuildings: SetCollisionType(2)

 

EntityColor(sceneBuildings,Vec4(.5,.5,.5,.5,1))

 

Is this what you mean? I am still not getting the desired effects....

Link to comment
Share on other sites

EntityColor(sceneBuildings,Vec4(.5,.5,.5,.5,1))

 

i am assuming you are using lua, so it should be:

sceneBuildings:SetColor(Vec4(.5,.5,.5,.5),1)

 

you know if you used the editor to create your scene, you could easily set these properties with the property dialog... just a suggestion.

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

Well I love the Editor and I had already created the scene in the Editor, but I want to learn more about the Script Editor mostly because I suck at programming in general. The Editor is very reliable and easy, but I just want to learn more. Programming is beginning to become more of a fun thing to me than a chore. Thanks a lot for the help and sorry, I should have told you that I was using Lua Script.

Link to comment
Share on other sites

I think it may take me a little more time to learn all of that. commands... or at least I think they are command like "self.model" and "self.super" confuse the hell out of me. Same with "group:" and "class" I'm just not advanced enough as a user to understand it quite yet, but I am getting there. If you would be willing to privately teach me ( which I highly doubt would ever happen haha ) and help me understand the class file or better yet how to make a controller that is compatible with the game script path, I would be very appreciative, but until then, I am happy with slowly learning on my own haha.

Link to comment
Share on other sites

Just curious. but why are you using code to place buildings in your game when its easier and faster to place them in the editor and then load them in with your scene with loadscene ?Thats what the editor is designed for.

EDIT:You can always use findchild to refer to them.

I only load characters in code ( with LoadMesh)

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

Well, like I said earlier, I used to use the Editor, but I want to better myself when it comes to programming and I think little things like this help. It's not like this little practice is ACTUALLY being used, it's all being put into a dummy scene where I just fool around with stuff. It's helpful too because I had no idea what recursive meant until now.

 

Well, I shouldn't say that I USED to use the Editor because I still do, but not for my little test lab scene...

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