www.tombraiderforums.com  

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Next Generation Level Editor

Reply
 
Thread Tools
Old 05-12-19, 08:39   #611
TokyoSU
Explorer
 
TokyoSU's Avatar
 
Join Date: Mar 2019
Location: France, Caen
Posts: 635
Default

you can delete #pragma pack(push, 1) and #pragma pack(pop) because #pragma once can do the job.
__________________
"Life is Dream, just a dream"
TokyoSU is online now   Reply With Quote
Old 05-12-19, 09:03   #612
JMN
Explorer
 
Join Date: 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, 14:09   #613
TokyoSU
Explorer
 
TokyoSU's Avatar
 
Join Date: Mar 2019
Location: France, Caen
Posts: 635
Default

i not have this problem with my plugins since i used #ifndef instead of #pragma pack() and i used your ClassicInventory without problem
__________________
"Life is Dream, just a dream"

Last edited by TokyoSU; 09-12-19 at 15:18.
TokyoSU is online now   Reply With Quote
Old 09-12-19, 09:50   #614
Delta
Historian
 
Delta's Avatar
 
Join Date: Jul 2007
Location: Italy
Posts: 282
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, 19:24   #615
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 4,078
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, 13:18   #616
smcandrew
Hobbyist
 
smcandrew's Avatar
 
Join Date: Aug 2008
Location: UK
Posts: 27
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, 13:33   #617
TokyoSU
Explorer
 
TokyoSU's Avatar
 
Join Date: Mar 2019
Location: France, Caen
Posts: 635
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.
__________________
"Life is Dream, just a dream"

Last edited by TokyoSU; 17-02-20 at 13:34.
TokyoSU is online now   Reply With Quote
Old 17-03-20, 05:56   #618
TokyoSU
Explorer
 
TokyoSU's Avatar
 
Join Date: Mar 2019
Location: France, Caen
Posts: 635
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
__________________
"Life is Dream, just a dream"

Last edited by TokyoSU; 17-03-20 at 06:02.
TokyoSU is online now   Reply With Quote
Old 19-03-20, 09:20   #619
TokyoSU
Explorer
 
TokyoSU's Avatar
 
Join Date: Mar 2019
Location: France, Caen
Posts: 635
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
__________________
"Life is Dream, just a dream"
TokyoSU is online now   Reply With Quote
Old 19-03-20, 16:36   #620
JMN
Explorer
 
Join Date: 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 07:14.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.