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

Re: MultiAlcoveManager

Post by AdrTru »

bongobeat wrote:gonna try it, thanks! :)

edit:
works great.
just to be sure, if I have custom items, and want that the racks recognize them, the only thing to do is to add them in the mam script, within the editor?
If you want to add your custom items:
1/ try to write item.name to Items definition ( like sword_4 = {"bone_blade","rapier", your item.name}, )
2/ If you dont found correct set of item you may create new with your item.name . eg. sword_5 = {"mySword"}
nex step is creating socket definition in MAM_wr_socket table simmilar as another definition
first name is free eg. ["sword_5_1"]
["items"] = - suitable items for socket
["pos"] - offset position socket from base position of rack object ( for facing=0 )
["rot"] - rottation offset from rack object
["fill"] - string definition of item occupated place in rack ( may be random or same as have another item in same position )
["inBlock"] - list of fill strings which blocked to insert your item ( every one is blocked )
["inNeed"] - list of fill strings which must be occupated for inserting your item ( all of string must be present for allow insert)
["reBlock"] - list of fill strings which blocked to remove inserting item - not implemented in published version
["reNeed"] - list of fill strings which allowed to remove inserting item - not implemented in published version
-- this definition must be inside table for rack eg. ["weaponrack"]= for socket for weaponrack
Its all for correct function.

sry for my english.

EDIT: I worked on some new functionalities like managing of remove items, disabling to moving thru racks. And I rewrited some function but this definitions will be simmilar.
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 »

New version is in NEXUS site.

- integration with FWhooks (managing remove items and moving thru racks)
- added more definituions for weaponrack
- added ledgerack for demonstration definitions for managing insert/remove items
- some big change in code - new script isnt fully compatible with previous versions
- adding of variables in object scripts for setting behaviour of each rack separately.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: MultiAlcoveManager

Post by bongobeat »

I have try your new version (MultiAlcoveManager_life_v1-21-1-0) and got a crash always when refreshing the renderer screen in the editor (with F5)
SpoilerShow

Code: Select all

Starting editor

=== Software Failure ===

mod_assets/scripts/fw_hooks.lua:297: attempt to call method 'executeEntityHooks' (a nil value)
stack traceback:
	mod_assets/scripts/fw_hooks.lua:297: in function <mod_assets/scripts/fw_hooks.lua:296>
	[string "Component.lua"]: in function 'callHook'
	[string "Surface.lua"]: in main chunk
	[string "GameObject.lua"]: in function 'sendMessage'
	[string "Item.lua"]: in function 'destroy'
	[string "GameObject.lua"]: in function 'removeComponent'
	[string "GameObject.lua"]: in function 'removeAllComponents'
	[string "GameObject.lua"]: in function 'destroy'
	[string "Map.lua"]: in function 'destroy'
	[string "Dungeon.lua"]: in function 'unload'
	[string "DungeonEditor.lua"]: in function 'stopPreview'
	[string "DungeonEditor.lua"]: in function 'playPreview'
	[string "DungeonEditor.lua"]: in function 'update'
	[string "Grimrock.lua"]: in main chunk
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: MultiAlcoveManager

Post by AdrTru »

I havent this crash.
It this crash repeatibe? do you able to say me partyposition? what changes you made before this crash?
THX for reply
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: MultiAlcoveManager

Post by bongobeat »

Yes, it's sometimes when I start the rendering windows in the editor.
sometime it works the first time, then when I re-do the rendering, or stop and restart with the classic button I got always a crash.
By the way, I have added your mod into my mod. I do no talk about your demo mod. <-- add to try a little more if I have a crash with your demo
so maybe it is an uncompatibility with an actual script.

I ve edited the mam.lua to add custom items:
I post the lines in case I have done something wrong: but I don't think so , I have try with and without custom items and I got always the crash.

--> added another position for the repeater, in the sword_2 def:
sword_2 = {"sabre","machete","sickle_sword","cutlass","two_handed_sword","repeater","fire_repeater","machinegun"},-- these are the custom items
sword_3 = {"serpent_blade"},
sword_4 = {"bone_blade","rapier"},
bow_1 = {"lightning_bow","longbow"},
bow_2 = {"short_bow"},
xbow = {"crossbow"},
fire_1 = {"arquebus"},
fire_2 = {"flintlock"},
fire_3 = {"repeater"},

Code: Select all

	helm_2		= {"crystal_helmet","adamantite_helmet"},
	chest_3		= {"crystal_cuirass","adamantite_cuirass"},


note:
just a question: in your old version the content of the mam.lua was directly imported in the editor, can it be redone in the new version?
it's more practical to add some custom items within the editor, as you have their name directly.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: MultiAlcoveManager

Post by bongobeat »

ok, when trying for a little more your demo dungeon I got the same crash:

but this time, I have refresh the renderer 5 times then it crash.
SpoilerShow
=== Software Failure ===

mod_assets/scripts/fw_hooks.lua:297: attempt to call method 'executeEntityHooks' (a nil value)
stack traceback:
mod_assets/scripts/fw_hooks.lua:297: in function <mod_assets/scripts/fw_hooks.lua:296>
[string "Component.lua"]: in function 'callHook'
[string "Surface.lua"]: in main chunk
[string "GameObject.lua"]: in function 'sendMessage'
[string "Item.lua"]: in function 'destroy'
[string "GameObject.lua"]: in function 'removeComponent'
[string "GameObject.lua"]: in function 'removeAllComponents'
[string "GameObject.lua"]: in function 'destroy'
[string "Map.lua"]: in function 'destroy'
[string "Dungeon.lua"]: in function 'unload'
[string "DungeonEditor.lua"]: in function 'stopPreview'
[string "DungeonEditor.lua"]: in function 'playPreview'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: MultiAlcoveManager

