www.tombraiderforums.com

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

Reply
 
Thread Tools
Old 26-11-07, 23:14   #1581
LaraCablara
Professor
 
LaraCablara's Avatar
 
Join Date: Feb 2006
Posts: 2,998
Default

Quote:
Originally Posted by GodOfLight View Post
well yes, this is a genius idea. i would love to have tumbeling leaves like in st.francis folly by changing the snow sprites. however, changing the snow sprite textures would affect the water dust particles in the pools of water, since i believe they both use the same texture.

would be a wonderful effect to work with though... especially if we could change the direction of the snow... so that it is tumbeling upwards from the floor, or from left to right, right to left etc. if it could tumble upwards from the floor it would look great over pools of lava in your case.
I was thinking wouldn't it be possible to link the sprite to a different, custom one like how the smooth shadow patch works which lets you select a sprite? I'm no expert on patching though, just a random idea .
LaraCablara is offline   Reply With Quote
Old 27-11-07, 00:23   #1582
ReeceMix
Explorer
 
ReeceMix's Avatar
 
Join Date: Aug 2007
Location: UK
Posts: 569
Default

Quote:
Originally Posted by nowid50 View Post
I already discovered that but I can know do what I want because I found how to make an external file code

Edit : Now it's fully functional !
Are you releasing this as a drc or external file that can be merged with trep?

I really want to be able to add new command functions to any anims.
ReeceMix is offline   Reply With Quote
Old 27-11-07, 01:56   #1583
Pyuaumch
Historian
 
Join Date: Dec 2005
Location: Russia
Posts: 491
Default

Quote:
Originally Posted by nowid50 View Post
can you tell me how I make a Dynamical light ?
Very simple:

Code:
PUSH 0             ; Blue colour (0-FF)
PUSH 0             ; Green colour (0-FF)
PUSH 0             ; Red colour (0-FF)
PUSH 5             ; Light radius (0-7F)
PUSH EAX           ; X coordinate
PUSH EBX           ; Y coordinate
PUSH ECX           ; Z coordinate
CALL 00435BF0      ; call dynamic light
ADD ESP,1C         ; restore stack
To make randomly "blinking" dynamic light, you must call randomizer (it returns pseudo-random value into EAX register), then limit resulting number with AND command, and then add/substract it to one of the colour parameters.

Quote:
Also, do you think it's really hard for processor for using 3 Extrafile at the same time ?
It's not hard for processor, it may be hard for poor player to manage all additional binaries . You'd better put them into /data folder or create additional /bin folder, and then load it from there. Trashed main game directory looks awful (look at Legend / Anniversary directory, all files in one place... awful).

Quote:
Also, do you know to check if the ground under lara is snow or other ? (The sound of the ground defined in the Winroomedit )
Easily can be found by tracing 45E440 sound play procedure. Place a breakpoint on all calls of this command, then play a bit without any ground sounds except default to remove wrong breakpoints, and then load level with snow/mud/etc. sounds and try to walk - then you should be pointed to a code that plays add-on texture sound.

Last edited by Pyuaumch; 27-11-07 at 01:58.
Pyuaumch is offline   Reply With Quote
Old 27-11-07, 07:47   #1584
aktrekker
Relic Hunter
 
aktrekker's Avatar
 
Join Date: Aug 2006
Posts: 5,239
Default

Quote:
Originally Posted by Pyuaumch View Post
What if i'll simply put DINPUT8.DLL into import table instead of DINPUT.DLL or load DINPUT8.DLL library seperately (as with binkw32.dll and bass.dll) and then create force-feedback device in it?
You would have to change all DX DLLs at the same time. This can be done and the EXE would still run (all previous versions of DX are still supported). But NEVER mix calls to different versions of DX.

