www.tombraiderforums.com

www.tombraiderforums.com (https://www.tombraiderforums.com/index.php)
-   Next Generation Level Editor (https://www.tombraiderforums.com/forumdisplay.php?f=40)
-   -   Open DLL Chat - Basic Questions, Inquiries, & Help Thread! (https://www.tombraiderforums.com/showthread.php?t=215819)

AkyV 15-08-16 22:19

Open DLL Chat - Basic Questions, Inquiries, & Help Thread!
 
If you don't understand anything about making TRNG user developments, then post your question here, somebody will answer hopefully soon.

Further information
in the TRNG user development archives thread.
If you would like something to be developed in a plugin then type your request here.
You can read about developments being in progress here.

AkyV 03-12-16 23:58

This thread was created when the new TRNG was confirmed in the summer of 2016. The good news is the thread is active now, please send your posts!

AkyV 05-12-16 18:29

Okay, the first question is mine.
I did what is told here, on a fresh installation:

http://www.trlevelmanager.eu/plugin_...press_2010.htm

Then I read this page (http://www.trlevelmanager.eu/plugin_...Plugin_SDK.htm):

Quote:

Build all
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
"Using MS Visual Studio compiler" - what does it mean?

Joey79100 05-12-16 18:44

Inside Visual Studio, you either have to go in Project > Generate (or Generate > Generate depending on the version) or to press F7.
Then you can find the .DLL in your project's folder, under Debug or Release depending on the version you've chosen to build. :)

AkyV 05-12-16 22:41

Well, I didn't find any menu commands like that. I loaded SLN project as Paolone said, and I already have the tutorial DLL in Plugin SDK Store. As a first step I don't think I should compile anything. Maybe I misunderstood something. :confused:
I go on I hope I won't be stuck.
Thanks for the answer, anyway. :)

EDIT:
http://www.trlevelmanager.eu/plugin_...Plugin_SDK.htm
Quote:

Exercise 1: the Magic Flare
Look fine and you see the "." (period) at end of enumGET
Now you should see this:
I should see some list now. I don't see any list. :confused:
So I added those texts manually. When I built solution after that, as it is said (not with F7, my 2010 has some other menu), then the program said there are errors (no "get" source or what).

THOR2010 06-12-16 17:57

Get(enumGET.LARA, 0

^right after typing this you built the solution?

AkyV 06-12-16 18:01

After this, as it is said in the tutorial:

Quote:

Get(enumGET.LARA,0,0);
Get(enumGET.INFO_LARA,0,0);

if (GET.LaraInfo.TestIsHoldingItem == true) {
if (GET.LaraInfo.HoldedItem == enumHOLD.FLARE) {
// lara is holding a flare in her hand
GET.pLara->CordY -= 32;
}
}
And I don't have auto enumerate.

(My Studio has a Build menu for build, Debug menu has other commands. i used that ISO that sapper sent.)

THOR2010 06-12-16 18:19

strange i copied yours and was able to build it fine, i have no idea what the problem could be, or why your version seems to be different from mine?

FreakRaider 06-12-16 18:21

Quote:

Originally Posted by THOR2010 (Post 7689021)
strange i copied yours and was able to build it fine, i have no idea what the problem could be, or why your version seems to be different from mine?

Or because you had a space after the comma? :p

AkyV 06-12-16 18:28

Get(enumGET.LARA, 0,0);
Get(enumGET.LARA,0,0);

With or without a space, both versions are there in the tutorial.

EDIT:
Okay, I fixed it, "only" with uninstalling/reinstalling the Visual Express. (Also cleaned registry. Who knows?)

Joey79100 08-12-16 20:42

I've looked through some files, and wanted to try something like the reverb presets the bass library provides.
There's a function, and there are some presets, so I thought I'd just add something like that to my code for now, just to test it:
Code:

BASS_SetEAXParameters(EAX_PRESET_ARENA);
Aaaaand obviously it isn't as simple as it could have been, because the function can't be found, even if it is in bass.h and that this file is included for the plugin code file. :D

Anyway, I should finish the exercises, because I'm definitely far too inexperienced with C++ for now. :D

GeekOfComedy 08-12-16 22:22

Quote:

Originally Posted by Joey79100 (Post 7689832)
I've looked through some files, and wanted to try something like the reverb presets the bass library provides.
There's a function, and there are some presets, so I thought I'd just add something like that to my code for now, just to test it:
Code:

BASS_SetEAXParameters(EAX_PRESET_ARENA);
Aaaaand obviously it isn't as simple as it could have been, because the function can't be found, even if it is in bass.h and that this file is included for the plugin code file. :D

Anyway, I should finish the exercises, because I'm definitely far too inexperienced with C++ for now. :D

Thanks for your continued effort. I emulated the PS version and the effects with the echos of her foot steps or grunts are amazing! Be great to have it on PC!

Joey79100 09-12-16 08:13

And with PS sound effects are in lower quality. So, imagine how it would sound with our quality... :D

I know there are some services that are using functions that probably talk to bass, but... Can we see the code of these services? It seems there's no source code for Tomb_NextGeneration.dll but I thought it was meant to be included for TRNG 1.3.0.0. Maybe it wasn't planed, or Paolone forgot to include it?
(or maybe I just overlooked it... :p)

AODfan 09-12-16 17:33

Did anyone try to do the cleaner robot yet? It says to use the cube code from the previous tutorial but if I do that, the robot won't turn. It just moves halfway through the wall before it explodes :confused:
I also made sure that I have exactly the same code as in the tutorial. The cube is still working fine but the robot seems to be broken :ponder:

AkyV 10-12-16 00:35

I am just in Chapter 3, with the cleaner robot. Just started, in the morning I will try what you say. (Not that previous chapters, mostly Chapter 2 are 100 % clear for me...)

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

How can I reach/call the memory zone fields (named in TRNG.dll triggers) in the source files?
Later, if I am not such a dumb of DLL making (I hope it happens...), then I'd like to make functions/triggers with them, not using TRNG.dll triggers. (One reason: I don't want to use those Local/Global Alfa/Beta variables with them, but customized variables. No way to do that with exported TRNG.dll triggers.)

EDIT:
I mean, literally. I need the exact identification of these fields. Paolone tells something in the triggers.htm, but I don't get it. And that surely doesn't identify the fields, just the route.

EDIT2:
AODfan, I suspect what your reason is. You probably have installed in NG Center the complete plugin of the cleaner robot, made for Paolone's tutorial project. Uninstall it.

AODfan 10-12-16 13:45

Quote:

Originally Posted by AkyV (Post 7690251)
EDIT2:
AODfan, I suspect what your reason is. You probably have installed in NG Center the complete plugin of the cleaner robot, made for Paolone's tutorial project. Uninstall it.

No, I only have the (mostly empty) plugin_trng.dll that you're supposed to start with. I must have a typo somewhere in my code but I can't find it.

Edit: Found the problem. I forgot to add the code that actually changed the orientation of the robot:
Code:

if (Direction != 0) {
        GET.pItem->OrientationH += Direction;
}

Problem solved :facepalm:

AODfan 11-12-16 16:05

I got a little impatient with the tutorials and started working on some of the objects I need for my TR1 project. I'm currently working on TR1-3 styled rollingballs and I think they turned out quite good so far :D
I only need to figure out how to give them a falling animation (instead of having them immediately reach the lowest floor) but everything else is working fine so far :)


TheTiger 11-12-16 16:11

It IS happening. Great job! :jmp:

Raider99 11-12-16 16:14

That was really quick! :p
Congrats, it's working flawlessly! :tmb:
I'm still at the magic flare tutorial... :vlol:

Xopax 11-12-16 16:18

This is awesome. :tmb:

SrDanielPonces 11-12-16 16:29

you are god, dom :D

Baratheon 11-12-16 16:31

That's so cool! :)

AODfan 11-12-16 17:01

Thanks everyone! :)
This was fairly easy object to do, I'm sure I'm gonna have a much harder time with enemies :vlol:

