Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Tutorials and Resources

Thread Tools
Old 29-11-07, 11:52   #1611
Mr. Tomb Raider
Mr. Tomb Raider's Avatar
Join Date: Oct 2006
Location: Germany
Posts: 47

hi nice new patch^^ but i have problems with it.:

i whant to make a part in game where lara meets a guy. if shes in the near of him a message should be popup in right corner: Press Action for Talk.... and then i will place a If_pressed action flipeffect.... i this possible?
If you dont understand me: Tell it me^^ i'm german

Last edited by Mr. Tomb Raider; 29-11-07 at 12:02.
Mr. Tomb Raider is offline   Reply With Quote
Old 29-11-07, 15:12   #1612
Trey87's Avatar
Join Date: Feb 2006
Posts: 104

It's strange... I have 2 flyby sequences in my level. I've triggered one of these with the flipeffect ACTIVATE_ITEM command, and works perfectly. But the other doesn't want to be triggered with TREP! If I use the normal trle trigger it works but with trep not.... What I should do?
/Give Me Time... Give Me Space... Give Me Real, Don't Give Me Fake...\
Trey87 is offline   Reply With Quote
Old 29-11-07, 15:17   #1613
Titak's Avatar
Join Date: Jul 2003
Location: Drenthe, The Netherlands
Posts: 31,689

There sems to be a bug with the clear inventory background patch and the mirrors.
When you press a key to bring up the inventory when standing in front of a mirror, all you see is Lara's ponytail.
If it walks like a duck and if it quacks like a duck, it is a duck.
Titak is offline   Reply With Quote
Old 29-11-07, 16:57   #1614
Join Date: Dec 2005
Location: Russia
Posts: 491

Okay, i've modified SECRET_MAP object in a way that now it does a callback of ANY custom flipeffect, if Lara presses action in front of it. To do this, enter NEGATIVE number of your custom flipeffect in OCB field. For example, if you want to call FE number 47 with some SECRET_MAP object, enter -47 in OCB field for corresponding object.

Note that if you want to disable "ACTION - interact" message after first flipeffect call, you must also add code to your flipeffect that will kill corresponding SECRET_MAP item. Also you MUST temporarily move this SECRET_MAP object to some unreachable place in your level, because it will take some time for object to be killed.

Example. You want to play certain soundtrack (for ex., 94) and flash screen red with some SECRET_MAP object. Let's assume you want to do this action only once, after which player won't be able to activate it again, and whole "ACTION - interact" will disappear. So:

1. Place SECRET_MAP object in your level and set its OCB to some free custom flipeffect slot number in negative. Let's use -47, for example (it means that you will use flipeffect slot #47 for callback).
2. Compile your level and check your SECRET_MAP object's index with FexInspect or in NGLE. Let's assume its index is 5.
3. Create new custom one-shot flipeffect #47 with this code:
MOVE_ITEM_X 5 100000
Now, when you will approach corresponding SECRET_MAP object, it will give you not "ACTION - talk" or "ACTION - examine" message, but "ACTION - interact" message instead. When Lara will press ACTION key nearby it, this object will call custom flipeffect with number specified in its OCB. In our case, this flipeffect will play soundtrack #94, flash screen red, AND (most important!) it will kill corresponding SECRET_MAP object. Please notice that in addition to KILL_ITEM command i also have used MOVE_ITEM_X command, so SECRET_MAP object will be temporarily moved out of Lara's interaction zone (somewhere far away, coordinate value doesn't really matter, just make sure it's not nearby Lara's position), so she won't get a chance to accidentally activate that SECRET_MAP object again. You MUST use this command every time you want to kill SECRET_MAP object, because if Lara will accidentally activate SECRET_MAP object that is being killed, game will crash when killing process is complete.

Now, with this approach, you can use this SECRET_MAP object to place certain interaction event places in your game. You can do almost anything with these interaction points (play FMVs and audiotracks, increase/decrease HP, load levels, activate items etc. - anything that usual flipeffect editor can do). I think, TRIPWIRE object may be made workable this way too, i just need to know how to check bounding box overlaps.

