Shops (now with source)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: Shops (now with source)

Post by LordGarth »

Still cant get shop framework to work with the sky framework.

If you want to send me the file you can upload it to the nexus I guess.


Thx,

LordGarth
Dungeon Master and DOOM will live forever.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Shops (now with source)

Post by bongobeat »

amazing things! :shock:

good job!
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Ulfsark
Posts: 18
Joined: Sun May 05, 2013 5:52 pm

Re: Shops (now with source)

Post by Ulfsark »

LordGarth wrote:Still cant get shop framework to work with the sky framework.

If you want to send me the file you can upload it to the nexus I guess.


Thx,

LordGarth
Hmm. I am not using the sky framework though so not sure if it would actually help out much :/ I can still upload it if you like however.
User avatar
LordGarth
Posts: 500
Joined: Mon Jun 18, 2012 5:07 pm
Location: Colorado USA

Re: Shops (now with source)

Post by LordGarth »

There are no shops yet in my demo game because a duplicate rain particle hit a black phantasm and he got mad and ate the shop keeper.

Coding joke. :lol:

function openshop
false
else
false

no return

end.
hahahahahahahhahahahahah :lol:


LordGarth

P.S.
I hope the flooded dungeon and mahric's npc code works with skyscript framework.
Dungeon Master and DOOM will live forever.
User avatar
remma
Posts: 36
Joined: Mon Apr 15, 2013 11:03 pm
Location: Newcastle upon Tyne, England

Re: Shops (now with source)

Post by remma »

there seems to a be bug in the released code, I'm not sure where but downloading the release code and implementing it in a dungeon - it doesn't seem to initialise properly and throws errors when trying to create a letter of credit, also just straight up drops out to editor when you try to open the shop

However if you take the demo dungeon and copy the files from there instead it works...and is wonderful!

Now all I need to do is to get it to play nice with my other scripts /grab_coffee


So I've got it to work with logfw woot!

leave the clone party code out of your init file instead create a script entity somewhere and place in the following code:

Code: Select all

function autoexec()

fw.addHooks('party', 'shop_init', {
	onDrawGui = function(g)
	 	return gui.onDrawGui(g)
	end,

	onMove = function(self)
		if (gui.globalVars["shopOn"]) then
			return false
		else
			return true
		end
	end,

	
})
fw.debugPrint("shop is activated")
end
works like a charm

The downside.... the guiondraw portion doesn't work if you have grimwidgets enabled so the whole thing breaks, bit of a bummer
User avatar
remma
Posts: 36
Joined: Mon Apr 15, 2013 11:03 pm
Location: Newcastle upon Tyne, England

Re: Shops (now with source)

Post by remma »

and fixed the issue with grimwidgets :)

go into your grimwidgets folder and open the file grimwidgets.lua

in the clone party section change

Code: Select all

	onDrawGui = function(g)
	   gw._drawGUI(g)
	end, 
to

Code: Select all

	onDrawGui = function(g)
	   gw._drawGUI(g)
	   return gui.onDrawGui(g)
	end, 
then save


for the autoexec earlier you don't need the onDrawGui bit so change it to

Code: Select all

function autoexec()

fw.addHooks('party', 'shop_init', {

	onMove = function(self)
		if (gui.globalVars["shopOn"]) then
			return false
		else
			return true
		end
	end,

	
})
fw.debugPrint("shop is activated")
end
User avatar
remma
Posts: 36
Joined: Mon Apr 15, 2013 11:03 pm
Location: Newcastle upon Tyne, England

Re: Shops (now with source)

Post by remma »

I think there's a bug in the script, if you compile the test dungeon and run it then try to save you will crash to desktop with a serialisation error.
troubleshooting comment out the lines in the script entity thus:

Code: Select all

function initLetter()
	--gui.createLetter(1,15,17)
	--gui.changeMoney(2000) -- initial amount of money
end
no crash on save

but if you try to open the shop then you get another crash to desktop with no errors but the error log reflects '#gui:328: attempt to index field 'letterCredit' (a nil value) stack traceback: #gui:328: in function 'getMoney''

likely due to the global variable calling an item
alois
Posts: 112
Joined: Mon Feb 18, 2013 7:29 am

Re: Shops (now with source)

Post by alois »

remma wrote:I think there's a bug in the script, if you compile the test dungeon and run it then try to save you will crash to desktop with a serialisation error.
troubleshooting comment out the lines in the script entity thus:

Code: Select all

function initLetter()
	--gui.createLetter(1,15,17)
	--gui.changeMoney(2000) -- initial amount of money
end
no crash on save

but if you try to open the shop then you get another crash to desktop with no errors but the error log reflects '#gui:328: attempt to index field 'letterCredit' (a nil value) stack traceback: #gui:328: in function 'getMoney''

likely due to the global variable calling an item
Yes, that's it; it looks for the 'letter of credit' and cannot find it... If I have time, I'll try to correct the bug (I should be able to do that in a couple of days) :)

alois :)
User avatar
remma
Posts: 36
Joined: Mon Apr 15, 2013 11:03 pm
Location: Newcastle upon Tyne, England

Re: Shops (now with source)

Post by remma »

you sir, are a legend!
Post Reply