Xopax 11-12-16 17:15

Quote:

Originally Posted by AODfan (Post 7690752)
Thanks everyone! :)
This was fairly easy object to do, I'm sure I'm gonna have a much harder time with enemies :vlol:

Do you actually have to make everything from scratch or is it possible to simply port code from past TR games?

AODfan 11-12-16 17:39

We don't have access to the TR1 source code so you need to replicate everything.

Titak 11-12-16 19:27

Oh, very good!! :tmb:

TR1-TR3 style rollingballs are not on the request list.
I think I should add them. :mis:

Paolone 13-12-16 23:16

I'm sorry to have seen only now this thread.
I'm really shocked by your progress and willing with plugins. Very happy about this. :)
Tomorrow I'll try to answer about some questions, now (it's late here 1.10 am) I wish reminding that there is an updates for plugin sdk and another for ng_center.
You have to use Check Update command to get them.
Using NG_Center for .dll and ng_Center update, while trngpatcher [Check Updates] for plugin sdk updates.

These updates are not visible from website.
Anyway there is a news about pages of trng site: now there is a module to signal bugs, requiring infos ect:

http://www.trlevelmanager.eu/sender.htm

AkyV 14-12-16 00:27

Quote:

Originally Posted by AkyV (Post 7690251)

How can I reach/call the memory zone fields (named in TRNG.dll triggers) in the source files?
Later, if I am not such a dumb of DLL making (I hope it happens...), then I'd like to make functions/triggers with them, not using TRNG.dll triggers. (One reason: I don't want to use those Local/Global Alfa/Beta variables with them, but customized variables. No way to do that with exported TRNG.dll triggers.)

