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
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Ask a simple question, get a simple answer

Post by Doridion »

Mmmhh ... in LoG1, objects "class" ( if I understand what you expect ) are in LoG2, the "traits" ( for items ) ...

For all others, i don't think that got a specific "object" trait anymore. As php4, the classes ( here the components ) defining by their group, the object specifications. I think that there's no "main" class ( just modify the class order in the definition to place one of them on the top of classes ).

Exemple for walls, as in defineObject, there's no way to define it like a "wall" oject class ( unlike LoG1 ) exept in addin the model in the tile definition under the "wall" class. You also have what you could call "main" classes like door, pit, item, button components, that what we have mostly closer to a LoG1 object class ...

When I create an object and define it, I make it door by adding "door" component, that's the only way to grimrock to recognise my door ... as a door.
Echoplex
Posts: 63
Joined: Tue Nov 04, 2014 10:59 pm

Re: Ask a simple question, get a simple answer

Post by Echoplex »

Very simple question. How do I take screenshots? Trying to get some shots of the world before publishing the mod. Looked in the help doc, wasnt there either. Also when captured where will they default too?

*Edit* I found it through mashing keys. F12 will capture the screen for anyone curious. Then hit shift tab
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:Aaa ...... NutJob ? When I want to know all the classes of something in the editor, i just add the item/object/etc on the map, and see names of all the classes in the object properties :D
I would really love to know exactly how you do this. Still having a devil of a time defining custom objects and their graphics.

@ Echoplex:
I have always just used "Alt + Print Screen" to take screenshots, this copies the image to your "copy/paste" function. Then just open an image editor (I use paint.net for simple stuff) and hit Ctrl + v to paste it in.
Teto
Posts: 7
Joined: Sat Apr 28, 2012 11:51 am

Re: Ask a simple question, get a simple answer

Post by Teto »

I'm starting modding, and I have 3 quick questions, about what I want to do (sorry if those questions were already posted somewhere, but I found nothing) :

- I've read that we can "disable" champions. Does it mean that the player can start the journey "alone" ?
- Also, does it mean that we can have new companions during the journey ?
- I want to have a new spell system. Can I change the drawn panel shown in the game (but keeping the same grid) ? And delete the old system to have a new one ?

Thanks in advance if someone can answer. :P
Meshki
Posts: 2
Joined: Tue Nov 11, 2014 12:27 pm

Re: Ask a simple question, get a simple answer

Post by Meshki »

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
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 »

So here is my test item:

Code: Select all

defineObject{
	  name = "rustykey",
	  baseObject = "base_item",
	  components = {
	  {
            class = "Model",
		 model = "assets/models/items/key_brass.fbx",
	  },
	  {
		 class = "Item",
		 uiName = "Rusty_Key",
		 gfxAtlas = "assets/textures/items_atlas.dds",
		 gfxIndex = 5,
		 weight = 0.5,
		 traits = { "key" }
		 description = "This key has seen better days."
	  },
   }
}
and it returns the error "mod_assets/scripts/items.lua:20: ' } ' expected (to close ' { ' at line 13) near 'description'" when I try to load it in the Editor.

I've tried placing another } but the count seems right to me, so what am I missing here?

EDIT: for some reason the class = "model", thing will not format properly in my post, but it's correct in the items.lua.
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 »

Matlock19 wrote:So here is my test item:

Code: Select all

defineObject{
	  name = "rustykey",
	  baseObject = "base_item",
	  components = {
	  {
            class = "Model",
		 model = "assets/models/items/key_brass.fbx",
	  },
	  {
		 class = "Item",
		 uiName = "Rusty_Key",
		 gfxAtlas = "assets/textures/items_atlas.dds",
		 gfxIndex = 5,
		 weight = 0.5,
		 traits = { "key" }
		 description = "This key has seen better days."
	  },
   }
}
and it returns the error "mod_assets/scripts/items.lua:20: ' } ' expected (to close ' { ' at line 13) near 'description'" when I try to load it in the Editor.

I've tried placing another } but the count seems right to me, so what am I missing here?

EDIT: for some reason the class = "model", thing will not format properly in my post, but it's correct in the items.lua.

Code: Select all

defineObject{
	  name = "rustykey",
   -- If you give a new model to an item, don't give a based item ;)
	  components = {
	  {
            class = "Model",
		 model = "assets/models/items/key_brass.fbx",
	  },
	  {
		 class = "Item",
		 uiName = "Rusty_Key",
		 gfxAtlas = "assets/textures/items_atlas.tga",
		 gfxIndex = 5,
		 weight = 0.5,
		 traits = { "key" },
		 description = "This key has seen better days.",
	  },
   },
}
Don't forget the "," after ALL properties ;) I think it'll be better like that ^^
Last edited by Doridion on Tue Nov 11, 2014 11:41 pm, edited 2 times in total.
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: Ask a simple question, get a simple answer

Post by Batty »

Matlock19 wrote:So here is my test item:

Code: Select all

defineObject{
   name = "rustykey",
   baseObject = "base_item",
   components = {
	   {
         class = "Model",
         model = "assets/models/items/key_brass.fbx"
      },
      {
         class = "Item",
         uiName = "Rusty_Key",
	      gfxAtlas = "assets/textures/items_atlas.dds",
	      gfxIndex = 5,
		   weight = 0.5,
		   traits = { "key" },
		   description = "This key has seen better days."
	   }
   }
}
Commas are to separate, so you don't need them after the last property, bracket, class, etc.
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 »

Thanks you guys, the map loads now, but when I try to place my new item I get this fun error and the editor crashes:

[string "Item.lua"]:0: File not found: assets/textures/items_atlas.dds
stack traceback:
[C]: in function 'load'
[string "Item.lua"]: in main chunk
[string "Component.lua"]: in function 'loadProperties'
[string "GameObject.lua"]: in function 'initComponents'
[string "Arch.lua"]: in function 'spawn'
[string "DungeonEditor.lua"]: in function 'addObjectTool'
[string "DungeonEditor.lua"]: in function 'mapView'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk

I thought I did everything properly, what's this about? I'm lost at sea here. I thought the gfxAtlas was at "assets/textures/items_atlas.dds", but apparently that doesn't exist? :?:
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 »

So, like I said above .....

Code: Select all

    defineObject{
         name = "rustykey",
       -- If you give a new model to an item, don't give a based item ;)
         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.",
         },
       },
    }
Why ? Because :

Base_object is to use if you just modify some properties, not most of the classes like here ... so remove it ^^

After, the item_atlas.tga is important ^^ In all the coding definitions, you'll never use the .dds extension or .model or .animation extensions, but .tga for materials/pictures and .fbx for models and animations.

At least, yes, the right path is for the atlas is : assets/textures/gui/items_atlas.tga ( Forgot the /gui/ file in my precedent exemple ^^ )

I know that i'm a boring guy who's not writing very well and most often saying some errors, but ... sometimes ... i'm in the right way ;)
Post Reply