Special Item in a box
Author | Topic: Special Item in a box |
---|---|
Law Bringer
Member # 2984
|
written Thursday, April 12 2007 20:48
Profile
Homepage
On searching a container, the player should receive a special item (via a town state). Obviously, the walk-on special areas won't cut it for this. So instead, I used a terrain script with a SEARCH_STATE that called the relevant town state. The terrain script was placed on the container, and memory cell #0 was set to 16. Town state 16 is this: Searching the box reveals the mundane items inside it. No other output is given - neither the short debug message nor the dialog that announces the discovery of the key. It appears the state isn't being called... [ Thursday, April 12, 2007 20:49: Message edited by: Dr. Johann Georg Faust ] -------------------- Encyclopaedia Ermariana • Forum Archives • Forum Statistics • RSS [Topic / Forum] My Blog • Polaris • I eat novels for breakfast. Polaris is dead, long live Polaris. Look on my works, ye mighty, and despair. Posts: 8752 | Registered: Wednesday, May 14 2003 07:00 |
Law Bringer
Member # 4153
|
written Thursday, April 12 2007 22:37
Profile
Homepage
Okay, first problem is that you have two break; calls in that state. The first one should be end(); instead. Also, you can use the terrain script specobj.txt (which can be found in most scenario folders) instead of the one you made. It's slightly more efficient... but the main difference is that instead of using the variable callthis, it just says run_town_script(get_memory_cell(0)); which is much easier. -------------------- Gamble with Gaea, and she eats your dice. I hate undead. I really, really, really, really hate undead. With a passion. Posts: 4130 | Registered: Friday, March 26 2004 08:00 |
Law Bringer
Member # 2984
|
written Friday, April 13 2007 03:36
Profile
Homepage
Um, call this an undocumented feature, but the pattern has worked so far. -------------------- Encyclopaedia Ermariana • Forum Archives • Forum Statistics • RSS [Topic / Forum] My Blog • Polaris • I eat novels for breakfast. Polaris is dead, long live Polaris. Look on my works, ye mighty, and despair. Posts: 8752 | Registered: Wednesday, May 14 2003 07:00 |
Infiltrator
Member # 5576
|
written Friday, April 13 2007 03:55
Profile
Homepage
I'm surprised to learn that that does work, but that is what the end() call is supposed to be used for. It shouldn't make any difference that I can see which you use then, based on what the documentation says, but I'm going to stick with end; I'm still wary that using break might have some odd side effect. (After all, so many things in Avernumscript seem to.) -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
...b10010b...
Member # 869
|
written Friday, April 13 2007 13:44
Profile
Homepage
Kelandon had a problem in Exodus with searching containers not calling scripts when they should have. I forget how he solved it, but talk to him about it. -------------------- The Empire Always Loses: This Time For Sure! Posts: 9973 | Registered: Saturday, March 30 2002 08:00 |
Off With Their Heads
Member # 4045
|
written Friday, April 13 2007 14:20
Profile
Homepage
Well, of course, the energy levels are... no, wait, sorry, just finished doing Thermo homework. :P The problem in Exodus was a very simple mistake in my modification of trap.txt, probably not relevant here. I don't know why you're messing with the callthis variable. Why not just use a standard specobj or my modification, Search-Block (dummy.txt in Exodus)? Nothing in the information that you've given us — other than the weird break — would lead to a problem, as far as I can see. It must be something more elaborate. If you zip the scenario and send it to me today, I'll take a look at it. -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
Law Bringer
Member # 2984
|
written Saturday, April 14 2007 00:27
Profile
Homepage
Well, I switched to specobj, and fixed the if-clause in that state, and now it works. I don't know which it was, but under the circumstances (one day to go till the deadline) I don't feel very curious. :P Thanks all! -------------------- Encyclopaedia Ermariana • Forum Archives • Forum Statistics • RSS [Topic / Forum] My Blog • Polaris • I eat novels for breakfast. Polaris is dead, long live Polaris. Look on my works, ye mighty, and despair. Posts: 8752 | Registered: Wednesday, May 14 2003 07:00 |