In BGII, you just press the TAB key and all containers magically highlight, allowing you to loot every piece you want. If you want to make things harder, then this tuto is for ya!
You need some files in order to make your first try.
- An .ARE file, named ARTEST.ARE;
- a .bcs file, named ARTEST.BCS, as it's the area's script;
- another .bcs file, named TRSE01.BCS, where TRSE01 is a trap;
The ARE file==========
You need first to add a container to your map. Set any x/y value for the box dimension or position; name it CTSE01.
Then create a new region (with the type TRAP), with the same dimension and location. Call it TRSE01.
Add a new variable to your area, let's say "CTSE01", with a base value of 0.
The Area script=======
It must contain the following block:
QUOTE
IF
Global("ContainerStuff","ARTEST",0)
THEN
RESPONSE #100
ContainerEnable("CTSE01",0)
SetGlobal("CTSE01","ARTEST",1)
END
Global("ContainerStuff","ARTEST",0)
THEN
RESPONSE #100
ContainerEnable("CTSE01",0)
SetGlobal("CTSE01","ARTEST",1)
END
This block ensure that the container is unavailable the first time you enter the area.
In game, it's juste invisible, non-selectable.
The Trap script=======
It must contain the following block:
QUOTE
IF
Detected([ANYONE])
Global("CTSE01","ARTEST",1) //ensure that party got the XP only once and all the stuff is proceeded just once
THEN
RESPONSE #100
RemoveTraps("TRSE01")
ContainerEnable("CTSE01",1)
DisplayStringHead("LastTrigger",XXXXX)//You have detected a secret container!
AddexperienceParty(YYY)//where yyy is the amount of XP gained
SetGlobal("CTSE01","ARTEST",2)
END
Detected([ANYONE])
Global("CTSE01","ARTEST",1) //ensure that party got the XP only once and all the stuff is proceeded just once
THEN
RESPONSE #100
RemoveTraps("TRSE01")
ContainerEnable("CTSE01",1)
DisplayStringHead("LastTrigger",XXXXX)//You have detected a secret container!
AddexperienceParty(YYY)//where yyy is the amount of XP gained
SetGlobal("CTSE01","ARTEST",2)
END
If you detect the trap, it's instantly removed, and the hidden container is just available.
The party gets some XP in the example. If you don't want that, just remove the AddexperienceParty(YYY)
You can set how difficult it is to detect the secret container by modifying the trap right in the ARE file.
You can repeat this operation for any container you want to make secret and harder to find (with name like CTSE02, 03 and so on).
Note==========
Detected() is just not triggered by using the spell Detect traps. I'm working to know how bypass that (perhaps with the SpellCast and Range triggers - I'm not quite sure if the Range trigger is available for Traps).