Post by AdrTru »

I change there much of scripts.
I wrote that its nessessary to change all mod data, and remove racks from dung. Next you put new racks to dung.

your changes are correct. ( you write are in new version of mam.lua ( in mam/scripts/mam.lua - file for edditing in external editor )

Do you have integrated FW hooks in your dung (viewtopic.php?f=22&t=8345)?
( there is nessesary to have party redefinition for activating onPickUpItem and onMove hook )

I use this activation code in init.lua

Code: Select all

defineObject{
   name = "party",
   baseObject = "party",
   components = {
        fw_addHooks{
            class = "Party"
        }
   },
}
If you have this clone party definition in another place (if you use fw hooks) you must to define this fw_addHooks to it.
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: MultiAlcoveManager

Post by bongobeat »

Well I have copied the party hook from the init.lua of your dungeon demo. The framework files are the same than the fw.lua and fw_hooks.lua that are in your demo, or?

here is my init.lua
the mam lines are in the middle of the file, and the party hook is at the end
SpoilerShow

Code: Select all

-- This file has been generated by Dungeon Editor 2.1.13

-- import standard assets
import "assets/scripts/standard_assets.lua"
-- import custom assets
import "mod_assets/scripts/items.lua"
import "mod_assets/scripts/monsters.lua"
import "mod_assets/scripts/objects.lua"
import "mod_assets/scripts/tiles.lua"
import "mod_assets/scripts/recipes.lua"
import "mod_assets/scripts/spells.lua"
import "mod_assets/scripts/materials.lua"
import "mod_assets/scripts/sounds.lua"
import "mod_assets/scripts/musics.lua"
import "mod_assets/scripts/particles.lua"
-- LOG1 monsters
import "assets/scripts/monsters/snail.lua"
import "assets/scripts/monsters/warden.lua"
import "assets/scripts/monsters/uggardian.lua"
import "assets/scripts/monsters/skeleton_warrior.lua"
import "assets/scripts/monsters/ogre.lua"
import "assets/scripts/grimrock1/grimrock1_materials.lua" 
-- log1 spawned items by skeletton warrior and ogre are in items.lua
--NPC script--------------------------------------------------
import "mod_assets/mdNPC/monsters.lua"
--------------------------------------------------------------
-- Traits for item -------------------------------------------
import "mod_assets/scripts/traits.lua"
--------------------------------------------------------------
-- custom items-----------------------------------------------
-- Germany ---------------------------------------------------
import "mod_assets/dmcsb_pack/objects.lua"
import "mod_assets/dmcsb_pack/items.lua"
import "mod_assets/dmcsb_pack/materials.lua"
--------------------------------------------------------------
import "mod_assets/runebooks/runebooks.lua"
--------------------------------------------------------------
-- 3d object from various site -------------------------------
import "mod_assets/custom_obj/items.lua"
import "mod_assets/custom_obj/materials.lua"
--------------------------------------------------------------
-- Multi alcove manager --------------------------------------
import "mod_assets/scripts/fw_hooks.lua"
import "mod_assets/mam/scripts/mam_init.lua"
--------------------------------------------------------------
-- Mine object by Phitt --------------------------------------
--------------------------------------------------------------
import "mod_assets/scripts/mine_objects.lua"
import "mod_assets/scripts/mine_textures.lua"
--------------------------------------------------------------
-- custom wallset---------------------------------------------
import "mod_assets/scripts/dark_elf_temple_tileset.lua"
--------------------------------------------------------------
import "mod_assets/scripts/dark_temple_tileset.lua"
--------------------------------------------------------------
-- odinsball wallset (outdoor - industrial)
import "mod_assets/sh_ob_wallset/farm.lua"
import "mod_assets/sh_ob_wallset/houses.lua"
import "mod_assets/sh_ob_wallset/outdoor.lua"
import "mod_assets/sh_ob_wallset/sh_ob_wallset_materials.lua"
--import "mod_assets/sh_ob_wallset/sh_ob_wallset_wallset.lua"
import "mod_assets/sh_ob_wallset/sh_ob_wallset_objects.lua"
--------------------------------------------------------------
defineObject{
   name = "party",
   baseObject = "party",
   components = {
        fw_addHooks{
            class = "Party"
        }
   },
}
I did not add anything else except all things that was in your demo without forgotting the 2 scripts within the editor.
But as I said, I got the same crash while testing your demo dungeon, so the crash comes from another thing. I did not modify anything.

Anyway, I have returned to your old mam script (mam V0,1 with small textures), since I did not have any problem with this one.
AdrTru wrote:I havent this crash.
It this crash repeatibe? do you able to say me partyposition? what changes you made before this crash?
THX for reply
how can I find partyposition?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
AdrTru
Posts: 223
Joined: Sat Jan 19, 2013 10:10 pm
Location: Trutnov, Czech Republic

Re: MultiAlcoveManager

Post by AdrTru »

Problem is fixed and tested by bongobeat. Thx for it.
New version is on Nexus as v1.1
My LOG2 projects: virtual money, Forge recipes, liquid potions and
MultiAlcoveManager, Toolbox, Graphic text,
User avatar
TheStoryteller01
Posts: 20
Joined: Wed Dec 31, 2014 3:29 am
Contact:

Re: MultiAlcoveManager

Post by TheStoryteller01 »

This looks amazing.

Is it actually possible to take stuff from the racks or is this just for the looks?
In case you find my grammar and/or spelling weird ---> native german speaker ^^

https://thestoryteller01.wordpress.com/
Post Reply