Getting Started/Tutorials?

If you have a module that you'd like comments on or would like to know how to create your very own module, post here

Moderator: Moderator

Post Reply
Message
Author
CodeD
Posts: 2
Joined: Fri Feb 24, 2012 9:46 am

Getting Started/Tutorials?

#1 Post by CodeD »

This is my first time using Lua but I'm feeling pretty comfortable with it. I'm familiar with basic programming principles and Lua seems pretty simple.

The real thing I'm trying to find is tutorials and documentation on making your own modules.

The How-to guides on the site seem sparse and serve as basic reference material.
http://te4.org/wiki/t4modules-module-howto-guides

The "Getting Started" page just tells you how to take the example folder and setup the init file, which basically just changes the name of your module and not much else.

I can't seem to find any guides on module making on google and the how to section on the site doesn't even seem to go over how to implement your own graphics.

I would like to do something simple for starters, taking the example module and turning it into a graphic RL where you go down x levels, obtain "amulet of yendor", then escape out of the dungeon, i.e. your basic roguelike.

At some point, I'd like to implement crafting and recipes using this engine but I'd like to do a simple RL for starters to get a hang of the engine but even something as simple and straightforward as that seems to be lacking documentation.

I've read articles on the website, I've tried googling...am I missing something here? Can some kind soul point me in the right direction?

Goblinz
Module Developer
Posts: 163
Joined: Tue Dec 14, 2010 3:23 am
Location: Where I need to be

Re: Getting Started/Tutorials?

#2 Post by Goblinz »

Unfortunately there is very little documentation on how to make a module. There have been only a few modules actually made. One that would work that you can use as an example is broken bottle (a 7drl). This will demonstrate some basic functionality like inventory. So for the most part just be prepared to pick apart and module you can find. Also if you need help the tome irc is a good place to go (irc.rizon.net #tome).
Those who complain are just Volunteering to fix the problem

<yufra> every vault designer should ask themselves exactly that: What Would Grey Do?

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Getting Started/Tutorials?

#3 Post by yufra »

I'll second joining the IRC channel, we are a friendly bunch. In regards to writing tutorials, documentation is definitely an area that needs improvement. Most of the devs are quite busy doing the "fun" stuff, though, and what little documentation there is has been done by people first digging in and learning a specific portion of the code (I did the chat how-to and a few others when first joining ToME). If you come by IRC and get help there and then take that and improve the documentation that would be fantastic. Cheers!
<DarkGod> lets say it's intended

CodeD
Posts: 2
Joined: Fri Feb 24, 2012 9:46 am

Re: Getting Started/Tutorials?

#4 Post by CodeD »

I would definitely be game for documenting the process of making a simple module.

I had a feeling that ripping apart someone else's module and sifting through the code page by page would be the answer, which isn't exactly ideal... :S

But, I'll give it a go.

Manipulative
Posts: 4
Joined: Sun Apr 01, 2012 3:57 pm
Contact:

Re: Getting Started/Tutorials?

#5 Post by Manipulative »

I am just starting work on my own module.

Well, I've been planning the game for decades but I am looking into learning Lua now!

I am beyond eager to see even a very basic walkthrough so I will be watching this thread.

Thanks! :D

Manipulative
Posts: 4
Joined: Sun Apr 01, 2012 3:57 pm
Contact:

Re: Getting Started/Tutorials?

#6 Post by Manipulative »

*bump*

Any updates?

Tutorials?

A path to follow for those hoping to make their own module? :idea:

Castler
Thalore
Posts: 153
Joined: Mon Mar 25, 2013 10:09 pm

Re: Getting Started/Tutorials?

#7 Post by Castler »

I've just started work on my own module, and I thought about blogging how it's going. Really, though, the wiki is pretty good (at least, for as far as I've gotten); it doesn't cover everything, but the topics there are pretty close to the order you'd want to follow for making your own module.

Are there particular questions you have?
Qi Daozei (QDZ) - an Oriental-themed fantasy game for T-Engine. ToME Tips - auto-generated spoilers for ToME.

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: Getting Started/Tutorials?

#8 Post by Zireael »

I agree that there are some things left undocumented, which makes me ask all sorts of questions over at #tome...

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Getting Started/Tutorials?

#9 Post by Grey »

I would suggest making a list of the things you struggle with so we can try as a community to get some suitable documentation in place.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: Getting Started/Tutorials?

#10 Post by Zireael »

Problems I ran into when trying to create a (working) PlayerDisplay:

What do x, y stand for? Are they measured in pixels?

What does self:resize do and what are the arguments?

Why can't I have PlayerDisplay work the same way as LogDisplay, i.e. with parameters in load.lua?

Some others:
Why can't I call dam = rng.dice(x,y) ? Since it doesn't work, how do I randomize damage?

How do I get the game to display x if a function returns something else (ie. I have a value of 5 and want the sheet to display 18 (+5), for example?

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Getting Started/Tutorials?

#11 Post by Grey »

Zireael wrote: What do x, y stand for? Are they measured in pixels?
Not sure what specific instance you mean, but yes it's pixels.
What does self:resize do and what are the arguments?
Where is it?
Why can't I have PlayerDisplay work the same way as LogDisplay, i.e. with parameters in load.lua?
Because it's not a default part of the game module. Every module needs a log, but PlayerDisplay is something you have to add on yourself. And what's the difference anyway? You just change it in Game.lua instead.
Why can't I call dam = rng.dice(x,y) ? Since it doesn't work, how do I randomize damage?
The correct function is dam = rng.range(x,y). This returns a random value from x to y. Not sure if you want something else? You could always write your own dice function.

Another useful one is rng.table({x,y,z}) - it chooses a random entry from a list of values. You can use this for randomised text, weighted randomisation of numbers, choosing a random enemy target, etc.
How do I get the game to display x if a function returns something else (ie. I have a value of 5 and want the sheet to display 18 (+5), for example?
Could you be more specific? What's your code and what do you want it to show?
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: Getting Started/Tutorials?

#12 Post by Zireael »

What does self:resize do and what are the arguments?
Quoted from your own PlayerDisplay topic.
local gw, gh = core.display.size()
self:resize(1, gh - 99, 234, 85)
I'm trying to find out why copying your code from Shadow doesn't work (no errors in the log)

Zireael
Archmage
Posts: 449
Joined: Tue Jun 18, 2013 7:24 pm

Re: Getting Started/Tutorials?

#13 Post by Zireael »

I wish there was a howto or a reference in LuaDoc about engine.interface.Combat.

What's a projector?

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: Getting Started/Tutorials?

#14 Post by Grey »

The stairs stuff isn't too hard - I can go through that with you whenever you feel ready.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Post Reply