virtual Money [Script]

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

virtual Money [Script]

Post by AdrTru »

Hi all,
I prepare script for managing virtual money with gui.
http://www.nexusmods.com/legendofgrimrock2/mods/39/?
Image

This script manages conversions between currency,
Get/Set money by mouse (if this currency are connected to item)
Scripting managing like Set,Sell,Pay
Last edited by AdrTru on Wed Apr 15, 2015 11:16 pm, edited 1 time in total.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: virtual Money

Post by Drakkan »

added to my mod, working fine. thanks for your work !
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
darwingregory
Posts: 1
Joined: Thu Apr 23, 2015 5:20 am
Contact:

Re: virtual Money [Script]

Post by darwingregory »

I already add it too and works well. Thanks for sharing your work ;)







_______________________
Genius will live and thrive without training, but it does not the less reward the watering-pot and butterfly knives
Last edited by darwingregory on Fri Apr 24, 2015 4:20 am, edited 1 time in total.
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: virtual Money [Script]

Post by AdrTru »

Thank you for feedback. I was afraid it does not work and moder's throw it away. :)

Now I am still working on viewtopic.php?f=22&t=9128&start=40#p91817.
This script will be provided complete managing alcove/altair crafting ( test for droped items, compare it with recipes, use recipes for destroying/creating items).
Some posibility for this crafting will be using pay/sell argument for "shoping recipes" working with this money script.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: virtual Money [Script]

Post by Drakkan »

count mods in development around (about 10 lets say)
count how many of them is using coins (about 3-4 at max I suppose)
well... thats the result :)
Breath from the unpromising waters.
Eye of the Atlantis
TheAdder
Posts: 26
Joined: Sat Mar 28, 2015 4:56 pm

Re: virtual Money [Script]

Post by TheAdder »

Can you please tell me how to make this work, as I follow the instructions in the documentation pdf and no gui appears in game.
The last line of the installation in the documentation is unreadable english, so I suspect there's something I can't understand. It says something about party and onDrawGui but gives no indication of what this means or how to do it. I would need detailed instructions about which file to open, what to edit, etc, not just a single line saying "do a thing" :/

I suspect that the onDrawGui hook is set up anyway by the script itself as there is an addConnector line in the source code for the money lua script.

I've put the money directory into mod_assets, created a script entity in my game and linked it to the external script as instructed, but nothing appears in game. No crash, though!

Help!
User avatar
Eleven Warrior
Posts: 752
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: virtual Money [Script]

Post by Eleven Warrior »

@ TheAdder Hi man. Look, Truhlík and myself wil try to help you out on this problem ok :) We are going to redefine this and make it better and hopefully include a dungeon editor to explain how it works ok
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: virtual Money [Script]

Post by AdrTru »

TheAdder wrote:Can you please tell me how to make this work, as I follow the instructions in the documentation pdf and no gui appears in game.
The last line of the installation in the documentation is unreadable english, so I suspect there's something I can't understand. It says something about party and onDrawGui but gives no indication of what this means or how to do it. I would need detailed instructions about which file to open, what to edit, etc, not just a single line saying "do a thing" :/

I suspect that the onDrawGui hook is set up anyway by the script itself as there is an addConnector line in the source code for the money lua script.

I've put the money directory into mod_assets, created a script entity in my game and linked it to the external script as instructed, but nothing appears in game. No crash, though!

Help!
Hi,
so sorry for my unreadable english.

Party hooks are events for reaction on special game situations eg. onDie, onMove, .... and onDrawGui for its special scripting.
Take file ini.lua from mod_assets/script and put to end of this file this code:

Code: Select all

defineObject{
   name = "party",
   baseObject = "party",
   components = 
   {
   		{
			class = "Party",  
			onDrawGui = function(party,g)
			end
		}
	}
}
Check for your script entity name is Money, and check if this script entity is on first floor.

In dungeon editor are visible coins only if you have view in fullscreen mode - key F

Coins are visible only if you have some ballance ( starting ballance is 0 )
For testing you may write setMoney(155,"copper") to the end of file Money.lua

Its all what I found as problems in new instalation.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
TheAdder
Posts: 26
Joined: Sat Mar 28, 2015 4:56 pm

Re: virtual Money [Script]

Post by TheAdder »

Thank you very much :) I haven't had a chance to check this out yet, but will do so when I get a moment and report back. I actually have a party hook already defined in one of my other experimental dungeons and copied it over but it didn't seem to make any difference, so I don't know if your code is different from what I had without looking. Perhaps something from another mod asset is interfering or redefining the party after I've already done it. That would be my guess.

Edit: I've just noticed the bit about naming my script Money and putting it on the first floor. Neither of these things are in the docs, so that's very probably it. Yay!

This is a really cool money script, as I've seen in Eye of the Atlantis. I don't really know why RPGs don't award money more often, even just as a "I ended up with more money than you" scoring system between friends playing the same game. Even if there's nowhere to spend it, it could essentially be a score if all monsters dropped cash :)

By the way, your English is fine - it's just frustrating when everything makes sense until you come to one line which suddenly doesn't seem to. I'm quite enjoying watching YouTube videos of people bursting into fits of laughter at every tiny spelling mistake in every mod for every game. I'm not quite there yet :)
TheAdder
Posts: 26
Joined: Sat Mar 28, 2015 4:56 pm

Re: virtual Money [Script]

Post by TheAdder »

Awesome - it seems to be working. Mostly :)

The interface appears, but when I click any of the coins in the wallet, nothing happens - nothing gets put in the mouse cursor. How do I make this happen, or do you think another mod asset is stopping this working? In particular, I'm experimenting with the source editor code for the Magic of Grimrock mod, adding money to that for the purposes of testing in an existing large scale game. I've had to move the interface up the screen so that it doesn't overlay the quick bars added by Magic of Grimrock.

Secondly, how do I actually add coins into the game for the player to pick up? There seems to be no new objects I can find in the editor objects pane, but then I don't know what I'm looking for!

Thanks in advance.
Post Reply