I am happy with my first try for a variable condition, which works: :D

Quote:

case 802: //flipeffect
StrAdrMemory *pSave1;
pSave1 = &Trng.pGlobTomb4->pVetMemorySavegame[58];
if (*pSave1->pShort == 3) {
PerformFlipeffect(NULL, 355, 0, 20);
}
break;
Except, debugger says about pSave1:
Quote:

"CXX0030: Error: expression cannot be evaluated".
:(

It is a lame trigger, all I wanted was to understand how it works. It says if Parameter#58 (little medipack amount) is 3, then a flipeffect for a flashing light will be executed.

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

I "swapped the formula" for not getting from values of zones but forcing values to zones. Theoretically this swap looks this way:

Quote:

case 803: //flipeffect
StrAdrMemory *pHello;
*pHello->pShort=20;
&Trng.pGlobTomb4->pVetMemorySavegame[58]=pHello;
break;
"The little medipack value must be 20".
But Vision Express says this error (for VetMemory... entry) when I build: :(

Quote:

error C2106: '=' : left operand must be l-value

sapper 14-12-16 06:25

Try

Code:

case 802:
        StrAdrMemory Save1;
        Save1 = Trng.pGlobTomb4->pVetMemorySavegame[58];
        if (*Save1.pShort == 3){
                PerformFlipeffect(NULL, 355, 0, 20);
        }
        break;

Nevermind. I misread your question. Don't know why debugger cannot evaluate.

In second case try

Code:

case 803:
        *Trng.pGlobTomb4->pVetMemorySavegame[58].pShort=20;
        break;


AkyV 14-12-16 10:01

Quote:

Originally Posted by sapper (Post 7691528)

Code:

case 802:
        StrAdrMemory Save1;
        Save1 = Trng.pGlobTomb4->pVetMemorySavegame[58];
        if (*Save1.pShort == 3){
                PerformFlipeffect(NULL, 355, 0, 20);
        }
        break;


This version seems better. Now there is no "evaluate", no red icons.
On the other hand, it tells Save1 about that "Bad Ptr".

Quote:

Code:

case 803:
        *Trng.pGlobTomb4->pVetMemorySavegame[58].pShort=20;
        break;


Thank you, it worked! :D

However, what if I want to force a variable value?

Quote:

int Alfa;
Alfa=20;
*Trng.pGlobTomb4->pVetMemorySavegame[58].pShort=Alfa;
break;
Now I could build Solution, but the game crashed.

LGG_PRODUCTION 14-12-16 10:33

Hello there, I tried to put a Mechwarrior in a level, but it doesn't work, same with the manual crane.
The robot cleaner worksd too.
Have I to set something to make these two object working?

sapper 14-12-16 11:01

Quote:

Originally Posted by AkyV (Post 7691548)
This version seems better. Now there is no "evaluate", no red icons.
On the other hand, it tells Save1 about that "Bad Ptr".

Don't know. Could try

Code:

case 802:
        if (*Trng.pGlobTomb4->pVetMemorySavegame[58].pShort == 3){
                PerformFlipeffect(NULL, 355, 0, 20);
        }
        break;



Quote:

However, what if I want to force a variable value?
int Alfa;
Alfa=20;
*Trng.pGlobTomb4->pVetMemorySavegame[58].pShort=Alfa;
break;
Now I could build Solution, but the game crashed.
Code worked for me but I am using VS2013.

It shouldn't matter in this case since 20 "fits" into a short variable but you should match the variable types i.e. declare Alfa as a short not an int.


BTW how did you know [58] is small medikit? Is it in the tutorial somewhere?

Paolone 14-12-16 12:39

Quote:

Originally Posted by AkyV (Post 7691469)
I am happy with my first try for a variable condition, which works: :D



Except, debugger says about pSave1:
:(

It is a lame trigger, all I wanted was to understand how it works. It says if Parameter#58 (little medipack amount) is 3, then a flipeffect for a flashing light will be executed.

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

I "swapped the formula" for not getting from values of zones but forcing values to zones. Theoretically this swap looks this way:



"The little medipack value must be 20".
But Vision Express says this error (for VetMemory... entry) when I build: :(

I'm reading all posts in this thread and I'll need of some day to give a good description of these questions (and others already received via on-line module)
Now I give you only a fast and important warning..
You are choosing the wrong way to access to some data.
Trying to look for these data directly via Trng.pGlobTomb4-> is possible but very very complicated.
For this reason I created the Get() and Find() locator functions.
For instance:
If you access to savegame data, you should use this code:
Code:

                Get(enumGET.INVENTORY,0,0);
                // and now you read in GET structure (remember that names are case sensitive in C++ : Get is different than GET
                GET.pInventory->

and now you'll see a long list about all stuff of savegame and inventory.
You can read or change those values, of course.

In the case you wish access to field of moveables, those in ngle have names like "item memory" you can access directly to structure of given item (in your action triggers and some condition triggers you'll receive as input parameter the itemindex

So to access to item memory of moveable with index as ItemIndex, you use this code:
Code:

                Get(enumGET.ITEM,ItemIndex,0);

                GET.pItem->

and now you'll have the list of all "item memory" or, in plugin nomenclature, the field of item's structure.

Another example. That variables that in trng triggers are named as "slot memory" you can access to them in plugin with a code like this:

Supposing the id of slot you received as parameter of some flipeffect trigger was SlotId variable:
Code:

                Get(enumGET.SLOT, SlotId, 0);
                GET.pSlot->

And now, as usual, you'll see the list of all fields of slot structure, to read or change them.

In some days I'll try to answer also about other matters.

AkyV 14-12-16 13:50

Quote:

Originally Posted by sapper (Post 7691560)
Don't know. Could try

Code:

case 802:
    if (*Trng.pGlobTomb4->pVetMemorySavegame[58].pShort == 3){
        PerformFlipeffect(NULL, 355, 0, 20);
    }
    break;


Wow. Thanks. It seems the perfect one. :D

Btw, does it really matter if I get messages like that? I mean, the trigger worked even if I got that "evaluate" error.

Quote:

Code worked for me but I am using VS2013.
Now it also works for me! :D
The problem was the windowed mode. When I adjusted it back to fullscreen, the game didn't crash any more.

Quote:

BTW how did you know [58] is small medikit? Is it in the tutorial somewhere?
From Paolone's triggers.htm:

Quote:

The value is an index to record for each Memory Savegame variable.
You should access to this record in this way:

StrAdrMemory *pSave;

pSave= &Trng.pGlobTomb4->pVetMemorySavegame[Value];
// and now with pointer pSave-> you can access to all values about that memory address
And from Set Trigger Type panel:

Quote:

#ID DESCRIPTION
--------------------------------------------------------------------------------
40: Inventory. Puzzle Item 1 (Byte)
49: Inventory. Puzzle Item 10 (Byte)
50: Inventory. Puzzle item 11 (Byte)
51: Inventory. Puzzle Item 12 (Byte)
41: Inventory. Puzzle Item 2 (Byte)
42: Inventory. Puzzle Item 3 (Byte)
43: Inventory. Puzzle Item 4 (Byte)
44: Inventory. Puzzle Item 5 (Byte)
45: Inventory. Puzzle Item 6 (Byte)
46: Inventory. Puzzle Item 7 (Byte)
47: Inventory. Puzzle Item 8 (Byte)
48: Inventory. Puzzle Item 9 (Byte)
57: Inventory. Quest items 1-8 (Byte)
72: Inventory. Remaining usage of Mechanical Scarab (Short)
30: Inventory. Revolver (Byte)
27: Inventory. Shotgun (Byte)
58: Inventory. Small medikit (Short)
26: Inventory. UZI Mask (Byte)
--------------------

Quote:

Originally Posted by Paolone (Post 7691572)
I'm reading all posts in this thread and I'll need of some day to give a good description of these questions (and others already received via on-line module)
Now I give you only a fast and important warning..

Thank you for the answer!

My problem was the Trng.pGlobTomb4 way seems easier, all I need to know is the field index.
If I want Get or Find function, then I don't always know what to get or find:
- I can't identify several memory zone fields of TRNG triggers in the structures.
- And I am not always sure how to use Get/Find for that subject. (See eg. audio volume of code memory zone. But it is only a sudden example.) Auto enumerate - this is something I can't make to work.

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

Another qustion:
if the trigger has parameters, then do I always need "if" procedures to know which parameter is chosen?
For example:

Quote:

if (Extra == 1) {
PerformFlipeffect(NULL, 129, 5, 0);
} else {
PerformFlipeffect(NULL, 129, 2, 0);
}
Or is there a shorter way?
It is several "if"s, if eg. I have 100 Extra parameters!:eek:

Sabatu 14-12-16 15:01

Quote:

Originally Posted by AODfan (Post 7690712)
I got a little impatient with the tutorials and started working on some of the objects I need for my TR1 project. I'm currently working on TR1-3 styled rollingballs and I think they turned out quite good so far :D
I only need to figure out how to give them a falling animation (instead of having them immediately reach the lowest floor) but everything else is working fine so far :)


Ohh my gosh :D This can't be Truth :d Will you release this plugin ? This will be great for my TR3 remake :D or another oldschool style of level ..
The last thing to make TR1 style in tr4 is water :D
Or Tutorial :D

sapper 14-12-16 22:12

Quote:

Originally Posted by AkyV (Post 7691581)
Btw, does it really matter if I get messages like that? I mean, the trigger worked even if I got that "evaluate" error.

No not really. It may mean the variable is out of scope for the debugger.

The bad ptr may be because you had the breakpoint set before the pointer was given a sensible value.

AkyV 15-12-16 17:47

Do I need to turn my custom variable at the end of the trigger code to zero, to save some memory, or not?

sapper 15-12-16 20:52

No.

Raider99 15-12-16 20:55

Quote:

Originally Posted by Sabatu (Post 7691591)
Or Tutorial :D

Paolone released a bunch of tutorials together with TRNG 1.3, should be enough to start from there. ;)
---------------------------------
I got magic flare to work, so... yeah, still a lot left to do. :vlol:

AODfan 15-12-16 21:04

Quote:

Originally Posted by Sabatu (Post 7691591)
Ohh my gosh :D This can't be Truth :d Will you release this plugin ? This will be great for my TR3 remake :D or another oldschool style of level ..

I will release this when I'm done with my level but I can't say when that will be.

______

What happens when we run out of new the slots? I guess we can just add new ones but how to we make WADMerger recognise the new slots (i.e. everything after New Slot 18)?


All times are GMT. The time now is 16:31.

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