Questions for DarkGod (or others)
Moderator: Moderator
Re: Questions for DarkGod (or others)
Awesome - thanks, DG!
Re: Questions for DarkGod (or others)
Here's a video of how the game looks at the moment:
http://youtu.be/TvJ4sqq_b6A
Will hopefully improve over the next 24 hours...
http://youtu.be/TvJ4sqq_b6A
Will hopefully improve over the next 24 hours...
Re: Questions for DarkGod (or others)
I'm probably going to have a ton of these UI related questions but here's the first one...
I shamelessly stole the player display code from Rogue Rage and I'm wondering if anyone knows how I'd go about repositioning it. Basically I want to display my resources and zone name at the top of the screen rather then the bottom.
I shamelessly stole the player display code from Rogue Rage and I'm wondering if anyone knows how I'd go about repositioning it. Basically I want to display my resources and zone name at the top of the screen rather then the bottom.
Re: Questions for DarkGod (or others)
In Game.lua there's a call for PlayerDisplay which sets its position. Just position it at 0,0 instead of 0,h-30 (or whatever it is).
However I should warn that I've had problems in the past with the PlayerDisplay being at the top of the screen ends up interfering with mouse control on the main map screen.
However I should warn that I've had problems in the past with the PlayerDisplay being at the top of the screen ends up interfering with mouse control on the main map screen.
Re: Questions for DarkGod (or others)
Thanks Grey, it took a bit of finagling (I had to add some arguments to the playerDisplay ini) but this pointed me in the right direction and I got it working 
http://i.imgur.com/hW9IS.png
Did you ever get smooth fog of war to work?
I also need to figure out how to convert the game log and mini-map into dialogues. Basically I want to keep the log output at the top of the screen and give the player the option to pull up a more verbose log with a hotkey and I want to hide the mini-map inside a hotkey as well. I also need to figure out how to register a more verbose tooltip on keypress (right now it's just the name of the entity with no border, as per the grass in the screen shot with life being represented by the color of the tooltip).
So the basic idea is to replace everything on the bottom with 10 hotkeys and maybe five smaller ones above that to switch stances.
That would be the basic UI (not counting anything like level up dialogues, inventories, and character sheets).

http://i.imgur.com/hW9IS.png
Did you ever get smooth fog of war to work?
I also need to figure out how to convert the game log and mini-map into dialogues. Basically I want to keep the log output at the top of the screen and give the player the option to pull up a more verbose log with a hotkey and I want to hide the mini-map inside a hotkey as well. I also need to figure out how to register a more verbose tooltip on keypress (right now it's just the name of the entity with no border, as per the grass in the screen shot with life being represented by the color of the tooltip).
So the basic idea is to replace everything on the bottom with 10 hotkeys and maybe five smaller ones above that to switch stances.
That would be the basic UI (not counting anything like level up dialogues, inventories, and character sheets).
Re: Questions for DarkGod (or others)
Multiple logs shouldn't be a problem - have one function which outputs to two logs, with conditions of verbosity. I never liked that flasher thing on the top though, myself... I'm not sure any sort of log is needed if you have flyout text, particles effects and sound.
Toggable map I'm less sure about - DarkGod will hopefully be able to instruct.
For smooth FOV your source is tiger_eye.
Toggable map I'm less sure about - DarkGod will hopefully be able to instruct.
For smooth FOV your source is tiger_eye.
Re: Questions for DarkGod (or others)
Just dont display the minimap when you dont need it 

[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: Questions for DarkGod (or others)
Yeah, I ended up ditching the flasher. I'm going to keep the pull up log with control + m so players can refer to it if they feel they miss something important (I kinda want a story which I'll present through emotes and what not, if the player misses those emotes I want a way for them to find out what was said easily).Grey wrote:Multiple logs shouldn't be a problem - have one function which outputs to two logs, with conditions of verbosity. I never liked that flasher thing on the top though, myself... I'm not sure any sort of log is needed if you have flyout text, particles effects and sound.
hehe.. thanks darkgodToggable map I'm less sure about - DarkGod will hopefully be able to instruct.

Yes... I also need tiger_eye to help me implement auto-explore. Hopefully his current break is shorter then his last breakFor smooth FOV your source is tiger_eye.

Re: Questions for DarkGod (or others)
I can help out there, what do you need?edge2054 wrote: Yes... I also need tiger_eye to help me implement auto-explore. Hopefully his current break is shorter then his last break(And I may just leave the mini-map out completely, auto-explore makes it less of a necessity).
<DarkGod> lets say it's intended
Re: Questions for DarkGod (or others)
I got it thanks yufra
However...
What do resolvers do? Like I know how ToME uses them but I tried to make my own and it didn't work how I expected.
So what I wanted was something I could call with resolvers.success(10, 6, 4) from anywhere in the game to get back a number like rng.range would do. But it didn't work.
I wrote a similar function in combat.
Which works fine.
I guess I just don't really now what resolvers are for. Can anyone elaborate?

What do resolvers do? Like I know how ToME uses them but I tried to make my own and it didn't work how I expected.
Code: Select all
--- Dice roll
function resolvers.success(dice, sides, target)
return {__resolver="success", dice, sides, target}
end
function resolvers.calc.success(t)
local successes = 0
local dice = t[1] or 1
local sides = t[2] or 6
local target = t[3] or sides /2 + 1
for i = 1, dice do
if rng.dice(1, sides) >= target then
successes = successes + 1
end
end
return successes
end
I wrote a similar function in combat.
Code: Select all
function _M:getSuccesses(dice, sides, target_number)
local successes = 0
local dice = dice or 1
local sides = sides or 6
local target_number = target_number or sides/2 + 1
for i = 1, dice do
if rng.dice(1, sides) >= target_number then
successes = successes + 1
end
end
print(("[ROLLING] %sd%s against target number %s, successes %s"):format(dice, sides, target_number, successes))
return successes
end
I guess I just don't really now what resolvers are for. Can anyone elaborate?
Re: Questions for DarkGod (or others)
Alright, I guess I still don't really understand resolvers.
I have the following two resolvers, neither of which works on birth (I did get them to work for an npc so they do function).
Both produce on error similar to this.
I have this in my load file..
And my calls look like this.. (which I've tried in the copy table, outside the copy table, with an inventory = in front of it without success).
And I can find both resolver functions with the console so they're getting loaded.
Any ideas what I might doing wrong?
I have the following two resolvers, neither of which works on birth (I did get them to work for an npc so they do function).
Code: Select all
--- Resolves equipment creation for an actor
function resolvers.equip(t)
return {__resolver="equip", __resolve_last=true, t}
end
--- Actually resolve the equipment creation
function resolvers.calc.equip(t, e)
print("Equipment resolver for", e.name)
-- Iterate of object requests, try to create them and equip them
for i, filter in ipairs(t[1]) do
print("Equipment resolver", e.name, filter.type, filter.subtype)
local o
if not filter.defined then
o = game.zone:makeEntity(game.level, "object", filter)
else
o = game.zone:makeEntityByName(game.level, "object", filter.defined)
end
if o then
print("Zone made us an equipment according to filter!", o:getName())
-- Auto alloc some stats to be able to wear it
if filter.autoreq and rawget(o, "require") and rawget(o, "require").stat then
print("Autorequire stats")
for s, v in pairs(rawget(o, "require").stat) do
print(s,v)
if e:getStat(s) < v then
e.unused_stats = e.unused_stats - (v - e:getStat(s))
e:incStat(s, v - e:getStat(s))
end
end
end
e:wearObject(o, true, false)
game.zone:addEntity(game.level, o, "object")
end
end
-- Delete the origin field
return nil
end
--- Resolves inventory creation for an actor
function resolvers.inventory(t)
return {__resolver="inventory", __resolve_last=true, t}
end
--- Actually resolve the inventory creation
function resolvers.calc.inventory(t, e)
-- Iterate of object requests, try to create them and equip them
for i, filter in ipairs(t[1]) do
print("Inventory resolver", e.name, filter.type, filter.subtype)
local o
if not filter.defined then
o = game.zone:makeEntity(game.level, "object", filter)
else
o = game.zone:makeEntityByName(game.level, "object", filter.defined)
end
if o then
print("Zone made us an inventory according to filter!", o:getName())
e:addObject(e.INVEN_INVEN, o)
game.zone:addEntity(game.level, o, "object")
if t[1].id then o:identify(t[1].id) end
end
end
e:sortInven()
-- Delete the origin field
return nil
end
Code: Select all
Lua Error: /engine/Birther.lua:46: /data/birth/descriptors.lua:31: attempt to call field 'inventory' (a nil value)
At [C]:-1
At [C]:-1 error
At /engine/Birther.lua:46 loadDefinition
At /mod/load.lua:54
At [C]:-1 require
At /engine/Module.lua:159 load
At /engine/Module.lua:566 instanciate
At /engine/utils.lua:1681 showMainMenu
At /engine/init.lua:124
At [C]:-1 dofile
At /loader/init.lua:170
Code: Select all
-- Additional entities resolvers
dofile("/mod/resolvers.lua")
Code: Select all
resolvers.inventory{ id=true,
{type="weapon", subtype="battleaxe", name="iron battleaxe"},
},
Any ideas what I might doing wrong?
Re: Questions for DarkGod (or others)
To answer my own question for future module makers...
It's important that when you add your resolver code (shown below) that you put it pretty high up in the load list. I had it after the birther
It's important that when you add your resolver code (shown below) that you put it pretty high up in the load list. I had it after the birther

Code: Select all
-- Additional entities resolvers
dofile("/mod/resolvers.lua")