www.tombraiderforums.com

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

Reply
 
Thread Tools
Old 27-02-17, 21:41   #241
turneraider
Historian
 
turneraider's Avatar
 
Join Date: Aug 2013
Location: Kokomo IN.
Posts: 386
Default

Oh, I'm sorry, I meant to click on the Open TRNG chat, not the DLL chat. Thank you though!
turneraider is offline   Reply With Quote
Old 03-03-17, 22:15   #242
Paolone
Explorer
 
Join Date: Apr 2007
Posts: 699
Default

Quote:
Originally Posted by AkyV View Post
Is there a way to identify when the original interaction objects (kickdoor, pickups, switches etc.) detect the possibility of Key ACTION? (The possibility, not the use of the key. I mean: "if I hit Key ACTION now - but I still do not - , then Lara would perform the interaction".)
Or perhaps more (i.e. also identify Lara's orientation+distance/position to interact)?
It's not easy, I belive, anyway first step should be to require a callback for Control procedure for that object, and then check for input and also verify some data about object (distance from lara, facing ect).

Quote:
(Can I expand the TrngPatcher window?)
Currently you can not, anywayI could see to get that in next update.
Paolone is offline   Reply With Quote
Old 03-03-17, 22:16   #243
Paolone
Explorer
 
Join Date: Apr 2007
Posts: 699
Default

Quote:
Originally Posted by AODfan View Post
I didn't think it was that easy! Thank you, it works now
I think I might have found a bug in the latest version. Please check the bugs and limitations thread
I read and taken note about signaled bug.
Paolone is offline   Reply With Quote
Old 03-03-17, 22:33   #244
Paolone
Explorer
 
Join Date: Apr 2007
Posts: 699
Default

Quote:
Originally Posted by AkyV View Post
enumFIND.DIAGNOSTIC is perhaps enough to discover DGX flags, but is there a way to read DGX flag VALUES (showed in the game screen as Diagnostics messages) in the code?
If it is to show your diagnostic on screen, best way is own to use the diagnostic callback.
You require it from RequireMyCallBacks() function with code:
Code:
	GET_CALLBACK(enumCB.DIAGNOSTIC, 0, 0 , cbDiagnosticMine);
And then you declare it (above RequireMyCallBacks() function) with this code:
Code:
char * cbDiagnosticMine(WORD DGX_Type, WORD EDGX_Flags, char *pCurrentLogText)
{
	

}
Now (inside of above function), you can check the value of current DGX flags from its input variabls DGX_Type and EDGX_Flags.
Anyway, in the case you wish know dgx flas, not for diagnostic purposes, then you can find those values in structure:
Code:
Trng.pGlobTomb4->pDiagnostica->
Quote:
How can I set a custom bar in the code?
Currently there is no specific plugin feature for custom bar, anyway you can use custom bar with triggers, or, working at low level, using the tomb4 function:
Code:
DoBar(int CordX, int CordY, int SizeX, int SizeY, int Percentuale, DWORD Colore, DWORD ColoreFade);
If I remember fine, you should call it from draw action code, otherwise nothing will be seen on screen.

Quote:
Can I project 3D game coordnates on the screen as 2D pixel-coordinates?
It should be possible, from 3d coordinates, getting the 2d x,y position on the screen but not the opposite, I believe.
Paolone is offline   Reply With Quote
Old 03-03-17, 22:55   #245
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,155
Default

Quote:
Originally Posted by Paolone View Post
It's not easy, I belive, anyway first step should be to require a callback for Control procedure for that object, and then check for input and also verify some data about object (distance from lara, facing ect).
Wow, it sounds complicated. I'll try it if I have more skills...

Quote:
Originally Posted by Paolone View Post
If it is to show your diagnostic on screen, best way is own to use the diagnostic callback.
Thanks, I'll try it.
-----
Edit:
I think you misunderstood it.
I don't want to add a new Diagnostic entry. What I want is to read an old diagnostic of yours.

Trng.pGlobTomb4->pDiagnostica->FlagsDgx & DGX_AUDIO_TRACKS

How can I check that in DGX_AUDIO_TRACKS which is the actual value of channel1 or channel2?

Quote:
Currently there is no specific plugin feature for custom bar, anyway you can use custom bar with triggers, or, working at low level, using the tomb4 function:
Code:
DoBar(int CordX, int CordY, int SizeX, int SizeY, int Percentuale, DWORD Colore, DWORD ColoreFade);
I'll try this, too.
I suppose "Percentuale" is the bar value itself, in percents.

Quote:
It should be possible, from 3d coordinates, getting the 2d x,y position on the screen but not the opposite, I believe.
Okay, later I'll try it. For the time being it sounds a bit mysterious to me,
I'd like to draw a haircross sprite on the 3D coordinate of the enemy aimed actually, on the 2D plane of the screen.

--------------------------------------

Edit:
ACTION triggers can see probably only Extra=0 parameter!
For example, if I type this:

Code:
		if (Extra == 1) {
			X  = 1;
		}
and I send X to the log, then the log says X=0, when I chose Extra 1 in the trigger! (And the feature that should be controlled by X is naturally useless.)

Last edited by AkyV; 04-03-17 at 10:22.
AkyV is online now   Reply With Quote
Old 04-03-17, 12:08   #246
Paolone
Explorer
 
Join Date: Apr 2007
Posts: 699
Default

Quote:
Originally Posted by AkyV View Post
How can I check that in DGX_AUDIO_TRACKS which is the actual value of channel1 or channel2?
You can discover infos about a given channel from this path:
Code:
Trng.pGlobTomb4->BaseBassHandles.VetCanali[0].
or
Trng.pGlobTomb4->BaseBassHandles.VetCanali[1].
Useful data are available also in root structure, of course:
Code:
Trng.pGlobTomb4->BaseBassHandles.
Quote:
Okay, later I'll try it. For the time being it sounds a bit mysterious to me,
I'd like to draw a haircross sprite on the 3D coordinate of the enemy aimed actually, on the 2D plane of the screen.
I understand your target...
I had same target in the past but I never discovered how to do with sprite.
So I did a work around: I draw a 3d mesh in 3d point I wish, using as mesh a sprite (i.e. a single face object) and place it a bit closer to source cam view respect original object.
I mean:
To draw a single mesh in 3d world, you can use the function:
Code:
void DrawMesh3D(StrPos3d *pPos, int MeshIndex)
You use as MeshIndex the value you find in Slot structure of sprite object, adding to FirstMesh value the relative index of sprite to use.
You set as position (pointed by pPos) the coordinate of main object over that you want show this "sprite"
Now, since using above method, the sprite will be closer to main object, while you wish the sprite seemed over 2d screen, you change a bit pPos to move the sprite closer to source cam view. Pratically, using the GetJointAbsPosition() function, you'll set a negative Z value. Using -1024, for instance, you could move the mesh/sprite a sector from main object in direction of source view.
Ok, it's a bit complicated, but it work just fine.
Quote:
ACTION triggers can see probably only Extra=0 parameter!
For example, if I type this:

Code:
		if (Extra == 1) {
			X  = 1;
		}
and I send X to the log, then the log says X=0, when I chose Extra 1 in the trigger! (And the feature that should be controlled by X is naturally useless.)
As usual I need to see how you declared the trigger in .trg file to understand the problem.
Paolone is offline   Reply With Quote
Old 04-03-17, 17:14   #247
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,155
Default

Quote:
Originally Posted by Paolone View Post
You can discover infos about a given channel from this path:
Code:
Trng.pGlobTomb4->BaseBassHandles.VetCanali[0].
or
Trng.pGlobTomb4->BaseBassHandles.VetCanali[1].
That was a problem I said. I mean VetCanali[X] data works like this:

025.wav starts -> VetCanali = turns to 25
025.wav stops -> VetCanali = stays 25
036.wav starts -> VetCanali = turns to 36

What DGX shows, and what I need:

025.wav starts -> Channel = turns to 25
025.wav stops -> Channel = turns to None (-1)
036.wav starts -> Channel = turns to 36

Quote:
Ok, it's a bit complicated, but it work just fine.
Thanks, I'll try it!

Quote:
As usual I need to see how you declared the trigger in .trg file to understand the problem.
I already transformed it into a flipeffect (item index got from script), but I try to reconstruate:

TRG

Object:
#MOVEABLES#

Extra:
0: start the feature
1: stop the feature

In the code:

PerformMyAction:
Extra:
0: MyData.X variable = 1
1: MyData.X variable = 0

CycleBegin (because I need to force the feature value continuously or else it turns back into the default):

if (MyData.X==1) {force the feature value;}

----------------------
Edit:
Is there a way to detect "Action/FlipEffect is just activated" in the code?

^Once I asked it and this was your answer:

Quote:
I suppose you are talking about trng (not yours of plugin) action/flipeffect triggers.
Sure, just you require a callback for a given flipeffect/action/condition trigger and the you'll have your callback executed when that trigger has been engaged in game.
For instance, if you wish knowing when FLIPEFFECT 341 will be executed in game, you ask a callback for flipeffect 341
Typing in RequireMyCallBacks() function the request:
Code:

GET_CALLBACK(enumCB.FLIPEFFECT, CBT_FIRST, 341, cbTrngFlipeffects);

the "cbTrngFlipeffects" is the name you chose for function that will receive the callback, so you should define this function (above RequireMyCallbacks()) in this way:
Code:

int cbTrngFlipeffects(WORD FlipIndex, WORD Timer, WORD Extra, WORD ActivationMode, WORD CBType)
{
switch (FlipIndex) {
case 341:
// the flipeffect 341 is going to be executed
// type here your code and read the Timer and Extra parameters to know details of this trigger 341
break;
}
return enumTRET.EXECUTE_ORIGINAL;
}

About details for other TRET value to return or other callbacks (about action triggers or condition triggers) read the bottom side of DefTomb4funct.h source. You'll find the decalaration for other callbacks and their descriptions.

Note: if you wish having more than one flipeffect trigger to monitor, you'll supply always same callback function (cbTrngFlipeffects), of course, ad in the request you'll change only the number of required flipeffect.
I read about the details in the callback tutorial, and I think what you say works when I want to change the code.
But I don't want to do that. All I want is to add a flag to the trigger: so I check in a MyCondition if that trng executable trigger has been executed.
So: keep the code but ALSO add a flag (like MyData.Flag = 1 or such).

About the tutorial, btw:

Code:
int cbHandleAction14(WORD ActionIndex, int ItemIndex, WORD Extra, WORD ActivationMode, WORD CBType)
{
          if (Extra != 3) return enumTRET.EXECUTE_ORIGINAL;

          // ... here we type our code, that it will work only when is has been chosen the "3: Exploding moveable underwater" way

          // at end we'll quit with returned value to skip the execution of originale code
          return enumTRET.PERFORM_ONCE_AND_GO;
}
1. In your answer above you didn't talk about enumTRET.PERFORM_ONCE_AND_GO, but you did that in the tutorial. Why?
2. (Extra != 3) ? In the tutorial you say it is for Extra=3. So is it not this you wanted to write: (Extra == 3) ?

----------------------
Else:
Can we get somewhere the number of locusts/beetles (just living or actually emitted from the actual/all locust/beetle emitters)? (I know "reserved" item memory zone fields can do something similar with fish emitters.)

Last edited by AkyV; 06-03-17 at 16:19.
AkyV is online now   Reply With Quote
Old 08-03-17, 13:51   #248
AkyV
Moderator
 
Join Date: Dec 2011
Location: Hungary
Posts: 2,155
Exclamation

Important!
I have modified the sources manually myself. (Red = added.)

Tomb_NextGeneration.h:
Code:
#define FITEM_FLAG_10 0x0010 // (misterious) it could be: enmey has already a defined target, or, enemy has been hurt, or enemy has been killed
trng.cpp:
Code:
enumFITEM.FLAG_10 = FITEM_FLAG_10;
structure.h:
Code:
typedef struct StrEnumFITEM {
    int NONE;    // used only to clear flags
    int ACTIVE;    // item is active (it will move) flag set after calling AddActiveItem()
    int CREATURE;    // Creatures are invisible until they have not been triggered
    int NOT_VISIBLE;    // the item was not visible at start
    int GRAVITY_AFFECTED;    // the item is falling down (or jumping up) and it's subject to gravity simulation, currently
    int FLAG_10;
Quote:
(misterious) it could be: enmey has already a defined target, or, enemy has been hurt, or enemy has be
No, it should clearly mean the enemy has just been hit.

Notes:

- It also works with immortal enemies.
- It works only with bullets, i.e. useless with arrows or grenades. (But you can do something similar with arrows or grenades - see Customize=CUST_AMMO Script command.)
- It works even if the aggressor is not Lara. (See if Troops shoots at a scorpion.) But it doesn't work with direct attacks. (See if the scorpion grabs a Troops.)
- If Lara hits 'accidentally' (i.e. if the player uses 'automatic targeting', but Lara shoots without aiming) that also matters now.
AkyV is online now   Reply With Quote
Reply

Bookmarks

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 11:18.


Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2017, vBulletin Solutions, Inc.