Page 1 of 1

Change Actor 3D model via DECORATE/ZSCRIPT

Posted: Thu Jan 19, 2017 5:13
by Jitan
Hi, First of all. I know this is not the right place to post. I unable to post to suggestion thread.

I have code qzdoom to allow model change via DECORATE and its working. The problem is its not working as intended. Whoever want to check the code and try it can download it from here.

https://www.dropbox.com/s/dro44zgriclr0 ... e.zip?dl=0

Instruction
1. Drag and drop skinmodelreplacement.pk3 into gzdoom.exe
2. At your front you will see a morphing 3d model object. This have been done via custom DECORATE code
3. on your left side, you will see a shape. This shape is the same actor name. When you shoot the shape. The other shape actor will change too and its not intended to happen(will explain it later)
4. On your right side, You will see 2 space marine. These 2 space marine is the same actor name. Shoot 1 of them and their texture and model will change. The other space marine able to retain the model due to using special hackery script.

The point is, I want to make a unique 3D Model Change via DECORATE. But due my limited knowledge in c++, I unable to solve this problem. What the actually the code does its just replace the data in the Struct array table. When GZdoom launched, It will create a data table for the model. I try to inspect the data table and try to make it more flexible and accept new unique data. I failed to find a solution for this.

I hope the drdteam can inspect my code and find a proper solution for this. Hopefully Its does not need a complete overhaul for gl_models.h

Re: Change Actor 3D model via DECORATE/ZSCRIPT

Posted: Thu Jan 19, 2017 14:00
by Blue Shadow
Jitan wrote:I unable to post to suggestion thread.
Suggestions and bug reports are posted in the bug tracker, here:
https://mantis.zdoom.org/view_all_bug_p ... oject_id=0

Re: Change Actor 3D model via DECORATE/ZSCRIPT

Posted: Thu Jan 19, 2017 14:15
by Graf Zahl
This isn't a suggestion anyway but an editing quesion.

Re: Change Actor 3D model via DECORATE/ZSCRIPT

Posted: Thu Jan 19, 2017 16:28
by Blue Shadow
Moved to Editing.

Re: Change Actor 3D model via DECORATE/ZSCRIPT

Posted: Wed Jan 25, 2017 3:16
by Jitan
Since this have fall into editing category. I have inspect the code

Code: Select all

struct FSpriteModelFrame
{
	int modelIDs[MAX_MODELS_PER_FRAME];
	FTextureID skinIDs[MAX_MODELS_PER_FRAME];
	FTextureID surfaceskinIDs[MAX_MODELS_PER_FRAME][MD3_MAX_SURFACES];
	int modelframes[MAX_MODELS_PER_FRAME];
	int actorTIDs[MAX_MODELS_PER_FRAME]; // actor tid
	float xscale, yscale, zscale;
	// [BB] Added zoffset, rotation parameters and flags.
	// Added xoffset, yoffset
	float xoffset, yoffset, zoffset;
	float xrotate, yrotate, zrotate;
	float rotationCenterX, rotationCenterY, rotationCenterZ;
	float rotationSpeed;
	unsigned int flags;
	const PClass * type;
	short sprite;
	short frame;
	FState * state;	// for later!
	int hashnext;
	float angleoffset;
	// added pithoffset, rolloffset.
	float pitchoffset, rolloffset; // I don't want to bother with type transformations, so I made this variables float.
};
I just wondering how to make the data in this struct unique by actor. The data table only unique by actor name. What reference should I look at ?