Ask a simple question, get a simple answer

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
Matlock19
Posts: 23
Joined: Sun Nov 02, 2014 2:11 am

Re: Ask a simple question, get a simple answer

Post by Matlock19 »

Well I hate to say it, but it's still not working. I changed it to:

Code: Select all

    defineObject{
         name = "rusty_key",
         components = {
         {
           class = "Model",
           model = "assets/models/items/key_brass.fbx",
         },
         {
           class = "Item",
           uiName = "Rusty_Key",
           gfxAtlas = "assets/textures/gui/items_atlas.tga",
           gfxIndex = 5,
           weight = 0.5,
           traits = { "key" },
           description = "This key has seen better days."
         }
       }
    }
And the editor is not crashing, but the "rusty_key" isn't showing up at all to be placed. So what did I screw up this time?
Thanks for all your help, I'm gettin' there...slowly...
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Ask a simple question, get a simple answer

Post by Doridion »

Try adding multiple = 1, just after weight.
User avatar
QuintinStone
Posts: 72
Joined: Sat Nov 01, 2014 9:58 pm

Pressure plate -> script

Post by QuintinStone »

So I have a pressure plate that calls a function in a script entity on activation. Is there a way in the script to determine what object triggered the activation event? Only 1 parameter seems to be passed to the function, the pressure plate itself.
Meshki
Posts: 2
Joined: Tue Nov 11, 2014 12:27 pm

Re: Ask a simple question, get a simple answer

Post by Meshki »

Meshki wrote:I want to create a Wall Trigger that will activate a magic bridge after shooting the wall with projectile (stones, arrows, anything) but can't seem to get it working. The wall trigger has projectile collider set and it actually stops the projectiles mid-air but doesn't trigger the connected entities. Thanks
Could I get some attention please? Thanks :-)
User avatar
Matlock19
Posts: 23
Joined: Sun Nov 02, 2014 2:11 am

Re: Ask a simple question, get a simple answer

Post by Matlock19 »

Doridion wrote:Try adding multiple = 1, just after weight.
Nope, that didn't do it. The key still doesn't show up.
I'll mess with this for an hour or so, maybe I'll get it.
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Ask a simple question, get a simple answer

Post by Blichew »

Matlock19 wrote:
Doridion wrote:Try adding multiple = 1, just after weight.
Nope, that didn't do it. The key still doesn't show up.
I'll mess with this for an hour or so, maybe I'll get it.
there's no such file as

Code: Select all

gfxAtlas = "assets/textures/gui/items_atlas.tga",
and this field isn't mandatory if you're using default item atlas.
Also, adding

Code: Select all

baseObject = "brass_key",
just before components block did the trick - key is showing in the editor and can be spawned.

Code: Select all

defineObject{
	name = "rusty_key",
	baseObject = "brass_key",
	components = {
		{
			class = "Model",
			model = "assets/models/items/key_brass.fbx",
		},
		{
			class = "Item",
			uiName = "Rusty Key",
			--gfxAtlas = "assets/textures/gui/items_atlas.tga",
			gfxIndex = 5,
			weight = 0.5,
			traits = { "key" },
			description = "This key has seen better days."
		},
	}
}
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Ask a simple question, get a simple answer

Post by Blichew »

Meshki wrote:
Meshki wrote:I want to create a Wall Trigger that will activate a magic bridge after shooting the wall with projectile (stones, arrows, anything) but can't seem to get it working. The wall trigger has projectile collider set and it actually stops the projectiles mid-air but doesn't trigger the connected entities. Thanks
Could I get some attention please? Thanks :-)
If you can't get it to work, maybe set up a hidden floor trigger in fron of the wall, with option to activate only by item ?
Then you can try to check every entity that's on this tile for a .name property to check if it's an item of the desired type/name.
User avatar
Matlock19
Posts: 23
Joined: Sun Nov 02, 2014 2:11 am

Re: Ask a simple question, get a simple answer

Post by Matlock19 »

Today you are my personal hero, Blichew. The key is perfect.

Well, if it's not one thing, it's yeah...check out my first attempt at working equipment:

Code: Select all

defineObject{
   name = "gibbs_cloak",
   baseObject = "bear_pelt",
   components = {
      {
         class = "Model",
         model = "assets/models/items/bear_pelt.fbx",
      },
      {
         class = "Item",
         uiName = "Gibb's Hide",
         gfxIndex = 320,
         weight = 1.5,
         --traits = { "equipment_item", "cloak" }, -- do i even need these?
         description = "Please work."
      },
	  {
	     class = "EquipmentItem",
		 slot = 5,
		 Protection = 2,
		 Evasion = 2,
		 Vitality = 2,
	  },
   } 
}
That item seems to work fine until you actually equip it. It doesn't really give any of those stats, though they appear in the tooltip properly. What big obvious thing am I missing here?
Decayer
Posts: 65
Joined: Sat Oct 13, 2012 3:19 pm

Re: Ask a simple question, get a simple answer

Post by Decayer »

Matlock19 wrote:Today you are my personal hero, Blichew. The key is perfect.

Well, if it's not one thing, it's yeah...check out my first attempt at working equipment:

Code: Select all

defineObject{
   name = "gibbs_cloak",
   baseObject = "bear_pelt",
   components = {
      {
         class = "Model",
         model = "assets/models/items/bear_pelt.fbx",
      },
      {
         class = "Item",
         uiName = "Gibb's Hide",
         gfxIndex = 320,
         weight = 1.5,
         --traits = { "equipment_item", "cloak" }, -- do i even need these?
         description = "Please work."
      },
	  {
	     class = "EquipmentItem",
		 slot = 5,
		 Protection = 2,
		 Evasion = 2,
		 Vitality = 2,
	  },
   } 
}
That item seems to work fine until you actually equip it. It doesn't really give any of those stats, though they appear in the tooltip properly. What big obvious thing am I missing here?
It's likely that Protection, Evasion and Vitality have to be all lower case.
User avatar
TheLastOrder
Posts: 104
Joined: Wed Oct 17, 2012 1:56 am

Re: Ask a simple question, get a simple answer

Post by TheLastOrder »

Hi there everybody. After looking as a crazy man in the reference list and several searchs on the forum, here we go:


then
kb_levers_door.door:open()
kb_teleport.teleport:isDeactivated()

The door opens, but the teleport isn't deactivated. the game crashes and returns me that it calls a nil value, when the kb_teleport actually EXISTS, I can see it and I can feel it xDDDD

I tried local kb_teleport = findEntity("kb_teleport"), but still the same problem.

And I tried :toggle or :deactivate

Nothing...

Thanks!!! :D
Post Reply