Mystery Topic Revealed: Glögg Session Part 3!

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!
Post Reply
User avatar
petri
Posts: 1890
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Mystery Topic Revealed: Glögg Session Part 3!

Post by petri » Tue Feb 24, 2015 10:03 pm

Welcome to the third Glögg powered coding session ever!

The idea of this session is to extend the modding capabilities of Grimrock 2 and more importantly to have fun! How does this work? Quite simply, you tell what you would like me to code today, and my Glögg fumed brain tries to do its best to implement them. I get to decide which features are implemented based on how generally useful they are and how simple and fun they are to code. Also it is a good idea to explain shortly why this feature is useful to have. Bonus points if you are having Glögg with me!

I have reserved a full working day for this session, but still our time is quite limited, so I can't do complex features or features requiring new content unfortunately.

The glögg is heating up! Let's have some fun, people!

User avatar
petri
Posts: 1890
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by petri » Wed Feb 25, 2015 10:06 am

It's been some time since I touched the Lua parts of Grimrock, I wonder how long it takes me to get up to speed.

Damn, this is some fine Glögg!

minmay
Posts: 2436
Joined: Mon Sep 23, 2013 2:24 am

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by minmay » Wed Feb 25, 2015 10:12 am

Here are the features that would be most useful to me:
- PartyComponent:setSpeed(number) method, to change the speed of movement and turning. Useful for making Toorum-like characters, a haste spell, etc.
- PartyComponent:move(direction) and PartyComponent:turn(direction) methods that work as if the party moved normally. This is mainly for custom movement control schemes. PartyComponent:knockback() doesn't quite work for movement since it is constrained to one speed, and there's no equivalent for turning at all.

Less useful, but still useful (IMO):
- onComputeAttackPower hook for skills/traits would be a great complement to onComputeAccuracy.
- Support for the "offset" property in CameraComponent, and CameraComponent:setFOV() method. I've implemented a "spyglass" item that lets you smoothly zoom in and out, and to accomplish this it currently defines 256 different CameraComponents. From a player perspective it works fine, but it's really gross from a coding perspective.

User avatar
petri
Posts: 1890
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by petri » Wed Feb 25, 2015 10:14 am

The first two should be easy.. now, let's see!

User avatar
petri
Posts: 1890
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by petri » Wed Feb 25, 2015 10:26 am

Done:
- PartyComponent:isIdle()
- PartyComponent:move()
- PartyComponent:turn()
- PartyComponent:setMovementSpeed()
- PartyComponent:getMovementSpeed()

move() and turn() should only be called when the party is idle (not moving/turning), i.e. when isIdle() return true.

User avatar
Drakkan
Posts: 1314
Joined: Mon Dec 31, 2012 12:25 am

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by Drakkan » Wed Feb 25, 2015 10:29 am

hope you will enjoy your Glögg petri !

here is my wish list:

- support for more alchemy ingredients / recipes and mixing similar to Log1, it is very limited now and moders need to make different workarounds, like spawning item on surfaces etc...
SpoilerShow
this will probably need to expand the GUI for mortar and pestle and somehow implement if some item has "herb" trait to display in it.
- disable writing gameEffects list on Item when EquipmentItem commponent is disabled

- more support for error debug inside editor (John W. mentioned this one --
if the error log could include a path when you get the dreaded "attempt to concatenate field 'id' (a nil value)" crash upon saving. Just adding "attempt to concatenate field 'id' in object 'myObject' (a nil value)" would be great. Even better would be "attempt to concatenate field 'id' in object 'entity.script.outerObject.innerObject' (a nil value)".
Another option would be to have a "test save" button in the editor. I've contemplated trying to write one, but without debug.getlocal I don't think it's possible.
Similarly described viewtopic.php?f=22&t=9361.
Last edited by Drakkan on Wed Feb 25, 2015 10:31 am, edited 1 time in total.
Breath from the unpromising waters.
Eye of the Atlantis

User avatar
petri
Posts: 1890
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by petri » Wed Feb 25, 2015 10:31 am

- added CameraComponent: setFov(), setNearClip(), setFarClip(), getFov(), getNearClip(), getFarClip()


Now some more of that Glögggggg!!

User avatar
petri
Posts: 1890
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by petri » Wed Feb 25, 2015 10:32 am

How useful is camera offset? It's a little bit tricky to implement...

User avatar
petri
Posts: 1890
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by petri » Wed Feb 25, 2015 10:34 am

Drakkan wrote:hope you will enjoy your Glögg petri !

- more support for error debug inside editor
I shall thank you! The error checking for illegal script globals has already been done for 2.2.4 :)

minmay
Posts: 2436
Joined: Mon Sep 23, 2013 2:24 am

Re: Mystery Topic Revealed: Glögg Session Part 3!

Post by minmay » Wed Feb 25, 2015 10:36 am

Wow, thanks!

I can't think of anything I need CameraComponent offset for, since you can just move the parent game object. It just struck me as strange that it wasn't supported, but if it's tricky then that makes perfect sense.

Post Reply