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 29-03-17, 14:34   #251
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default

Quote:
Originally Posted by Paolone View Post
Well done but what is the question?
You asked this:

Quote:
As usual I need to see how you declared the trigger in .trg file to understand the problem.
When I asked this:

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.)
Quote:
Originally Posted by Paolone View Post
Oh fine. If you are sure, I'll change that flag, giving to it a descriptive name (and right description as comment) to explain the meaning you discovered.
Bravo!
Thank you!
And okay, a descriptive name would be fine.
AkyV is online now   Reply With Quote
Old 31-03-17, 14:08   #252
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default

Else:
I can't find any pointer or what to get in the StrSoundInfos structure.

Quote:
// struttura di soundinfos
typedef struct StrSoundInfos {
short Indice;
BYTE Volume;
BYTE RAD; // valore originale
BYTE CH; // totale con 100 = 255
char PIT; // valori positivi o negativi con massimi (+/) 128
WORD Flags; // FSI_
}SoundInfosFields;
---------------------------------------
Quote:
Originally Posted by Paolone View Post
The callback for trng action/flipeffects work also for your target.
You can require a CBT_FIRST callback for the given trigger and then, in your code, you can only use the instrution "MyData.Flag = 1" and then use the instruction:
return TRET_EXECUTE_ORIGINAL;
And the orignal trng trigger will be performed.
I try to record the item index when A14 explodes the object "as creature", but no success, MyData.Save.Local.ExpCreature remains 0 when the trigger is activated:

GET_CALLBACK(CB_PROGR_ACTION_MINE, 0, 0, cbProgrActionMine);
GET_CALLBACK(CB_INIT_OBJECTS, 0, 0, cbInitObjects);
GET_CALLBACK(enumCB.ACTION, CBT_FIRST, 14, cbHandleAction14);
return true;

Code:
int cbHandleAction14 (WORD ActionIndex, int ItemIndex, WORD Extra, WORD ActivationMode, WORD CBType)
{
    switch (ActionIndex) {
        case 14:
        if (Extra == 4) {
            MyData.Save.Local.ExpCreature = ItemIndex;
        }
        break;
    }
    return enumTRET.EXECUTE_ORIGINAL;
}
Edit:
That should be Extra again, here as well, what I also said above with my own Actions. I mean, if I remove Extra parameter from this setup (the solution is not the one I want, naturally, though), the callback will work. (The same experience for trng.dll Flipeffect callbacks!)

Last edited by AkyV; 14-04-17 at 11:37.
AkyV is online now   Reply With Quote
Old 22-04-17, 19:36   #253
DJ Full
Member
 
DJ Full's Avatar
 
Joined: Jul 2007
Posts: 4,183
Default

Quote:
Originally Posted by Joey79100 View Post
Quote:
Originally Posted by AkyV View Post
http://www.trlevelmanager.eu/plugin_...Plugin_SDK.htm
Now you should build:
The script, using NG_Center
The plugin.tr4 file, using NGLE program
The plugin_trng.dll file, using MS Visual Studio compiler
Inside Visual Studio, you either have to go in Project > Generate (or Generate > Generate depending on the version) or to press F7.
Using 2012 Express, stuck exactly here.
Hitting Build (former "Generate" but still F7) gives me this:

error LNK1117: syntax error in option 'VERSION:1.0.0'
C:\NG\plugin_sdk_store\Plugin\plugin_trng_start_vc 2010_sources\LINK PlugIn_trng


^ The second line isn't visible in the compiler but appeared when I pasted the error here.

In the "Output" tab view, not much more info:

1> PlugIn_trng.cpp
1> Generating Code...
1>LINK : fatal error LNK1117: syntax error in option 'VERSION:1.0.0'


Thankfully I have just 4 months to chase up... Anybody had this already?
What can it mean, did I mess up the directories? I triple-checked the config...
DJ Full is offline   Reply With Quote
Old 06-05-17, 07:42   #254
Delta
Member
 
Joined: Jul 2007
Posts: 288
Default

Hi! I don't remember if it has already been asked: how can i spawn a new object by code in runtime?
I'm sorry but i have very few time lately, not enaugh to properly look for this info

EDIT: Nevermind, found it

Last edited by Delta; 07-05-17 at 13:37.
Delta is offline   Reply With Quote
Old 06-05-17, 08:37   #255
sapper
Member
 
