I'd assume it would go something like this:
Linked kill object = texture change?
Moderator: Moderators
-
fasty
- 1st Lieutenant

- Posts: 438
- Joined: Thu Apr 15, 2010 4:17 am
- Projects :: Server modding
- Contact:
Linked kill object = texture change?
Is it possible to rig it so on the destruction of an object, another objects texture changes?
I'd assume it would go something like this:
I'd assume it would go something like this:
Hidden/Spoiler:
- Firefang
- Major

- Posts: 518
- Joined: Mon Nov 15, 2010 8:55 pm
- Location: California
Re: Linked kill object = texture change?
You have to spawn a new object with the changed texture.
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Linked kill object = texture change?
no, you dont have to, you can do it by loading a new texture with the same name into memory
how to switch textures through lua:
1. make a side "textures" and the according folder in _BUILD\Sides\ with the munge.bat and clean.bat in it.
2. make an "msh"-folder in the data_XXX\Sides\Texture folder and put in all textures.
3.1 change the texture(s) once:
make a "textures.req" file with this in it:
in your lua, put that in your triggerfunction:
3.2 change textures and change them back or change different textures on different events:
make a "textures.req" with this in it
make a "req" folder in your sides folder and for each pack listed in the "textures.req"
make a new reqfile called "texturepack1.req" and so on, in each put:
in your lua you can now trigger the change by putting this in your function:
and so on.
how to switch textures through lua:
1. make a side "textures" and the according folder in _BUILD\Sides\ with the munge.bat and clean.bat in it.
2. make an "msh"-folder in the data_XXX\Sides\Texture folder and put in all textures.
3.1 change the texture(s) once:
make a "textures.req" file with this in it:
Code: Select all
ucft
{
REQN
{
"texture"
"texturename1"
"texturename2" etc.
}
}Code: Select all
ReadDataFile("DC:SIDE\\textures.lvl")make a "textures.req" with this in it
Code: Select all
ucft
{
REQN
{
"lvl"
"texturepack1"
"texturepack2" etc.
}
}make a new reqfile called "texturepack1.req" and so on, in each put:
Code: Select all
ucft
{
REQN
{
"texture"
"texturename1"
"texturename2" etc.
}
}Code: Select all
ReadDataFile("DC:SIDE\\textures.lvl",
"texturepack1")
Last edited by DarthD.U.C.K. on Wed Feb 23, 2011 11:50 am, edited 1 time in total.
-
fasty
- 1st Lieutenant

- Posts: 438
- Joined: Thu Apr 15, 2010 4:17 am
- Projects :: Server modding
- Contact:
Re: Linked kill object = texture change?
Thanks I knew there was SOME way to do it.
That's very clever.
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Linked kill object = texture change?
thanks 
i think you can change mshs and odfs through this too, but im not sure. i tried it with an odf once and it atleast gave some kind of respose (geometry not found
)
i think you can change mshs and odfs through this too, but im not sure. i tried it with an odf once and it atleast gave some kind of respose (geometry not found
- AceMastermind
- Gametoast Staff

- Posts: 3285
- Joined: Mon Aug 21, 2006 6:23 am
- Contact:
Re: Linked kill object = texture change?
What kind of code do you plan to use that actually changes the object's texture? I don't see any properties that can do this for any object. I'm no programmer but I think Firefang may be right. The instructions provided by DarthD.U.C.K. is basically what Syth describes HERE as a "skin side". This thread can't be solved until you have something that works like it should.fasty wrote:...Code: Select all
killobjc = OnObjectKill( function(object, killer) if GetEntityName(object) == "ObjectIKill" then <InsertCodeThatChangesTextureHere> end end )
-
fasty
- 1st Lieutenant

- Posts: 438
- Joined: Thu Apr 15, 2010 4:17 am
- Projects :: Server modding
- Contact:
Re: Linked kill object = texture change?
So far I've gotten my unit to change weapons on object destruction, but I'm still working on a texture change. I don't really know what to put in place of WeaponName1 that will change the texture. Everything I've tried either doesn't work or crashes.
Changing the geometry causes a crash just like Duck said it would.
Hidden/Spoiler:
- Firefang
- Major

- Posts: 518
- Joined: Mon Nov 15, 2010 8:55 pm
- Location: California
Re: Linked kill object = texture change?
You would have to change the unit's msh to change texture. I was working on this a while ago, which proves that a msh can be swapped ingame.
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: Linked kill object = texture change?
i tried overriding a msh via sideloading and it complained about model being loaded already.
loading an odf didnt give me an error but i think you have to respawn a prop to get it to use the new odf (if that works)
anyway, like firefang said, you can change the texture by changing the units model with setproperty.
there is however a difference between changing the "odf" of the unit and the texture itself.
if you change the odf with setproperty, it will apply to all units that are spawned after the change was made
if you change it by overriding a texture in the memory, it will apply to all units.
to change the texture in memory, put "ReadDataFile("DC:SIDE\\textures.lvl")" instead of the setpropertyline in the function.
loading an odf didnt give me an error but i think you have to respawn a prop to get it to use the new odf (if that works)
anyway, like firefang said, you can change the texture by changing the units model with setproperty.
there is however a difference between changing the "odf" of the unit and the texture itself.
if you change the odf with setproperty, it will apply to all units that are spawned after the change was made
if you change it by overriding a texture in the memory, it will apply to all units.
to change the texture in memory, put "ReadDataFile("DC:SIDE\\textures.lvl")" instead of the setpropertyline in the function.
