Page 12 of 17

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Sun Nov 09, 2014 7:20 am
by Matlock19
Thanks for the answers, that was exactly what I needed to get started figuring it all out. The game will have custom items after all! :!:

Your videos are really great, Skuggasveinn, I look forward to more.

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Sun Nov 09, 2014 10:43 am
by The cube
That's awesome for checking models, but i am not sure how to do it for gfxIndex and -Atlas

Code: Select all

function getGraphicAtlas()
	print(spawn("assassin_dagger").gfxAtlas:getGfxAtlas())
end

function getGraphicIndex()
	print(spawn("assassin_dagger").gfxIndex:getGfxIndex())
end
Neither works.

Thanks.

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Sun Nov 09, 2014 1:45 pm
by Grimfan
It's

Code: Select all

print(spawn("assassin_dagger").item:getGfxIndex())
Before you were pretty much trying to get the GfxIndex of the GfxIndex.

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Fri Nov 21, 2014 7:48 pm
by spacecookie
I'm subscribed to you on youtube. You're really helping. Looking forward to the release of each new video constantly.

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Fri Nov 28, 2014 12:22 am
by blob
Hi!
I'm unable to make the alcove code work.
I basically just copied the script from your video and changed the name of items to fit my map as a test but I get " attempt to call method 'contents' ( a nil value) " on line 2.

Code: Select all

function surfaceContains(surface, item)
   for v,i in surface:contents() do
   if i.go.name == item then return true
   end
end
end

function openPowerGemDoor()
	if surfaceContains(castle_alcove_2,"peasant_cap_1") then
	castle_door_portcullis_10.door:open()
end
end
Did I miss something? :S
(castle alcove 2 calls function openpowergemdoor on insert items)

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Fri Nov 28, 2014 12:47 am
by THOM
peasant_cap_1 is the name of the item with a number that the engine gives every item to make it unique (if you do not give it a personal name). But in case of the alcove-puzzle you don't want to call for that single item but for any item of that kind. So you have to script "peasant_cap"

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Fri Nov 28, 2014 12:52 am
by Batty
blob wrote:Hi!
I'm unable to make the alcove code work.
I basically just copied the script from your video and changed the name of items to fit my map as a test but I get " attempt to call method 'contents' ( a nil value) " on line 2.
Tested this, it works:

Code: Select all

function surfaceContains(object, item)
   for _, i in object.surface:contents() do
      if i.go.id == item then return true end
   end
end

function openPowerGemDoor()
   if surfaceContains(castle_alcove_2, "peasant_cap_1") then
      castle_door_portcullis_10.door:open()
   end
end
In first function, you forgot the alcove object that the surface class is referencing. Also, i.go.name was changed to i.go.id because you're comparing IDs. I changed your surface parameter in the first function to object because I'm not sure surface.surface:contents() would work (maybe it will, try it). :)

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Fri Nov 28, 2014 9:10 am
by blob
Ah! Thanks a ton to the two of you! :)

I now understand my confusion with name and Ids, thanks.

surface.surface:contents() does work too btw! But now I'm confused as to why the example from the tutorial is missing the reference and seemed to be working for Skugga.

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Wed Dec 03, 2014 6:51 pm
by QuintinStone
blob wrote:Ah! Thanks a ton to the two of you! :)

I now understand my confusion with name and Ids, thanks.

surface.surface:contents() does work too btw! But now I'm confused as to why the example from the tutorial is missing the reference and seemed to be working for Skugga.
Me too! I had trouble with coding surfaces because contents() is not listed in the reference. :?

Re: Editor Tutorials on YouTube - part 12 is out

Posted: Mon Dec 15, 2014 3:24 pm
by Skuggasveinn
Thanks for kind words.

I've not done a tut in some time but I'm far from "gone" (got a PM asking if I was gone from LoG2 modding :D )
I've just been working on some things like waterfalls, you can take a look at them here http://youtu.be/96v6ZV2R14I

I've also been working on a urban town creating kit, it's a model set that uses the existing log2 models and textures and lets you create houses, its modular so you can create any layout, multible floors etc.
Since its all existing stuff its footprint size has minimal impact on your mods size.
Screen of a house is here http://www.zorglubb.net/grimrock/images ... ouse_2.jpg

but just wanted to jump in and say I'm far from gone :D