Registration Code (Part 1): w%kQ6
Registration Code (Part 2): b<#$1[*(cw~
In order to register on this forum, you must use the codes above. Combine them into one code (copy paste).

A Guide To Grim Dawn's Lua Engine

Topics regarding the new upcoming ARPG Grim Dawn.
Harmtouch
Posts: 2
Joined: Sun Sep 06, 2015 7:55 pm

Re: A Guide To Grim Dawn's Lua Engine

Post by Harmtouch » Mon Sep 07, 2015 8:00 am

Do you know of an easy way to give players faction? My current thinking was giving them a bonus reputation item, then giving/completing bounties through a script (I have no idea how to find the quest id numbers though), but is there a better way?
User avatar
atom0s
Site Admin
Posts: 408
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: A Guide To Grim Dawn's Lua Engine

Post by atom0s » Mon Sep 07, 2015 8:34 am

The last time I dumped the Lua state there was no exposed Lua function to give a player faction points. So not too sure about doing it in Lua. The game has updated several times since I've touched it though so it may be there now.
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
Harmtouch
Posts: 2
Joined: Sun Sep 06, 2015 7:55 pm

Re: A Guide To Grim Dawn's Lua Engine

Post by Harmtouch » Mon Sep 07, 2015 9:40 am

I just checked, and there doesn't seem to be one yet, *sadface*
Yliana
Posts: 1
Joined: Mon Dec 28, 2015 7:05 pm

Re: A Guide To Grim Dawn's Lua Engine

Post by Yliana » Fri Jan 01, 2016 9:51 am

So, like lots of people, I've been shuffling quests.gdd back and forward to repeatedly turn in the final quest and claim the free legendary - back to menu, back in, repeat etc.

I prefer this because it generates proper items unlike the 'baseline' ones through lua, so my question is as follows:

Is it possible to *uncomplete* a quest through lua? So I can simply hand in, hit the script which unflags the quest and rewinds the stage to 'ready for turn in' and repeat until I get bored?
User avatar
atom0s
Site Admin
Posts: 408
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: A Guide To Grim Dawn's Lua Engine

Post by atom0s » Fri Jan 01, 2016 1:17 pm

You can try making use of the following:
GrantQuest
CompleteQuest

These are both part of the Player table. I have not tried to do anything with the quest stuff so I'm not sure what limitations it has. I don't really touch Grim Dawn anymore since I do not find the game fun at all.
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
CocainePrincess
Posts: 2
Joined: Fri Feb 26, 2016 7:04 am

Re: A Guide To Grim Dawn's Lua Engine

Post by CocainePrincess » Sun Feb 28, 2016 9:19 am

Is there any comfortabler way of getting specific sets of entities?

Code: Select all

	for x = 0, 500000 do
	local n = Chest.Get(x);
		if(n ~= nil)then
			print(string.format("%d %s",Chest.GetId(n), Chest.GetName(n)));
		end
	end
This prints me out the pointers of all chests that have been loaded.
Which means, if I wanted to know if there was a chest in proximity, I would need to keep re-evaluating a massive amount of memory and calculate the distance for each entity located.
Of course I could optimize it by only doing the first big chunk, then using my own list until a new area, but that seems excessive to me.
There's also the issue of those objects never being destroyed, they keep populating with each new area and even if you exit to the mainmenu.

Creating new entities is easier, because I already have the object reference. eg.

Code: Select all

local createchest = Chest.Create("records/items/lootchests/a01_chestcorpse02.dbr");
local newchest_id = Chest.GetId(createchest);
Chest.SetCoords(Chest.Get(newchest_id), Game.GetLocalPlayer():GetCoords());
But I'd prefer to use already existing elements. Also, how do I check the userdata contents of the dbr files during runtime? Like reading the HP of a monster.
hotdog666
Posts: 2
Joined: Thu Mar 03, 2016 7:05 pm

Re: A Guide To Grim Dawn's Lua Engine

Post by hotdog666 » Mon Sep 12, 2016 10:20 am

Hello atomos, i come to your forum because may be you know how i can move character via lua scripts http://prntscr.com/ch8212
Image
User avatar
atom0s
Site Admin
Posts: 408
Joined: Sun Jan 04, 2015 11:23 pm
Location: 127.0.0.1
Contact:

Re: A Guide To Grim Dawn's Lua Engine

Post by atom0s » Wed Sep 14, 2016 12:03 pm

If I recall, there is no way to create a WorldVec object from Lua since the object in Lua is just a table. I'm not certain how to go about calling that without implementing some custom code to expose the games WorldVec3 object to Lua.
Derp~
Need a great web host? Check out: AnHonestHost.com


Donations can be made via Paypal:
https://www.paypal.me/atom0s
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest