1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: passing values to Effects.
[Re: Alexander Esslinger]
#21425
12/23/03 11:38
12/23/03 11:38
|
Joined: Aug 2003
Posts: 145
Beorn
OP
Member
|
OP
Member
Joined: Aug 2003
Posts: 145
|
Thank You very much Alexander, I did try everything except using MY in Material Event. Unfortunately it still doesnt work. The last entity that uses the material, sets the amount of displacement for all that is uding the same material. Ive tried changing so that i have different HMp models for entities, and lots of other stuff. But i have no luck. I thought that this text from the readbeta was the ticket: Quote:
material.enable_render If this flag is set, the material's event function is executed at the beginning of every entity rendering, if the material contains an effect and was assigned to the entity. This can be used to perform effect calculations based on entity skills or the entity's world matrix.
Another funny thing is that im only allowed to use the MY pointer in the material event if i state further MTL.EVENTS. If i only use event=function(); in the actual MATERIAL definition, i get "EmPTY POINTER all the time.
I hope there is something that i still dont understand.
And thanks again for your help.
Merry Christmas!
|
|
|
Re: passing values to Effects.
[Re: Alexander Esslinger]
#21429
12/31/03 12:46
12/31/03 12:46
|
Joined: Aug 2003
Posts: 145
Beorn
OP
Member
|
OP
Member
Joined: Aug 2003
Posts: 145
|
Alexander, Sorry for the silence. The flu got me big time. Here the code. In this example im simply trying to give each entity different texture scaling, but they all end up with the same. Note: The entities are created in runtime by another entity and given the same Action. They use the same model. They all have different skill2 values. Code:
bmap testsquares = <testsquares50.tga>;
function mtl_terr_view() {
mtl.matrix22 = floatd(mtl.skill1,1); mtl.matrix11 = floatd(mtl.skill1,1);
}
function mtl_terrer_init { mtl.skill1 = my.skill2*10; mtl.event = mtl_terr_view; mtl.enable_render=on;
}
material terry { skin1 = testsquares; event = mtl_terrer_init;
effect =" texture entSkin1; texture mtlSkin1;
matrix matMtl;
technique scalex { pass p0 {
Texture[0]=<mtlSkin1>;
ColorArg1[0]=Texture; ColorOp[0]=SELECTARG1;
TextureTransformFlags[0] = count2; // use u,v values TextureTransform[0] = <matMtl>; }
} "; }
|
|
|
Re: passing values to Effects.
[Re: Alexander Esslinger]
#21431
01/01/04 13:08
01/01/04 13:08
|
Joined: Aug 2003
Posts: 145
Beorn
OP
Member
|
OP
Member
Joined: Aug 2003
Posts: 145
|
Thanks. Because i get two of this, and then the effect dies: Quote:
Malfunction W1501: Empty pointer in mtl_terr_view: mtl.matrix22=floatr(my.skill2)
As soon as i try to use any "my.skill" in the "last" event function of an effect. This goes for all of my materials/effects.
In the the second (INIT), i can use my.skill w/o problems but they are only run once.
Any ideas?
|
|
|
|