Hi, I'm looking to make a roguelike that is turn based, but with action points and control of more than one character. I bet that's not something not supported out of the box.
But, is ToME open source? Would that be a project that would take me a very long time, so I'm better off starting from scratch? What would be my first step?
Thanks for all your help!
Regarding ToME engine
Moderator: Moderator
Re: Regarding ToME engine
It's open source and you can add an action point system easily to a module.
There's party support in already.
There's party support in already.
-
- Higher
- Posts: 55
- Joined: Thu Aug 16, 2012 10:52 pm
- Location: Philadelphia, Pennsylvania, USA
- Contact:
Re: Regarding ToME engine
No way! Neat! I will go look at the documentation then.
Re: Regarding ToME engine
I think the docs are kinda outdated.
You can hop on IRC #tome on rizon.net I believe if you need help with anything.
You can hop on IRC #tome on rizon.net I believe if you need help with anything.
-
- Higher
- Posts: 55
- Joined: Thu Aug 16, 2012 10:52 pm
- Location: Philadelphia, Pennsylvania, USA
- Contact:
Re: Regarding ToME engine
I'd love to chat on IRC, but then no one would be able to learn how to do this but me!
I could do something with this part of Game.lua
function _M:onTurn()
-- The following happens only every 10 game turns (once for every turn of 1 mod speed actors)
if self.turn % 10 ~= 0 then return end
I'd have to shut the monsters down and then let them move in this section. Aaaand, AP wouldn't be tied to anything like dexterity, it'd just be 10. Though this is Lua, I could probably write:
if self.turn % self:getDex() ~= 0 then return
-- Move some monsters here.
end
And that doesn't even begin to let the players choose where they want to go before they go there.
That'd be in Grid.lua in this function, yeah?
function _M:setupMouse(reset)
if reset then self.mouse:reset() end
self.mouse:registerZone(Map.display_x, Map.display_y, Map.viewport.width, Map.viewport.height, function(button, mx, my, xrel, yrel, bx, by, event)
-- Handle targeting
if self:targetMouse(button, mx, my, xrel, yrel, event) then return end
-- Could I put code here that would show a blue line to the character if they have enough action points, and a red line if they don't?
Do you see any better or easier way to complete these tasks?
The way I made Project Zomboid turn based, is: I froze the monsters, and set up a counter every time the character moved. When the counter got to 10, I froze the player, let the monsters move, and started a new timer. Would that be easier you think?
I was told this is the best roguelike engine, and I am not disappointed. Well done, guys.
I could do something with this part of Game.lua
function _M:onTurn()
-- The following happens only every 10 game turns (once for every turn of 1 mod speed actors)
if self.turn % 10 ~= 0 then return end
I'd have to shut the monsters down and then let them move in this section. Aaaand, AP wouldn't be tied to anything like dexterity, it'd just be 10. Though this is Lua, I could probably write:
if self.turn % self:getDex() ~= 0 then return
-- Move some monsters here.
end
And that doesn't even begin to let the players choose where they want to go before they go there.
That'd be in Grid.lua in this function, yeah?
function _M:setupMouse(reset)
if reset then self.mouse:reset() end
self.mouse:registerZone(Map.display_x, Map.display_y, Map.viewport.width, Map.viewport.height, function(button, mx, my, xrel, yrel, bx, by, event)
-- Handle targeting
if self:targetMouse(button, mx, my, xrel, yrel, event) then return end
-- Could I put code here that would show a blue line to the character if they have enough action points, and a red line if they don't?
Do you see any better or easier way to complete these tasks?
The way I made Project Zomboid turn based, is: I froze the monsters, and set up a counter every time the character moved. When the counter got to 10, I froze the player, let the monsters move, and started a new timer. Would that be easier you think?
I was told this is the best roguelike engine, and I am not disappointed. Well done, guys.
Re: Regarding ToME engine
The counter system is essentially how the engines default energy based game goes.
You require X energy to act and once you fill up to that energy amount the game pauses, you take your turn, and then the monsters get to do the same. You can have different actions require different amounts of energy. So a move for instance might cost 10 points while an attack would cost 100 points.
For Fae, the module I was working on, I gave each actor Action Points because I wanted to do a bit more with them and I wanted the player to easily be able to see how many more moves they'd have etc.
But the energy system works well enough.
Alternatively you could do movement as a resource and have a move talent that would consume move based on the number of tiles you moved with it.
As a quick example, say you have 5 movement. The range of your move talent would be 5 and you could use the engine targeting for lines with no modification. If you moved two tiles your movement resource would deplete to 3. You could keep moving as long as it remained your turn and you had movement points left.
For NPCs you could run them off the same movement resource. Just don't give them the movement talent and have the move method directly consume movement points until they run out rather then energy.
If you want to look over my Fae commits and code feel free. The repo is here https://github.com/edge2054/Fae . Feel free to use anything you need from it. Just make sure to give credit to any artists I credited in my credits file if you decide to use any of the music/talent icons/or whatever. It was all CC or Public Domain, aside from the music. I talked to that guy about using it so I probably wouldn't reuse that without contacting him.
And I'm on IRC quite a bit, was out of the house tonight when you logged in earlier.
You require X energy to act and once you fill up to that energy amount the game pauses, you take your turn, and then the monsters get to do the same. You can have different actions require different amounts of energy. So a move for instance might cost 10 points while an attack would cost 100 points.
For Fae, the module I was working on, I gave each actor Action Points because I wanted to do a bit more with them and I wanted the player to easily be able to see how many more moves they'd have etc.
But the energy system works well enough.
Alternatively you could do movement as a resource and have a move talent that would consume move based on the number of tiles you moved with it.
As a quick example, say you have 5 movement. The range of your move talent would be 5 and you could use the engine targeting for lines with no modification. If you moved two tiles your movement resource would deplete to 3. You could keep moving as long as it remained your turn and you had movement points left.
For NPCs you could run them off the same movement resource. Just don't give them the movement talent and have the move method directly consume movement points until they run out rather then energy.
If you want to look over my Fae commits and code feel free. The repo is here https://github.com/edge2054/Fae . Feel free to use anything you need from it. Just make sure to give credit to any artists I credited in my credits file if you decide to use any of the music/talent icons/or whatever. It was all CC or Public Domain, aside from the music. I talked to that guy about using it so I probably wouldn't reuse that without contacting him.
And I'm on IRC quite a bit, was out of the house tonight when you logged in earlier.
-
- Higher
- Posts: 55
- Joined: Thu Aug 16, 2012 10:52 pm
- Location: Philadelphia, Pennsylvania, USA
- Contact:
Re: Regarding ToME engine
Oh wow. Everything is a talent. Attacking is a talent. The mana bar is a talent.
I guess I'll do this as a talent then.
If I were editing ToME, would it look a little something like this? (Certainly not precisely, as it does not work.)
newTalent{
name = "Move",
type = {"base/class", 1},
info = "Turn based tactical combat movement.",
mode = "passive",
hide = true,
no_unlearn_last = true,
range = 10,
action = function(self, t)
local tg = {type="ball", range=self:getTalentRange(t), radius=1, talent=t}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:move(x, y, false)
return true
}
I guess I'll do this as a talent then.
If I were editing ToME, would it look a little something like this? (Certainly not precisely, as it does not work.)
newTalent{
name = "Move",
type = {"base/class", 1},
info = "Turn based tactical combat movement.",
mode = "passive",
hide = true,
no_unlearn_last = true,
range = 10,
action = function(self, t)
local tg = {type="ball", range=self:getTalentRange(t), radius=1, talent=t}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:move(x, y, false)
return true
}
-
- Higher
- Posts: 55
- Joined: Thu Aug 16, 2012 10:52 pm
- Location: Philadelphia, Pennsylvania, USA
- Contact:
Re: Regarding ToME engine
Wait, scratch that. Nothing is talents. I'll use your action point system to start, maybe a talent to show the range of things.
Here's what I learned on IRC:
[08:06] <Chezzo_> I'm making a new talent that uses action points for moving and shooting. Once your action points are up, the monsters move.
[08:07] <@DarkGod2> well before doing the talents, did yuo make the action point system ?
[08:08] <Chezzo_> Would I need to make a talent to make the action point system, like the mana bar?
[08:09] <Chezzo_> Or could I use Fae's: function _M:useActionPoints(value) local value = value or 10 self:incActions(-value) -- Action points should never go below zero, but just in case if self:getActions() <= 0 then self:useEnergy() end self.changed = true end
[08:12] <Chezzo_> Does anyone know where the meat and potatoes behind the mana bar are in ToME? It can't ALL be in Misc.lua, right?
[08:14] <@DarkGod2> the manabar is not a talent
[08:14] <@DarkGod2> it uses a talent to know if an actor has it or not
[08:14] <Chezzo_> Oh, okay. Ah, I see.
[08:14] <@DarkGod2> you dont need that
[08:14] <@DarkGod2> and yeah take fae's code it looks like what you want
[08:15] <@DarkGod2> and you got to understand how things work
[08:15] <Chezzo_> So the talent I'm making, I want it to show where the character can move.
[08:15] <@DarkGod2> code is not magic; talents dont make stuff work jsut because, as in the exmaple you posted
[08:16] <@DarkGod2> if you want a talent to consume action pionts you need to maek the action point system and then define how points are spent in probably postUseTalent
[08:16] <@DarkGod2> jsut like it is used to remove mana in tome
[08:17] <@DarkGod2> as for moving .. why a talent ? just ahve your actor:move method remove an action point per tile
[08:17] <Chezzo_> Well, I want people to be able to plan their actions. See where there character can go.
[08:17] <Chezzo_> I figured the range on talents would be able to do that.
[08:17] <quicksilver> action point games often have an undo feature
[08:17] <@DarkGod2> why ? it's a tiled game; if 1 action = 1 move; it's obvious where you can go
[08:18] <quicksilver> you could use DG's magic chronomancy code for undo
[08:18] <Chezzo_> No, I want there to be many actions and many moves.
[08:18] <@DarkGod2> ???
[08:18] <Chezzo_> I want to make a tactical turn based roguelike with an action point system.
[08:19] <quicksilver> I think you missed dg's point
[08:19] <Chezzo_> Where you can move more than one hex, and attack more than once before the monsters move more than one square and attack more than once.
[08:19] <quicksilver> DarkGod2: but maybe it isn't obvious, maybe some terrains are more aps than others etc
[08:20] <Chezzo_> Thanks for your help!
[08:21] <@DarkGod2> well it sounds to me moving by a talent would be cumbersome; but whatever
[08:21] <@DarkGod2> and no talent range si not magical either
[08:21] <@DarkGod2> if you want it to understand yoru action point system you have to make it do so
[08:21] <Chezzo_> Could I use a talent to show the range?
[08:23] <@DarkGod2> well the right anwser to most quesitons will always be "yes"
[08:23] <@DarkGod2> or rather "yes, make it so"
[08:24] <@DarkGod2> I'l lgo back to my previous question: did you make your action system ? does it work ?
[08:24] <@DarkGod2> *then* you can think about how showing ranges and such
[08:24] <@DarkGod2> one step at a time; and in the correct order; lest you get lost
[08:24] <Chezzo_> Yeah, I'm using Fae's action point system.
[08:24] <Chezzo_> Okay. I gotcha.
[08:25] <Chezzo_> So moving takes an action point. I've got that down. Now I need attacking to take an action point.
[08:25] <Chezzo_> Yeah?
[08:26] <@DarkGod2> I imagine yeah
[08:26] <@DarkGod2> probably want your combat code to just call useActionPoint(1) ?
Here's what I learned on IRC:
[08:06] <Chezzo_> I'm making a new talent that uses action points for moving and shooting. Once your action points are up, the monsters move.
[08:07] <@DarkGod2> well before doing the talents, did yuo make the action point system ?
[08:08] <Chezzo_> Would I need to make a talent to make the action point system, like the mana bar?
[08:09] <Chezzo_> Or could I use Fae's: function _M:useActionPoints(value) local value = value or 10 self:incActions(-value) -- Action points should never go below zero, but just in case if self:getActions() <= 0 then self:useEnergy() end self.changed = true end
[08:12] <Chezzo_> Does anyone know where the meat and potatoes behind the mana bar are in ToME? It can't ALL be in Misc.lua, right?
[08:14] <@DarkGod2> the manabar is not a talent
[08:14] <@DarkGod2> it uses a talent to know if an actor has it or not
[08:14] <Chezzo_> Oh, okay. Ah, I see.
[08:14] <@DarkGod2> you dont need that
[08:14] <@DarkGod2> and yeah take fae's code it looks like what you want
[08:15] <@DarkGod2> and you got to understand how things work
[08:15] <Chezzo_> So the talent I'm making, I want it to show where the character can move.
[08:15] <@DarkGod2> code is not magic; talents dont make stuff work jsut because, as in the exmaple you posted
[08:16] <@DarkGod2> if you want a talent to consume action pionts you need to maek the action point system and then define how points are spent in probably postUseTalent
[08:16] <@DarkGod2> jsut like it is used to remove mana in tome
[08:17] <@DarkGod2> as for moving .. why a talent ? just ahve your actor:move method remove an action point per tile
[08:17] <Chezzo_> Well, I want people to be able to plan their actions. See where there character can go.
[08:17] <Chezzo_> I figured the range on talents would be able to do that.
[08:17] <quicksilver> action point games often have an undo feature
[08:17] <@DarkGod2> why ? it's a tiled game; if 1 action = 1 move; it's obvious where you can go
[08:18] <quicksilver> you could use DG's magic chronomancy code for undo

[08:18] <Chezzo_> No, I want there to be many actions and many moves.
[08:18] <@DarkGod2> ???
[08:18] <Chezzo_> I want to make a tactical turn based roguelike with an action point system.
[08:19] <quicksilver> I think you missed dg's point
[08:19] <Chezzo_> Where you can move more than one hex, and attack more than once before the monsters move more than one square and attack more than once.
[08:19] <quicksilver> DarkGod2: but maybe it isn't obvious, maybe some terrains are more aps than others etc
[08:20] <Chezzo_> Thanks for your help!
[08:21] <@DarkGod2> well it sounds to me moving by a talent would be cumbersome; but whatever

[08:21] <@DarkGod2> and no talent range si not magical either
[08:21] <@DarkGod2> if you want it to understand yoru action point system you have to make it do so
[08:21] <Chezzo_> Could I use a talent to show the range?
[08:23] <@DarkGod2> well the right anwser to most quesitons will always be "yes"
[08:23] <@DarkGod2> or rather "yes, make it so"
[08:24] <@DarkGod2> I'l lgo back to my previous question: did you make your action system ? does it work ?
[08:24] <@DarkGod2> *then* you can think about how showing ranges and such
[08:24] <@DarkGod2> one step at a time; and in the correct order; lest you get lost
[08:24] <Chezzo_> Yeah, I'm using Fae's action point system.
[08:24] <Chezzo_> Okay. I gotcha.
[08:25] <Chezzo_> So moving takes an action point. I've got that down. Now I need attacking to take an action point.
[08:25] <Chezzo_> Yeah?
[08:26] <@DarkGod2> I imagine yeah
[08:26] <@DarkGod2> probably want your combat code to just call useActionPoint(1) ?