Editor Tutorials on YouTube - part 15 is out

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
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Editor Tutorials on YouTube - part 12 is out

Post by petri »

Regarding automap tiles in part 11, you could try using Map:setAutomapTile() to dynamically update the automap tile when the wall is destroyed.
User avatar
The cube
Posts: 94
Joined: Tue Apr 23, 2013 6:09 pm
Location: Barren Desert

Re: Editor Tutorials on YouTube - part 12 is out

Post by The cube »

There's two things that you didin't talk about in the alcove puzzles video, that are essential for alcove puzzles:

1. How to spawn items to the alcove / remove items from the alcove

2. How to correctly count the amount of, for example, rocks in the alcove, when some of them could be in a stack

I'm trying to do an alcove puzzle now, and would like to know how to do these two. Thanks!

Oh, and the new videos are awesome.
User avatar
Dhomochevsky
Posts: 88
Joined: Sat Feb 16, 2013 11:18 pm
Location: Spain

Re: Editor Tutorials on YouTube - part 12 is out

Post by Dhomochevsky »

Sorry for my english. I subscribed on your channel few days ago, absolutely amazing tutorials. For me this videos are really useful because i'm not the best doing mods and scripts :lol: :lol: :lol:
You do that videos easy and clear and probably i'm going to use some of your hints to make things on my future mods.
My idea was congratulate you for your job some days ago but i can't do until today because i'm too busy with different things. Thanks for all job you do :mrgreen:
User avatar
5angel
Posts: 7
Joined: Sat Nov 01, 2014 10:07 pm

Re: Editor Tutorials on YouTube - part 12 is out

Post by 5angel »

Interesting. But is is posible to add a new item using the original model and sprite?
User avatar
5angel
Posts: 7
Joined: Sat Nov 01, 2014 10:07 pm

Re: Editor Tutorials on YouTube - part 12 is out

Post by 5angel »

Okay. Quick researching actually helped me to get a grasp on how it's done. But still lot's of guessing, heh (:
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Editor Tutorials on YouTube - part 12 is out

Post by Skuggasveinn »

you can do this

Code: Select all

defineObject{
   name = "longersword",
   baseObject = "long_sword",
   components = {
      {
         class ="Item",
         uiName = "Longersword",
         description = "exactly like a longsword but just a tiny bit longer."
      },  
}
}
That will use the long_sword as a base, but when you define a class (in this case class="Item") you overwrite the whole class, so in the code above the item class is missing the weight, they gfxAtlas index and everything else in the Item Class, but it has the other classes intact.
So the guessing part is limited to the class your are overwriting.

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
GoldenShadowGS
Posts: 168
Joined: Thu Oct 30, 2014 1:56 am

Re: Editor Tutorials on YouTube - part 12 is out

Post by GoldenShadowGS »

Code: Select all

for v,i in alcove:contents() do
What is the purpose of the "v" ?
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Editor Tutorials on YouTube - part 12 is out

Post by cromcrom »

Thankyou so much for the tuts. May I suggest some GraphicsContext tutorial ? That could be tremendously helpfull.
A trip of a thousand leagues starts with a step.
User avatar
Skuggasveinn
Posts: 562
Joined: Wed Sep 26, 2012 5:28 pm

Re: Editor Tutorials on YouTube - part 12 is out

Post by Skuggasveinn »

GoldenShadowGS wrote:

Code: Select all

for v,i in alcove:contents() do
What is the purpose of the "v" ?
in my head it just means for variable(v) counter(i) in alcove.
A more correct syntax would have been for _,i in alcove,
Taken from the Lua scripting guide
LUA scripting guide wrote: The variable consisting of only an underscore "_" is commonly used as a placeholder when you want to ignore the variable
By all standards I'm still a complete freshman in Lua, never used it before modding LoG1, so I'm still learning myself, and do mistakes often ;)

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
GoldenShadowGS
Posts: 168
Joined: Thu Oct 30, 2014 1:56 am

Re: Editor Tutorials on YouTube - part 12 is out

Post by GoldenShadowGS »

I am learning as well. I think I figured out how to do a for loop

Code: Select all

for i = 1,4,1 do
print(i)
end
i is the variable
first 1 is the starting value of i
4 is the max value of i
the second 1 is the increment value.

so this for loop, it will print

1
2
3
4

If I change the increment value to 2. then my print will only show

1
3

I completely understand this so far.

So then I am looking at some Grimrock scripts examples and a lot of time, the increment value is left off. I assume the increment value defaults to 1 when it is missing.

Then I see your for loop with v,i and I am completely lost. it has no numbers or anything.
Post Reply