Page 12 of 396

Re: Ask a simple question, get a simple answer

Posted: Thu Nov 06, 2014 11:26 am
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)".

Re: Ask a simple question, get a simple answer

Posted: Thu Nov 06, 2014 11:32 am
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.

Re: Ask a simple question, get a simple answer

Posted: Thu Nov 06, 2014 11:42 am
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")

Re: Ask a simple question, get a simple answer

Posted: Thu Nov 06, 2014 11:57 pm
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?

Re: Ask a simple question, get a simple answer

Posted: Fri Nov 07, 2014 2:57 am
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.

Re: Ask a simple question, get a simple answer

Posted: Fri Nov 07, 2014 3:03 am
by Jackard
What is Monster Level? It ranges from one to five.

Re: Ask a simple question, get a simple answer

Posted: Fri Nov 07, 2014 4:33 am
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

Re: Ask a simple question, get a simple answer

Posted: Fri Nov 07, 2014 6:22 am
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.

Re: Ask a simple question, get a simple answer

Posted: Fri Nov 07, 2014 6:44 am
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.

Re: Ask a simple question, get a simple answer

Posted: Fri Nov 07, 2014 9:58 am
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.