Attaching *models* onto *units*
Moderator: Moderators
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
edit: with some help from jK i have it loading (and rendering!) the changed geometry. now for textures
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
99% complete. only problem is that shadows are not casting properly (recieving fine), Spring seems to be reading the alpha channel on the textures as actually transparent. not 100% sure how to fix.

woohoo!
woohoo!
- Attachments
-
- screen00000.jpg
- (356.9 KiB) Downloaded 2 times
Re: Attaching *models* onto *units*
perhaps JK may be able to give insight on it?
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
Shadows fixed, but another problem has popped up to do with the displaylists, gonna quickly swing off onto a parallel track, try and get something releasable before I fall into a black hole of buggy, poorly written code :D
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
Fixed the screwyness, but no show/hide 
So here it is :)

So here it is :)
Read me before downloading wrote:1)to activate the gadget for a unit, it will need a customparam in the unitdef "unitdraw" it can be any non-nil value
2)the names of the pieces to be drawn onto other models MUST be unique, be creative!
3)the pieces to be loaded need to be in the s3o of a valid unitdef, this means script and unitdef.lua (they can be rubbish values, but they have to be there)
4)the best (imo) way to organize the pieces is to group them into 'library' units, this will save on texture memory use, aswell as being much cleaner
- Attachments
-
- unit_draw.7z
- (2.06 KiB) Downloaded 28 times
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
new version, should be 100% functional.
- Attachments
-
- UnitDraw.7z
- (2.07 KiB) Downloaded 33 times
Re: Attaching *models* onto *units*
acuelly is 99%
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
rubbishknorke wrote:acuelly is 99%

testmod works fine.
Re: Attaching *models* onto *units*
can you upload the tutorialgame with the draw stuff inserted?
to test if it is a mod or computer thing.
to test if it is a mod or computer thing.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
Download this and it should work out of the box.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
getting some of the weird errors you reported last night knorke, no idea wtf is causing them 

Re: Attaching *models* onto *units*
this works.Pressure Line wrote:Download this and it should work out of the box.
just stupid guess, but could the problems be because not all textures have the same dimensions?
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
nope, that aint it.
new screens :D i think i have all the bugs pretty much ironed out.

scoutcar on the right has wheels taken from something i found on my HDD, has a 512*256 texture! The brown tank is trying on the Angletank's turret for size.

The 'Trifighter' with the gun barrel from my 'Angletank' model
new screens :D i think i have all the bugs pretty much ironed out.
scoutcar on the right has wheels taken from something i found on my HDD, has a 512*256 texture! The brown tank is trying on the Angletank's turret for size.
The 'Trifighter' with the gun barrel from my 'Angletank' model
- Attachments
-
- screen00002.jpg
- (281.86 KiB) Downloaded 2 times
-
- screen00001.jpg
- (348.57 KiB) Downloaded 2 times
Re: Attaching *models* onto *units*
Is this just the texture attachment or actual piece attachment?
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
You can keep your toys in the cot smoth.
The gadget grabs the geometry of a piece and the texture from a unit, and replaces the geometry of the piece(s) defined in the gadget config.
Still got work to do on the loading side (currently all the dLists are loaded at game-start which is quite seriously non-ideal) as well as setting up a debug mode and appropriate messages and a few other minor things.
The gadget grabs the geometry of a piece and the texture from a unit, and replaces the geometry of the piece(s) defined in the gadget config.
Still got work to do on the loading side (currently all the dLists are loaded at game-start which is quite seriously non-ideal) as well as setting up a debug mode and appropriate messages and a few other minor things.
Re: Attaching *models* onto *units*
still it is a lot further than you were thinking you'd get to a few days ago! Keep up the good work man, this is pretty cool.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
It's currently totally functional, will need to test with custom texture-based shaders (normalmaps) but the "x-ray highlight" widget works fine. I'm thinking I will need to manually add in support for normal maps, but it's hard to test as I have no normal-mapped units.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
I still feel the gadget needs a less 'general' name. Currently called "unit_draw.lua" not sure what else fits though 

Re: Attaching *models* onto *units*
s44 has a few.Pressure Line wrote:It's currently totally functional, will need to test with custom texture-based shaders (normalmaps) but the "x-ray highlight" widget works fine. I'm thinking I will need to manually add in support for normal maps, but it's hard to test as I have no normal-mapped units.
- Pressure Line
- Posts: 2283
- Joined: 21 May 2007, 02:09
Re: Attaching *models* onto *units*
woo!
on-demand loading of the displaylists is here! also added in a debug mode switch (only settable by changing a boolean in the gadget, i will consider making a "/changepiece debug" switch if its *really* wanted) and commented some of the code.
will clean up the mod file and release for testage later
on-demand loading of the displaylists is here! also added in a debug mode switch (only settable by changing a boolean in the gadget, i will consider making a "/changepiece debug" switch if its *really* wanted) and commented some of the code.
will clean up the mod file and release for testage later