Jump to content

Questions about my new scenario - I need help!


Recommended Posts

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

Link to post
Share on other sites
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
Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

 

 

Link to post
Share on other sites
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 ? wink

Chokboyz
Link to post
Share on other sites

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 "\".

 

Link to post
Share on other sites

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 crazy ). 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

Link to post
Share on other sites

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)?

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites
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 ! wink ).

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
Link to post
Share on other sites
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?
Link to post
Share on other sites
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.

Link to post
Share on other sites
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.
Link to post
Share on other sites
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?
Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites
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. crazy
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 smile

Chokboyz
Link to post
Share on other sites
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. crazy
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 smile

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?
Link to post
Share on other sites

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.

Link to post
Share on other sites
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 confused

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 wink

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
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...