Is there currently a way to modify a hero's default hand position with plotscripting? (Other than making a clone hero) That would rule.
My website, the home of Motrya:
http://www.jshgaming.com
Haha! yes! Here I am :)
Well, let me see...
This feature would not be as simple as you might hope. It is not just a matter of writing some new commands to read and write data x and y values.
Hero hand positions are stored in the hero data lump. Hand positions are not stored in the RSAV file. To make them editable, they would need to be saveable state. That can be done.
One problem that is introduced by making hand positions saved is that if you set hand positions, start a new game, and then change the hand positions in custom, any old save games will not get the new changes.
If you could explain why you think this would be a useful feature, it would actually go a long way towards convincing me that it is worth spending the time to implement. (Of course the simple fact that you are asking for something that you presumably need for Motrya already makes me very favorably disposed towards doing it for you)
Well, let me see...
This feature would not be as simple as you might hope. It is not just a matter of writing some new commands to read and write data x and y values.
Hero hand positions are stored in the hero data lump. Hand positions are not stored in the RSAV file. To make them editable, they would need to be saveable state. That can be done.
One problem that is introduced by making hand positions saved is that if you set hand positions, start a new game, and then change the hand positions in custom, any old save games will not get the new changes.
If you could explain why you think this would be a useful feature, it would actually go a long way towards convincing me that it is worth spending the time to implement. (Of course the simple fact that you are asking for something that you presumably need for Motrya already makes me very favorably disposed towards doing it for you)
James Paige wrote:
Haha! yes! Here I am :)
Well, let me see...
This feature would not be as simple as you might hope. It is not just a matter of writing some new commands to read and write data x and y values.
Hero hand positions are stored in the hero data lump. Hand positions are not stored in the RSAV file. To make them editable, they would need to be saveable state. That can be done.
One problem that is introduced by making hand positions saved is that if you set hand positions, start a new game, and then change the hand positions in custom, any old save games will not get the new changes.
If you could explain why you think this would be a useful feature, it would actually go a long way towards convincing me that it is worth spending the time to implement. (Of course the simple fact that you are asking for something that you presumably need for Motrya already makes me very favorably disposed towards doing it for you)
Well, let me see...
This feature would not be as simple as you might hope. It is not just a matter of writing some new commands to read and write data x and y values.
Hero hand positions are stored in the hero data lump. Hand positions are not stored in the RSAV file. To make them editable, they would need to be saveable state. That can be done.
One problem that is introduced by making hand positions saved is that if you set hand positions, start a new game, and then change the hand positions in custom, any old save games will not get the new changes.
If you could explain why you think this would be a useful feature, it would actually go a long way towards convincing me that it is worth spending the time to implement. (Of course the simple fact that you are asking for something that you presumably need for Motrya already makes me very favorably disposed towards doing it for you)
I'm basically asking for this so I don't have to entirely clone a hero to make it possible to change his picture.
Minor problems:
- having to do stuff like reassign equipment, including manually assign the equippable items in custom
- make sure his stats, exp, etc are the same at that moment in time for the cloned hero
Major problem:
- I've relied on findhero(hero:x) for tons of scripts, and having another hero with the same name would mean I'd have to create a new function for this specific one and fix every instance in the code. It's doable, but I'm really not looking forward to it, and wanted to see if there was an engine solution first.
My website, the home of Motrya:
http://www.jshgaming.com
Although I'm not so interested in this feature, I will make a comment:
I don't think this is a problem. Practically everything else already works this way. For example, if give a hero some spell, start a new game, and decide later that the hero shouldn't have this spell, my change in custom doesn't affect the saved game. Ditto stat changes.
Basically what I'm saying is that anyone who releases his game before it is finished, and then makes changes to heroes afterwards in custom, will need to fix everyone's saved games anyways. Every time I released an update of Tales 1 I had to take saved games and have an NPC to update all of the characters in game. (This was not fun then; it might be easier now, I'm not sure - the problem was that we did not have a ps-function to write a hero's 'starting' level)
I am Srime
Quote:
One problem that is introduced by making hand positions saved is that if you set hand positions, start a new game, and then change the hand positions in custom, any old save games will not get the new changes.
I don't think this is a problem. Practically everything else already works this way. For example, if give a hero some spell, start a new game, and decide later that the hero shouldn't have this spell, my change in custom doesn't affect the saved game. Ditto stat changes.
Basically what I'm saying is that anyone who releases his game before it is finished, and then makes changes to heroes afterwards in custom, will need to fix everyone's saved games anyways. Every time I released an update of Tales 1 I had to take saved games and have an NPC to update all of the characters in game. (This was not fun then; it might be easier now, I'm not sure - the problem was that we did not have a ps-function to write a hero's 'starting' level)
I am Srime
msw188 wrote:
I don't think this is a problem. Practically everything else already works this way. For example, if give a hero some spell, start a new game, and decide later that the hero shouldn't have this spell, my change in custom doesn't affect the saved game. Ditto stat changes.
Yeah. That fact bothers me, especially that heros in saves don't get changes to spell lists.
But I guess you are right. Everybody is used to it, and it only matters for game demos, and has no consequence for finished released games.
I would like a general solution to that problem, and I would like to think about how it should work now, although it can be implemented a s a separate step from implementing the hand-position-saving feature.
This is actually closely related to the issue of saving NPC locations in save games. For that purpose, I plan to add an internal edit-counter for each NPC instance. You won't see this in custom because it will happen behind the scenes, but each time you change the placement of an NPC in the map editor, an edit-count number will be incremented for that NPC slot. The edit-count number will be saved in the RSAV file, so when an NPC is moved or changed in custom, old saved games will know that they need to discard old saved NPCs when loading.
The same solution could work for spell lists, hand positions, and anything else that gets stored in RSAV files.
One nice thing about that plan is that although it is a general solution, I can implement it little bit at a time, so it will be easier.
James Paige wrote:
I would like a general solution to that problem, and I would like to think about how it should work now, although it can be implemented a s a separate step from implementing the hand-position-saving feature.
How about a plotscripting command, "reset hero spell list(who, which)"?
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Mogri wrote:
How about a plotscripting command, "reset hero spell list(who, which)"?
James Paige wrote:
I would like a general solution to that problem, and I would like to think about how it should work now, although it can be implemented a s a separate step from implementing the hand-position-saving feature.
How about a plotscripting command, "reset hero spell list(who, which)"?
Well, that seems like a different thing to me-- but it also sounds like a good thing :)
I don't know, this seems a bit backwards. I mean, in my opinion, the general problem is unsolvable. Custom and Game have no way of knowing whether or not the save file or the rpg file should take precedence. Imagine the following scenario:
NPC is in position A in custom
NPC is moved to position B during game
author changes NPC to position C in custom
Now should game put the NPC in position B or C? Game won't know whether or not the movement to position B was more important than the starting position C. The same situation can be easily crafted for hero spell lists, or hero stats, or any number of things. I don't think game should automatically override its own sav files. I think it's better to simply have (tons) of commands like Moogle is describing: essentially 'reset to default' commands for all things that are stored in RSAV.
Perhaps it would be better to have variables in RSAV that keep track of whether or not something has been changed from its default. Then you could have a giant for loop in your scripts:
I am Srime
NPC is in position A in custom
NPC is moved to position B during game
author changes NPC to position C in custom
Now should game put the NPC in position B or C? Game won't know whether or not the movement to position B was more important than the starting position C. The same situation can be easily crafted for hero spell lists, or hero stats, or any number of things. I don't think game should automatically override its own sav files. I think it's better to simply have (tons) of commands like Moogle is describing: essentially 'reset to default' commands for all things that are stored in RSAV.
Perhaps it would be better to have variables in RSAV that keep track of whether or not something has been changed from its default. Then you could have a giant for loop in your scripts:
Code:
for(all things in RSAV)
if(the variable indicates the thing has NOT been altered within the game),
(reset to default) #which may have been altered in custom
else
(leave it alone)
for(all things in RSAV)
if(the variable indicates the thing has NOT been altered within the game),
(reset to default) #which may have been altered in custom
else
(leave it alone)
I am Srime
My plan does work under the assumption that changes to an NPC's position that are made in custom should take priority over changes that have been saved in RSAV. I think this is reasonable. If you need the NPC to be at a script-specified location, then you do it in the autorun script, and it doesn't really matter what either the RSAV location or the custom location is.
I suppose it would be possible to add the ability to decide whether custom location or RSAV location takes priority on an NPC-by-NPC basis, but I would need a good example of a game that would require this to convince me that it is worth the extra work.
The main point of saving NPCs in save games is to make NPC location saving easy for people who are not using scripts at all, so a command to get the custom-specified location of an NPC is not a good workaround with that purpose in mind (Although there will DEFINITELY be a scripting command to get the custom-specified location of an NPC, so hopefully everybody will be happy)
I suppose it would be possible to add the ability to decide whether custom location or RSAV location takes priority on an NPC-by-NPC basis, but I would need a good example of a game that would require this to convince me that it is worth the extra work.
The main point of saving NPCs in save games is to make NPC location saving easy for people who are not using scripts at all, so a command to get the custom-specified location of an NPC is not a good workaround with that purpose in mind (Although there will DEFINITELY be a scripting command to get the custom-specified location of an NPC, so hopefully everybody will be happy)
Time for a dissenting opinion: hand positions should never have been stored in the hero data in the first place. I assume that you want to change the hand positions because you want to change the hero graphics, as I can think of no other reason. Hand positions really should be stored on the hero sprite sets themselves.
It's probably easier to add some script commands to modify hand positions than to move the data, because the later requires an editor in Custom. But that's moot because James has already nearly finished with the script commands.
Of course there are other bits of data that are misplaced in the same way. Fixing the problem "properly" is by no means impossible in the future; default palettes for example worked out really well. If we can be bothered now that there's a quick fix.
As for merging saved games and modified games, that's something I'm quite interested in attempting as well, especially more radical merging for the Test Game mode, such as modifying hero stats when the level 0/99 values change. But in general if something has been modified in Custom, but not in the saved game, I think the saved game should be updated. We just need ways of detecting that. NPCs are a bit of an exception because they typically move around, without concidence, so I agree with James that edits in Custom should take precedence.
There would probably also be options to modify that behaviour.
It's probably easier to add some script commands to modify hand positions than to move the data, because the later requires an editor in Custom. But that's moot because James has already nearly finished with the script commands.
Of course there are other bits of data that are misplaced in the same way. Fixing the problem "properly" is by no means impossible in the future; default palettes for example worked out really well. If we can be bothered now that there's a quick fix.
As for merging saved games and modified games, that's something I'm quite interested in attempting as well, especially more radical merging for the Test Game mode, such as modifying hero stats when the level 0/99 values change. But in general if something has been modified in Custom, but not in the saved game, I think the saved game should be updated. We just need ways of detecting that. NPCs are a bit of an exception because they typically move around, without concidence, so I agree with James that edits in Custom should take precedence.
There would probably also be options to modify that behaviour.