Quote:
Originally Posted by Pyuaumch View Post
But what confuses me is all these external calls like "CALL NEAR [ECX+30]" etc. Almost all DirectX functions are called this way; how on Earth can i know which function is assigned to each of these relative offsets in DirectX 6 and DirectX 8? Is there any documentation that explains any DirectX function calls on low level, not in C, Delphi etc.?
DirectX is based on COM objects, and this is how they are called. Each object begins with a jump table, and you call an offset in the table to get to the right function. The only way I have found to get back to the function is to go to the include file, find the DX object, and count the functions in the order they are listed until I get to the right offset. At that point, I go to the documentation to find a description of the parameters.

Quote:
Originally Posted by Pyuaumch View Post
As far as i know, force-feedback support was implemented in DirectX 7... Am i wrong? If yes, how can i download a force feedback effect to device, is it similar to DirectInput 8 way of downloading? I just don't know where i can find any of this information, including these complicated relative offset calls description... MSDN is too slow for my dial-up
DirectX6.1 documentation talks about force feedback input devices. It has a section on how to use them. I could send you the DInput.doc word document. It shows as 549KB. But you would probably need include files, and accessing DX structures from assembly might be tough because of alignment within the structure.
If you know what you want to do, I could try to compile it and get the assembly code it creates.
aktrekker is offline   Reply With Quote
Old 27-11-07, 15:36   #1585
Pyuaumch
Historian
 
Join Date: Dec 2005
Location: Russia
Posts: 491
Default

Quote:
Originally Posted by aktrekker
You would have to change all DX DLLs at the same time. This can be done and the EXE would still run (all previous versions of DX are still supported).
I'm not sure, but at least DirectInputCreateA from DirectX 6 and DirectInput8Create from DirectX 8 have different amount of parameters to PUSH... I suppose that if i simply replace one libraries with other, it'll be also needed to correct parameters for each call?
Quote:
Originally Posted by aktrekker
The only way I have found to get back to the function is to go to the include file, find the DX object, and count the functions in the order they are listed until I get to the right offset. At that point, I go to the documentation to find a description of the parameters.
Ah, i see it... So there's no way to identify a function except digging through include files? If so, then it's even not possible to find all references to specific DirectX function in TR4 engine automatically, we have to search for them manually?
Quote:
Originally Posted by aktrekker
DirectX6.1 documentation talks about force feedback input devices. It has a section on how to use them. I could send you the DInput.doc word document. It shows as 549KB. But you would probably need include files, and accessing DX structures from assembly might be tough because of alignment within the structure.
I suppose that interface has indeed changed since DirectX 6.1. I'm not sure my mailbox can handle 500k letter, could you upload it somewhere instead? Include files actually seems like a good idea, but where i can find them? Do i need to download DirectX SDK?
Quote:
Originally Posted by aktrekker
If you know what you want to do, I could try to compile it and get the assembly code it creates.
I just looked at unofficial RE4 vibration patch and thought that it can be implemented in TR4 too, but TR4 works with DX6 (RE4 uses DX8 at least for input), and now you say that we can't mix various DX libraries' versions... I feel so lame, because i've never tried to do anything with DirectX before... At first, i simply want to understand which DX function is called in certain case of TR4 engine
Pyuaumch is offline   Reply With Quote
Old 27-11-07, 16:34   #1586
nowid50
Archaeologist
 
nowid50's Avatar
 
Join Date: Oct 2006
Location: France
Posts: 1,380
Default

Quote:
Originally Posted by ReeceMix View Post
Are you releasing this as a drc or external file that can be merged with trep?

I really want to be able to add new command functions to any anims.
Also, I tried to make A StatID editor... That's impossible because all StatID get replaced by the new ones...

@Ensi : Can you explain me why increasing ESP ?
__________________
I'm part of the "should be reading more but life's too short" generation.
nowid50 is offline   Reply With Quote
Old 27-11-07, 19:32   #1587
ReeceMix
Explorer
 
ReeceMix's Avatar
 
Join Date: Aug 2007
Location: UK
Posts: 569
Default

Quote:
Originally Posted by nowid50 View Post
Also, I tried to make A StatID editor... That's impossible because all StatID get replaced by the new ones...
Nowid50 Impossible means it can never happen, please stop using this word.