WARNING 2: since SECRET_MAP object is now uses extra tooltip (in addition to two "talk" and "examine", that were implemented earlier), you must add one extra string after two "ACTION - talk" and "ACTION - examine" strings. This string will be used to show tooltip for SECRET_MAP objects that are calling flipeffects. For example, i've set it to "ACTION - interact", so end part of my STRINGS2.TXT looks like this:

; Gamepad axis swap option strings

Swap Gamepad Axes

; Diary item text to replace EXAMINE text.

Read Diary

; Indicator messages for textbox object interaction

ACTION - examine
ACTION - talk
ACTION - interact
As for extra text entries that can be used for SECRET_MAP messaging, you can use RESERVED diary strings for now, because forthcoming new patches may utilize end of STRINGS2.TXT, so you may face problems when adding extra strings to the end of STRINGS2.TXT file. But since there are 500 reserved entries for diary, this should be enough (if it's not, you may add your strings to the end, but remember that you'll have to move them down and correct string numbers in OCB, if new patches which are using extra strings will appear).

@Titak: i don't know, everything works on my side - both vertical and horizontal mirrors. Check latest patches.rar file from TREP webpage.

Last edited by Pyuaumch; 29-11-07 at 17:02.
Pyuaumch is offline   Reply With Quote
Old 29-11-07, 17:35   #1615
nowid50's Avatar
Join Date: Oct 2006
Location: France
Posts: 1,380

Originally Posted by nowid50 View Post
@ Ensi : How can I make a rope ?
How can I draw objects ?
How can I manage an object get triggerred ?
How can I make bubbles ?
How do I can manage to call code when an object is selected in inventory ?
How can I get current animation frame ?

Oh sorry XD I'm getting really crazy. Assembler is really a good world
Please Ensi I really need these thing for trying something
I'm part of the "should be reading more but life's too short" generation.
nowid50 is offline   Reply With Quote
Old 29-11-07, 18:13   #1616
Join Date: Dec 2005
Location: Russia
Posts: 491

I don't know about ropes, object selection and drawing. You can learn object triggering by learning ACTIVATE_ITEM flipeffect code (however, sometimes it doesn't work, as Trey87 mentioned - because it seems i've missed something). Bubbles are made by procedure 4391A0 with four parameters:

PUSH 7      ; kinda size, better always leave 7
PUSH 8      ; kinda size, better always leave 8
PUSH EAX    ; room number to generate bubbles in
PUSH ESI    ; pointer to 3 bubble coordinates
CALL 4391A0 ; call it
ADD ESP,10  ; restore stack
Room number is needed because bubbles procedure check if room have water flag or not (if not, bubbles won't be generated). Pointer should point to an address with 3 4-byte coordinates (first goes X, then Y, and then Z).

As for counting animation frames, it is a bit complicated, and it gave me some headache when i was writing cold breath patch. The thing is, TR4 isn't counting specific animation frames, it counts OVERALL (absolute) amount of frames in WHOLE Lara's object. I'm not sure what will happen if overall amount of frames in Lara's object will exceed value of 32767 (or 65535, if value is unsigned), most likely game will crash... But anyway, if you want to count frames in certain animation, at first you must get absolute starting frame value. Here's a code that will do the trick (don't forget to back-up all used registers with PUSH commands, and then POP them in reverse order at the end of your code):

MOV ESI,DWORD PTR DS:[80E01C]     ; get a pointer to Lara's object entry
MOVSX EAX,WORD PTR DS:[ESI+14]    ; get current animation number
MOV EAX,DWORD PTR DS:[533938]     ; |
LEA EBP,DWORD PTR DS:[EAX+EDX*8]  ; \> calculate pointer to current animation properties entry
MOVSX EBX,WORD PTR SS:[EBP+1E]    ; get absolute animation starting frame
MOVSX ECX,WORD PTR DS:[ESI+16]    ; get absolute animation current frame
SUB ECX,EBX                       ; substract absolute start from absolute current, so you will get frame count starting from zero
P.S.: I have two days to finish my degree work, so if i will fail, i will blame you

