Tentative changelist for 2.1.19

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!
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Tentative changelist for 2.1.19

Post 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.
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Tentative changelist for 2.1.19

Post 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.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Isaac
Posts: 3191
Joined: Fri Mar 02, 2012 10:02 pm

Re: Tentative changelist for 2.1.19

Post 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.
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: Tentative changelist for 2.1.19

Post 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?
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Tentative changelist for 2.1.19

Post 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.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Tentative changelist for 2.1.19

Post 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.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Tentative changelist for 2.1.19

Post 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.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Tentative changelist for 2.1.19

Post 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.
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Tentative changelist for 2.1.19

Post 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.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Tentative changelist for 2.1.19

Post by JKos »

Yeah, I got it right after I posted and read JohnW's comment above. So yes, it's useful, thanks.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
Post Reply