Heyho,
I have a question about materialnumber = FetchEntityMaterial(#Entity, #Material [, SubEntity]). First, I don´t know how to use this, because I have to set a materialnumber to get a materialnumber?! Even if first materialnumber is only the second materialnumber, which numbers can I use for FetchEntityMaterial()?
I mean, if I use #Material = 1 and I already got an Material with number "1", what shall I do?
Ah, one more question: Is there Support for #PB_Any?
EDIT: There is Support for #PB_Any with #Material. Could you add this to the Documentation.
There´s another Thing wrong with this function. In the bottomline of the IDE (I forgot the Name of that line) there is an issue with this function... Too much arguments.
FetchEntityMaterial() - nonsense Function?!
- Bananenfreak
- Enthusiast

- Posts: 519
- Joined: Mon Apr 15, 2013 12:22 pm
Re: FetchEntityMaterial() - nonsense Function?!
This command should assign the mesh material to a #Material number, so you can use the material library command on it. Does it works as expected ?
Re: FetchEntityMaterial() - nonsense Function?!
refer to the FetchEntityMaterial.pb example
if you want to use the matNumber as this
matNumber = FetchEntityMaterial(#Entity0, #Material1)
then this works:
CreateEntity(#Entity1, MeshID(#Mesh1), MaterialID(#Material1), 60, 0, 0)
also this will work:
CreateEntity(#Entity1, MeshID(#Mesh1), matNumber, 60, 0, 0)
i guess matNumber is a pointer to the material (long number), correct me if wrong
if you want to use the matNumber as this
matNumber = FetchEntityMaterial(#Entity0, #Material1)
then this works:
CreateEntity(#Entity1, MeshID(#Mesh1), MaterialID(#Material1), 60, 0, 0)
also this will work:
CreateEntity(#Entity1, MeshID(#Mesh1), matNumber, 60, 0, 0)
i guess matNumber is a pointer to the material (long number), correct me if wrong
- Bananenfreak
- Enthusiast

- Posts: 519
- Joined: Mon Apr 15, 2013 12:22 pm
Re: FetchEntityMaterial() - nonsense Function?!
Ah, then FetchEntityMaterial() gives you pointer to the "fetched" material back as result and #Material is the PB-intern value; Material will set to this #Material.
Ok, now it´s clear why we need a #Material for a materialnumber.
Personally, I don´t like this command, because there are 2 (different) functions in 1 command...
Ok, now it´s clear why we need a #Material for a materialnumber.
Personally, I don´t like this command, because there are 2 (different) functions in 1 command...
Re: FetchEntityMaterial() - nonsense Function?!
No, only the #Material number is valid. It returns the materialID, but it's not documented. You have to use MaterialID() if you want it
http://www.purebasic.com/documentation/ ... erial.html
http://www.purebasic.com/documentation/ ... erial.html
- Bananenfreak
- Enthusiast

- Posts: 519
- Joined: Mon Apr 15, 2013 12:22 pm
Re: FetchEntityMaterial() - nonsense Function?!
Aha, then the german Documentation isn't up-to-date. I will post it in the german forum.

