![]() |
The Black Wyrm's Lair Terms of Use |
![]() ![]() ![]() ![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
![]() Eminence Grise Machiavelic ![]() Mod Developer Posts: 244 Joined: 12-November 04 From: Monthléry ![]() |
![]() Here what I want: make a container invisible for everybody unless a thief (or a character with the detect traps skill) detect a special trap. Detecting invisible container should reward XP. I have a container named "Cont01" and a trap "Traps01". i decided to code that in the area script (AREATEST) Here it is: QUOTE IF True() THEN RESPONSE #100 ContainerEnable("Cont01",0) END IF Detected("Traps01") THEN RESPONSE #100 RemoveTraps("Traps01") ContainerEnable("Cont01",1) DisplayStringHead("Cont01",XXXXX)//You have detected a secret container! AddexperienceParty(YYY) DisplayString((),ZZZZZ)//You win YYY XP END Is it correct? |
|
|
![]()
Post
#2
|
|
![]() Mathematical poet Retired team member Posts: 159 Joined: 9-July 04 From: Prague, Czech Republic ![]() |
First: In your first block, you have there True() in triggers. That means that this block is always proceeded. When the block is proceeded, the scripts restarts to its beginning -> you have the infinite loop with this first block. Use there some variable to ensure that the container is disabled only once.
Second: Detected... 0x0054 Detected(O:Object*) Only for trap scripts. Returns true only if the specified object detected this trap in the last script round. - detected() can be used only in trap script and with correct object. ([ANYONE], [PC],...) So I suggest something as: in area script: CODE IF Global("ContainerStuff","ARxxxx",0) THEN RESPONSE #100 ContainerEnable("Cont01",0) SetGlobal("ContainerStuff","ARxxxx",1) END in trap script: CODE IF Detected([ANYONE]) Global("ContainerStuff","ARxxxx",1) //ensure that party got the XP only once and all the stuff is proceeded just once THEN RESPONSE #100 RemoveTraps("Traps01") ContainerEnable("Cont01",1) DisplayStringHead("Cont01",XXXXX)//You have detected a secret container! //I'm not sure whether this works with containers... whether they have any "head" (technically;))) if not, you can simulate it via invisible creature stands near this container and ActionOverride("my_invis",DisplayStringHead(myself,XYZ)) AddexperienceParty(YYY) DisplayString((),ZZZZZ)//You win YYY XP SetGlobal("ContainerStuff","ARxxxx",2) END This may work... ![]() BTW just an addition: AddexperienceParty(N) provides the displaying of "Party gains N XPs" - so dispalystring((),'Party gains N XPs') is not needed after it... -------------------- |
|
|
![]()
Post
#3
|
|
![]() Eminence Grise Machiavelic ![]() Mod Developer Posts: 244 Joined: 12-November 04 From: Monthléry ![]() |
okay, I understand,
And for the DisplayStringHead, I think I will display on "LastTrigger" instead Thanks!!! |
|
|
![]()
Post
#4
|
|
![]() Eminence Grise Machiavelic ![]() Mod Developer Posts: 244 Joined: 12-November 04 From: Monthléry ![]() |
Champagne for everybody!!!
![]() It takes me hours to fully tested and understand how it works, but now its works!!!
Attached File(s)
|
|
|
![]()
Post
#5
|
|
![]() Eminence Grise Machiavelic ![]() Mod Developer Posts: 244 Joined: 12-November 04 From: Monthléry ![]() |
By, the way, it seems that the trigger Detected () isn't triggered by the spell effect: find traps. I mean, when its Yoshimo with its class ability, it works, but when it's Jaheira with a spell, it doesn't.
|
|
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 6th June 2025 - 07:14 PM |