Tomb Raider Forums  

Go Back   Tomb Raider Forums > Tomb Raider Level Editor and Modding > Tomb Raider Level Editor > Tomb Raider Next Generation

Reply
 
Thread Tools
Old 05-12-19, 09:39   #611
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Default

you can delete #pragma pack(push, 1) and #pragma pack(pop) because #pragma once can do the job.
TokyoSU is offline   Reply With Quote
Old 05-12-19, 10:03   #612
JMN
Member
 
Joined: Sep 2006
Posts: 674
Default

That doesn't sound right, they do different things.

pragma pack sets how structs are aligned in memory and is needed to make it compatible with the other plugin sources, otherwise you'll get all kinds of weird crashes or wrong values in the game.

pragma once does the same as #include guards by including the file only once during compilation to help prevent multiple definitions.
JMN is offline   Reply With Quote
Old 05-12-19, 15:09   #613
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Default

i not have this problem with my plugins since i used #ifndef instead of #pragma pack() and i used your ClassicInventory without problem

Last edited by TokyoSU; 09-12-19 at 16:18.
TokyoSU is offline   Reply With Quote
Old 09-12-19, 10:50   #614
Delta
Member
 
Joined: Jul 2007
Posts: 288
Default

Sorry for the late answer, i just got the project working fine yesterday, there was still something to configure to make the package work correctly in Visual Studio 2019. Anyway the $(SolutionDir) was correct Thank you JMN

About those #pragma pack, not sure if it is necessary, so i'll keep them, just to be sure
Delta is offline   Reply With Quote
Old 10-01-20, 20:24   #615
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default

My Visual Express Debug DLL works like a charm, but the Release DLL made from that produces a bug. Unbelievable...
(I can't tell more now, because I don't know yet where to find the reason.)
AkyV is offline   Reply With Quote
Old 17-02-20, 14:18   #616
smcandrew
Member
 
smcandrew's Avatar
 
Joined: Aug 2008
Posts: 32
Default

I'm trying to figure out how to replicate the TestPosition script using the plugin. I've had a look through the tutorials / documentation, and I have this so far:

Code:
	StrTestPositionCmd MyPosition;
	StrBoxCollisione *pDist;
    StrBoxOrienting *pOrient;
	pDist = &MyPosition.DatiPosition.Distance;
    pOrient = &MyPosition.DatiPosition.Orienting;

    pDist->MinX = 0-256;
    pDist->MaxX = 0+256;
    pDist->MinY = 253-129;          
    pDist->MaxY = 253+640;
    pDist->MinZ = -379-256;
    pDist->MaxZ = -379+256;

    pOrient->OrientHMin = -16384;
    pOrient->OrientHMax = +16384;
    pOrient->OrientVMin = -1000;
    pOrient->OrientVMax = 1000;
    pOrient->OrientRMin = -1000;
    pOrient->OrientRMax = 1000;

	MyPosition.IdTestPosition = -1;
	MyPosition.Flags = TPOS_FOUR_HORIENT;
	MyPosition.Slot = ???


	if (CheckPositionAlignment(&MyPosition, ???) == true)
	{
			 //PERFORM FLIP EFFECT	
	}
For the flag I want to use the TPOS_FOUR_HORIENT, however I'm not sure what to put in the slot? If I want a specific Moveable do I just put that number? That didn't seem to work for me. Also in the CheckPositionAlignment second arguement, I'm not sure what needs to go in there either. Does anyone have any ideas?

Thanks!
smcandrew is offline   Reply With Quote
Old 17-02-20, 14:33   #617
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Default

CheckPositionAlignement is used in the Collision function of your object to check if the position you set in MyPosition is true, then you will do something in the if.
sorry for not more info i not use plugin anymore. check paolone tutorial or in the vehicle project in Plugin SDK for more info about Alignement.
PS: the slot is the objNumber in objects.h object list but check it in the tutorial just in case.

Last edited by TokyoSU; 17-02-20 at 14:34.
TokyoSU is offline   Reply With Quote
Old 17-03-20, 06:56   #618
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Default

it's nothing with TRNG plugins, but since i use a dll and you can only found it there, i say it here
i found the 3 fuc**** function that control the lara render, it's not DrawLara() anymore unlike TR1-TR3 but CalcLaraMatrices() so i decompiled it and the render is correct, TR4 have a bug in InterpolateArmMatrix() it not do that:
Code:
*(phd_mxptr + M00) = *(phd_mxptr + M00 - 24);
*(phd_mxptr + M01) = *(phd_mxptr + M01 - 24);	 // Restore Laras Main Rotations
*(phd_mxptr + M02) = *(phd_mxptr + M02 - 24);       // Less any torso rotations
*(phd_mxptr + M10) = *(phd_mxptr + M10 - 24);       // avoids Wobbly arms when
*(phd_mxptr + M11) = *(phd_mxptr + M11 - 24);       // moving 'n' shooting
*(phd_mxptr + M12) = *(phd_mxptr + M12 - 24);
*(phd_mxptr + M20) = *(phd_mxptr + M20 - 24);
*(phd_mxptr + M21) = *(phd_mxptr + M21 - 24);
*(phd_mxptr + M22) = *(phd_mxptr + M22 - 24);
but that:
Code:
phd_mxptr[M00] = phd_mxptr[M00];
and it's all the MXX you found upward.
it messup all the think in DEL_CalcLaraMatrices_Interpolate() if you try to decompile it.
now there the new render (only in CalcLaraMatrices()):
Code:
    void assign_pprot(short pprot);
    void assign_matrixptr();
    void create_item();
    void create_object();
    void create_bone();
    void create_frame();
    void check_hitdirection();
    void create_rotation();
    void create_shadow();
    void assign_weapon();

    void start_world();
    void start_list();
    
    void mesh_hips();
    void mesh_thight_l();
    void mesh_calf_l();
    void mesh_foot_l();
    void mesh_thight_r();
    void mesh_calf_r();
    void mesh_foot_r();
    void mesh_torso();
    void mesh_head();
    void mesh_unarmed(); // this one and the one after contains the arm.
    void mesh_1gun();
    void mesh_2gun();
    void mesh_revolver();

    void end_list();
    void end_world();
so all i need is to decompile the inventory, then assigning a item to be able to use a new weapon and see if it change anything..
but i'm not using TRNG exe but the original one, since i cant replace anything with TRNG in the way :'(
- this project is for my own personnal use and knowledge, dont assign it with TR5Main, TR5Main is MUCH more advanced than me and maybe more good that this one, i just want the original render instead of a new one like TR5Main have :x
PS: yea you will not be curious about that since it's not a plugin, and i would not do all that just to decompile the inventory, i would use ClassicInventory new item to call that new weapon but it's not possible

Last edited by TokyoSU; 17-03-20 at 07:02.
TokyoSU is offline   Reply With Quote
Old 19-03-20, 10:20   #619
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Default

Decompiled the inventory 2D
https://github.com/TokyoSU/TR4Main/b.../inventory.cpp
it's really a big think since i just need to decompile the save/load function, i will can add new weapon
it's really sad i cant do it with TRNG
TokyoSU is offline   Reply With Quote
Old 19-03-20, 17:36   #620
JMN
Member
 
Joined: Sep 2006
Posts: 674
Default

Nice, you've decompiled DrawThreeDeeObject2D().

I'm using that function to draw the pickup notifier in the ring inventory plugin. Might come in handy to fix some issues with it.

Thanks for sharing the code.
JMN is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 17:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Tomb Raider Forums is not owned or operated by CDE Entertainment Ltd.
Lara Croft and Tomb Raider are trademarks of CDE Entertainment Ltd.