Freaking awesome !petri wrote:http://i.imgur.com/VdTj3.jpg
And this is how it's done:
Petri consumes glögg and codes with you
Re: Petri consumes glögg and codes with you
-
flatline
Re: Petri consumes glögg and codes with you
Amazing indeed. Looking forward to the patch!
Oh, and this +1Grimwold wrote:I was keen for a way to make monsters flee for a time.. alternative solutions would be
#1 a new AI type = flee (instead of default or guard)
#2 monster:setFlee(5)
to make it flee the party for 5 seconds.
#3 monster:setSight(0)
set the sight of the monster on the fly so that it would at least wander
Last edited by flatline on Tue Dec 04, 2012 10:06 pm, edited 1 time in total.
Re: Petri consumes glögg and codes with you
Ok, folks, our time is up! Thanks to all for ideas & participating!
Here is the complete changelog and documentation for the new gui system:
- lever click box can be adjusted by placing a Node named "lever_node" in the model file
- added Item:insertItem(slot, item), Item:removeItem(slot), Item:getItem(slot) and Item:getItem(slot)
- added new LightSource property: flicker (default value is true)
- added new optional 15th parameter for shootProjectile(): championOrdinal
- added Item:onEquipItem(champion, slot) and Item:onUnequipItem(champion, slot) hooks (works for all inventory slots)
- added Monster:setPosition(x, y, level, facing) and Party:setPosition(x, y, level, facing) for instantly teleporting the monster or party
- bug fix: shootProjectile's offsetX, offsetY, offsetZ parameters don't work
- added onGuiDraw, onDrawInventory, onDrawSkills, onDrawStats hooks to Party class for implementing custom guis (see below)
onGuiDraw hook is a Lua function which receives a single argument, a graphics context which can be used to draw custom gui graphics to the screen. The context has the following properties and methods:
width returns the width of the screen
height returns the height of the screen
color(r,g,b,a) set the pen current color
drawRect(x, y, width, height) draws a filled rectangle with current pen color
drawImage(filename, x, y) draws an image modulated with current pen color
drawText(text, x, y) draws a line of text with current pen color
button(id, x, y, width, height) returns true if the mouse was clicked in the given button rectangle
Buttons must be identified by unique string IDs.
onDrawInventory, onDrawSkills and onDrawStats are called when the corresponding page of the character sheet is visible. These functions receive a secondary parameter, the champion whose sheet is currently visible.
For example,
Here is the complete changelog and documentation for the new gui system:
- lever click box can be adjusted by placing a Node named "lever_node" in the model file
- added Item:insertItem(slot, item), Item:removeItem(slot), Item:getItem(slot) and Item:getItem(slot)
- added new LightSource property: flicker (default value is true)
- added new optional 15th parameter for shootProjectile(): championOrdinal
- added Item:onEquipItem(champion, slot) and Item:onUnequipItem(champion, slot) hooks (works for all inventory slots)
- added Monster:setPosition(x, y, level, facing) and Party:setPosition(x, y, level, facing) for instantly teleporting the monster or party
- bug fix: shootProjectile's offsetX, offsetY, offsetZ parameters don't work
- added onGuiDraw, onDrawInventory, onDrawSkills, onDrawStats hooks to Party class for implementing custom guis (see below)
onGuiDraw hook is a Lua function which receives a single argument, a graphics context which can be used to draw custom gui graphics to the screen. The context has the following properties and methods:
width returns the width of the screen
height returns the height of the screen
color(r,g,b,a) set the pen current color
drawRect(x, y, width, height) draws a filled rectangle with current pen color
drawImage(filename, x, y) draws an image modulated with current pen color
drawText(text, x, y) draws a line of text with current pen color
button(id, x, y, width, height) returns true if the mouse was clicked in the given button rectangle
Buttons must be identified by unique string IDs.
onDrawInventory, onDrawSkills and onDrawStats are called when the corresponding page of the character sheet is visible. These functions receive a secondary parameter, the champion whose sheet is currently visible.
For example,
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onGuiDraw = function(g)
-- draw transparent background
g.color(30,30,30,150)
g.drawRect(30, 50, 345, 300)
-- draw the portrait
g.color(255,255,255,255)
g.drawImage("assets/textures/portraits/human_female_01.tga", 40, 60)
-- draw some text
g.color(255, 128, 128)
g.drawText("Well, Hello", 200, 80)
g.color(128, 128, 255)
g.drawText("Grimrockers!", 200, 95)
-- draw button with text
g.color(128, 128, 128)
g.drawRect(200, 120, 115, 20)
g.color(255, 255, 255)
g.drawText("How u doing?!", 210, 135)
-- button logic
if g.button("button1", 200, 120, 115, 20) then
hudPrint("*kick in the groin*")
end
end,
}
Re: Petri consumes glögg and codes with you
I agree with the others, you're doing wonderful work, Petri!
As for suggestions, could you add Item:setPosition method, too?
Other things that occur to me are a method for controlling the exact angle at which an item is placed on the ground for situations where the normal random variation isn't fitting, and Item:getSubtileOffset method.
As for suggestions, could you add Item:setPosition method, too?
Other things that occur to me are a method for controlling the exact angle at which an item is placed on the ground for situations where the normal random variation isn't fitting, and Item:getSubtileOffset method.
Re: Petri consumes glögg and codes with you
We can have monster health bars over their heads now if we wanted... Via a spell of course.
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
Re: Petri consumes glögg and codes with you
Wow Petri, thanks!

Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563
My preciousss: http://www.moonsharp.org
Re: Petri consumes glögg and codes with you
There are couple questions that everyone (community wide, I presume) would like to ask: Will those new goodies (together with result of the previous beverage enhanced coding sprint) be released soon or do we have to wait till OSX version is released? In any case, is there anything we can do help speed this patch up? Would OSX testers be helpful for you in any way?
Re: Petri consumes glögg and codes with you
It's truly amazing indeed, but from that documentation I could not quite get it how the onGuiDraw get's triggered. If it's called continuously by small interval then it it's super awesome and gives endless possibilities for custom GUIs.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: Petri consumes glögg and codes with you
All gui drawing hooks are called every frame so you can build animated guis or even complete mini games 
Re: Petri consumes glögg and codes with you
Ok, now I get it that's just perfect. Thanks again.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450