Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
petri wrote:Champion:getPortrait() is imposible to add in general case. Remember the portraits can be imported, so portrait data is stored in the save games. Otherwise save games couldn't be transferred between computers.
Meaning transfered between PC/MAC/Linux/IOS? That is pretty cool; Fallout was like that. The PC & Mac games loaded via floppy on either OS from either OS; pretty sharp feature considering the endian differences between x86 and PPC.
____
Is it possible to define them as materials at load? Doesn't the game fall back to the default portraits if the custom ones are not present when the save is loaded?
The only reason that users want this feature is to be able to restore the original portraits after a change; (including after changing a PC to a different one, and wanting to change it back).
**Obviously none of us know the technical impediments involved; but it would be a cool feature if it could be managed.
No I meant that the portraits are always embedded in save games. The moment you set portrait for a champion, the portrait is loaded and the portrait file is no longer needed for anything.
I think there are only 2 things that I would love to do with portraits...
1. Temporarily override a portrait for a champion (with an ability to revert to the original).
2. Use the portrait in the GUI system to draw it on the dialogue system.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
petri wrote:No I meant that the portraits are always embedded in save games. The moment you set portrait for a champion, the portrait is loaded and the portrait file is no longer needed for anything.
Aha...
So it does not resort to default portraits; (that's even cooler). It's a shame that I cannot run the game [or any 3D game*] to have checked before posting an assumption.
So [part of] the problem is that if we change the portrait, and save the game, the original custom image is lost /replaced in the saved game.
SpoilerShow
* "Pink screen of death"
It's an Nvidia driver issue. I think I am going to have to revert to an earlier driver version.
I have one new issue with spawned items in surface.
Items are spawned in one point. Is it possible to spawn object randomly on surface plane? Or make function for reorganize surfaced objects?
Champion:resetExp() - That's awesome.
g.drawImage("$portrait2", 40, 60) - Great. Thanks a lot.
party.onGetPortrait - To be honest, I don't really get how this should help us? We already have Champion:setPortrait(fileName) so we can change the portrait, no need to override it.
party.onSetPortrait(champion,fileName) - would have been more useful, so we could save the file name to some variable for later access. BUT ONLY IF it gets called on party generation screen also.
Anyway, thank you again, you guys are the best game devs ever. resetExp() and drawing a portrait are really useful features. And
we can live without the access to the original portrait file name, which is really only needed if we want to replace the champion with another and store the replaced champion for later use.
JKos wrote:party.onGetPortrait - To be honest, I don't really get how this should help us?
The point of this hook is that you can dynamically change the portrait and easily revert to the default portrait by simply returning nil. This is a workaround for the lack of getPortrait() method which can't be implemented.
JKos wrote:party.onSetPortrait(champion,fileName) - would have been more useful, so we could save the file name to some variable for later access.
This has the same problem as Champion:getPortait() -- the filenames of portraits are generally not usable for anything because the files may not exist in the file system at all.