Page 4 of 4

Re: Shops (now with source)

Posted: Sun Jun 23, 2013 2:00 am
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

Re: Shops (now with source)

Posted: Sun Jun 23, 2013 1:20 pm
by bongobeat
amazing things! :shock:

good job!

Re: Shops (now with source)

Posted: Sun Jun 23, 2013 8:38 pm
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.

Re: Shops (now with source)

Posted: Mon Jun 24, 2013 8:10 pm
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.

Re: Shops (now with source)

Posted: Thu Jun 27, 2013 9:43 am
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

Re: Shops (now with source)

Posted: Thu Jun 27, 2013 1:20 pm
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

Re: Shops (now with source)

Posted: Mon Jul 01, 2013 7:14 am
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

Re: Shops (now with source)

Posted: Mon Jul 01, 2013 8:36 am
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 :)

Re: Shops (now with source)

Posted: Mon Jul 01, 2013 9:53 pm
by remma
you sir, are a legend!