www.tombraiderforums.com  

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

Closed Thread
 
Thread Tools
Old 23-02-21, 18:48   #1
A_De
Archaeologist
 
A_De's Avatar
 
Join Date: Jan 2012
Posts: 1,290
Default New PLS with limited batteries

Features
PLS can be switched on/off by Flare key. PLS requires batteries, player has to pick them up and use during the game. The timer is displayed on screen. Once the charge is over the PLS will switch off itself. Player has to go into inventory and use battery to enable PLS again. Batteries are not rechargeable, but player can save charge by turning PLS off. Charge and on/off PLS status is kept on leveljumps.
Disadvantage: glowing halo is seen at Lara's back on running.

Requirements: TRNG 1.3.0.7 + Classic Inventory Plugin
Used variables: Global Short Beta 1 (GSB1), Global Byte Alfa 1 bit-0 (GBA1 bit-0)

I'm currently too lazy to make a detailed tutorial, this is rather backup of a small part from my script. But since I'm pretty satisfied with results I decided to share the script here.
I hope the comments will tell enough

Code:
; -------------------------- pls with batteries -------------------

#define @Plugin_ClassicInventory  3

; effect-1 white light
AddEffect=	1, ADD_LIGHT_FLAT, FADD_CONTINUE_EMIT, JOINT_ABDOMEN,0,-50,100,IGNORE,IGNORE, 12, IGNORE, MIST_COL_WHITE

; effect-2 white halo
AddEffect=	2, ADD_LIGHT_GLOVE, FADD_CONTINUE_EMIT, JOINT_ABDOMEN,52,-140,30,IGNORE,IGNORE, 12, IGNORE, MIST_COL_WHITE

; using batteries from inventory
Customize=CUST_CINV_ITEM_ACTION, CINV_ITEM_PUZZLE12, CINV_FACTION_CONFIRM, CINV_ACTION_USE, IGNORE, IGNORE, IGNORE, CINV_FACTION_REPLACE, 10, 9

Parameters=	PARAM_PRINT_TEXT, 1, CL_GOLD, FT_SIZE_MICRO_CHAR, IGNORE, IGNORE, 955, 120	; on-screen PLS timer

; Set Trigger Type - FLIPEFFECT 701
; <#> : Inventory. Decrease the number of <&> by (E) ; <&> : PUZZLE12 ; (E) :      1
; #define @Plugin_ClassicInventory  3
; Values to add in script command: $032000,701,$130			; take 1 battery (PUZZLE12)

; gr-9 reset GSB1 = 30, gtrigg-1 is on - PLS can work again, set bit-0 at GBA1, add to Lara(0) effect-1, effect-2, run org-2,
TriggerGroup=	9, $2000,232,$1E12, $2000,109,$101, $2000,234,$0, $5000,0,$130, $5000,0,$230, $2000,127,$2, >
	$032000,701,$130						;  take 1 battery from inventory

; gr-10 if GSB1 = 0 - battery is exhausted (condition group for using batteries from inventory)
TriggerGroup=	10, $8000,18,$2B			
;
; --------------- initialisation ---->>>>
;
; Set Trigger Type - FLIPEFFECT 232
; <#> : Variables. Numeric. Set <&>Variable with (E)value
; <&> : Global Short Beta1 ; (E) : Value     30
; Values to add in script command: $2000,232,$1E12		; set GSB1 value = 30
; Values to add in script command: $2000,232,$7812		; set GSB1 value = 120
;
TriggerGroup=	11, $2000,232,$1E12						; gr-11 set GSB1 value = 30
GlobalTrigger=	4, FGT_SINGLE_SHOT, GT_ALWAYS, IGNORE, IGNORE,11,IGNORE		; gtrigg-4 set GSB1 = 30
;
; <<<<---------- initialisation --------
;
; Set Trigger Type - FLIPEFFECT 233
; Values to add in script command: $2000,233,$112		; subtract 1 from GSB1
; Values to add in script command: $2000,233,$0			; subtract 0 from GBA1 - empty action, for ELSE condition only
;
; Set Trigger Type - CONDITION 43
; Values to add in script command: $8000,0,$2B			; condition: GBA1 = 0
; Values to add in script command: $8000,18,$2B			; condition: GSB1 = 0
;
; Set Trigger Type - FLIPEFFECT 127
; Values to add in script command: $2000,127,$2			; run organizer-2
; Set Trigger Type - FLIPEFFECT 128
; Values to add in script command: $2000,128,$2			; stop organizer-2
;
; Set Trigger Type - FLIPEFFECT 109
; Values to add in script command: $2000,109,$100		; stop gtrigg-1 - PLS doesn't work if batteries are not loaded
;
; gr-6 subtract 1 from GSB1, if (GSB1 = 0) -> (stop org-2, clear bit-0 at GBA1, stop gtrigg-1, remove effect-1, remove effect-2 from Lara(0))
TriggerGroup=	6, $2000,233,$112, $8000,18,$2B, $2000,128,$2, $2000,235,$0, $2000,109,$100, $5000,0,$131, $5000,0,$231, >
	$2000+TGROUP_ELSE,233,$0					; else (do nothing)