sapper's Avatar
 
Joined: Sep 2007
Posts: 1,684
Default

Quote:
Originally Posted by DJ Full View Post
Using 2012 Express, stuck exactly here.
Hitting Build (former "Generate" but still F7) gives me this:

error LNK1117: syntax error in option 'VERSION:1.0.0'
C:\NG\plugin_sdk_store\Plugin\plugin_trng_start_vc 2010_sources\LINK PlugIn_trng


^ The second line isn't visible in the compiler but appeared when I pasted the error here.

In the "Output" tab view, not much more info:

1> PlugIn_trng.cpp
1> Generating Code...
1>LINK : fatal error LNK1117: syntax error in option 'VERSION:1.0.0'


Thankfully I have just 4 months to chase up... Anybody had this already?
What can it mean, did I mess up the directories? I triple-checked the config...
See here http://sappersblog.blogspot.com/2016...h-vs-2013.html
sapper is offline   Reply With Quote
Old 19-06-17, 12:34   #256
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default

When I want a vector in my plugin, then what is the connection between the variable and the vector size?

For example:

BYTE VetIndex [3];

VetIndex [0] = 70;
VetIndex [1] = 210;
VetIndex [2] = 42;

Let's suppose, I use all the three indices at the same time, so 70+210+42 = 322 => bigger than BYTE = 255.

Or does the BYTE size matter only for each single value of the variable, so it is not a problem now?
Or is the BYTE size for the vector size now (as well), I mean, the biggest size is BYTE VetIndex [255] now?
AkyV is online now   Reply With Quote
Old 19-06-17, 12:51   #257
Joey79100
Member
 
Joey79100's Avatar
 
Joined: Mar 2012
Posts: 3,741
Default

Quote:
Originally Posted by AkyV View Post
When I want a vector in my plugin, then what is the connection between the variable and the vector size?

For example:

BYTE VetIndex [3];

VetIndex [0] = 70;
VetIndex [1] = 210;
VetIndex [2] = 42;

Let's suppose, I use all the three indices at the same time, so 70+210+42 = 322 => bigger than BYTE = 255.

Or does the BYTE size matter only for each single value of the variable, so it is not a problem now?
Or is the BYTE size for the vector size now (as well), I mean, the biggest size is BYTE VetIndex [255] now?
BYTE VetIndex[3] will create 3 BYTEs in the memory (it's just than they will be accessible from the same variable basically). So the BYTE limit is for each individual value, ie. VetIndex[0] can have values from 0 to 255, VetIndex[1] can have values from 0 to 255, etc. Each value in an array is independent from the other.
The number of values in the array is not limited by the type of values it stores either.
Joey79100 is offline   Reply With Quote
Old 19-06-17, 12:56   #258
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default

You confirmed what I thought. Exactly what I hoped. Thanks!
AkyV is online now   Reply With Quote
Old 20-06-17, 12:01   #259
AkyV
Moderator
 
Joined: Dec 2011
Posts: 4,881
Default

Else (almost):

Quote:
int MyVector[100];
int index;
int NowValue;

for (i=0 ; i < 100; i++) {
NowValue=MyVector[i];
// ... other code to elaborate NowValue
}
This is from Paolone's "Basic C++" tutorial. This is not really clear. I mean, vector indices start from 0, right? So MyVector for 100 = 0, 1, 2... 98, 99.

for (i=0 ; i < 100; i++)
means first I check i=1 (= i0+ i++), then i=2 (=i1+ i++) etc.

But then what about MyVector[0]? And this also checks MyVector[100] which doesn't exist...
Isn't the proper code NowValue=MyVector[i-1]?

Last edited by AkyV; 20-06-17 at 12:03.
AkyV is online now   Reply With Quote
Old 20-06-17, 12:15   #260
Joey79100
Member
 
Joey79100's Avatar
 
Joined: Mar 2012
Posts: 3,741
Default

Absolutely not.
Code:
for (i=0 ; i < 100; i++)
The first time the code in this loop is read, i = 0. Then, the second time, it will be incremented, so i = 1. Then, it is incremented again, etc.
It will loop as long as i is still under 100. Once this condition gets false (so once i is not under 100 anymore), it stops looping, meaning the code won't be read anymore.
So the last time the code is read, i = 99. It would have been 100 if the condition was i <= 100.
Joey79100 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 09:13.


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.