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 03-03-19, 06:24   #111
A_De
Member
 
A_De's Avatar
 
Joined: Jan 2012
Posts: 1,320
Default

I was thinking that this plugin has a possibility to change a behavior of any inventory item. There are some items which were not used in original game nor in TRNG, i.e. MAP, SECRET_MAP and DIARY slots. I guess now we can use them too?
A_De is offline   Reply With Quote
Old 03-03-19, 09:58   #112
JMN
Member
 
Joined: Sep 2006
Posts: 674
Default

Any moveable slot can be used, so yes it's possible to define behaviour for those items. To create new items you use CINV_ITEM_NEWx.

See the script posted here as an example:
https://www.tombraiderforums.com/sho...4&postcount=69

Note that for items without proper pickup behaviour defined you will have to script the pickup animations and adding them to the inventory yourself. Same goes for using them at puzzle holes.
JMN is offline   Reply With Quote
Old 10-03-19, 07:23   #113
TokyoSU
Member
 
TokyoSU's Avatar
 
Joined: Mar 2019
Posts: 687
Talking

it's a great plugin, now can have 3d inventory in tr4 !!
thanks you
TokyoSU is offline   Reply With Quote
Old 18-03-19, 19:44   #114
A_De
Member
 
A_De's Avatar
 
Joined: Jan 2012
Posts: 1,320
Default

I think that CINV_ACTION_SAVE_GAME function does not work in the way it supposed. Because right after using it all variables become messed. Or, may be, reseted? I mean, all texts from diary disappear, also disappears ammo picked up before, and global triggers which are disabled by default and then activated before saving via CINV_ACTION_SAVE_GAME, also become disabled. It all returns if I reload that save, but I still think that it is critical. No matter if I try to use that function on new created item like passport or if I use default memcard without customization. F5 does not cause this.

Edit: Is that function made by using TRNG's flipeffect like 'make backup'? Then, probably this bug came not from the plugin, but from TRNG

Edit2: I think I know what is a reason of that bug. If on opening inventory Lara gets transported to another place then on closing inventory she must be brought back. And, since while saving game inventory is open then place variables must be restored before actual saving. Unfortunately, this resets all variables present at the moment. Then the game loads that save to put variables' values at their places, however gets failed somewhere.

A workaround can be to add custom action which would close inventory and then call a flipeffect which uses default SAVE function. If this possible, of course.

Edit3: Looks like I was right about new saving system which resets variables because transporting Lara while inventory is open. That's not that big problem though, because workaround method above actually works! See my next post here

Last edited by A_De; 20-03-19 at 05:49. Reason: Found out what was wrong with new saving system
A_De is offline   Reply With Quote
Old 19-03-19, 12:50   #115
Dustie
Member
 
Dustie's Avatar
 
Joined: Apr 2005
Posts: 9,208
Default

Excuse me being a complete noob, but I have a few questions, basing solely on first impressions after adding the plugin

- are there script/setups available for the passport to replace separate Load/Save items?
- the above seem to have a redundant interaction method, first you confirm Load/Save, then there's another command LOAD GAME / SAVE GAME and only then you're led to the actual screen

- the same goes for having to confirm the selection with Use command, can it be skipped?

- is there a way to have the animations when weapons are being equipped?

- can we skip ammo selection with this somehow? some way to force either of ammo kinds? if not with script commands, then maybe this could be coded in the plugin?

- is there a way to force the ring to not respect the screen ratio and not stretch to the sides and stay centered? I'm guessing that's something that would have to be changed in the code altogether

Last edited by Dustie; 19-03-19 at 13:09.
Dustie is offline   Reply With Quote
Old 20-03-19, 05:45   #116
A_De
Member
 
A_De's Avatar
 
Joined: Jan 2012
Posts: 1,320
Talking Manual saving workaround!

Those who have troubles with new saving system can now use a workaround, which allows to save like with default F5 function. The trick is that inventory closes before saving option appears, therefore there is no need to reset variables.
Quote:
Customize= CUST_CINV_ITEM_ACTION, CINV_ITEM_NEW1, CINV_ACTION_CUSTOM, 47, IGNORE, CINV_TRUE, IGNORE, 192, >
CINV_ACTION_LOAD_GAME, 46, IGNORE, IGNORE, IGNORE, IGNORE, >
CINV_ACTION_EXIT_TO_TITLE, 180, IGNORE, IGNORE, IGNORE, IGNORE, >
CINV_ACTION_USE, IGNORE, IGNORE, IGNORE, 193, IGNORE


; Set Trigger Type - FLIPEFFECT 53
; Exporting: TRIGGER(18:0) for FLIPEFFECT(53) {Tomb_NextGeneration}
; <#> : Keyboard. Simulate receivement of <&>keyboard comand in (E) way
; <&> : Save the game (special)
; (E) : Single sending
; Values to add in script command: $2000, 53, $12
TriggerGroup= 191, $2000,53,$12 ; group-191 for saving game

Organizer= 30,FO_TICK_TIME,IGNORE, 10,191

; Set Trigger Type - FLIPEFFECT 127
; Values to add in script command: $2000,127,$1E ; run organizer-30