;
Organizer=	2,FO_LOOP, IGNORE, 1,6				; org-2 every second reduce PLS timer, switch PLS off on zero value

; Set Trigger Type - CONDITION 45
; Values to add in script command: $8000,0,$2D		; bit-0 is clear at GBA1
; Set Trigger Type - CONDITION 44
; Values to add in script command: $8000,0,$2C		; bit-0 is set at GBA1
TriggerGroup=	1, $8000,0,$2C				; gr-1 condition: bit-0 is set at GBA1

; Set Trigger Type - FLIPEFFECT 70
; Values to add in script command: $2000,70,$1F6C	; play click sound (sfx 108 MENU_ROTATE)

; Set Trigger Type - FLIPEFFECT 234
; Values to add in script command: $2000,234,$0		; set bit-0 at GBA1
; Set Trigger Type - FLIPEFFECT 235
; Values to add in script command: $2000,235,$0		; clear bit-0 at GBA1

; gr-2 click sfx, if (bit-0 is clean at GBA1) -> (set bit-0 at GBA1, run org-2), else -> (clear bit-0 at GBA1, stop org-2)	
TriggerGroup=	2, $2000,70,$1F6C, $8000,0,$2D, $2000,234,$0, $2000,127,$2, $2000+TGROUP_ELSE,235,$0, $2000,128,$2

Organizer=	1,FO_TICK_TIME,IGNORE,2,2			; org-1 small delay before switching PLS on (before switching bit-0 at GBA1)

; Set Trigger Type - FLIPEFFECT 127
; Values to add in script command: $2000,127,$1		; run org-1
TriggerGroup=	3, $2000,127,$1				; gr-3 run org-1

; gtrigg-1 on pressing flare key switch bit-0 at Global Byte Alfa1 (GBA1)
GlobalTrigger= 1, FGT_SINGLE_SHOT_RESUMED, GT_GAME_KEY2_COMMAND, KEY2_USE_FLARE, IGNORE,3,IGNORE

; -----
; Set Trigger Type - FLIPEFFECT 203
; <#> : Text. Print formatted text <&>ExtaNg string with (E)formatting data
; <&> : 209: #0012
; (E) : Parameters=PARAM_PRINT_TEXT,     1
; Values to add in script command: $2000,203,$1D1		; display value of GSB1: using NG string 209 with string value #0012
; Set Trigger Type - FLIPEFFECT 204
; <#> : Text. Print. Remove (&)Extra NG String from screen
; <&> : 209: #0012
; Values to add in script command: $2000,204,$D1		; remove NG string 209 from screen
; -----

; Set Trigger Type - ACTION 48
; Values to add in script command: $5000,0,$130		; add effect-1 to Lara(0)
; Values to add in script command: $5000,0,$230		; add effect-2 to Lara(0)
; gr-4 add to Lara(0) effect-1, effect-2, show PLS timer, run org-2 as PLS timer
TriggerGroup= 4, $5000,0,$130, $5000,0,$230, $2000,203,$1D1, $2000,127,$2

; Set Trigger Type - ACTION 49
; Values to add in script command: $5000,0,$131		; remove effect-1 from Lara(0)
; Values to add in script command: $5000,0,$231		; remove effect-2 from Lara(0)
; gr-5 remove from Lara(0) effect-1, effect-2, hide PLS timer, stop org-2 as PLS timer
TriggerGroup= 5, $5000,0,$131, $5000,0,$231, $2000,204,$D1, $2000,128,$2

; gtrigg-2 if (bit-0 is set at GBA1) -> (add effects)
GlobalTrigger=	2, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 1,4,IGNORE

TriggerGroup=	12, $8000,0,$2D					; gr-12 condition where bit-0 at GBA1 is clear

; gtrigg-5 if (bit-0 at GBA1 is clear) -> (remove effects)
GlobalTrigger=	5, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 12,5,IGNORE

; Set Trigger Type - CONDITION 1
; <#> : PUZZLE_ITEM12                   	Slot=186
; <&> : Inventory. Missing <#>inventory_item. 
; Values to add in script command: $8000, 186, $1			; condition where Lara has no batteries (PUZZLE_ITEM12)

; Set Trigger Type - CONDITION 43
; Values to add in script command: $8000,18,$2B				; condition where GSB1 = 0 (battery exhausted)

TriggerGroup=	7, $8000,186,$1, $8000,18,$2B				; gr-7 no batteries, and GSB1 = 0

; Set Trigger Type - FLIPEFFECT 109
; Values to add in script command: $2000,109,$100			; disable gtrigg-1 (PLS won't work without batteries)

TriggerGroup=	8, $2000,109,$100					; gr-8 disable gtrigg-1

; gtrigg-3 if (no batteries AND PLS is off) -> (disable switching the PLS on)
GlobalTrigger= 3, FGT_SINGLE_SHOT_RESUMED, GT_CONDITION_GROUP, IGNORE, 7,8,IGNORE

; -------------------------- //pls with batteries -------------------
__________________
...ARGENTINAMANITNEGRA...
A_De is offline  
Closed Thread

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 15:42.


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