Shadowflamez@Posted: Wed Mar 31, 2010 12:19 pm :
I'm trying to replace the skin of the multiplayer health models in Quake 4.This means they must be whit their own standart skin before the player pick them, and they must change it after they respawn, after the player pick them.This is the same like when you have to pick an ammo.The ammo model becames transparent after the player pick it.My problem is that I don't know how to set the skin settings correctly.There is a skin file whit the skin settings.In the skin settings you must write the destination of the material settings.In the material settings you must write the tga settings.I have worked whit materials already but never whit the skins.There is another thing that confuse me.In the SDK in the item.cpp you can see that the "skin_pickup" is defined ( all def files who using idItem spawnclass ).But it works only whit the ammo models of the weapons.I mean if I set the same "skin_pickup" in another item def file, when I pick up this item the skin will stay the same.This means it works only whit the ammo models.
Now I'm working whit two classes.First is the idItem - the standart items, the other is idHealthReserve( all def files who using idHealthReserve spawnclass ) ( my own custom class ) which including only the health items.This definitly don't case problems whit the skin I think, but I'm still confused and I don't know how to fix it.If you can show me a little example or something I will be greatful.

Thank you.



Dafama2k7@Posted: Thu Apr 08, 2010 8:19 am :
You can change the skins in real time with the command setSkin, like entity.setSkin(skin);

See the scripts/doomevents.script for more about this.

I have already done in Doom 3 and Prey, but the problem with Quake 4 is because for an unknown reason its developers Raven has limited VERY much the script handling, with or without the SDK.



AnthonyJa@Posted: Thu Apr 08, 2010 12:59 pm :
Dafama2k7 wrote:
but the problem with Quake 4 is because for an unknown reason its developers Raven has limited VERY much the script handling


Probably because the scripts are painfully slow compared to C++, and if you're capable of doing whatever you need in C++ it is far better to do it in the DLL than in scripts - the setSkin method ends up calling some C++ code in the DLL anyway, so you might as well just keep it all internal where possible.



Shadowflamez@Posted: Fri Apr 09, 2010 11:34 am :
Ok but where to write this command?In the map script file or in the dll?I can use " Setskin(skin name ); " in the item.cpp where is definitions of all item entities in the SDK, and this don't help me already as I told you before.And the second method is the script.But How to use this in the script? I can't imagine how this can't work in the dll but work whit the script.I mean setSkin void work only whit the ammo of the wepons but not whit the other item entities.I have test it several times whit no result.And I'm using setskin command in the SDK.If can be done whit the script... very cool but... I don't know how. :)



Shadowflamez@Posted: Wed Mar 31, 2010 12:19 pm :
I'm trying to replace the skin of the multiplayer health models in Quake 4.This means they must be whit their own standart skin before the player pick them, and they must change it after they respawn, after the player pick them.This is the same like when you have to pick an ammo.The ammo model becames transparent after the player pick it.My problem is that I don't know how to set the skin settings correctly.There is a skin file whit the skin settings.In the skin settings you must write the destination of the material settings.In the material settings you must write the tga settings.I have worked whit materials already but never whit the skins.There is another thing that confuse me.In the SDK in the item.cpp you can see that the "skin_pickup" is defined ( all def files who using idItem spawnclass ).But it works only whit the ammo models of the weapons.I mean if I set the same "skin_pickup" in another item def file, when I pick up this item the skin will stay the same.This means it works only whit the ammo models.
Now I'm working whit two classes.First is the idItem - the standart items, the other is idHealthReserve( all def files who using idHealthReserve spawnclass ) ( my own custom class ) which including only the health items.This definitly don't case problems whit the skin I think, but I'm still confused and I don't know how to fix it.If you can show me a little example or something I will be greatful.

Thank you.



Dafama2k7@Posted: Thu Apr 08, 2010 8:19 am :
You can change the skins in real time with the command setSkin, like entity.setSkin(skin);

See the scripts/doomevents.script for more about this.

I have already done in Doom 3 and Prey, but the problem with Quake 4 is because for an unknown reason its developers Raven has limited VERY much the script handling, with or without the SDK.



AnthonyJa@Posted: Thu Apr 08, 2010 12:59 pm :
Dafama2k7 wrote:
but the problem with Quake 4 is because for an unknown reason its developers Raven has limited VERY much the script handling


Probably because the scripts are painfully slow compared to C++, and if you're capable of doing whatever you need in C++ it is far better to do it in the DLL than in scripts - the setSkin method ends up calling some C++ code in the DLL anyway, so you might as well just keep it all internal where possible.



Shadowflamez@Posted: Fri Apr 09, 2010 11:34 am :
Ok but where to write this command?In the map script file or in the dll?I can use " Setskin(skin name ); " in the item.cpp where is definitions of all item entities in the SDK, and this don't help me already as I told you before.And the second method is the script.But How to use this in the script? I can't imagine how this can't work in the dll but work whit the script.I mean setSkin void work only whit the ammo of the wepons but not whit the other item entities.I have test it several times whit no result.And I'm using setskin command in the SDK.If can be done whit the script... very cool but... I don't know how. :)



Shadowflamez@Posted: Wed Mar 31, 2010 12:19 pm :
I'm trying to replace the skin of the multiplayer health models in Quake 4.This means they must be whit their own standart skin before the player pick them, and they must change it after they respawn, after the player pick them.This is the same like when you have to pick an ammo.The ammo model becames transparent after the player pick it.My problem is that I don't know how to set the skin settings correctly.There is a skin file whit the skin settings.In the skin settings you must write the destination of the material settings.In the material settings you must write the tga settings.I have worked whit materials already but never whit the skins.There is another thing that confuse me.In the SDK in the item.cpp you can see that the "skin_pickup" is defined ( all def files who using idItem spawnclass ).But it works only whit the ammo models of the weapons.I mean if I set the same "skin_pickup" in another item def file, when I pick up this item the skin will stay the same.This means it works only whit the ammo models.
Now I'm working whit two classes.First is the idItem - the standart items, the other is idHealthReserve( all def files who using idHealthReserve spawnclass ) ( my own custom class ) which including only the health items.This definitly don't case problems whit the skin I think, but I'm still confused and I don't know how to fix it.If you can show me a little example or something I will be greatful.

Thank you.



Dafama2k7@Posted: Thu Apr 08, 2010 8:19 am :
You can change the skins in real time with the command setSkin, like entity.setSkin(skin);

See the scripts/doomevents.script for more about this.

I have already done in Doom 3 and Prey, but the problem with Quake 4 is because for an unknown reason its developers Raven has limited VERY much the script handling, with or without the SDK.



AnthonyJa@Posted: Thu Apr 08, 2010 12:59 pm :
Dafama2k7 wrote:
but the problem with Quake 4 is because for an unknown reason its developers Raven has limited VERY much the script handling


Probably because the scripts are painfully slow compared to C++, and if you're capable of doing whatever you need in C++ it is far better to do it in the DLL than in scripts - the setSkin method ends up calling some C++ code in the DLL anyway, so you might as well just keep it all internal where possible.



Shadowflamez@Posted: Fri Apr 09, 2010 11:34 am :
Ok but where to write this command?In the map script file or in the dll?I can use " Setskin(skin name ); " in the item.cpp where is definitions of all item entities in the SDK, and this don't help me already as I told you before.And the second method is the script.But How to use this in the script? I can't imagine how this can't work in the dll but work whit the script.I mean setSkin void work only whit the ammo of the wepons but not whit the other item entities.I have test it several times whit no result.And I'm using setskin command in the SDK.If can be done whit the script... very cool but... I don't know how. :)