Kyshakk Koan Mistb0rn Posted October 12, 2009 Posted October 12, 2009 I'm trying to make a sort of cutscene near the beginning of the scenario where an NPC walks up to you, says some things, then walks away. At the moment I have a string of create monster, play sound, destroy monster, repeat several times, display dialog, same thing again. In-game it only plays the sounds and shows the dialog, but the NPC doesn't show up. I also tried it with creating town encounters, but that didn't work either. Any help would be appreciated! ~Mistb0rn Quote
Understated Ur-Drakon The Almighty Doer of Stuff Posted October 12, 2009 Posted October 12, 2009 Try Move Party before each sound. It refreshes the screen. Quote
Kyshakk Koan Mistb0rn Posted October 12, 2009 Author Posted October 12, 2009 Great! It works!! Thanks, ADoS! Quote
Understated Ur-Drakon The Almighty Doer of Stuff Posted October 13, 2009 Posted October 13, 2009 No problem. Quote
Kyshakk Koan Mistb0rn Posted October 16, 2009 Author Posted October 16, 2009 Is there any problem with using flag 0,0? It seems to inexplicably reset for no apparent reason. Quote
Understated Ur-Drakon The Almighty Doer of Stuff Posted October 16, 2009 Posted October 16, 2009 Yes, don't use that flag. I think the bug's been fixed on Windows, but it may not have been on Mac. Quote
Kyshakk Koan Mistb0rn Posted October 16, 2009 Author Posted October 16, 2009 I'm on Windows, using the win32CBoE, so I'm assuming it hasn't been fixed there either. Thanks! Quote
Rotghroth Rhapsody Chokboyz Posted October 16, 2009 Posted October 16, 2009 Originally Posted By: Mistb0rn Is there any problem with using flag 0,0? It seems to inexplicably reset for no apparent reason. At what moment/after what action exactly does it seems to reset ? I don't think i've fixed this (0,0) oddity ... Chokboyz Quote
Kyshakk Koan Mistb0rn Posted October 16, 2009 Author Posted October 16, 2009 I haven't been able to pinpoint the error, but I had stopped testing once it became apparent that it was not the fault of my noding. I can try some additional tests and see if I can find out more. Quote
Well-Actually War Trall Ishad Nha Posted October 17, 2009 Posted October 17, 2009 Error may be in the scenario not the game per se. I just looked at the latest Windows source code and did not see any apparent uses of flag [0][0]. Ditto, in the Windows code from April this year. Latest Windows Scenario Editor has a specdata.txt report that prints out all specials in the game, you may find evidence of a problem there. You could try a new, small scenario and see if the problem occurs there. Quote
Understated Ur-Drakon Celtic Minstrel Posted October 17, 2009 Posted October 17, 2009 Did you check for places where the indices are a variable rather than a constant, where it's possible for the variables to both be 0? Quote
Understated Ur-Drakon The Almighty Doer of Stuff Posted October 17, 2009 Posted October 17, 2009 It's definitely a program bug and not just a corrupted or poorly-noded scenario. We've known about the bug for a long time. What causes it? I have no idea, but we know it's a program bug. Quote
Well-Actually War Trall Ishad Nha Posted October 17, 2009 Posted October 17, 2009 I used the Find in Files function, this checks all files in the project. I actually searched for "0][0", this is meant to catch any uses of the flag [0][0]. Edit: You could use the Debug functions to print out the value of this sdf regularly, to see where it happens. Quote
Well-Actually War Trall Niemand Posted October 17, 2009 Posted October 17, 2009 A better way to do this would be for someone (a developer) to run the program under the debugger with a watchpoint set on that variable. Quote
Understated Ur-Drakon Celtic Minstrel Posted October 17, 2009 Posted October 17, 2009 Originally Posted By: Ishad Nha I actually searched for "0][0", this is meant to catch any uses of the flag [0][0]. Well, there's your problem: it's probably changed with something more like "i][j" where i and j both happen to be 0. Quote
Well-Actually War Trall Ishad Nha Posted October 17, 2009 Posted October 17, 2009 In Blades of Avernum it would be so simple to track when the flag was altered, just have the Start State of the scenario script print out the value of SDF(0,0) every move. Here you could use a few scenario nodes to test for key values of this flag and print messages, then the timer runs this group of states every 10 moves. You can't print the value in a message as such. If you re-wrote the game you would be able to create a move by move printout of the flag's value. Quote
Well-Actually War Trall Niemand Posted October 17, 2009 Posted October 17, 2009 No, that way would be painful and ugly, giving a flood of information to be waded through, and simultaneously poor granularity. There's a reason modern debuggers have a feature for this exact purpose. Quote
Well-Actually War Trall Ishad Nha Posted October 17, 2009 Posted October 17, 2009 I just checked "stuff_done" in Find in Files, most of the SDFs are straight absolute numbers. But there a few with algebraic values, I will look at these, especially if their value is being set. Edit: Checking Find in Files for "PSD" I found quite a few flags where X was less than 299. There were a few algebraic ones too. Edit: Does the SDF (0,0) problem affect all scenarios or only some of them? Default value of Extra Values A,B,C,D for all dialog node types happens to be 0. So it is possible to affect flag (0,0) inadvertently, if the designer forgets to enter the intended values of A,B,C,D. Quote
Rotghroth Rhapsody Chokboyz Posted October 17, 2009 Posted October 17, 2009 Originally Posted By: Ishad Nha I just checked "stuff_done" in Find in Files, most of the SDFs are straight absolute numbers. But there a few with algebraic values, I will look at these, especially if their value is being set. Edit: Checking Find in Files for "PSD" I found quite a few flags where X was less than 299. There were a few algebraic ones too. Edit: Does the SDF (0,0) problem affect all scenarios or only some of them? Default value of Extra Values A,B,C,D for all dialog node types happens to be 0. So it is possible to affect flag (0,0) inadvertently, if the designer forgets to enter the intended values of A,B,C,D. Yup, that's one possibility ... I've already investigates the PSD/party.stuff_done accesses and apart from talking or node setting, the PSD[0][0] can also be changed by a monster life flag. So far, i've not been able to "reset" the PSD[0][0]. I'll give the debugger a try, but last time i used DevCPP's it was really funky (breakpoints ignored, watched variables not updated or locking the editor when manually asked to update, etc ) ... Originally Posted By: Mistb0rn Is there any problem with using flag 0,0? It seems to inexplicably reset for no apparent reason. By the way, when you say the PSD[0][0] "resets", i assume it takes the value 0 ? Originally Posted By: Mistb0rn I can try some additional tests and see if I can find out more. Did you find anything useful ? Chokboyz Quote
Kyshakk Koan Mistb0rn Posted October 17, 2009 Author Posted October 17, 2009 As far as I can tell, it occurs at some point during an outdoor wandering monster encounter. Leaving and reentering any number of towns or triggering unrelated nodes had no effect that I could see. Quote
Well-Actually War Trall Ishad Nha Posted October 18, 2009 Posted October 18, 2009 Every time you save the game, you can check the value of any flag if you open the save game file in a hex editor like the freeware Hexplorer. For tips how to do this, see the post: http://www.ironycentral.com/forum/ubbthreads.php?ubb=showflat&Number=27554#Post27554 With the outdoor encounters, there is not the same potential for accidentally setting flag (0,0). Here you would have to call a special which had that effect. There may be a problem in the game, I will have to examine the source code at my leisure. Edit: Using "A" and "B" rather than "x" and "y". Actual formula seems to be: offset = 10A + B + 14. Stuff Done Flags start at offset 14, there are 3,100 of them. They are of the form "unsigned char", that means that each SDF occupies one space/place in the file. Now the last 100 SDFs are used by the game for internal purposes, only the first 3,000 are actually used by scenarios. So you are looking at addresses 14 thru 3,013. 300x * 10y = 3,000. XOR: for the area of the file where the SDFs are found the relevant is hexadecimal 5C = decimal 92, this represents the backslash character "\". Quote
Rotghroth Rhapsody Chokboyz Posted October 18, 2009 Posted October 18, 2009 Ok, i've found what was causing the SDF[0][0] problem (or one of the cause but i've not encountered any "reset" since) ... The problem was that the "null monster" start structure template was giving the monster a default (0,0) life flag (even when it is correctly set to (-1,-1) in the editor ). This "null" template is used when creating some monsters : wandering (outdoor or in town) and summoning ones. So, their life flag being (0,0), everytime you killed such a monster, the SDF[0][0] was reset to 1 (i.e monster's dead). The fix will be included in the next commit (here is the fixed null_start_type = {0,0,location(80,80),1,0,0,0,-1,-1,0,0, 0,-1,-1,-1} if anyone ever needs it). Originally Posted By: Mistb0rn As far as I can tell, it occurs at some point during an outdoor wandering monster encounter. Thanks, that was a good way to start the investigation. Chokboyz Quote
Well-Actually War Trall Ishad Nha Posted October 18, 2009 Posted October 18, 2009 In the meantime don't use (0,0) for anything important. You still have that potential problem with the dialog nodes for good measure. Quote
Kyshakk Koan Mistb0rn Posted October 19, 2009 Author Posted October 19, 2009 A few new questions...I'm trying to transform terrain from one terrain to a box, which is a container, then place an item in the box - all from a conversation node. Every time I tested it, it instead transformed the terrain to the regular cave, even though I had checked the transform to on the terrain type and it was set properly. I changed the transform node to a change terrain node. That worked, but the item was placed on top of it, not inside the container. Is there any way to make it be inside the box (apart from using another three nodes on an if-then-give-item string)? Quote
Well-Actually War Trall Ishad Nha Posted October 19, 2009 Posted October 19, 2009 Contained property is set in the preset item type record, this can't be changed by any node IIRC. You have a problem that seems insurmountable. Possibly, hide the container behind a wall then make the wall disappear. Quote
Understated Ur-Drakon Celtic Minstrel Posted October 19, 2009 Posted October 19, 2009 I think you should be able to place the item in the scenario editor as a preset item, then set it as contained. That will make it inaccessible since the space is not a container, but perhaps when changing the space to a container the item will be able to be taken. If this works, you would not need the place item node. The transform terrain node changes the terrain to whatever is set as the "transform to" type on that specific terrain. Most terrains don't have a "transform to" type, and it defaults to 0: hence, the regular cave problem. It's probably better to use change terrain in this case. Quote
Kyshakk Koan Mistb0rn Posted October 19, 2009 Author Posted October 19, 2009 I set the 'transform to' of the terrain I wanted to change to the proper number for the box, and it still changed to cave. I tried putting a 'contained in something' item in the non-container terrain, but then even after I change the terrain to the box it still isn't accessible. Quote
Rotghroth Rhapsody Chokboyz Posted October 19, 2009 Posted October 19, 2009 Originally Posted By: Ishad Nha In the meantime don't use (0,0) for anything important. You still have that potential problem with the dialog nodes for good measure. What problem ? The fact that A,B,C and D are 0 by default ? Don't worry, the only way to change SDF using A,B, C or D while talking is to either use the Set Flag to 1 or Buy response, Change flag nodes (and forgetting to assign A, B or C for those is hardly a bug ! ). Originally Posted By: Mistb0rn I set the 'transform to' of the terrain I wanted to change to the proper number for the box, and it still changed to cave. I confirm this (swap also doesn't work). I'll try to take a look into it this week. Originally Posted By: Mistb0rn I tried putting a 'contained in something' item in the non-container terrain, but then even after I change the terrain to the box it still isn't accessible. I just tried Celtic Minstrel's method and it worked fine (changed/swapped/tranformed a terrain to the chest on grey blocks, terrain number 194). What terrain did you changed to ? (tested "transform terrain" while talking too) Chokboyz Quote
Understated Ur-Drakon Celtic Minstrel Posted October 19, 2009 Posted October 19, 2009 Originally Posted By: Chokboyz I just tried Celtic Minstrel's method and it worked fine (changed/swapped/tranformed a terrain to the chest on grey blocks, terrain number 194). What terrain did you changed to ? (tested "transform terrain" while talking too) So, you were able to access an item that had been placed on the non-container space and marked as contained, once the space was transformed to a container? Quote
Rotghroth Rhapsody Chokboyz Posted October 19, 2009 Posted October 19, 2009 Originally Posted By: Celtic Minstrel So, you were able to access an item that had been placed on the non-container space and marked as contained, once the space was transformed to a container? Yes i did ... Chokboyz Quote
Understated Ur-Drakon Celtic Minstrel Posted October 19, 2009 Posted October 19, 2009 We should still probably add a way to set item properties when placing an item with a node, though... but it can be low priority. Quote
Kyshakk Koan Mistb0rn Posted October 19, 2009 Author Posted October 19, 2009 Originally Posted By: Chokboyz I just tried Celtic Minstrel's method and it worked fine (changed/swapped/tranformed a terrain to the chest on grey blocks, terrain number 194). What terrain did you changed to ? (tested "transform terrain" while talking too) Huh. I guess I'll try again then. Both terrain types were custom, but I doubt that would have affected it. I have a long chain of nodes, I probably just forgot to change one of them in there somewhere. Thanks! EDIT: I found the problem, but due to the nature of the encounter it's unavoidable, so I'm going to need to go with the nodes after all. Quote
Kyshakk Koan Mistb0rn Posted October 22, 2009 Author Posted October 22, 2009 Is there something that prevents a one-time place town special encounter from being placed more than once even if there is no flag assigned to it? I can't seem to get them to place more than once. Quote
Garrulous Glaahk Cryolemon Posted October 22, 2009 Posted October 22, 2009 Wouldn't that defeat the object of it being one-time? Quote
Hatchling Cockatrice Lilith Posted October 22, 2009 Posted October 22, 2009 Originally Posted By: Mistb0rn Is there something that prevents a one-time place town special encounter from being placed more than once even if there is no flag assigned to it? I can't seem to get them to place more than once. Remember, town special encounters don't actually create monsters: they just reveal ones that are already there. If you already revealed them and killed them, they aren't there any more until the town resets. Quote
Kyshakk Koan Mistb0rn Posted October 22, 2009 Author Posted October 22, 2009 Originally Posted By: Thuryl Remember, town special encounters don't actually create monsters: they just reveal ones that are already there. If you already revealed them and killed them, they aren't there any more until the town resets. Aha! That would explain it. Is there any other way to place creatures that have a specific personalities and on-death nodes though? Quote
Understated Ur-Drakon Celtic Minstrel Posted October 23, 2009 Posted October 23, 2009 I don't believe so – not while remaining in town. If you just wanted on-death nodes, it would be possible. Quote
Rotghroth Rhapsody Thaluikhain Posted October 23, 2009 Posted October 23, 2009 Well, if you made them as new monsters with the call node when killed thing as a special ability. Quote
Well-Actually War Trall Ishad Nha Posted October 25, 2009 Posted October 25, 2009 I could add a printout for the debug function that will show the state of all SDFs, Events and whatever. The Editor already has print out report functions. Edit: It is simple enough to adapt the code from the Editor. Now I am adding entries to the party data report, starting with the SDFs. Quote
Kyshakk Koan Mistb0rn Posted October 31, 2009 Author Posted October 31, 2009 Is there any way to use a node to kill the party without them being able to block it with a life-saving item? Quote
Hatchling Cockatrice Lilith Posted October 31, 2009 Posted October 31, 2009 Kill Party -> Kill Party -> End Scenario. That way nobody survives unless they're wearing at least two life-saving items, and even if they are, they still get kicked out of the scenario. Quote
Rotghroth Rhapsody Thaluikhain Posted November 2, 2009 Posted November 2, 2009 Hmmm...to be really sure you could have: Set stuff done flag to 1 -> Kill Party -> Increment stuff done flag -> If stuff done flag is higher than 100, end scenario, otherwise go back to Kill Party Though that's a silly amount of overkill Quote
Kyshakk Koan Mistb0rn Posted November 2, 2009 Author Posted November 2, 2009 Well, I don't want to end the scenario afterward-I just want to take away all their items. Quote
Understated Ur-Drakon Celtic Minstrel Posted November 2, 2009 Posted November 2, 2009 Then replace End Scenario with a resurrect node. Quote
Kyshakk Koan Mistb0rn Posted November 2, 2009 Author Posted November 2, 2009 That's what I currently have, but I'm wondering if, since there doesn't seem to be a sure way of killing them, would putting an increment loop be overkill? It would sort of completely ruin everything if they were able to sneak their items through. Quote
Garrulous Glaahk Cryolemon Posted November 2, 2009 Posted November 2, 2009 As was mentioned, you could just do it a few times. That would make 99% certain they were all dead. Quote
Rotghroth Rhapsody Chokboyz Posted November 2, 2009 Posted November 2, 2009 Originally Posted By: Mistb0rn Is there any way to use a node to kill the party without them being able to block it with a life-saving item? Sorry for being late here ... In fact, the node "kill party" is supposed to ignore life saving items, but it seems i've forgot to put the check back when fixing the kill function. I've, of course, reverted it to the original behavior, but we can implement a kill node that allows choosing to force kill or not, if it seems revelant Chokboyz Quote
Garrulous Glaahk Cryolemon Posted November 2, 2009 Posted November 2, 2009 Originally Posted By: Chokboyz Originally Posted By: Mistb0rn Is there any way to use a node to kill the party without them being able to block it with a life-saving item? Sorry for being late here ... In fact, the node "kill party" is supposed to ignore life saving items, but it seems i've forgot to put the check back when fixing the kill function. I've, of course, reverted it to the original behavior, but we can implement a kill node that allows choosing to force kill or not, if it seems revelant Chokboyz It makes sense to have an option in the node (as an extra value say) to force kill, or allow life saving items to work. What would the default be for compatibility? Quote
Hatchling Cockatrice Lilith Posted November 2, 2009 Posted November 2, 2009 The original behaviour was that life-saving items would in fact save the party from Kill Party nodes. This has been a pain for designers for a very long time. I think the number of times you have to kill the party to be sure they won't survive if they're wearing a life-saving item in each slot is 15. Keep in mind that a chain of more than 50 special nodes is treated as an infinite loop and automatically terminated. Quote
Rotghroth Rhapsody Chokboyz Posted November 2, 2009 Posted November 2, 2009 Originally Posted By: Thuryl The original behaviour was that life-saving items would in fact save the party from Kill Party nodes. So i've not forgotten to put the check back : it wasn't here in the first place ... Which is a bit strange since there is a check that prevents luck from interfering if the party is killed via the Kill Party node Originally Posted By: Thuryl This has been a pain for designers for a very long time. Originally Posted By: Cryolemon It makes sense to have an option in the node (as an extra value say) to force kill, or allow life saving items to work. What would the default be for compatibility? I would propose keeping 0 (dead), 1 (dust) and 2 (stone) for backwards compatibility and use extra1b value 2 to force kill (0 is ressurect and 1 is kill). As always, it's open to discussion Originally Posted By: Thuryl Keep in mind that a chain of more than 50 special nodes is treated as an infinite loop and automatically terminated. The old 50 max node limit is gone, if i'm not mistaken ... Thanks, Chokboyz Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.