3 registered members (AndrewAMD, VoroneTZ, 1 invisible),
1,512
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
change skin
#244868
01/07/09 10:30
01/07/09 10:30
|
Joined: Oct 2008
Posts: 24 Germany
Hazardos
OP
Newbie
|
OP
Newbie
Joined: Oct 2008
Posts: 24
Germany
|
Hi,
I am trying to load an Object and assign a skin to it during runtime. The model does not contain a skin and i don't want to include skins to the model, because there are too many.
the function ent_morphskin() accepts only filenames, but no bmaps. I don't want to create a bmap, save it to a file and then load it again to make this work! How can I put a bmap directly onto a model?
Greetz, Jörn
Last edited by Hazardos; 01/07/09 13:48.
|
|
|
Re: change skin
[Re: Hazardos]
#244928
01/07/09 14:41
01/07/09 14:41
|
Joined: Oct 2008
Posts: 24 Germany
Hazardos
OP
Newbie
|
OP
Newbie
Joined: Oct 2008
Posts: 24
Germany
|
Now, I tried to use bmap_for_entity. The Result was not as I expectet. By modifying the returned bmap, the skins of all entities of the same kind change.
BMAP* test;
test = bmap_for_entity(my,0);
bmap_fill(test,vector(random(255),random(255),random(255)),100);
When i add test = bmap_createblack(16,16,32); above bmap_fill(), all entities are black. Without that line, all entities have the same random color. How can I set up an own skin for each entity?
|
|
|
Re: change skin
[Re: Hazardos]
#244995
01/07/09 21:35
01/07/09 21:35
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
you need ent_clone ore ent_clonskin
"empty"
|
|
|
Re: change skin
[Re: flits]
#245066
01/08/09 09:23
01/08/09 09:23
|
Joined: Oct 2008
Posts: 24 Germany
Hazardos
OP
Newbie
|
OP
Newbie
Joined: Oct 2008
Posts: 24
Germany
|
even by using ent_clone or ent_cloneskin the skins of all entities changes...perhaps its another problem, my code looks like this:
BMAP* test;
for (i=0,i<100,i++)
{
my = ent_create([.....]);
ent_clone(my);//ent_cloneskin(my);
test = bmap_createblack(16,16,32);
bmap_fill(test,vector(random(255),random(255),random(255)),100);
ent_setskin(my,test,1);
}
perhaps i'm using the same pointer to the bmap inside the whole loop...
|
|
|
Re: change skin
[Re: Hazardos]
#245161
01/08/09 18:12
01/08/09 18:12
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
doest this still happen if you put a wait(1); inside your loop?
i know it has to be fast but there could be a scripting bug
"empty"
|
|
|
|