Search found 2784 matches

by minmay
Fri Jan 22, 2016 7:19 am
Forum: Mod Creation
Topic: Grim 2 rope item
Replies: 24
Views: 21945

Re: Grim 2 rope item

The routine I posted is not the one I was referring to. I took your advice and got rid the string check and used what I though would be a component check. It's just that the routine I came up with (before I saw yours) is a little different. This is what I did. l is the level entity I pass to the ro...
by minmay
Thu Jan 21, 2016 2:00 am
Forum: Mod Creation
Topic: Grim 2 rope item
Replies: 24
Views: 21945

Re: Grim 2 rope item

The routine you posted parses the names of all the objects on the square. This doesn't work, because an object having "pit" in its name does not guarantee that it is actually a pit. For example, if there were a piece of pitroot bread on the level above, your function would cause an error, ...
by minmay
Wed Jan 20, 2016 7:22 am
Forum: Mod Creation
Topic: Grim 2 rope item
Replies: 24
Views: 21945

Re: Grim 2 rope item

https://en.wikipedia.org/wiki/False_positives_and_false_negatives False positive: your test said "yes" when it should have said "no" False negative: your test said "no" when it should have said "yes" Yes, components should be considered classes. You can acces...
by minmay
Sat Jan 16, 2016 3:03 am
Forum: Mod Creation
Topic: Custom Sounds
Replies: 1
Views: 3717

Re: Custom Sounds

by minmay
Sat Jan 16, 2016 3:01 am
Forum: Mod Creation
Topic: Grim 2 rope item
Replies: 24
Views: 21945

Re: Grim 2 rope item

...Map is a class name. Not an identifier. getAdjacentLevel is a method of the Map class. You would use party.map:getAdjacentLevel(x, y, z) Also, why are you checking the name of the object to detect if it is a pit? That will result in both false positives and false negatives. Why are you not checki...
by minmay
Fri Jan 15, 2016 4:45 am
Forum: Mod Creation
Topic: Grim 2 rope item
Replies: 24
Views: 21945

Re: Grim 2 rope item

I wasn't sure what getAdjacentLevel() got. If the was the level above, below, up, down, left, or right. Will definitely try it! It can get any map, at any distance. The three number arguments are the dx, dy, dz. So you could get the map above with getAdjacentLevel(0,0,-1), the map to the east with ...
by minmay
Fri Jan 15, 2016 2:02 am
Forum: Mod Creation
Topic: Grim 2 rope item
Replies: 24
Views: 21945

Re: Grim 2 rope item

If you return false from an onUseItem hook, the item will not be destroyed.
The rope and shovel in the base game are implemented in RopeToolComponent and DiggingToolComponent, not with the user scripting interface.
Why not just use Map:getAdjacentLevel() to get the level above the party?
by minmay
Wed Jan 13, 2016 10:31 pm
Forum: Grimrock 2 Discussion
Topic: entitiesAt()
Replies: 4
Views: 9541

Re: entitiesAt()

The construct is: for [variables] in [iterator] do [block] end An iterator, like any other function in Lua, can have multiple return values. The iterators returned by pairs and ipairs are examples; they return both a key and the corresponding value in the table they're iterating over. So, for exampl...
by minmay
Tue Jan 12, 2016 8:09 am
Forum: Grimrock 2 Discussion
Topic: entitiesAt()
Replies: 4
Views: 9541

Re: entitiesAt()

entitiesAt is no longer a global function, it belongs to the Map class.