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
blob
Posts: 50
Joined: Fri Aug 02, 2013 9:34 am

Re: Ask a simple question, get a simple answer

Post by blob »

Mmmh, I just tried with quotes, with demon / deamon spelling and fbx / model extension but no success.
I'm very new to scripting, err, maybe I should share the error message in case I misunderstand it.
I get " attempt to index field 'object' (a nil value)".
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 »

You're using:

Code: Select all

    local beacon_furnace_head = spawn("beacon_furnace_head")
    beacon_furnace_head.object:setModel(assets/models/env/demon_head.model)
and .object is not found. Aren't models defined in model component ?
If that's the case then this should be working:

Code: Select all

    local beacon_furnace_head_1 = spawn("beacon_furnace_head")
    beacon_furnace_head_1.model:setModel(assets/models/env/demon_head.model)
I've also added _1 to variable in case it can't be named the same way actual object_type is named.
User avatar
blob
Posts: 50
Joined: Fri Aug 02, 2013 9:34 am

Re: Ask a simple question, get a simple answer

Post by blob »

Ah yes yes yes. Thanks guys!
. model + missing quotes + .fbx

local beacon_furnace_head = spawn("beacon_furnace_head")
beacon_furnace_head.model:setModel("assets/models/env/demon_head.fbx")
PPanda
Posts: 20
Joined: Tue Oct 14, 2014 9:13 am

Re: Ask a simple question, get a simple answer

Post by PPanda »

I'm trying to define an object, but failing. I watched Steing's mod tutorial ep 11, but the code he uses doesn't work for me. A few other people have asked this very question but with no response. I've studied the Mod Script reference, but apparently I'm missing something.

Basically, despite my tinkering, I can't get a defineObject to NOT return a nil value. How do you phrase it?

i've tried:

defineObject{ stuff}

defineObject()
{stuff}

defineObject{}
stuff

Error message: "attempt to call global 'defineObject' (a nil value) x"

which to me means I need to put something in the (), but what?

edit: made some headway. Seems I have to do this: local defineObject({stuff})
Strange nobody else has to do this. Does all this need to be done outside the editor on a Lua editor to work?
GoldenShadowGS
Posts: 168
Joined: Thu Oct 30, 2014 1:56 am

Re: Ask a simple question, get a simple answer

Post by GoldenShadowGS »

Are you adding those scripts that define objects to the mod directory's scripts folders? That's where they go, not in-editor. They need to exist before the editor is loaded.
Jackard
Posts: 59
Joined: Thu Oct 30, 2014 7:32 pm

Re: Ask a simple question, get a simple answer

Post by Jackard »

What is Monster Level? It ranges from one to five.
User avatar
MadCatter
Posts: 34
Joined: Mon Nov 03, 2014 5:02 am
Location: Southampton, UK

Re: Ask a simple question, get a simple answer

Post by MadCatter »

When creating custom floor tiles, how does one set is so that it replaces the floor texture underneath? (preventing nasty clipping).
I have tried including the "Occluder" class in the object definition which seems to be present in existing floor objects, but to no avail. Is there more to the definition I'm missing?

Thanks
PPanda
Posts: 20
Joined: Tue Oct 14, 2014 9:13 am

Re: Ask a simple question, get a simple answer

Post by PPanda »

Jackard wrote:What is Monster Level? It ranges from one to five.
How much damage the monsters do. lvl1 is the easy version, lvl 3 is tough, lvl5 is dangerous. The game's dificulty scales off of these numbers. I think I got that right.
User avatar
blob
Posts: 50
Joined: Fri Aug 02, 2013 9:34 am

Re: Ask a simple question, get a simple answer

Post by blob »

Does anyone know how the ladder component works?
Disabling it does not make ladders stop working. In fact disabling all components still gives a working invisible ladder.
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 »

I am posting these on the most recent page to get attention, please forgive. Once I have these things down, I'll be a lot happier with my game.

1. How do I remove the natural loot that a monster can drop? I want to use a watered-down Skeleton Commander as an early boss, but I can't seem to stop him from dropping his longswords. I want him to drop what I say, and nothing more.I know there is a "setLootDrop" component but it asks for a table and I don't know what to put.

2. When editing equipment, I can't seem to remove item properties. For example, when basing a new cloak off the "bear pelt", I tried "new_cloak.equipmentitem:setResistCold(0)". That sets the cold resist to 0, but unfortunately doesn't remove the tooltip from the item. When you hover over it, it says "Resist Cold +0". I need to get rid of that completely.

3. How do you add a monster group to a bossfight? The usual "addMonster" script doesn't work when I point it at a group of monsters like the skeleton trooper pair. I even tried "addMonsterGroup" and "skeleton_trooper_pair.monstergroup" but it still doesn't work. Monster groups don't have "onDie" connections either, which bugs me. How do we get around that?

*** 4. Actually what I really need to know is how to discover which model and icon are used by each item so that I can reference them in custom items, then I just start defining new objects and solve a few problems at once.
Last edited by Matlock19 on Fri Nov 07, 2014 11:01 am, edited 1 time in total.
Post Reply