Page 1 of 3

Assets and introduction to scripting and scripting ref ETA ?

Posted: Tue Oct 21, 2014 6:54 am
by cromcrom
Hello there. Any ETA of the assets download and Introduction to Scripting (with list of Scripting references ) ? Just, erm, you know, I am on holydays next week, and I will have plenty of time to code (that is, if I don't go hiking. Anyways...).

Re: Assets and introduction to scripting and scripting ref E

Posted: Tue Oct 21, 2014 7:03 am
by Mysterious
Sorry Crom Crom no luck on that yet but I hope it happens soon, god I need them bad lol.

Re: Assets and introduction to scripting and scripting ref E

Posted: Tue Oct 21, 2014 7:52 am
by Chimera005ao
Quite a few of us are waiting. There is much fun to be had.
A trip of a thousand leagues starts with a step.
And ends with Johny dying of dysentery somewhere around Chimney Rock.

Re: Assets and introduction to scripting and scripting ref E

Posted: Tue Oct 21, 2014 11:00 am
by NutJob
I agree with this thread. Actually I'm willing to pay to have the documentation at this point. Thank you ADHD for making me want to spend all my money.

Re: Assets and introduction to scripting and scripting ref E

Posted: Tue Oct 21, 2014 11:08 am
by Jhaelen
NutJob wrote:I agree with this thread. Actually I'm willing to pay to have the documentation at this point. Thank you ADHD for making me want to spend all my money.
I cannot say anything else than "ME TOO" ! The cool thing is that during the waiting I can put on a (numeric) sheet of paper all my futur mod stories and quests.

Re: Assets and introduction to scripting and scripting ref E

Posted: Tue Oct 21, 2014 3:18 pm
by NutJob
Anyone with a little background on creating custom assets in LoG1 help me with this?

Objective: close a door slower so it doesn't slam shut

So far added this to my objects.lua

Code: Select all

defineObject {
	name = "door_of_closing",
	baseObject = "dungeon_door_portcullis",
	components = {
		class = "door",
		closeVelocity = -0.5,
		closeAcceleration = -50,
	}
}
Reloaded my Project. Woot! It's there.

Added this to a script

Code: Select all

spawn("door_of_closing", 1, 26, 29, 1, 5, "doc1")
doc1.door:setDoorState("open")
floor_trigger_1.floortrigger:addConnector("onActivate", "doc1", "close")
Walked over floor trigger. Works... almost. Door still shuts at the same acceleration and velocity as normal so I think I made my definition completely wrong.

I know one of the dev's gave us a "sample" of the structure (in General Discussion) but I can not, for the life of me, find it again.

Re: Assets and introduction to scripting and scripting ref E

Posted: Wed Oct 22, 2014 1:03 pm
by JohnWordsworth
I'm afraid I do not have a solution with regards to which keywords to use exactly, but I have spotted on syntax error in your definition which means that the door component is likely not being defined correctly. The "components" property should refer to a list of components (each of which is it's own table), so there should be some extra curly braces in there.

Code: Select all

defineObject {
   name = "door_of_closing",
   baseObject = "dungeon_door_portcullis",
   components = {
     {  
       class = "Door",
       closeVelocity = -0.5,
       closeAcceleration = -50,
     }  
   }
}
Notice the extra set of braces around the component definition. I also expect that "Door" should be capitalised (also changed above). Beyond that, there's no definite way of knowing what you need to put for the open/close velocity - but it's possible the above may work!

Re: Assets and introduction to scripting and scripting ref E

Posted: Wed Oct 22, 2014 1:37 pm
by NutJob
Your example got me back on track and I'm now getting the results I want by removing closeVelocity/Acceleration.

Code: Select all

defineObject {
	name = "door_of_closing",
	baseObject = "dungeon_door_portcullis",
	components = {
		{
			class = "Door"
		}
	}
}
Works exactly how I want; door closes slowly. Now the question is how to speed it up for future Projects. I'm guessing we're waiting to know this kind of information from the LoG2 asset_pack.zip? (unsure what we're waiting for to gain access ~laughs~)

Re: Assets and introduction to scripting and scripting ref E

Posted: Wed Oct 22, 2014 2:35 pm
by NutJob
I have no idea what the range for these method calls are but I got this working.

Code: Select all

spawn("door_of_closing", 1, 26, 29, 0, 5, "doc1")
doc1.door:setDoorState("open")
doc1.door:setCloseVelocity(-2.4)
doc1.door:setCloseAcceleration(-0.7)
floor_trigger_1.floortrigger:addConnector("onActivate", "doc1", "close")
Velocity: -0.1 (slowest) to -100 (fastest). No idea what the actual range is but going lower (faster) than -100 I seen no difference.


--
Edit: the best my perception allows, this...

Code: Select all

doc1.door:setCloseVelocity(-2.9)
doc1.door:setCloseAcceleration(-2.1)
... seems to be about default closing speed.

Re: Assets and introduction to scripting and scripting ref E

Posted: Wed Oct 22, 2014 3:03 pm
by cromcrom
May I suggest you guys open a dedicated thread about this door issue, as it might interest other modders, that might not think about looking into this tread :-)