Page 2 of 2

Re: A Guide To Grim Dawn's Lua Engine

Posted: Mon Sep 07, 2015 8:00 am
by Harmtouch
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?

Re: A Guide To Grim Dawn's Lua Engine

Posted: Mon Sep 07, 2015 8:34 am
by atom0s
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.

Re: A Guide To Grim Dawn's Lua Engine

Posted: Mon Sep 07, 2015 9:40 am
by Harmtouch
I just checked, and there doesn't seem to be one yet, *sadface*

Re: A Guide To Grim Dawn's Lua Engine

Posted: Fri Jan 01, 2016 9:51 am
by Yliana
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?

Re: A Guide To Grim Dawn's Lua Engine

Posted: Fri Jan 01, 2016 1:17 pm
by atom0s
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.

Re: A Guide To Grim Dawn's Lua Engine

Posted: Sun Feb 28, 2016 9:19 am
by CocainePrincess
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.

Re: A Guide To Grim Dawn's Lua Engine

Posted: Mon Sep 12, 2016 10:20 am
by hotdog666
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

Re: A Guide To Grim Dawn's Lua Engine

Posted: Wed Sep 14, 2016 12:03 pm
by atom0s
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.