Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 857 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
change skin #244868
01/07/09 10:30
01/07/09 10:30
Joined: Oct 2008
Posts: 24
Germany
H
Hazardos Offline OP
Newbie
Hazardos  Offline OP
Newbie
H

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
H
Hazardos Offline OP
Newbie
Hazardos  Offline OP
Newbie
H

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.

Code:
BMAP* test;
test = bmap_for_entity(my,0);
bmap_fill(test,vector(random(255),random(255),random(255)),100);


When i add
Code:
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
F
flits Offline
User
flits  Offline
User
F

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
H
Hazardos Offline OP
Newbie
Hazardos  Offline OP
Newbie
H

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:

Code:

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
F
flits Offline
User
flits  Offline
User
F

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"
Re: change skin [Re: flits] #245833
01/12/09 09:44
01/12/09 09:44
Joined: Oct 2008
Posts: 24
Germany
H
Hazardos Offline OP
Newbie
Hazardos  Offline OP
Newbie
H

Joined: Oct 2008
Posts: 24
Germany
wait(1) won't work in this case. :-(


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1