; Set Trigger Type - FLIPEFFECT 51
; <#> : Keyboard. Disable <&>keyboard command for (E) time
; <&> : Inventory ; (E) : 1 seconds
; Values to add in script command: $2000,51,$10E ; forbid inventory key for 1 second

TriggerGroup= 192, $2000,127,$1E, $2000,51,$10E
The black bold text is showing that I used CINV_ACTION_CUSTOM instead of CINV_ACTION_SAVE_GAME. Colors are showing the IDs of Triggergroups and Organizer, change them according your script. The grey text means that I didn't customize those lines, they have been copied from JMN's sample script.
A_De is offline   Reply With Quote
Old 20-03-19, 11:00   #117
Dustie
Member
 
Dustie's Avatar
 
Joined: Apr 2005
Posts: 9,208
Default

Is that something that can be used to bypass the Use or Equip commands?
Dustie is offline   Reply With Quote
Old 20-03-19, 11:47   #118
A_De
Member
 
A_De's Avatar
 
Joined: Jan 2012
Posts: 1,320
Default

^ Yes. You need to put in EnabledCondition field of CINV_ACTION_USE command the ID of triggergroup which never has TRUE value.
A_De is offline   Reply With Quote
Old 24-03-19, 11:05   #119
JMN
Member
 
Joined: Sep 2006
Posts: 674
Default

Quote:
Originally Posted by A_De View Post
I think that CINV_ACTION_SAVE_GAME function does not work in the way it supposed. Because right after using it all variables become messed. Or, may be, reseted? I mean, all texts from diary disappear, also disappears ammo picked up before, and global triggers which are disabled by default and then activated before saving via CINV_ACTION_SAVE_GAME, also become disabled. It all returns if I reload that save, but I still think that it is critical. No matter if I try to use that function on new created item like passport or if I use default memcard without customization. F5 does not cause this.

Edit: Is that function made by using TRNG's flipeffect like 'make backup'? Then, probably this bug came not from the plugin, but from TRNG

Edit2: I think I know what is a reason of that bug. If on opening inventory Lara gets transported to another place then on closing inventory she must be brought back. And, since while saving game inventory is open then place variables must be restored before actual saving. Unfortunately, this resets all variables present at the moment. Then the game loads that save to put variables' values at their places, however gets failed somewhere.

A workaround can be to add custom action which would close inventory and then call a flipeffect which uses default SAVE function. If this possible, of course.

Edit3: Looks like I was right about new saving system which resets variables because transporting Lara while inventory is open. That's not that big problem though, because workaround method above actually works! See my next post here
Sorry A_De, I'm not able to reproduce this bug. Variable values persists after saving through the ring inventory and nothing else gets messed like you described.

Your hypothesis about it perhaps being due to Lara getting transported is interesting, however she only gets transported for a very small duration of the inventory loop when items are being rendered. When the saving function runs she is back at her original position where the inventory was opened.

The saving function is the same one used by F5, so something else must be going on to cause it to mess up stuff. I did notice in Sabatu's latest release that the game loads right after saving through the inventory, but this only starts happening after killing the first enemy. Something is definitely wrong, but I'm not sure what. What I would do is to start with a clean test level and start adding scripts until the issue appears. That might tell you what's causing it.

I could perhaps also send you a test build of the plugin where Lara isn't being transported at all to see if this fixes things. Don't know how familiar you are with C++, but the code is also available to be checked out, modified and built on your machine.

Quote:
Originally Posted by Dustie View Post
- are there script/setups available for the passport to replace separate Load/Save items?
Yes: https://www.tombraiderforums.com/sho...4&postcount=69

Quote:
Originally Posted by Dustie View Post
- the above seem to have a redundant interaction method, first you confirm Load/Save, then there's another command LOAD GAME / SAVE GAME and only then you're led to the actual screen
I'm aware of this. Perhaps I could change it so that if there's only one action available it gets executed immediately without showing the menu. You could also for now just hold action/enter.

Quote:
Originally Posted by Dustie View Post
- is there a way to have the animations when weapons are being equipped?
You mean play an additional animation when using/equipping an item? Not at the moment, but I might be able to add it.

Quote:
Originally Posted by Dustie View Post
- can we skip ammo selection with this somehow? some way to force either of ammo kinds? if not with script commands, then maybe this could be coded in the plugin?
Yes: https://www.tombraiderforums.com/sho...6&postcount=28

Quote:
Originally Posted by Dustie View Post
- is there a way to force the ring to not respect the screen ratio and not stretch to the sides and stay centered? I'm guessing that's something that would have to be changed in the code altogether
I think this will involve digging deeper into the rendering code, something I haven't been able to do yet. Probably related to stretched text as well.
JMN is offline   Reply With Quote
Old 25-03-19, 10:43   #120
Dustie
Member
 
Dustie's Avatar
 
Joined: Apr 2005
Posts: 9,208
Default

Thanks for the reply, I'll check it all out, I hope I can make it work as the inventory is sort of cherry on the cake in my current project


it would be amazing if you could add animations that play when weapon is selected, although from what I checked it seems those were hardcoded somehow... I can't see any animations in the inventory items objects in WadMerger, so I guess we would have to recreate them
Dustie 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 10:33.


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.