MultiAlcoveManager

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
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: MultiAlcoveManager

Post by THOM »

You can take the stuff and you can put it back. Concerning the weapon-only-racks there is the restriction that some weapon just fit on certain places.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: MultiAlcoveManager

Post by AdrTru »

TheStoryteller01 wrote:This looks amazing.

Is it actually possible to take stuff from the racks or is this just for the looks?
Normal situation is free manipulation with items like another alcove object. But is possible to set variable with script in object ( canRemove = false) for disabling to take item from rack.
That means you may have some rack as decoration and some as standard alcove.
This correctly working in last version - v1.1
THOM wrote:You can take the stuff and you can put it back. Concerning the weapon-only-racks there is the restriction that some weapon just fit on certain places.
Yes this positions of object in rack is stricly defined for each item( group of items if they have simmilar root position and type ) separately. But this system is open and it is possible to add new positions for custom items if it need.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: MultiAlcoveManager

Post by AdrTru »

I published version 1.5 of this mod.

There is massive bugfix for savevariables.
there is added short documentation

When you use older version of MAM is it neccessary to remove old rack from dung and put new ones after reloading dung with new scrips.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: MultiAlcoveManager

Post by Duncan1246 »

AdrTru wrote:I published version 1.5 of this mod....
Hi AdrTru,
I use several multialcoves manager in my mod. Each time, the same issue occurs: when I have one elevation above or under the racks, party can't move if in front of the rack in the dir of the rack... I think perhaps it's because of this part of code:
SpoilerShow

Code: Select all

function onMoveThru(dir)
	local dx, dy = getForward(dir)
	local tile = party.map:entitiesAt(party.x, party.y)
    for ent in tile do
		if ent.mamdata ~= nil and ent.mamdata.getCanMoveThru() ~= nil and MAM_Racks[ent.id] ~= nil then
			local canMoveThru = MAM_Racks[ent.id].canMoveThru or MAM_onMoveThru or false
			if (canMoveThru == false) and (ent.facing == dir) then return false end
		end
	end
	local tile = party.map:entitiesAt(party.x + dx, party.y + dy)
	for ent in tile do
		if ent.mamdata ~= nil and MAM_Racks[ent.id] ~= nil then
			if (MAM_Racks[ent.id].canMoveThru == false) and (ent.facing == (dir + 2) % 4) then return false end
		end
	end

	return true
end

... but rather to attempt to change it by myself, what do you suggest (except to don't use it in multielevations map :mrgreen: )?
Duncan
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: MultiAlcoveManager

Post by AdrTru »

Oki, thank you for report.

There is changed function for respected Elevation.
SpoilerShow

Code: Select all

function onMoveThru(dir)
   local dx, dy = getForward(dir)
   local tile = party.map:entitiesAt(party.x, party.y)
    for ent in tile do
      if ent.mamdata ~= nil and ent.mamdata.getCanMoveThru() ~= nil and MAM_Racks[ent.id] ~= nil then
         local canMoveThru = MAM_Racks[ent.id].canMoveThru or MAM_onMoveThru or false
         if (canMoveThru == false) and (ent.facing == dir) and (ent:getElevation() == party:getElevation()) then return false end
      end
   end
   local tile = party.map:entitiesAt(party.x + dx, party.y + dy)
   for ent in tile do
      if ent.mamdata ~= nil and MAM_Racks[ent.id] ~= nil then
         if (MAM_Racks[ent.id].canMoveThru == false) and (ent.facing == (dir + 2) % 4) and (ent:getElevation() == party:getElevation()) then return false end
      end
   end

   return true
end
But for OOR3 project I changed MAM like Pedestal ( there isnt need this function )
I will create new mod version for nexus site asap.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: MultiAlcoveManager

Post by Duncan1246 »

AdrTru wrote:Oki, thank you for report.

There is changed function for respected Elevation.
SpoilerShow

Code: Select all

function onMoveThru(dir)
   local dx, dy = getForward(dir)
   local tile = party.map:entitiesAt(party.x, party.y)
    for ent in tile do
      if ent.mamdata ~= nil and ent.mamdata.getCanMoveThru() ~= nil and MAM_Racks[ent.id] ~= nil then
         local canMoveThru = MAM_Racks[ent.id].canMoveThru or MAM_onMoveThru or false
         if (canMoveThru == false) and (ent.facing == dir) and (ent:getElevation() == party:getElevation()) then return false end
      end
   end
   local tile = party.map:entitiesAt(party.x + dx, party.y + dy)
   for ent in tile do
      if ent.mamdata ~= nil and MAM_Racks[ent.id] ~= nil then
         if (MAM_Racks[ent.id].canMoveThru == false) and (ent.facing == (dir + 2) % 4) and (ent:getElevation() == party:getElevation()) then return false end
      end
   end

   return true
end
But for OOR3 project I changed MAM like Pedestal ( there isnt need this function )
I will create new mod version for nexus site asap.
Thanks a lot! I have tested it just now and it works fine. I don't use your asset in ORR3, only in the mod I am working on.
Duncan
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: MultiAlcoveManager

Post by AdrTru »

In Nexus is new version MAM.

- mod now worked without need fw hook.
- keep compatibility with object in dung ( read readme.txt for instalation )
- add hook for hanging shields on wall
- racks are redefined lke pedestal for manipulating items from both sides
- fix for bug on moving thru rack in different elevations ( as pedestal )
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
Duncan1246
Posts: 404
Joined: Mon Jan 19, 2015 7:42 pm

Re: MultiAlcoveManager

Post by Duncan1246 »

AdrTru wrote:In Nexus is new version MAM.

- mod now worked without need fw hook.
- keep compatibility with object in dung ( read readme.txt for instalation )
- add hook for hanging shields on wall
- racks are redefined lke pedestal for manipulating items from both sides
- fix for bug on moving thru rack in different elevations ( as pedestal )
Hi AdrTru,
I tried to install the new version, but some issue happens: armours and weapons don't take theirs positions on the racks (except on the ledge) even on new racks. I have suppressed the script "mam" in the dungeon, following the "readme" but perhaps it's necessary to recreate it? For the moment I reinstall the precedent version ...
The Blue Monastery (LOG1)
download at:http://www.nexusmods.com/grimrock/mods/399/?

Finisterrae(LOG2)
download at:http://www.nexusmods.com/legendofgrimrock2/mods/61/?
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: MultiAlcoveManager

Post by AdrTru »

Hi,
unfortunately I am dont able to simulate this situation.
This qiuck update worked for near last versions. If you have older version, this replacing is little difficult.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
Post Reply