Last edited by Pyuaumch; 29-11-07 at 18:18.
Pyuaumch is offline   Reply With Quote
Old 30-11-07, 08:48   #1617
Relic Hunter
aktrekker's Avatar
Join Date: Aug 2006
Posts: 5,239

Originally Posted by Pyuaumch View Post
Hmm, very interesting... But how DX can allow application to use newer functions, if application initializes older interface? I. e. if device is created with DirectInputCreate (not DirectInput8Create), how DirectX will allow to use DirectInput8 functions for it? Is it some kind of forward-compatibility?
No. Since the game is using DX6, you can ONLY use DX6 objects and interfaces. But the way COM is designed these older calls will still work even if you have a newer version of DX. So you only need to use the DX6 version of force-feedback. DInput will make sure the calls work with whatever force-feedback device you are using (if it is DX compatible).

Originally Posted by Pyuaumch View Post
But this structure have dynamic address, right? It is stored in [754468], this value points to other address, where sub-pointers are stored... There are just too many pointers that are referring to pointers, and these pointers also refer to sub-pointers... It drives me crazy, but i'm slowly getting used to it... Still, it's impossible to do anything without some reference (at least include file) to all these functions.
That is the pointer to a structure at 7538b1. The structure is layed out as follows:
typedef struct //  100 bytes // 7538b1
	LPDIRECTDRAW4              pDD; // 0
	LPDIRECT3D3                   pD3D; // 4
	LPDIRECT3DDEVICE3         pDev; // 8
	LPDIRECT3DDEVICE3         pDev2; // 12
	LPDIRECT3DVIEWPORT3    pView; // 28
	LPDIRECTSOUND              pDS; // 32
	DWORD                          dwWidth; // 36
	DWORD                          dwHeight; // 40
	RECT                             rectScreen1; // 44
	RECT                             rectScreen2; // 60
	DWORD                          dwCfgFlags; // 76
	DWORD                          dwWindowStyle; // 80
	DWORD                          dwCoopFlags; // 84
	LPDIRECTINPUT2A            pDI; // 88
	HWND                            hWnd; // 96
	} TRDXInfo;
I changed the tabs to spaces and it still doesn't line up. Damned variable fonts.

Last edited by aktrekker; 30-11-07 at 08:49. Reason: To add a rant
aktrekker is offline   Reply With Quote
Old 30-11-07, 10:04   #1618
Relic Hunter
ggctuk's Avatar
Join Date: Mar 2005
Location: England
Posts: 8,681

Hey, could you make a fipeffect something like this?

IF SECRETS = [enter secret number] THEN ...

LOAD_LEVEL [enter level no] (I think this one exists already)

Also could you make a Save Crystal functionable?

This way you could have more than 1 bonus level in a gmae.
Current projects: Zootopia Futures Past, Battle Of The Kings, Battlefront Legacy
ggctuk is offline   Reply With Quote
Old 30-11-07, 10:25   #1619
Join Date: Nov 2007
Posts: 14

Hey! Can someone explaine me how to use FADEOUT command properly? I need to create fade out before fmv starts but all i have is a short blink
And second question is how to teleport Lara after cutscene?

Last edited by Hammer; 30-11-07 at 11:13.
Hammer is offline   Reply With Quote
Old 30-11-07, 11:46   #1620
Active Man
Join Date: Nov 2006
Posts: 406
Thumbs up

Thank you for all these glorious patches, Pyuaumch, there is no way I can even say thanks because they are coming so fast !
Good luck with your degree work!

Originally Posted by ggctuk View Post
Hey, could you make a flipeffect something like this?

IF SECRETS = [enter secret number] THEN ...

LOAD_LEVEL [enter level no] (I think this one exists already)

Also could you make a Save Crystal functionable?

This way you could have more than 1 bonus level in a game.
You can easily achieve the 'IF_SECRETS' command by adding DWORD_IF= 7F7744 X to your Flip Effect, X meaning the number of secrets you want to use.
After that, use the LOAD_LEVEL command, which already exists.

Save Crystals are easy to make.
Just take some Save Crystal mesh and put it in your level, and below it, put a trigger for a Flip Effect where you should put:
SAVE_GAME, and make it One Shot.
Active Man is offline   Reply With Quote


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 00:50.

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