Page 6 of 8

Re: Tentative changelist for 2.1.19

Posted: Tue Feb 17, 2015 5:15 pm
by petri
Isaac wrote:
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. 8-)
____

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.

Re: Tentative changelist for 2.1.19

Posted: Tue Feb 17, 2015 6:45 pm
by JohnWordsworth
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.

Re: Tentative changelist for 2.1.19

Posted: Tue Feb 17, 2015 9:12 pm
by Isaac
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... :D
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.

Re: Tentative changelist for 2.1.19

Posted: Tue Feb 17, 2015 10:27 pm
by AdrTru
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?

Re: Tentative changelist for 2.1.19

Posted: Wed Feb 18, 2015 2:49 am
by Dr.Disaster
Isaac wrote:It's a shame that I cannot run the game [or any 3D game*] to have checked before posting an assumption.
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.
You can try changing the driver but from my experience it's far more likely that your Video RAM or it's soldering is giving up.

Re: Tentative changelist for 2.1.19

Posted: Wed Feb 18, 2015 10:10 am
by petri
Ok, heads up. Added the following new functionality for 2.2.3:

Code: Select all

defineObject{
	name = "party",
	baseObject = "party",
	components = {
		{
			class = "Party",
			onDrawGui = function(self, g)
				-- draw portrait of 2nd champion
				g.drawImage("$portrait2", 40, 60)
			end,
			onGetPortrait = function(self, champion)
				-- override portrait of a champion
				if champion:getOrdinal() == 3 then
			 		return "assets/textures/portraits/human_female_01.tga"
			 	end
			end,
		},
	},
}
Also, added Champion:resetExp() which resets experience and level. It is up to you to degrade stats, skills, traits, etc.

Re: Tentative changelist for 2.1.19

Posted: Wed Feb 18, 2015 12:28 pm
by JKos
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.

Re: Tentative changelist for 2.1.19

Posted: Wed Feb 18, 2015 12:40 pm
by petri
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.

Re: Tentative changelist for 2.1.19

Posted: Wed Feb 18, 2015 12:43 pm
by petri
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.

Re: Tentative changelist for 2.1.19

Posted: Wed Feb 18, 2015 12:46 pm
by JKos
Yeah, I got it right after I posted and read JohnW's comment above. So yes, it's useful, thanks.