Adding tag to existing object

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!
Post Reply
Posts: 25
Joined: Fri Apr 05, 2013 10:52 pm

Adding tag to existing object

Post by Torquemada » Mon Apr 15, 2019 12:10 am

I wanted to make the editor a bit easier to use by redefining the object filter, for example make a new filter called "vegetation" so I can easily find all trees, bushes, flowers, etc. To do that I need to add an extra tag to the corresponding object called "vegetation". Is it possible to add a property to existing object without having to redefine the whole object?
Say instead of adding

Code: Select all

	name = "forest_grass_01",
	baseObject = "base_floor_decoration",
	components = {
			class = "Model",
			model = "assets/models/env/forest_grass_01.fbx",
			castShadow = false,
			dissolveStart = 2,
			dissolveEnd = 4,
			class = "Animation",
			animations = {
				sway = "assets/animations/env/forest_grass_01_idle.fbx",
			playOnInit = "sway",
			loop = true,
			maxUpdateDistance = 5,
	editorIcon = 240,
	reflectionMode = "never",
	minimalSaveState = true,
	tags = { "vegetation" },
I could simply do something line this:

Code: Select all

forest_grass_01.tags = {"vegetation"}

User avatar
Posts: 95
Joined: Sun Oct 19, 2014 1:56 am

Re: Adding tag to existing object

Post by 7Soul » Mon Apr 15, 2019 3:16 am

No, you have to redefine all items/objects and add tags manually


You can download the files I'm using on my project which I already did that: zip file
It has more items than a default project so you'll still have to go through and delete my items. As far as I can remember the only thing I changed was the weight of some armors and maybe some sets, and there's some extra code in the stat potions and the 'onUseItem' function I added to foods
I also added some accessories and they wont work without the extra code so remember to remove them
Join the LoG discord server: :D

My Mod The Old Nexus (wip)

Post Reply