www.tombraiderforums.com

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

Reply
 
Thread Tools
Old Yesterday, 17:39   #13231
TheLostSecret
Explorer
 
TheLostSecret's Avatar
 
Join Date: Mar 2018
Location: Tehran, Iran
Posts: 502
Arrow A solution for your problem...

Quote:
Originally Posted by A_De View Post
Does anybody know how to disable keyboard keys during flyby or Inventory/Pause menu?
For some reasons there are only controls disabled, but not other keys. I added the hotkey for diary and it can be switched on always, no matter if the controls are off. The same is about using PLS with globaltrigger with GT_GAME_KEY2_COMMAND and KEY2_USE_FLARE. It completely ignores any status of controls, and there even does not matter if Lara is alive or not.
Hello A_De!

There is one solution for you which I suppose it can help you with your issue.

This is how the algorithm works:

We need to allocate a variable to check for us whether a flyby camera is active or we are in our Inventory/Pause Menu. Whenever the variable is set to 1, it means that the game is busy doing some operations hence our other TriggerGroups in action must be suspended. After the operation is complete ( I mean when the player has exited Inventory/Pause Screen and/or the flyby scene has been broken/ended ), we will set the value to 0, which means there are no more operations to wait for.

Here, I have used Local Byte Delta4 variable, but if you have already occupied this variable, you can change the code the way you want!

Code:
GlobalTrigger=  1 , IGNORE , GT_GAME_KEY2_COMMAND , 65536 , IGNORE , 1 , 2
GlobalTrigger=  2 , IGNORE , GT_GAME_KEY2_COMMAND , 8192 , IGNORE  , 1 , 2
GlobalTrigger=  3 , IGNORE , GT_CONDITION_GROUP , IGNORE , 3 , 1 , 2

TriggerGroup=  1 , $2000, 232, $14B
TriggerGroup=  2 , $2000, 232, $4B
TriggerGroup=  3 , $8000+TGROUP_AND, 13, $34 , $8000+TGROUP_AND, 10, $5
Now, a very strange thing you might realize is that we have used GT_GAME_KEY2_COMMAND, but what does 65536 mean? This is something I have discovered recently. According to Microsoft DirectX DirectInput Knowledge Base, each key code is assigned with a value of power 2. 65536 equals 2 ^ 16, which means 16 is the control ID handle for "Pause" command and a power of two is the code received by game from our controller device.

Maybe this question might pop up in your mind that why do I have to use a GT_GAME_KEYX_COMMAND? Why can't I use other condition triggers to check for input? The answer is that when the inventory/pause menu is prompted, the game's background operations such as rendering the scene, getting other inputs, etc. will be disabled 1 frame before the inventory/pause menu is shown, but here we need a command that has A VERY HIGH PRIORITY which even works in the suspension frame, and as a result, GT_GAME_KEYX_COMMAND is the best choice.

So, the code works like this:

GlobalTrigger with ID 1 waits for "Pause" key input from the player. As soon as the mapped button is received from our controller device, it will set the Local Byte Alfa4 value to 1. If not TRUE, it will revert it back to 0.
GlobalTrigger with ID 2 waits for "Inventory" key input from the player. As soon as the mapped button is received from our controller device, it will set the Local Byte Alfa4 value to 1. If not TRUE, it will revert it back to 0.
GlobalTrigger with ID 3 checks for miscellaneous conditions, such as if there is a flyby sequence in progress or if Lara is dying.

TriggerGroup with ID 1 sets the variable's value to 1.
TriggerGroup with ID 2 sets the variable's value to 0.
TriggerGroup with ID 3 is our condition group.

HOW TO MAKE OUR CODE WORK?

Simple!

Just add this condition trigger to the beginning of each TriggerGroup you want to control its suspension while the game is busy doing some operations ( such as player is in pause menu/inventory and other conditions you would like to be there! ):

Code:
$8000+TGROUP_AND, 75, $2B , ;OTHER COMMANDS...
; Set Trigger Type - CONDITION 43
; Exporting: CONDITION(43:62) for PARAMETER(75) {Tomb_NextGeneration}
; <#> : Local Byte Delta4
; <&> : Variables. The <#>Numeric Variable is = than (E)Value
; (E) : Value= 0
; Values to add in script command: $8000, 75, $2B


If you had any problems, let me know and I would be grateful to help you!
__________________
Egypt has many secrets and mysteries yet to be discovered ...

Last edited by TheLostSecret; Yesterday at 18:51. Reason: Updating Code
TheLostSecret is offline   Reply With Quote
Old Today, 10:11   #13232
Dino14
Explorer
 
Dino14's Avatar
 
Join Date: Apr 2010
Posts: 787
Default

Is it possible to make enemy not turn towards Lara? I had to put monkey in small_scorpion slot because baboon slot causes savegame crashes. It performs only idle animation so it stays on spot. Only problem is that it turns towards Lara and it looks a bit silly.
__________________
"Spider-Pig, Spider-Pig, Does whatever a Spider-Pig does."
Dino14 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 14:07.


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