Pyuaumch for the Ledge Climb Control, You made it possible to add two new state IDs for animation #96 (Jump state=28 & Down state=25), I havent tried it yet but it seems we can change the state ID number to whatever command button we want.

Ive talked about it alot and I havent heard a responce from you if you can make adding stateIDs to all anims possible, making this a reality would alter TR gameplay exponentially. If it helps you I will check every animation for every used state_ID command, Also I belive that when Tomo made the tightrope animation he found existing State_IDs that werent used in any animations, yet they performed movement functions.

Maybe all key commands do exist in every animation allready, I personally know that when I tried to create a 'spider-lara' when i used a new animation slot and directed lara to that animation #445, 57 made her move left but 59 wouldnt make her go right 56-57-58-59 being up/left/down/right for the existing wall climbing animation.

Tomo told me long ago that many of the state_ids were hardcoded to specific animations, The roll anim & Up.Down keys was a hardcoded command which Harly found and now we can change its command or disable it. (Why roll was seperated from the other standard state_ids I have no idea, but the animation order is messed up and there is an unused roll in the anims list)

So what I dont know is how the tomb4.exe assigns commands to new animations. I could just test all states from 0-200 for a new animation slot, but even working with one animation testing different evironments floor/water/wall/hanging/rope, it would take a really long time.

Maybe it would be easier to just delete the existing anim list and state_ID and build the whole thing up from scratch lol , but I know its all alot of work, I just wish we had more programmers around TRLE at this time, SOO much is potentially possible.

Sounds & lights are a nice addition but if this could be cracked we could make animations that would put TR Legend to shame.

As always I appriciate what you guys have done for us
ReeceMix is offline   Reply With Quote
Old 27-11-07, 19:33   #1588
nowid50
Archaeologist
 
nowid50's Avatar
 
Join Date: Oct 2006
Location: France
Posts: 1,380
Default

If it's so easy then make it...

Making "Everything is possible" is true only when you're programming in a High-Level Language
__________________
I'm part of the "should be reading more but life's too short" generation.

Last edited by nowid50; 27-11-07 at 19:37.
nowid50 is offline   Reply With Quote
Old 27-11-07, 19:38   #1589
Pyuaumch
Historian
 
Join Date: Dec 2005
Location: Russia
Posts: 491
Default

Quote:
Originally Posted by nowid50 View Post
Can you explain me why increasing ESP ?
The concept is very simple: each PUSH command moves stack pointer (aka ESP register) 4 bytes back, and then writes PUSHed value to these 4 bytes of stack. Since stack is used for storing almost all service variables (including addresses of parent procedures for RETN commands), you need to restore this stack pointer to an initial position after PUSHing various parameters, or else stack will be ruined, and game will obviously crash.

However, if you're calling some external .dll procedures, like bass.dll procedures or most of DirectX procedures, these external procedures may restore stack pointer automatically, and there will be no need in ADD ESP,x command. I suppose that it's done because if you will program in some high-level language, compiler won't recognize amount of PUSHed parameters for each external procedure (exactly because it's external - compiler simply don't know anything about these procedures), so procedure restores stack pointer for itself to prevent stack corruption.
Pyuaumch is offline   Reply With Quote
Old 27-11-07, 19:39   #1590
ReeceMix
Explorer
 
ReeceMix's Avatar
 
Join Date: Aug 2007
Location: UK
Posts: 569
Default

Quote:
Originally Posted by nowid50 View Post
If it's so easy then make it !

Making "Everything is possible" is true only when you're programming in a High-Level Language
When you type impossible (in all your posts) your saying 'No-One' can do it. When what you should say is 'I cant do it'. Im not saying its easy I Cant do it. I just want you to stop saying 'impossible'

Santa makes it round the whole world in 1 night, he makes it possible.. somehow, just have some faith. I thank you for the work you do for us x
ReeceMix is offline   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 16:29.


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