drake127 Posted February 2, 2007 Share Posted February 2, 2007 http://forums.gibberlings3.net/index.php?s...7902#entry77902 You may be interested in second part of my post. Link to comment
Avenger Posted February 2, 2007 Share Posted February 2, 2007 In my opinion, at OnCreation area variables don't yet exist. I already mentioned something like this a while ago. Link to comment
Nythrun Posted February 2, 2007 Share Posted February 2, 2007 Well, only the first time OnCreation() returns true. Any subsequent times, area variables do exist and work normally Link to comment
drake127 Posted February 2, 2007 Author Share Posted February 2, 2007 In my opinion, at OnCreation area variables don't yet exist. I already mentioned something like this a while ago. I've read that thread however behavior of that bug is pretty straightforward. I can test it little further if you think it is necessary. Link to comment
drake127 Posted February 2, 2007 Author Share Posted February 2, 2007 I created this script and placed it in _blank_ ar0602.bcs: IF OnCreation() THEN RESPONSE #100 DisplayString(Player1,5003) // Power Word Sleep Continue() END IF OnCreation() Global("AreaTest","AR0602",0) THEN RESPONSE #100 DisplayString(Player1,7778) // Power Word Silence SetGlobal("AreaTest","AR0602",1) Continue() END IF OnCreation() Global("LocalTest","LOCALS",0) THEN RESPONSE #100 DisplayString(Player1,7783) // Power Word Blind SetGlobal("LocalTest","LOCALS",1) Continue() END IF OnCreation() Global("GlobalTest","GLOBAL",0) THEN RESPONSE #100 DisplayString(Player1,22142) // Power Word, Kill SetGlobal("GlobalTest","GLOBAL",1) // ##### Notice missing Continue()! ##### END IF OnCreation() THEN RESPONSE #100 DisplayString(Player1,22143) // Power Word, Stun END Upon creating the game Sleep, Silence, Kill words shown up. Upon saving and loading game only Sleep, Stun word shown up. After leaving and reentering area only Sleep, Stun word shown up. "LOCALS" scope does not work with areas properly (I've never seen "LOCALS" used in area scripts so why to bother?). OnCreation evaluates true every first and only first script loop (this is both necessary and sufficient condition). Link to comment
devSin Posted February 2, 2007 Share Posted February 2, 2007 In my opinion, at OnCreation area variables don't yet exist. I already mentioned something like this a while ago.I may be misunderstanding you, but I don't think this is correct. You can check a variable in an OnCreation() block; it should do the right thing (i.e., not repeat). Most of the behavior should be common sense. OnCreation() returns true when the resource is loaded (since this is when the script first fires). The only thing I don't know is if resting restarts parsing (I don't think it does, but I don't know). LOCALS can only be used with creatures. If you use it with any other object type, it will always return false. Link to comment
Avenger Posted February 2, 2007 Share Posted February 2, 2007 Yes, you are right. MYAREA works though, LOCALS truly doesn't work. Now i just have to cut it out of GemRB because it breaks compatibility with Glory of Istar. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.